├── .gitattributes
├── .gitignore
├── LICENSE.txt
├── O365-REST-API-Explorer.sln
├── Office365RESTAPIExplorer
├── AccountFlyout.xaml
├── AccountFlyout.xaml.cs
├── App.xaml
├── App.xaml.cs
├── Assets
│ ├── DarkGray.png
│ ├── Delete.png
│ ├── DocCreate.png
│ ├── DocRead.png
│ ├── DocUpdate.png
│ ├── Document.png
│ ├── LightGray.png
│ ├── List.png
│ ├── ListCreate.png
│ ├── ListItem.png
│ ├── ListItemCreate.png
│ ├── ListItemRead.png
│ ├── ListItemUpdate.png
│ ├── ListRead.png
│ ├── ListUpdate.png
│ ├── Logo.scale-100.png
│ ├── MediumGray.png
│ ├── SmallLogo.scale-100.png
│ ├── SplashScreen.scale-100.png
│ ├── Square310x310Logo.scale-100.png
│ ├── Square70x70Logo.scale-100.png
│ ├── StoreLogo.scale-100.png
│ └── Wide310x150Logo.scale-100.png
├── BundleArtifacts
│ └── neutral.txt
├── Common
│ ├── NavigationHelper.cs
│ ├── ObservableDictionary.cs
│ ├── ReadMe.txt
│ ├── RelayCommand.cs
│ └── SuspensionManager.cs
├── ConfigureAppPage.xaml
├── ConfigureAppPage.xaml.cs
├── DataModel
│ ├── InitialData.json
│ ├── ObjectConverters.cs
│ └── RESTDataSource.cs
├── GlobalSuppressions.cs
├── Helpers
│ ├── AuthenticationHelper.cs
│ └── MessageDialogHelper.cs
├── ItemsPage.xaml
├── ItemsPage.xaml.cs
├── Office365RESTAPIExplorer.csproj
├── Package.appxmanifest
├── Properties
│ └── AssemblyInfo.cs
├── SplitPage.xaml
├── SplitPage.xaml.cs
└── packages.config
├── README.md
└── SECURITY.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # HOW TO USE THIS FILE
2 |
3 | # Installing this package works best if you do a little preparation first.
4 | # Whether you create your initial repository on GitHub, or use the Git Source Control Provider Visual Studio extension,
5 | # a default .gitignore file will already be at the root of your git repository.
6 | # Usually, this means it is directly within your main solution folder, as a sibling to your MyProject.sln file,
7 | # your .git folder, and possibly your packages directory.
8 |
9 | # In the Visual Studio Solution Explorer, right click your Solution node and select `Add > Existing Item`.
10 | # Navigate to the root .gitignore file and add it.
11 | # It will appear in your "Solution Items" folder, but only the path, not the file name.
12 | # This is because the file does not contain a name before the extension. Yay windows.
13 | # Regardless, this provides an easy way to get at your .gitignore file, which you will need to do after installing this package.
14 |
15 | # Now install this package. You will notice that a git.ignore file is added to your project directory (not your solution directory).
16 | # This is another wonderful windows *feature* that prevents nuget packages from copying nameless / extension-only files.
17 | # It doesn't matter though. All you have to do is open this git.ignore file (which you already have done), select all, copy,
18 | # then open your other .gitignore from the Solution Items folder select all, and paste.
19 | # When you are done, REMOVE THIS PACKAGE. You don't need it any more. It's pointless and it's wasting bits.
20 |
21 | # Unless you want to push all of your packages to your remote repository, enable NuGet Package Restore on your solution.
22 | # This .gitignore will make sure that NuGet.exe gets added, and your packages stay off of the remote.
23 |
24 | # Finally, you can delete all of this text to and including the #BEGIN GIT IGNORES line below.
25 | # For more information, see the README at https://github.com/danludwig/VisualStudioGitIgnore
26 | ===================================================================================================================================
27 |
28 | #BEGIN GIT IGNORES
29 | #Ignore thumbnails created by windows
30 | Thumbs.db
31 |
32 | #Ignore files built by Visual Studio
33 | *.obj
34 | *.exe
35 | *.pdb
36 | *.user
37 | *.aps
38 | *.pch
39 | *.vspscc
40 | *_i.c
41 | *_p.c
42 | *.ncb
43 | *.suo
44 | *.tlb
45 | *.tlh
46 | *.bak
47 | *.cache
48 | *.ilk
49 | *.log
50 | [Bb]in
51 | [Dd]ebug*/
52 | *.lib
53 | *.sbr
54 | obj/
55 | [Rr]elease*/
56 | _ReSharper*/
57 | [Tt]est[Rr]esult*
58 |
59 | #Ignore packages directory
60 | Packages/
61 |
62 | #Allow NuGet.exe
63 | !NuGet.exe
64 |
65 | #Ignore generated nupkg files
66 | *.nupkg
67 |
68 | #Allow released nupkg files
69 | !MyProjectName.1.0.nupkg
70 |
71 | #Ignore local testsettings
72 | Local.testsettings
73 |
74 | #Allow R# .DotSettings
75 | !*.csproj.DotSettings
76 |
77 | #Ignore Azure build csdef & Pubxml files
78 | ServiceDefinition.build.csdef
79 | *.azurePubxml
80 |
81 | #Ignore WebDeploy publish profile
82 | *.Publish.xml
83 |
84 | #Ignore email files delivered to specified pickup directory
85 | *.eml
86 |
87 | #Allow chromedriver.exe
88 | !chromedriver.exe
89 |
90 | #Ignore _vti folders in ExpressionWeb
91 | desktop.ini
92 | _vti_cnf/
93 | _vti_pvt/
94 |
95 | #Ignore private folder
96 | /Private/
97 |
98 | #Ignore .vs folder
99 | .vs
100 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Office-365-REST-API-Explorer, https://github.com/OfficeDev/Office-365-REST-API-Explorer
2 |
3 | Copyright (c) Microsoft. All rights reserved.
4 |
5 | MIT License:
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining
8 | a copy of this software and associated documentation files (the
9 | ""Software""), to deal in the Software without restriction, including
10 | without limitation the rights to use, copy, modify, merge, publish,
11 | distribute, sublicense, and/or sell copies of the Software, and to
12 | permit persons to whom the Software is furnished to do so, subject to
13 | the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be
16 | included in all copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 |
--------------------------------------------------------------------------------
/O365-REST-API-Explorer.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30723.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Office365RESTAPIExplorer", "Office365RESTAPIExplorer\Office365RESTAPIExplorer.csproj", "{343911E3-9697-41F0-AAE7-AE974DE93342}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Debug|ARM = Debug|ARM
12 | Debug|x64 = Debug|x64
13 | Debug|x86 = Debug|x86
14 | Release|Any CPU = Release|Any CPU
15 | Release|ARM = Release|ARM
16 | Release|x64 = Release|x64
17 | Release|x86 = Release|x86
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
23 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Debug|ARM.ActiveCfg = Debug|ARM
24 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Debug|ARM.Build.0 = Debug|ARM
25 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Debug|ARM.Deploy.0 = Debug|ARM
26 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Debug|x64.ActiveCfg = Debug|x64
27 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Debug|x64.Build.0 = Debug|x64
28 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Debug|x64.Deploy.0 = Debug|x64
29 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Debug|x86.ActiveCfg = Debug|x86
30 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Debug|x86.Build.0 = Debug|x86
31 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Debug|x86.Deploy.0 = Debug|x86
32 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Release|Any CPU.ActiveCfg = Release|Any CPU
33 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Release|Any CPU.Build.0 = Release|Any CPU
34 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Release|Any CPU.Deploy.0 = Release|Any CPU
35 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Release|ARM.ActiveCfg = Release|ARM
36 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Release|ARM.Build.0 = Release|ARM
37 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Release|ARM.Deploy.0 = Release|ARM
38 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Release|x64.ActiveCfg = Release|x64
39 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Release|x64.Build.0 = Release|x64
40 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Release|x64.Deploy.0 = Release|x64
41 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Release|x86.ActiveCfg = Release|x86
42 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Release|x86.Build.0 = Release|x86
43 | {343911E3-9697-41F0-AAE7-AE974DE93342}.Release|x86.Deploy.0 = Release|x86
44 | EndGlobalSection
45 | GlobalSection(SolutionProperties) = preSolution
46 | HideSolutionNode = FALSE
47 | EndGlobalSection
48 | EndGlobal
49 |
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/AccountFlyout.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/AccountFlyout.xaml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See LICENSE in the project root for license information.
4 | */
5 |
6 | using Office365RESTExplorerforSites.Common;
7 | using Office365RESTExplorerforSites.Helpers;
8 | using System;
9 | using Windows.UI.Xaml;
10 | using Windows.UI.Xaml.Controls;
11 |
12 | namespace Office365RESTExplorerforSites
13 | {
14 | ///
15 | /// A settings flyout that shows the configured username and site
16 | ///
17 | public sealed partial class AccountFlyout : SettingsFlyout
18 | {
19 | private ObservableDictionary defaultViewModel = new ObservableDictionary();
20 | public AccountFlyout()
21 | {
22 | this.InitializeComponent();
23 |
24 | // Add the local settings to the view model
25 | this.DefaultViewModel["ServiceResourceId"] = AuthenticationHelper.ServiceResourceId;
26 | this.DefaultViewModel["UserAccount"] = AuthenticationHelper.UserAccount;
27 |
28 | if(!String.IsNullOrEmpty(AuthenticationHelper.ServiceResourceId))
29 | {
30 | this.DefaultViewModel["SignOutVisible"] = Visibility.Visible;
31 | }
32 | else
33 | {
34 | this.DefaultViewModel["SignOutVisible"] = Visibility.Collapsed;
35 | }
36 | }
37 |
38 | ///
39 | /// This can be changed to a strongly typed view model.
40 | ///
41 | public ObservableDictionary DefaultViewModel
42 | {
43 | get { return this.defaultViewModel; }
44 | }
45 |
46 | private async void SignOut_Click(object sender, RoutedEventArgs e)
47 | {
48 | await AuthenticationHelper.SignOutAsync();
49 |
50 | // Add the local settings to the view model
51 | this.DefaultViewModel["ServiceResourceId"] = null;
52 | this.DefaultViewModel["UserAccount"] = null;
53 | this.DefaultViewModel["SignOutVisible"] = Visibility.Collapsed;
54 |
55 | (Window.Current.Content as Frame).Navigate(typeof(ConfigureAppPage));
56 | }
57 |
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
13 |
14 |
15 |
16 | https://login.microsoftonline.com/
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/App.xaml.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See LICENSE in the project root for license information.
4 | */
5 |
6 | using Office365RESTExplorerforSites.Common;
7 | using Office365RESTExplorerforSites.Helpers;
8 | using System;
9 | using Windows.ApplicationModel;
10 | using Windows.ApplicationModel.Activation;
11 | using Windows.Security.Authentication.Web;
12 | using Windows.UI.ApplicationSettings;
13 | using Windows.UI.Xaml;
14 | using Windows.UI.Xaml.Controls;
15 | using Windows.UI.Xaml.Navigation;
16 |
17 | // The Split App template is documented at http://go.microsoft.com/fwlink/?LinkId=234228
18 |
19 | namespace Office365RESTExplorerforSites
20 | {
21 | ///
22 | /// Provides application-specific behavior to supplement the default Application class.
23 | ///
24 | sealed partial class App : Application
25 | {
26 | ///
27 | /// Initializes the singleton Application object. This is the first line of authored code
28 | /// executed, and as such is the logical equivalent of main() or WinMain().
29 | ///
30 | public App()
31 | {
32 | this.InitializeComponent();
33 | this.Suspending += OnSuspending;
34 | }
35 |
36 | // Properties of the native client app
37 | // The ClientID is added as a resource in App.xaml when you register the app with
38 | // Office 365. As a convenience, we load that value into a variable called ClientID. By doing this,
39 | // whenever you register the app using another account, this variable will be in sync with whatever is in App.xaml.
40 | internal string ClientId
41 | {
42 | get {
43 | // Older versions of thye 'Connected Service' experience
44 | // inject ClientID to App.xaml, newer inject ClientId.
45 | // Just check for both.
46 | return Resources.ContainsKey("ida:ClientId") ?
47 | Resources["ida:ClientId"].ToString() :
48 | Resources["ida:ClientID"].ToString();
49 | }
50 | }
51 | internal Uri ReturnUri
52 | {
53 | get { return WebAuthenticationBroker.GetCurrentApplicationCallbackUri(); }
54 | }
55 |
56 | protected override void OnWindowCreated(WindowCreatedEventArgs args)
57 | {
58 | base.OnWindowCreated(args);
59 |
60 | SettingsPane.GetForCurrentView().CommandsRequested += OnCommandsRequested;
61 | }
62 |
63 | private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
64 | {
65 | SettingsCommand generalCommand = new SettingsCommand("account", "Account Settings",
66 | (handler) =>
67 | {
68 | AccountFlyout sf = new AccountFlyout();
69 | sf.Show();
70 | });
71 |
72 | args.Request.ApplicationCommands.Add(generalCommand);
73 | }
74 |
75 | ///
76 | /// Invoked when the application is launched normally by the end user. Other entry points
77 | /// will be used such as when the application is launched to open a specific file.
78 | ///
79 | /// Details about the launch request and process.
80 | protected override async void OnLaunched(LaunchActivatedEventArgs e)
81 | {
82 |
83 | #if DEBUG
84 | if (System.Diagnostics.Debugger.IsAttached)
85 | {
86 | this.DebugSettings.EnableFrameRateCounter = true;
87 | }
88 | #endif
89 |
90 | Frame rootFrame = Window.Current.Content as Frame;
91 |
92 | // Do not repeat app initialization when the Window already has content,
93 | // just ensure that the window is active
94 |
95 | if (rootFrame == null)
96 | {
97 | // Create a Frame to act as the navigation context and navigate to the first page
98 | rootFrame = new Frame();
99 | //Associate the frame with a SuspensionManager key
100 | SuspensionManager.RegisterFrame(rootFrame, "AppFrame");
101 | // Set the default language
102 | rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
103 |
104 | rootFrame.NavigationFailed += OnNavigationFailed;
105 |
106 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
107 | {
108 | // Restore the saved session state only when appropriate
109 | try
110 | {
111 | await SuspensionManager.RestoreAsync();
112 | }
113 | catch (SuspensionManagerException)
114 | {
115 | //Something went wrong restoring state.
116 | //Assume there is no state and continue
117 | }
118 | }
119 |
120 | // Place the frame in the current Window
121 | Window.Current.Content = rootFrame;
122 | }
123 | if (rootFrame.Content == null)
124 | {
125 | // When the navigation stack isn't restored navigate to the first page,
126 | // configuring the new page by passing required information as a navigation
127 | // parameter
128 | bool configured = !String.IsNullOrEmpty(AuthenticationHelper.ServiceResourceId);
129 | if (configured)
130 | rootFrame.Navigate(typeof(ItemsPage), e.Arguments);
131 | else
132 | rootFrame.Navigate(typeof(ConfigureAppPage), e.Arguments);
133 | }
134 | // Ensure the current window is active
135 | Window.Current.Activate();
136 | }
137 |
138 | ///
139 | /// Invoked when Navigation to a certain page fails
140 | ///
141 | /// The Frame which failed navigation
142 | /// Details about the navigation failure
143 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
144 | {
145 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
146 | }
147 |
148 | ///
149 | /// Invoked when application execution is being suspended. Application state is saved
150 | /// without knowing whether the application will be terminated or resumed with the contents
151 | /// of memory still intact.
152 | ///
153 | /// The source of the suspend request.
154 | /// Details about the suspend request.
155 | private async void OnSuspending(object sender, SuspendingEventArgs e)
156 | {
157 | var deferral = e.SuspendingOperation.GetDeferral();
158 | await SuspensionManager.SaveAsync();
159 | deferral.Complete();
160 | }
161 | }
162 | }
163 |
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/DarkGray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/DarkGray.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/Delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/Delete.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/DocCreate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/DocCreate.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/DocRead.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/DocRead.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/DocUpdate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/DocUpdate.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/Document.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/Document.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/LightGray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/LightGray.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/List.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/List.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/ListCreate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/ListCreate.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/ListItem.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/ListItem.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/ListItemCreate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/ListItemCreate.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/ListItemRead.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/ListItemRead.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/ListItemUpdate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/ListItemUpdate.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/ListRead.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/ListRead.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/ListUpdate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/ListUpdate.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/Logo.scale-100.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/MediumGray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/MediumGray.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/SmallLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/SmallLogo.scale-100.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/Square310x310Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/Square310x310Logo.scale-100.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/Square70x70Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/Square70x70Logo.scale-100.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/StoreLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/StoreLogo.scale-100.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Assets/Wide310x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Office-365-REST-API-Explorer/b0b52936832ce198455d2c7ff72bfdb06186b848/Office365RESTAPIExplorer/Assets/Wide310x150Logo.scale-100.png
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/BundleArtifacts/neutral.txt:
--------------------------------------------------------------------------------
1 | MainPackage=D:\code\patsol\Office365RESTforSites\Office365RESTAPIExplorer\bin\Debug\Office365RESTAPIExplorer_0.0.1.5_Bundle\Office365RESTAPIExplorer_0.0.1.5_AnyCPU_Debug.appx
2 | SymbolPackage=D:\code\patsol\Office365RESTforSites\Office365RESTAPIExplorer\AppPackages\Office365RESTAPIExplorer_0.0.1.5_Debug_Test\Office365RESTAPIExplorer_0.0.1.5_AnyCPU_Debug.appxsym
3 |
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Common/NavigationHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows.Input;
7 | using Windows.System;
8 | using Windows.UI.Core;
9 | using Windows.UI.Xaml;
10 | using Windows.UI.Xaml.Controls;
11 | using Windows.UI.Xaml.Navigation;
12 |
13 | namespace Office365RESTExplorerforSites.Common
14 | {
15 | ///
16 | /// NavigationHelper aids in navigation between pages. It provides commands used to
17 | /// navigate back and forward as well as registers for standard mouse and keyboard
18 | /// shortcuts used to go back and forward in Windows and the hardware back button in
19 | /// Windows Phone. In addition it integrates SuspensionManger to handle process lifetime
20 | /// management and state management when navigating between pages.
21 | ///
22 | ///
23 | /// To make use of NavigationHelper, follow these two steps or
24 | /// start with a BasicPage or any other Page item template other than BlankPage.
25 | ///
26 | /// 1) Create an instance of the NavigationHelper somewhere such as in the
27 | /// constructor for the page and register a callback for the LoadState and
28 | /// SaveState events.
29 | ///
30 | /// public MyPage()
31 | /// {
32 | /// this.InitializeComponent();
33 | /// var navigationHelper = new NavigationHelper(this);
34 | /// this.navigationHelper.LoadState += navigationHelper_LoadState;
35 | /// this.navigationHelper.SaveState += navigationHelper_SaveState;
36 | /// }
37 | ///
38 | /// private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
39 | /// { }
40 | /// private async void navigationHelper_SaveState(object sender, LoadStateEventArgs e)
41 | /// { }
42 | ///
43 | ///
44 | /// 2) Register the page to call into the NavigationHelper whenever the page participates
45 | /// in navigation by overriding the
46 | /// and events.
47 | ///
48 | /// protected override void OnNavigatedTo(NavigationEventArgs e)
49 | /// {
50 | /// navigationHelper.OnNavigatedTo(e);
51 | /// }
52 | ///
53 | /// protected override void OnNavigatedFrom(NavigationEventArgs e)
54 | /// {
55 | /// navigationHelper.OnNavigatedFrom(e);
56 | /// }
57 | ///
58 | ///
59 | [Windows.Foundation.Metadata.WebHostHidden]
60 | public class NavigationHelper : DependencyObject
61 | {
62 | private Page Page { get; set; }
63 | private Frame Frame { get { return this.Page.Frame; } }
64 |
65 | ///
66 | /// Initializes a new instance of the class.
67 | ///
68 | /// A reference to the current page used for navigation.
69 | /// This reference allows for frame manipulation and to ensure that keyboard
70 | /// navigation requests only occur when the page is occupying the entire window.
71 | public NavigationHelper(Page page)
72 | {
73 | this.Page = page;
74 |
75 | // When this page is part of the visual tree make two changes:
76 | // 1) Map application view state to visual state for the page
77 | // 2) Handle hardware navigation requests
78 | this.Page.Loaded += (sender, e) =>
79 | {
80 | #if WINDOWS_PHONE_APP
81 | Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
82 | #else
83 | // Keyboard and mouse navigation only apply when occupying the entire window
84 | if (this.Page.ActualHeight == Window.Current.Bounds.Height &&
85 | this.Page.ActualWidth == Window.Current.Bounds.Width)
86 | {
87 | // Listen to the window directly so focus isn't required
88 | Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated +=
89 | CoreDispatcher_AcceleratorKeyActivated;
90 | Window.Current.CoreWindow.PointerPressed +=
91 | this.CoreWindow_PointerPressed;
92 | }
93 | #endif
94 | };
95 |
96 | // Undo the same changes when the page is no longer visible
97 | this.Page.Unloaded += (sender, e) =>
98 | {
99 | #if WINDOWS_PHONE_APP
100 | Windows.Phone.UI.Input.HardwareButtons.BackPressed -= HardwareButtons_BackPressed;
101 | #else
102 | Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated -=
103 | CoreDispatcher_AcceleratorKeyActivated;
104 | Window.Current.CoreWindow.PointerPressed -=
105 | this.CoreWindow_PointerPressed;
106 | #endif
107 | };
108 | }
109 |
110 | #region Navigation support
111 |
112 | RelayCommand _goBackCommand;
113 | RelayCommand _goForwardCommand;
114 |
115 | ///
116 | /// used to bind to the back Button's Command property
117 | /// for navigating to the most recent item in back navigation history, if a Frame
118 | /// manages its own navigation history.
119 | ///
120 | /// The is set up to use the virtual method
121 | /// as the Execute Action and for CanExecute.
122 | ///
123 | public RelayCommand GoBackCommand
124 | {
125 | get
126 | {
127 | if (_goBackCommand == null)
128 | {
129 | _goBackCommand = new RelayCommand(
130 | () => this.GoBack(),
131 | () => this.CanGoBack());
132 | }
133 | return _goBackCommand;
134 | }
135 | set
136 | {
137 | _goBackCommand = value;
138 | }
139 | }
140 | ///
141 | /// used for navigating to the most recent item in
142 | /// the forward navigation history, if a Frame manages its own navigation history.
143 | ///
144 | /// The is set up to use the virtual method
145 | /// as the Execute Action and for CanExecute.
146 | ///
147 | public RelayCommand GoForwardCommand
148 | {
149 | get
150 | {
151 | if (_goForwardCommand == null)
152 | {
153 | _goForwardCommand = new RelayCommand(
154 | () => this.GoForward(),
155 | () => this.CanGoForward());
156 | }
157 | return _goForwardCommand;
158 | }
159 | }
160 |
161 | ///
162 | /// Virtual method used by the property
163 | /// to determine if the can go back.
164 | ///
165 | ///
166 | /// true if the has at least one entry
167 | /// in the back navigation history.
168 | ///
169 | public virtual bool CanGoBack()
170 | {
171 | return this.Frame != null && this.Frame.CanGoBack;
172 | }
173 | ///
174 | /// Virtual method used by the property
175 | /// to determine if the can go forward.
176 | ///
177 | ///
178 | /// true if the has at least one entry
179 | /// in the forward navigation history.
180 | ///
181 | public virtual bool CanGoForward()
182 | {
183 | return this.Frame != null && this.Frame.CanGoForward;
184 | }
185 |
186 | ///
187 | /// Virtual method used by the property
188 | /// to invoke the method.
189 | ///
190 | public virtual void GoBack()
191 | {
192 | if (this.Frame != null && this.Frame.CanGoBack) this.Frame.GoBack();
193 | }
194 | ///
195 | /// Virtual method used by the property
196 | /// to invoke the method.
197 | ///
198 | public virtual void GoForward()
199 | {
200 | if (this.Frame != null && this.Frame.CanGoForward) this.Frame.GoForward();
201 | }
202 |
203 | #if WINDOWS_PHONE_APP
204 | ///
205 | /// Invoked when the hardware back button is pressed. For Windows Phone only.
206 | ///
207 | /// Instance that triggered the event.
208 | /// Event data describing the conditions that led to the event.
209 | private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
210 | {
211 | if (this.GoBackCommand.CanExecute(null))
212 | {
213 | e.Handled = true;
214 | this.GoBackCommand.Execute(null);
215 | }
216 | }
217 | #else
218 | ///
219 | /// Invoked on every keystroke, including system keys such as Alt key combinations, when
220 | /// this page is active and occupies the entire window. Used to detect keyboard navigation
221 | /// between pages even when the page itself doesn't have focus.
222 | ///
223 | /// Instance that triggered the event.
224 | /// Event data describing the conditions that led to the event.
225 | private void CoreDispatcher_AcceleratorKeyActivated(CoreDispatcher sender,
226 | AcceleratorKeyEventArgs e)
227 | {
228 | var virtualKey = e.VirtualKey;
229 |
230 | // Only investigate further when Left, Right, or the dedicated Previous or Next keys
231 | // are pressed
232 | if ((e.EventType == CoreAcceleratorKeyEventType.SystemKeyDown ||
233 | e.EventType == CoreAcceleratorKeyEventType.KeyDown) &&
234 | (virtualKey == VirtualKey.Left || virtualKey == VirtualKey.Right ||
235 | (int)virtualKey == 166 || (int)virtualKey == 167))
236 | {
237 | var coreWindow = Window.Current.CoreWindow;
238 | var downState = CoreVirtualKeyStates.Down;
239 | bool menuKey = (coreWindow.GetKeyState(VirtualKey.Menu) & downState) == downState;
240 | bool controlKey = (coreWindow.GetKeyState(VirtualKey.Control) & downState) == downState;
241 | bool shiftKey = (coreWindow.GetKeyState(VirtualKey.Shift) & downState) == downState;
242 | bool noModifiers = !menuKey && !controlKey && !shiftKey;
243 | bool onlyAlt = menuKey && !controlKey && !shiftKey;
244 |
245 | if (((int)virtualKey == 166 && noModifiers) ||
246 | (virtualKey == VirtualKey.Left && onlyAlt))
247 | {
248 | // When the previous key or Alt+Left are pressed navigate back
249 | e.Handled = true;
250 | this.GoBackCommand.Execute(null);
251 | }
252 | else if (((int)virtualKey == 167 && noModifiers) ||
253 | (virtualKey == VirtualKey.Right && onlyAlt))
254 | {
255 | // When the next key or Alt+Right are pressed navigate forward
256 | e.Handled = true;
257 | this.GoForwardCommand.Execute(null);
258 | }
259 | }
260 | }
261 |
262 | ///
263 | /// Invoked on every mouse click, touch screen tap, or equivalent interaction when this
264 | /// page is active and occupies the entire window. Used to detect browser-style next and
265 | /// previous mouse button clicks to navigate between pages.
266 | ///
267 | /// Instance that triggered the event.
268 | /// Event data describing the conditions that led to the event.
269 | private void CoreWindow_PointerPressed(CoreWindow sender,
270 | PointerEventArgs e)
271 | {
272 | var properties = e.CurrentPoint.Properties;
273 |
274 | // Ignore button chords with the left, right, and middle buttons
275 | if (properties.IsLeftButtonPressed || properties.IsRightButtonPressed ||
276 | properties.IsMiddleButtonPressed) return;
277 |
278 | // If back or foward are pressed (but not both) navigate appropriately
279 | bool backPressed = properties.IsXButton1Pressed;
280 | bool forwardPressed = properties.IsXButton2Pressed;
281 | if (backPressed ^ forwardPressed)
282 | {
283 | e.Handled = true;
284 | if (backPressed) this.GoBackCommand.Execute(null);
285 | if (forwardPressed) this.GoForwardCommand.Execute(null);
286 | }
287 | }
288 | #endif
289 |
290 | #endregion
291 |
292 | #region Process lifetime management
293 |
294 | private String _pageKey;
295 |
296 | ///
297 | /// Register this event on the current page to populate the page
298 | /// with content passed during navigation as well as any saved
299 | /// state provided when recreating a page from a prior session.
300 | ///
301 | public event LoadStateEventHandler LoadState;
302 | ///
303 | /// Register this event on the current page to preserve
304 | /// state associated with the current page in case the
305 | /// application is suspended or the page is discarded from
306 | /// the navigaqtion cache.
307 | ///
308 | public event SaveStateEventHandler SaveState;
309 |
310 | ///
311 | /// Invoked when this page is about to be displayed in a Frame.
312 | /// This method calls , where all page specific
313 | /// navigation and process lifetime management logic should be placed.
314 | ///
315 | /// Event data that describes how this page was reached. The Parameter
316 | /// property provides the group to be displayed.
317 | public void OnNavigatedTo(NavigationEventArgs e)
318 | {
319 | var frameState = SuspensionManager.SessionStateForFrame(this.Frame);
320 | this._pageKey = "Page-" + this.Frame.BackStackDepth;
321 |
322 | if (e.NavigationMode == NavigationMode.New)
323 | {
324 | // Clear existing state for forward navigation when adding a new page to the
325 | // navigation stack
326 | var nextPageKey = this._pageKey;
327 | int nextPageIndex = this.Frame.BackStackDepth;
328 | while (frameState.Remove(nextPageKey))
329 | {
330 | nextPageIndex++;
331 | nextPageKey = "Page-" + nextPageIndex;
332 | }
333 |
334 | // Pass the navigation parameter to the new page
335 | if (this.LoadState != null)
336 | {
337 | this.LoadState(this, new LoadStateEventArgs(e.Parameter, null));
338 | }
339 | }
340 | else
341 | {
342 | // Pass the navigation parameter and preserved page state to the page, using
343 | // the same strategy for loading suspended state and recreating pages discarded
344 | // from cache
345 | if (this.LoadState != null)
346 | {
347 | this.LoadState(this, new LoadStateEventArgs(e.Parameter, (Dictionary)frameState[this._pageKey]));
348 | }
349 | }
350 | }
351 |
352 | ///
353 | /// Invoked when this page will no longer be displayed in a Frame.
354 | /// This method calls , where all page specific
355 | /// navigation and process lifetime management logic should be placed.
356 | ///
357 | /// Event data that describes how this page was reached. The Parameter
358 | /// property provides the group to be displayed.
359 | public void OnNavigatedFrom(NavigationEventArgs e)
360 | {
361 | var frameState = SuspensionManager.SessionStateForFrame(this.Frame);
362 | var pageState = new Dictionary();
363 | if (this.SaveState != null)
364 | {
365 | this.SaveState(this, new SaveStateEventArgs(pageState));
366 | }
367 | frameState[_pageKey] = pageState;
368 | }
369 |
370 | #endregion
371 | }
372 |
373 | ///
374 | /// Represents the method that will handle the event
375 | ///
376 | public delegate void LoadStateEventHandler(object sender, LoadStateEventArgs e);
377 | ///
378 | /// Represents the method that will handle the event
379 | ///
380 | public delegate void SaveStateEventHandler(object sender, SaveStateEventArgs e);
381 |
382 | ///
383 | /// Class used to hold the event data required when a page attempts to load state.
384 | ///
385 | public class LoadStateEventArgs : EventArgs
386 | {
387 | ///
388 | /// The parameter value passed to
389 | /// when this page was initially requested.
390 | ///
391 | public Object NavigationParameter { get; private set; }
392 | ///
393 | /// A dictionary of state preserved by this page during an earlier
394 | /// session. This will be null the first time a page is visited.
395 | ///
396 | public Dictionary PageState { get; private set; }
397 |
398 | ///
399 | /// Initializes a new instance of the class.
400 | ///
401 | ///
402 | /// The parameter value passed to
403 | /// when this page was initially requested.
404 | ///
405 | ///
406 | /// A dictionary of state preserved by this page during an earlier
407 | /// session. This will be null the first time a page is visited.
408 | ///
409 | public LoadStateEventArgs(Object navigationParameter, Dictionary pageState)
410 | : base()
411 | {
412 | this.NavigationParameter = navigationParameter;
413 | this.PageState = pageState;
414 | }
415 | }
416 | ///
417 | /// Class used to hold the event data required when a page attempts to save state.
418 | ///
419 | public class SaveStateEventArgs : EventArgs
420 | {
421 | ///
422 | /// An empty dictionary to be populated with serializable state.
423 | ///
424 | public Dictionary PageState { get; private set; }
425 |
426 | ///
427 | /// Initializes a new instance of the class.
428 | ///
429 | /// An empty dictionary to be populated with serializable state.
430 | public SaveStateEventArgs(Dictionary pageState)
431 | : base()
432 | {
433 | this.PageState = pageState;
434 | }
435 | }
436 | }
437 |
--------------------------------------------------------------------------------
/Office365RESTAPIExplorer/Common/ObservableDictionary.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using Windows.Foundation.Collections;
5 |
6 | namespace Office365RESTExplorerforSites.Common
7 | {
8 | ///
9 | /// Implementation of IObservableMap that supports reentrancy for use as a default view
10 | /// model.
11 | ///
12 | public class ObservableDictionary : IObservableMap
13 | {
14 | private class ObservableDictionaryChangedEventArgs : IMapChangedEventArgs
15 | {
16 | public ObservableDictionaryChangedEventArgs(CollectionChange change, string key)
17 | {
18 | this.CollectionChange = change;
19 | this.Key = key;
20 | }
21 |
22 | public CollectionChange CollectionChange { get; private set; }
23 | public string Key { get; private set; }
24 | }
25 |
26 | private Dictionary _dictionary = new Dictionary();
27 | public event MapChangedEventHandler MapChanged;
28 |
29 | private void InvokeMapChanged(CollectionChange change, string key)
30 | {
31 | var eventHandler = MapChanged;
32 | if (eventHandler != null)
33 | {
34 | eventHandler(this, new ObservableDictionaryChangedEventArgs(change, key));
35 | }
36 | }
37 |
38 | public void Add(string key, object value)
39 | {
40 | this._dictionary.Add(key, value);
41 | this.InvokeMapChanged(CollectionChange.ItemInserted, key);
42 | }
43 |
44 | public void Add(KeyValuePair item)
45 | {
46 | this.Add(item.Key, item.Value);
47 | }
48 |
49 | public bool Remove(string key)
50 | {
51 | if (this._dictionary.Remove(key))
52 | {
53 | this.InvokeMapChanged(CollectionChange.ItemRemoved, key);
54 | return true;
55 | }
56 | return false;
57 | }
58 |
59 | public bool Remove(KeyValuePair item)
60 | {
61 | object currentValue;
62 | if (this._dictionary.TryGetValue(item.Key, out currentValue) &&
63 | Object.Equals(item.Value, currentValue) && this._dictionary.Remove(item.Key))
64 | {
65 | this.InvokeMapChanged(CollectionChange.ItemRemoved, item.Key);
66 | return true;
67 | }
68 | return false;
69 | }
70 |
71 | public object this[string key]
72 | {
73 | get
74 | {
75 | return this._dictionary[key];
76 | }
77 | set
78 | {
79 | this._dictionary[key] = value;
80 | this.InvokeMapChanged(CollectionChange.ItemChanged, key);
81 | }
82 | }
83 |
84 | public void Clear()
85 | {
86 | var priorKeys = this._dictionary.Keys.ToArray();
87 | this._dictionary.Clear();
88 | foreach (var key in priorKeys)
89 | {
90 | this.InvokeMapChanged(CollectionChange.ItemRemoved, key);
91 | }
92 | }
93 |
94 | public ICollection Keys
95 | {
96 | get { return this._dictionary.Keys; }
97 | }
98 |
99 | public bool ContainsKey(string key)
100 | {
101 | return this._dictionary.ContainsKey(key);
102 | }
103 |
104 | public bool TryGetValue(string key, out object value)
105 | {
106 | return this._dictionary.TryGetValue(key, out value);
107 | }
108 |
109 | public ICollection