diff --git a/.gitignore b/.gitignore
index 89cb0b08..20938efd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,184 +1,184 @@
-## Ignore Visual Studio temporary files, build results, and
-## files generated by popular Visual Studio add-ons.
-
-# User-specific files
-*.suo
-*.user
-*.userosscache
-*.sln.docstates
-
-# Build results
-[Dd]ebug/
-[Dd]ebugPublic/
-[Rr]elease/
-[Rr]eleases/
-x64/
-x86/
-build/
-bld/
-[Bb]in/
-[Oo]bj/
-
-# Roslyn cache directories
-*.ide/
-
-# MSTest test Results
-[Tt]est[Rr]esult*/
-[Bb]uild[Ll]og.*
-
-#NUNIT
-*.VisualState.xml
-TestResult.xml
-
-# Build Results of an ATL Project
-[Dd]ebugPS/
-[Rr]eleasePS/
-dlldata.c
-
-*_i.c
-*_p.c
-*_i.h
-*.ilk
-*.meta
-*.obj
-*.pch
-*.pdb
-*.pgc
-*.pgd
-*.rsp
-*.sbr
-*.tlb
-*.tli
-*.tlh
-*.tmp
-*.tmp_proj
-*.log
-*.vspscc
-*.vssscc
-.builds
-*.pidb
-*.svclog
-*.scc
-
-# Chutzpah Test files
-_Chutzpah*
-
-# Visual C++ cache files
-ipch/
-*.aps
-*.ncb
-*.opensdf
-*.sdf
-*.cachefile
-
-# Visual Studio profiler
-*.psess
-*.vsp
-*.vspx
-
-# TFS 2012 Local Workspace
-$tf/
-
-# Guidance Automation Toolkit
-*.gpState
-
-# ReSharper is a .NET coding add-in
-_ReSharper*/
-*.[Rr]e[Ss]harper
-*.DotSettings.user
-
-# JustCode is a .NET coding addin-in
-.JustCode
-
-# TeamCity is a build add-in
-_TeamCity*
-
-# DotCover is a Code Coverage Tool
-*.dotCover
-
-# NCrunch
-_NCrunch_*
-.*crunch*.local.xml
-
-# MightyMoose
-*.mm.*
-AutoTest.Net/
-
-# Web workbench (sass)
-.sass-cache/
-
-# Installshield output folder
-[Ee]xpress/
-
-# DocProject is a documentation generator add-in
-DocProject/buildhelp/
-DocProject/Help/*.HxT
-DocProject/Help/*.HxC
-DocProject/Help/*.hhc
-DocProject/Help/*.hhk
-DocProject/Help/*.hhp
-DocProject/Help/Html2
-DocProject/Help/html
-
-# Click-Once directory
-publish/
-
-# Publish Web Output
-*.[Pp]ublish.xml
-*.azurePubxml
-# TODO: Comment the next line if you want to checkin your web deploy settings
-# but database connection strings (with potential passwords) will be unencrypted
-*.pubxml
-*.publishproj
-
-# NuGet Packages
-*.nupkg
-# The packages folder can be ignored because of Package Restore
-**/packages/*
-# except build/, which is used as an MSBuild target.
-!**/packages/build/
-# If using the old MSBuild-Integrated Package Restore, uncomment this:
-#!**/packages/repositories.config
-
-# Windows Azure Build Output
-csx/
-*.build.csdef
-
-# Windows Store app package directory
-AppPackages/
-
-# Others
-sql/
-*.Cache
-ClientBin/
-[Ss]tyle[Cc]op.*
-~$*
-*~
-*.dbmdl
-*.dbproj.schemaview
-*.pfx
-*.publishsettings
-node_modules/
-
-# RIA/Silverlight projects
-Generated_Code/
-
-# Backup & report files from converting an old project file
-# to a newer Visual Studio version. Backup files are not needed,
-# because we have git ;-)
-_UpgradeReport_Files/
-Backup*/
-UpgradeLog*.XML
-UpgradeLog*.htm
-
-# SQL Server files
-*.mdf
-*.ldf
-
-# Business Intelligence projects
-*.rdl.data
-*.bim.layout
-*.bim_*.settings
-
-# Microsoft Fakes
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+build/
+bld/
+[Bb]in/
+[Oo]bj/
+
+# Roslyn cache directories
+*.ide/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+#NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opensdf
+*.sdf
+*.cachefile
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding addin-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# TODO: Comment the next line if you want to checkin your web deploy settings
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# If using the old MSBuild-Integrated Package Restore, uncomment this:
+#!**/packages/repositories.config
+
+# Windows Azure Build Output
+csx/
+*.build.csdef
+
+# Windows Store app package directory
+AppPackages/
+
+# Others
+sql/
+*.Cache
+ClientBin/
+[Ss]tyle[Cc]op.*
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.pfx
+*.publishsettings
+node_modules/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
FakesAssemblies/
\ No newline at end of file
diff --git a/Attributes/AttachableAttribute.cs b/Attributes/AttachableAttribute.cs
index 4dfa40fe..56a3f467 100644
--- a/Attributes/AttachableAttribute.cs
+++ b/Attributes/AttachableAttribute.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the AttachableAttribute attribute.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -28,4 +43,4 @@ internal AttachableAttribute()
{
}
}
-}
+}
\ No newline at end of file
diff --git a/Attributes/EwsEnumAttribute.cs b/Attributes/EwsEnumAttribute.cs
index 89ef5180..b3eaf0ff 100644
--- a/Attributes/EwsEnumAttribute.cs
+++ b/Attributes/EwsEnumAttribute.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EwsEnumAttribute attribute
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -47,4 +62,4 @@ internal string SchemaName
}
}
}
-}
+}
\ No newline at end of file
diff --git a/Attributes/RequiredServerVersionAttribute.cs b/Attributes/RequiredServerVersionAttribute.cs
index 01e8b6cb..017c5aeb 100644
--- a/Attributes/RequiredServerVersionAttribute.cs
+++ b/Attributes/RequiredServerVersionAttribute.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the RequiredServerVersion attribute
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -46,4 +61,4 @@ internal ExchangeVersion Version
}
}
}
-}
+}
\ No newline at end of file
diff --git a/Attributes/SchemaAttribute.cs b/Attributes/SchemaAttribute.cs
index add8a8b9..e3ff1366 100644
--- a/Attributes/SchemaAttribute.cs
+++ b/Attributes/SchemaAttribute.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the SchemaAttribute attribute.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -27,4 +42,4 @@ internal SchemaAttribute()
{
}
}
-}
+}
\ No newline at end of file
diff --git a/Attributes/ServiceObjectDefinitionAttribute.cs b/Attributes/ServiceObjectDefinitionAttribute.cs
index f90d983b..4f82131d 100644
--- a/Attributes/ServiceObjectDefinitionAttribute.cs
+++ b/Attributes/ServiceObjectDefinitionAttribute.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ServiceObjectDefinitionAttribute attribute
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -52,4 +67,4 @@ public bool ReturnedByServer
set { this.returnedByServer = value; }
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/AlternateMailbox.cs b/Autodiscover/AlternateMailbox.cs
index d1e3dc4b..6b227f66 100644
--- a/Autodiscover/AlternateMailbox.cs
+++ b/Autodiscover/AlternateMailbox.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the AlternateMailbox class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -133,4 +148,4 @@ public string OwnerSmtpAddress
internal set { this.ownerSmtpAddress = value; }
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/AlternateMailboxCollection.cs b/Autodiscover/AlternateMailboxCollection.cs
index 5e4bc32d..41945a93 100644
--- a/Autodiscover/AlternateMailboxCollection.cs
+++ b/Autodiscover/AlternateMailboxCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the AlternateMailboxCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -58,4 +73,4 @@ public List Entries
get; private set;
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/AutodiscoverDnsClient.cs b/Autodiscover/AutodiscoverDnsClient.cs
index 177cb739..c08aba0b 100644
--- a/Autodiscover/AutodiscoverDnsClient.cs
+++ b/Autodiscover/AutodiscoverDnsClient.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// Defines the AutodiscoverDnsClient class.
-//------------------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
diff --git a/Autodiscover/AutodiscoverError.cs b/Autodiscover/AutodiscoverError.cs
index dd0cd1ec..0e9ef994 100644
--- a/Autodiscover/AutodiscoverError.cs
+++ b/Autodiscover/AutodiscoverError.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the AutodiscoverError class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -117,4 +132,4 @@ public string DebugData
get { return this.debugData; }
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/AutodiscoverResponseCollection.cs b/Autodiscover/AutodiscoverResponseCollection.cs
index 1741019d..46a4d26a 100644
--- a/Autodiscover/AutodiscoverResponseCollection.cs
+++ b/Autodiscover/AutodiscoverResponseCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the AutodiscoverResponseCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -151,4 +166,4 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/AutodiscoverService.cs b/Autodiscover/AutodiscoverService.cs
index 35c09b8c..1d54831c 100644
--- a/Autodiscover/AutodiscoverService.cs
+++ b/Autodiscover/AutodiscoverService.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ExchangeService class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -438,7 +453,7 @@ private TSettings InternalGetLegacyUserSettings(
}
// Assume caller is not inside the Intranet, regardless of whether SCP Urls
- // were returned or not. SCP Urls are only relevent if one of them returns
+ // were returned or not. SCP Urls are only relevant if one of them returns
// valid Autodiscover settings.
this.isExternal = true;
@@ -524,7 +539,7 @@ private TSettings InternalGetLegacyUserSettings(
EwsUtilities.Assert(
false,
"Autodiscover.GetConfigurationSettings",
- "An unexpected error has occured. This code path should never be reached.");
+ "An unexpected error has occurred. This code path should never be reached.");
break;
}
}
@@ -694,7 +709,7 @@ private bool TryLastChanceHostRedirection(
this.DisableScpLookupIfDuplicateRedirection(settings.RedirectTarget, redirectionEmailAddresses);
settings = this.InternalGetLegacyUserSettings(
- emailAddress,
+ settings.RedirectTarget,
redirectionEmailAddresses,
ref currentHop);
return true;
@@ -1913,4 +1928,4 @@ public Func> GetScpUrlsForDomainCallback
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/ComparisonHelpers.cs b/Autodiscover/ComparisonHelpers.cs
index 74873a9c..e6b90576 100644
--- a/Autodiscover/ComparisonHelpers.cs
+++ b/Autodiscover/ComparisonHelpers.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ComparisonHelpers class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -41,4 +56,4 @@ internal static bool CaseInsensitiveContains(this ICollection collection, string
return false;
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/ConfigurationSettings/ConfigurationSettingsBase.cs b/Autodiscover/ConfigurationSettings/ConfigurationSettingsBase.cs
index 643c7789..9ed447fe 100644
--- a/Autodiscover/ConfigurationSettings/ConfigurationSettingsBase.cs
+++ b/Autodiscover/ConfigurationSettings/ConfigurationSettingsBase.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ConfigurationSettingsBase class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -116,4 +131,4 @@ internal AutodiscoverError Error
get { return this.error; }
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/ConfigurationSettings/Outlook/OutlookAccount.cs b/Autodiscover/ConfigurationSettings/Outlook/OutlookAccount.cs
index a11428b7..d1b18a7b 100644
--- a/Autodiscover/ConfigurationSettings/Outlook/OutlookAccount.cs
+++ b/Autodiscover/ConfigurationSettings/Outlook/OutlookAccount.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the OutlookAccount class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -148,4 +163,4 @@ internal string RedirectTarget
get; set;
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/ConfigurationSettings/Outlook/OutlookConfigurationSettings.cs b/Autodiscover/ConfigurationSettings/Outlook/OutlookConfigurationSettings.cs
index 6bf475e1..e8399834 100644
--- a/Autodiscover/ConfigurationSettings/Outlook/OutlookConfigurationSettings.cs
+++ b/Autodiscover/ConfigurationSettings/Outlook/OutlookConfigurationSettings.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the OutlookConfigurationSettings class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -217,4 +232,4 @@ internal override string RedirectTarget
}
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/ConfigurationSettings/Outlook/OutlookProtocol.cs b/Autodiscover/ConfigurationSettings/Outlook/OutlookProtocol.cs
index 1a361cb2..737f6ddb 100644
--- a/Autodiscover/ConfigurationSettings/Outlook/OutlookProtocol.cs
+++ b/Autodiscover/ConfigurationSettings/Outlook/OutlookProtocol.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the OutlookProtocol class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -510,4 +525,4 @@ internal static List AvailableUserSettings
}
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/ConfigurationSettings/Outlook/OutlookUser.cs b/Autodiscover/ConfigurationSettings/Outlook/OutlookUser.cs
index 632fd0da..92621d01 100644
--- a/Autodiscover/ConfigurationSettings/Outlook/OutlookUser.cs
+++ b/Autodiscover/ConfigurationSettings/Outlook/OutlookUser.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the OutlookUser class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -123,4 +138,4 @@ internal static IEnumerable AvailableUserSettings
get { return converterDictionary.Member.Keys; }
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/DirectoryHelper.cs b/Autodiscover/DirectoryHelper.cs
index 33718cbc..da01415c 100644
--- a/Autodiscover/DirectoryHelper.cs
+++ b/Autodiscover/DirectoryHelper.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the DirectoryHelper class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -179,7 +194,7 @@ private List GetScpUrlList(
// Stop the current search, start another from a new location.
this.TraceMessage(
string.Format(
- "SCP pointer for '{0}' is found in '{1}', restarting seach in '{2}'",
+ "SCP pointer for '{0}' is found in '{1}', restarting search in '{2}'",
domainMatch,
scpDirEntry.Path,
scpPtrLdapPath));
@@ -389,4 +404,4 @@ internal ExchangeServiceBase Service
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/DocumentSharingLocation.cs b/Autodiscover/DocumentSharingLocation.cs
index c1d6dbe8..80799d41 100644
--- a/Autodiscover/DocumentSharingLocation.cs
+++ b/Autodiscover/DocumentSharingLocation.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the DocumentSharingLocation class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -285,4 +300,4 @@ internal static DocumentSharingLocation LoadFromXml(EwsXmlReader reader)
return location;
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/DocumentSharingLocationCollection.cs b/Autodiscover/DocumentSharingLocationCollection.cs
index db2a9971..e93d8d4b 100644
--- a/Autodiscover/DocumentSharingLocationCollection.cs
+++ b/Autodiscover/DocumentSharingLocationCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the DocumentSharingLocationCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -59,4 +74,4 @@ public List Entries
get; private set;
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/DomainSettingError.cs b/Autodiscover/DomainSettingError.cs
index 436456af..15f8c60f 100644
--- a/Autodiscover/DomainSettingError.cs
+++ b/Autodiscover/DomainSettingError.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the DomainSettingError class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -85,4 +100,4 @@ public string SettingName
get { return this.settingName; }
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/ProtocolConnection.cs b/Autodiscover/ProtocolConnection.cs
index 6f56cb6a..a0a82d96 100644
--- a/Autodiscover/ProtocolConnection.cs
+++ b/Autodiscover/ProtocolConnection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ProtocolConnection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -105,4 +120,4 @@ public int Port
set { this.port = value; }
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/ProtocolConnectionCollection.cs b/Autodiscover/ProtocolConnectionCollection.cs
index f60f091b..282a9bd5 100644
--- a/Autodiscover/ProtocolConnectionCollection.cs
+++ b/Autodiscover/ProtocolConnectionCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ProtocolConnectionCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -68,4 +83,4 @@ public List Connections
internal set { this.connections = value; }
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/Requests/AutodiscoverRequest.cs b/Autodiscover/Requests/AutodiscoverRequest.cs
index cef629bc..3ced2404 100644
--- a/Autodiscover/Requests/AutodiscoverRequest.cs
+++ b/Autodiscover/Requests/AutodiscoverRequest.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the AutodiscoverRequest class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -626,4 +641,4 @@ internal Uri Url
get { return this.url; }
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/Requests/GetDomainSettingsRequest.cs b/Autodiscover/Requests/GetDomainSettingsRequest.cs
index 3ae681e9..5c883b78 100644
--- a/Autodiscover/Requests/GetDomainSettingsRequest.cs
+++ b/Autodiscover/Requests/GetDomainSettingsRequest.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the GetDomainSettingsRequest class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -213,4 +228,4 @@ internal ExchangeVersion? RequestedVersion
set { requestedVersion = value; }
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/Requests/GetUserSettingsRequest.cs b/Autodiscover/Requests/GetUserSettingsRequest.cs
index 1d699e01..31e9c751 100644
--- a/Autodiscover/Requests/GetUserSettingsRequest.cs
+++ b/Autodiscover/Requests/GetUserSettingsRequest.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the GetUserSettingsRequest class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -273,4 +288,4 @@ internal string PartnerTokenReference
private set;
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/Responses/AutodiscoverResponse.cs b/Autodiscover/Responses/AutodiscoverResponse.cs
index 2719b75a..2f1095f3 100644
--- a/Autodiscover/Responses/AutodiscoverResponse.cs
+++ b/Autodiscover/Responses/AutodiscoverResponse.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the AutodiscoverResponse class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -83,4 +98,4 @@ internal Uri RedirectionUrl
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/Responses/GetDomainSettingsResponse.cs b/Autodiscover/Responses/GetDomainSettingsResponse.cs
index 327f6e0e..6cf8a9f5 100644
--- a/Autodiscover/Responses/GetDomainSettingsResponse.cs
+++ b/Autodiscover/Responses/GetDomainSettingsResponse.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the GetDomainSettingsResponse class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -199,4 +214,4 @@ private void LoadDomainSettingErrorsFromXml(EwsXmlReader reader)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/Responses/GetDomainSettingsResponseCollection.cs b/Autodiscover/Responses/GetDomainSettingsResponseCollection.cs
index 5cf56c7f..43ffbe0c 100644
--- a/Autodiscover/Responses/GetDomainSettingsResponseCollection.cs
+++ b/Autodiscover/Responses/GetDomainSettingsResponseCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the GetDomainSettingsResponseCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -56,4 +71,4 @@ internal override string GetResponseInstanceXmlElementName()
return XmlElementNames.DomainResponse;
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/Responses/GetUserSettingsResponse.cs b/Autodiscover/Responses/GetUserSettingsResponse.cs
index 1625caab..f0efc6e5 100644
--- a/Autodiscover/Responses/GetUserSettingsResponse.cs
+++ b/Autodiscover/Responses/GetUserSettingsResponse.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the GetUserSettingsResponse class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -242,4 +257,4 @@ private void LoadUserSettingErrorsFromXml(EwsXmlReader reader)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/Responses/GetUserSettingsResponseCollection.cs b/Autodiscover/Responses/GetUserSettingsResponseCollection.cs
index 9e7bb080..c17191c4 100644
--- a/Autodiscover/Responses/GetUserSettingsResponseCollection.cs
+++ b/Autodiscover/Responses/GetUserSettingsResponseCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the GetUserSettingsResponseCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -56,4 +71,4 @@ internal override string GetResponseInstanceXmlElementName()
return XmlElementNames.UserResponse;
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/UserSettingError.cs b/Autodiscover/UserSettingError.cs
index 03657302..c736f695 100644
--- a/Autodiscover/UserSettingError.cs
+++ b/Autodiscover/UserSettingError.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the UserSettingError class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -101,4 +116,4 @@ public string SettingName
get; internal set;
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/WebClientUrl.cs b/Autodiscover/WebClientUrl.cs
index 11a39726..e2ee41ed 100644
--- a/Autodiscover/WebClientUrl.cs
+++ b/Autodiscover/WebClientUrl.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the WebClientUrl class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -88,4 +103,4 @@ public string Url
internal set { this.url = value; }
}
}
-}
+}
\ No newline at end of file
diff --git a/Autodiscover/WebClientUrlCollection.cs b/Autodiscover/WebClientUrlCollection.cs
index ced7971c..3a85970d 100644
--- a/Autodiscover/WebClientUrlCollection.cs
+++ b/Autodiscover/WebClientUrlCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the WebClientUrlCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Autodiscover
{
@@ -59,4 +74,4 @@ public List Urls
get { return this.urls; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/AddressEntity.cs b/ComplexProperties/AddressEntity.cs
index 1d0aea5a..8c5f4801 100644
--- a/ComplexProperties/AddressEntity.cs
+++ b/ComplexProperties/AddressEntity.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the AddressEntity class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -49,4 +64,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/AddressEntityCollection.cs b/ComplexProperties/AddressEntityCollection.cs
index 361d303c..3752e508 100644
--- a/ComplexProperties/AddressEntityCollection.cs
+++ b/ComplexProperties/AddressEntityCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the AddressEntityCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -50,15 +65,6 @@ internal override AddressEntity CreateComplexProperty(string xmlElementName)
return new AddressEntity();
}
- ///
- /// Creates the default complex property.
- ///
- /// AddressEntity.
- internal override AddressEntity CreateDefaultComplexProperty()
- {
- return new AddressEntity();
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(AddressEntity complexPr
return XmlElementNames.NlgAddress;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/AppointmentOccurrenceId.cs b/ComplexProperties/AppointmentOccurrenceId.cs
index 8a596646..71569b7b 100644
--- a/ComplexProperties/AppointmentOccurrenceId.cs
+++ b/ComplexProperties/AppointmentOccurrenceId.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the AppointmentOccurrenceId class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -45,7 +60,7 @@ public int OccurrenceIndex
set
{
- // The occurence index has to be positive integer.
+ // The occurrence index has to be positive integer.
if (value < 1)
{
throw new ArgumentException(Strings.OccurrenceIndexMustBeGreaterThanZero);
@@ -73,23 +88,5 @@ internal override void WriteAttributesToXml(EwsServiceXmlWriter writer)
writer.WriteAttributeValue(XmlAttributeNames.RecurringMasterId, this.UniqueId);
writer.WriteAttributeValue(XmlAttributeNames.InstanceIndex, this.OccurrenceIndex);
}
-
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.AddTypeParameter(this.GetXmlElementName());
- jsonProperty.Add(XmlAttributeNames.RecurringMasterId, this.UniqueId);
- jsonProperty.Add(XmlAttributeNames.InstanceIndex, this.OccurrenceIndex);
-
- return jsonProperty;
- }
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ApprovalRequestData.cs b/ComplexProperties/ApprovalRequestData.cs
index fa50759c..6fef1322 100644
--- a/ComplexProperties/ApprovalRequestData.cs
+++ b/ComplexProperties/ApprovalRequestData.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ApprovalRequestData class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -55,35 +70,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.IsUndecidedApprovalRequest:
- this.isUndecidedApprovalRequest = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.ApprovalDecision:
- this.approvalDecision = jsonProperty.ReadAsInt(key);
- break;
- case XmlElementNames.ApprovalDecisionMaker:
- this.approvalDecisionMaker = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.ApprovalDecisionTime:
- this.approvalDecisionTime = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value;
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets a value indicating whether this is an undecided approval request.
///
@@ -116,4 +102,4 @@ public DateTime ApprovalDecisionTime
get { return this.approvalDecisionTime; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ArchiveTag.cs b/ComplexProperties/ArchiveTag.cs
index 87888ce7..15db2297 100644
--- a/ComplexProperties/ArchiveTag.cs
+++ b/ComplexProperties/ArchiveTag.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ArchiveTag class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -37,4 +52,4 @@ public ArchiveTag(bool isExplicit, Guid retentionId)
this.RetentionId = retentionId;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Attachment.cs b/ComplexProperties/Attachment.cs
index c83ecbbf..142bb708 100644
--- a/ComplexProperties/Attachment.cs
+++ b/ComplexProperties/Attachment.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Attachment class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -267,67 +282,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.AttachmentId:
- this.LoadAttachmentIdFromJson(jsonProperty.ReadAsJsonObject(key));
- break;
- case XmlElementNames.Name:
- this.name = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.ContentType:
- this.contentType = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.ContentId:
- this.contentId = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.ContentLocation:
- this.contentLocation = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.Size:
- this.size = jsonProperty.ReadAsInt(key);
- break;
- case XmlElementNames.LastModifiedTime:
- this.lastModifiedTime = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value;
- break;
- case XmlElementNames.IsInline:
- this.isInline = jsonProperty.ReadAsBool(key);
- break;
- default:
- break;
- }
- }
- }
-
- ///
- /// Loads the attachment id from json.
- ///
- /// The json object.
- private void LoadAttachmentIdFromJson(JsonObject jsonObject)
- {
- this.id = jsonObject.ReadAsString(XmlAttributeNames.Id);
-
- if (this.Owner != null &&
- jsonObject.ContainsKey(XmlAttributeNames.RootItemChangeKey))
- {
- string rootItemChangeKey = jsonObject.ReadAsString(XmlAttributeNames.RootItemChangeKey);
-
- if (!string.IsNullOrEmpty(rootItemChangeKey))
- {
- this.Owner.RootItemId.ChangeKey = rootItemChangeKey;
- }
- }
- }
-
///
/// Writes elements to XML.
///
@@ -344,30 +298,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.AddTypeParameter(this.GetXmlElementName());
- jsonProperty.Add(XmlElementNames.Name, this.Name);
- jsonProperty.Add(XmlElementNames.ContentType, this.ContentType);
- jsonProperty.Add(XmlElementNames.ContentId, this.ContentId);
- jsonProperty.Add(XmlElementNames.ContentLocation, this.ContentLocation);
- if (service.RequestedServerVersion > ExchangeVersion.Exchange2007_SP1)
- {
- jsonProperty.Add(XmlElementNames.IsInline, this.IsInline);
- }
-
- return jsonProperty;
- }
-
///
/// Load the attachment.
///
@@ -397,4 +327,4 @@ public void Load()
this.InternalLoad(null, null);
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/AttachmentCollection.cs b/ComplexProperties/AttachmentCollection.cs
index da2fe492..b6c6521f 100644
--- a/ComplexProperties/AttachmentCollection.cs
+++ b/ComplexProperties/AttachmentCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Implements an attachment collection.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -139,6 +154,26 @@ public FileAttachment AddFileAttachment(string name, byte[] content)
return fileAttachment;
}
+ ///
+ /// Adds a reference attachment to the collection
+ ///
+ /// The display name of the new attachment.
+ /// The fully-qualified path identifying the attachment
+ /// A ReferenceAttachment instance
+ public ReferenceAttachment AddReferenceAttachment(
+ string name,
+ string attachLongPathName)
+ {
+ ReferenceAttachment referenceAttachment = new ReferenceAttachment(this.owner);
+
+ referenceAttachment.Name = name;
+ referenceAttachment.AttachLongPathName = attachLongPathName;
+
+ this.InternalAdd(referenceAttachment);
+
+ return referenceAttachment;
+ }
+
///
/// Adds an item attachment to the collection
///
@@ -210,20 +245,13 @@ internal override Attachment CreateComplexProperty(string xmlElementName)
return new FileAttachment(this.owner);
case XmlElementNames.ItemAttachment:
return new ItemAttachment(this.owner);
+ case XmlElementNames.ReferenceAttachment:
+ return new ReferenceAttachment(this.owner);
default:
return null;
}
}
- ///
- /// Creates the default complex property.
- ///
- /// An Attachment instance.
- internal override Attachment CreateDefaultComplexProperty()
- {
- throw new JsonDeserializationNotImplementedException();
- }
-
///
/// Determines the name of the XML element associated with the complexProperty parameter.
///
@@ -235,6 +263,10 @@ internal override string GetCollectionItemXmlElementName(Attachment complexPrope
{
return XmlElementNames.FileAttachment;
}
+ else if (complexProperty is ReferenceAttachment)
+ {
+ return XmlElementNames.ReferenceAttachment;
+ }
else
{
return XmlElementNames.ItemAttachment;
diff --git a/ComplexProperties/Attendee.cs b/ComplexProperties/Attendee.cs
index 669a1fd7..aebf485d 100644
--- a/ComplexProperties/Attendee.cs
+++ b/ComplexProperties/Attendee.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Attendee class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -124,4 +139,4 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
writer.WriteEndElement();
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/AttendeeCollection.cs b/ComplexProperties/AttendeeCollection.cs
index b7738ecb..c073a5e5 100644
--- a/ComplexProperties/AttendeeCollection.cs
+++ b/ComplexProperties/AttendeeCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// Implements a collection of attendees.
-//------------------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -118,15 +133,6 @@ internal override Attendee CreateComplexProperty(string xmlElementName)
}
}
- ///
- /// Creates the default complex property.
- ///
- ///
- internal override Attendee CreateDefaultComplexProperty()
- {
- return new Attendee();
- }
-
///
/// Retrieves the XML element name corresponding to the provided Attendee object.
///
@@ -137,4 +143,4 @@ internal override string GetCollectionItemXmlElementName(Attendee attendee)
return XmlElementNames.Attendee;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/AttributedString.cs b/ComplexProperties/AttributedString.cs
new file mode 100644
index 00000000..68097d2b
--- /dev/null
+++ b/ComplexProperties/AttributedString.cs
@@ -0,0 +1,152 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents an attributed string, a string with a value and a list of attributions.
+ ///
+ public sealed class AttributedString : ComplexProperty
+ {
+ ///
+ /// Internal attribution store
+ ///
+ private List attributionList;
+
+ ///
+ /// String value
+ ///
+ public string Value { get; set; }
+
+ ///
+ /// Attribution values
+ ///
+ public IList Attributions { get; set; }
+
+ ///
+ /// Default constructor
+ ///
+ public AttributedString()
+ : base()
+ {
+ }
+
+ ///
+ /// Constructor
+ ///
+ public AttributedString(string value)
+ : this()
+ {
+ EwsUtilities.ValidateParam(value, "value");
+ this.Value = value;
+ }
+
+ ///
+ /// Constructor
+ ///
+ /// String value
+ /// A list of attributions
+ public AttributedString(string value, IList attributions)
+ : this(value)
+ {
+ if (attributions == null)
+ {
+ throw new ArgumentNullException("attributions");
+ }
+
+ foreach (string s in attributions)
+ {
+ EwsUtilities.ValidateParam(s, "attributions");
+ }
+
+ this.Attributions = attributions;
+ }
+
+ ///
+ /// Defines an implicit conversion from a regular string to an attributedString.
+ ///
+ /// String value of the attributed string being created
+ /// An attributed string initialized with the specified value
+ public static implicit operator AttributedString(string value)
+ {
+ return new AttributedString(value);
+ }
+
+ ///
+ /// Tries to read an attributed string blob represented in XML.
+ ///
+ /// XML reader
+ /// Whether reading succeeded
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.Value:
+ this.Value = reader.ReadElementValue();
+ return true;
+ case XmlElementNames.Attributions:
+ return this.LoadAttributionsFromXml(reader);
+ default:
+ return false;
+ }
+ }
+
+ ///
+ /// Read attribution blobs from XML
+ ///
+ /// XML reader
+ /// Whether reading succeeded
+ internal bool LoadAttributionsFromXml(EwsServiceXmlReader reader)
+ {
+ if (!reader.IsEmptyElement)
+ {
+ string localName = reader.LocalName;
+ this.attributionList = new List();
+
+ do
+ {
+ reader.Read();
+ if (reader.NodeType == XmlNodeType.Element &&
+ reader.LocalName == XmlElementNames.Attribution)
+ {
+ string s = reader.ReadElementValue();
+ if (!string.IsNullOrEmpty(s))
+ {
+ this.attributionList.Add(s);
+ }
+ }
+ }
+ while (!reader.IsEndElement(XmlNamespace.Types, localName));
+ this.Attributions = this.attributionList.ToArray();
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/AttributedStringCollection.cs b/ComplexProperties/AttributedStringCollection.cs
new file mode 100644
index 00000000..690a2abe
--- /dev/null
+++ b/ComplexProperties/AttributedStringCollection.cs
@@ -0,0 +1,169 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+
+ ///
+ /// Represents a collection of attributed strings
+ ///
+ public sealed class AttributedStringCollection : ComplexPropertyCollection
+ {
+ ///
+ /// Collection parent XML element name
+ ///
+ private readonly string collectionItemXmlElementName;
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ internal AttributedStringCollection()
+ : this(XmlElementNames.StringAttributedValue)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ /// Name of the collection item XML element.
+ internal AttributedStringCollection(string collectionItemXmlElementName)
+ : base()
+ {
+ EwsUtilities.ValidateParam(collectionItemXmlElementName, "collectionItemXmlElementName");
+ this.collectionItemXmlElementName = collectionItemXmlElementName;
+ }
+
+ ///
+ /// Adds an attributed string to the collection.
+ ///
+ /// Attributed string to be added
+ public void Add(AttributedString attributedString)
+ {
+ this.InternalAdd(attributedString);
+ }
+
+ ///
+ /// Adds multiple attributed strings to the collection.
+ ///
+ /// Attributed strings to be added
+ public void AddRange(IEnumerable attributedStrings)
+ {
+ if (attributedStrings != null)
+ {
+ foreach (AttributedString attributedString in attributedStrings)
+ {
+ this.Add(attributedString);
+ }
+ }
+ }
+
+ ///
+ /// Adds an attributed string to the collection.
+ ///
+ /// The SMTP address used to initialize the e-mail address.
+ /// An AttributedString object initialized with the provided SMTP address.
+ public AttributedString Add(string stringValue)
+ {
+ AttributedString attributedString = new AttributedString(stringValue);
+
+ this.Add(attributedString);
+
+ return attributedString;
+ }
+
+ ///
+ /// Adds a string value and list of attributions
+ ///
+ /// String value of the attributed string being added
+ /// Attributions of the attributed string being added
+ /// The added attributedString object
+ public AttributedString Add(string stringValue, IList attributions)
+ {
+ AttributedString attributedString = new AttributedString(stringValue, attributions);
+
+ this.Add(attributedString);
+
+ return attributedString;
+ }
+
+ ///
+ /// Clears the collection.
+ ///
+ public void Clear()
+ {
+ this.InternalClear();
+ }
+
+ ///
+ /// Removes an attributed string from the collection.
+ ///
+ /// Attributed string to be removed
+ /// Whether succeeded
+ public bool Remove(AttributedString attributedString)
+ {
+ EwsUtilities.ValidateParam(attributedString, "attributedString");
+
+ return this.InternalRemove(attributedString);
+ }
+
+ ///
+ /// Creates an AttributedString object from an XML element name.
+ ///
+ /// The XML element name from which to create the attributed string object
+ /// An AttributedString object
+ internal override AttributedString CreateComplexProperty(string xmlElementName)
+ {
+ EwsUtilities.ValidateParam(xmlElementName, "xmlElementName");
+ if (xmlElementName == this.collectionItemXmlElementName)
+ {
+ return new AttributedString();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Retrieves the XML element name corresponding to the provided AttributedString object.
+ ///
+ /// The AttributedString object from which to determine the XML element name.
+ /// The XML element name corresponding to the provided AttributedString object.
+ internal override string GetCollectionItemXmlElementName(AttributedString attributedString)
+ {
+ return this.collectionItemXmlElementName;
+ }
+
+ ///
+ /// Determine whether we should write collection to XML or not.
+ ///
+ /// Always true, even if the collection is empty.
+ internal override bool ShouldWriteToRequest()
+ {
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/Attribution.cs b/ComplexProperties/Attribution.cs
new file mode 100644
index 00000000..74c971e1
--- /dev/null
+++ b/ComplexProperties/Attribution.cs
@@ -0,0 +1,152 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ ///
+ /// Represents an attribution of an attributed string
+ ///
+ public sealed class Attribution : ComplexProperty
+ {
+ ///
+ /// Attribution id
+ ///
+ public string Id { get; set; }
+
+ ///
+ /// Attribution source
+ ///
+ public ItemId SourceId { get; set; }
+
+ ///
+ /// Display name
+ ///
+ public string DisplayName { get; set; }
+
+ ///
+ /// Whether writable
+ ///
+ public bool IsWritable { get; set; }
+
+ ///
+ /// Whether a quick contact
+ ///
+ public bool IsQuickContact { get; set; }
+
+ ///
+ /// Whether hidden
+ ///
+ public bool IsHidden { get; set; }
+
+ ///
+ /// Folder id
+ ///
+ public FolderId FolderId { get; set; }
+
+ ///
+ /// Default constructor
+ ///
+ public Attribution()
+ : base()
+ {
+ }
+
+ ///
+ /// Creates an instance with required values only
+ ///
+ /// Attribution id
+ /// Source Id
+ /// Display name
+ public Attribution(string id, ItemId sourceId, string displayName)
+ : this(id, sourceId, displayName, false, false, false, null)
+ {
+ }
+
+ ///
+ /// Creates an instance with all values
+ ///
+ /// Attribution id
+ /// Source Id
+ /// Display name
+ /// Whether writable
+ /// Wther quick contact
+ /// Whether hidden
+ /// Folder id
+ public Attribution(string id, ItemId sourceId, string displayName, bool isWritable, bool isQuickContact, bool isHidden, FolderId folderId)
+ : this()
+ {
+ EwsUtilities.ValidateParam(id, "id");
+ EwsUtilities.ValidateParam(displayName, "displayName");
+
+ this.Id = id;
+ this.SourceId = sourceId;
+ this.DisplayName = displayName;
+ this.IsWritable = isWritable;
+ this.IsQuickContact = isQuickContact;
+ this.IsHidden = isHidden;
+ this.FolderId = folderId;
+ }
+
+ ///
+ /// Tries to read element from XML
+ ///
+ /// XML reader
+ /// Whether reading succeeded
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.Id:
+ this.Id = reader.ReadElementValue();
+ break;
+ case XmlElementNames.SourceId:
+ this.SourceId = new ItemId();
+ this.SourceId.LoadFromXml(reader, reader.LocalName);
+ break;
+ case XmlElementNames.DisplayName:
+ this.DisplayName = reader.ReadElementValue();
+ break;
+ case XmlElementNames.IsWritable:
+ this.IsWritable = reader.ReadElementValue();
+ break;
+ case XmlElementNames.IsQuickContact:
+ this.IsQuickContact = reader.ReadElementValue();
+ break;
+ case XmlElementNames.IsHidden:
+ this.IsHidden = reader.ReadElementValue();
+ break;
+ case XmlElementNames.FolderId:
+ this.FolderId = new FolderId();
+ this.FolderId.LoadFromXml(reader, reader.LocalName);
+ break;
+
+ default:
+ return base.TryReadElementFromXml(reader);
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/AttributionCollection.cs b/ComplexProperties/AttributionCollection.cs
new file mode 100644
index 00000000..38745299
--- /dev/null
+++ b/ComplexProperties/AttributionCollection.cs
@@ -0,0 +1,128 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+
+ ///
+ /// Represents a collection of attributions
+ ///
+ public sealed class AttributionCollection : ComplexPropertyCollection
+ {
+ ///
+ /// XML element name
+ ///
+ private readonly string collectionItemXmlElementName;
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ internal AttributionCollection()
+ : this(XmlElementNames.Attribution)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ /// Name of the collection item XML element.
+ internal AttributionCollection(string collectionItemXmlElementName)
+ : base()
+ {
+ EwsUtilities.ValidateParam(collectionItemXmlElementName, "collectionItemXmlElementName");
+ this.collectionItemXmlElementName = collectionItemXmlElementName;
+ }
+
+ ///
+ /// Adds an attribution to the collection.
+ ///
+ /// Attributions to be added
+ public void Add(Attribution attribution)
+ {
+ this.InternalAdd(attribution);
+ }
+
+ ///
+ /// Adds multiple attributions to the collection.
+ ///
+ /// Attributions to be added
+ public void AddRange(IEnumerable attributions)
+ {
+ if (attributions != null)
+ {
+ foreach (Attribution attribution in attributions)
+ {
+ this.Add(attribution);
+ }
+ }
+ }
+
+ ///
+ /// Clears the collection.
+ ///
+ public void Clear()
+ {
+ this.InternalClear();
+ }
+
+ ///
+ /// Creates an attribution object from an XML element name.
+ ///
+ /// Attribution XML node name
+ /// The attribution object created
+ internal override Attribution CreateComplexProperty(string xmlElementName)
+ {
+ EwsUtilities.ValidateParam(xmlElementName, "xmlElementName");
+ if (xmlElementName == this.collectionItemXmlElementName)
+ {
+ return new Attribution();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Retrieves the XML element name corresponding to the provided attribution object.
+ ///
+ /// The attribution object from which to determine the XML element name.
+ /// The XML element name corresponding to the provided attribution object.
+ internal override string GetCollectionItemXmlElementName(Attribution attribution)
+ {
+ return this.collectionItemXmlElementName;
+ }
+
+ ///
+ /// Determine whether we should write collection to XML or not.
+ ///
+ /// Always true, even if the collection is empty.
+ internal override bool ShouldWriteToRequest()
+ {
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/Availability/CalendarEvent.cs b/ComplexProperties/Availability/CalendarEvent.cs
index c3192c9f..dd47e4a0 100644
--- a/ComplexProperties/Availability/CalendarEvent.cs
+++ b/ComplexProperties/Availability/CalendarEvent.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Implements the CalendarEvent class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -91,39 +106,5 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
return false;
}
}
-
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.StartTime:
- this.startTime = EwsUtilities.ParseAsUnbiasedDatetimescopedToServicetimeZone(
- jsonProperty.ReadAsString(key),
- service);
- break;
- case XmlElementNames.EndTime:
- this.endTime = EwsUtilities.ParseAsUnbiasedDatetimescopedToServicetimeZone(
- jsonProperty.ReadAsString(key),
- service);
- break;
- case XmlElementNames.BusyType:
- this.freeBusyStatus = jsonProperty.ReadEnumValue(key);
- break;
- case XmlElementNames.CalendarEventDetails:
- this.details = new CalendarEventDetails();
- this.details.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- default:
- break;
- }
- }
- }
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Availability/CalendarEventDetails.cs b/ComplexProperties/Availability/CalendarEventDetails.cs
index 14f7e5c7..34124b65 100644
--- a/ComplexProperties/Availability/CalendarEventDetails.cs
+++ b/ComplexProperties/Availability/CalendarEventDetails.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Implements the CalendarEventDetails class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -74,47 +89,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.ID:
- this.storeId = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.Subject:
- this.subject = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.Location:
- this.location = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.IsMeeting:
- this.isMeeting = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.IsRecurring:
- this.isRecurring = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.IsException:
- this.isException = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.IsReminderSet:
- this.isReminderSet = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.IsPrivate:
- this.isPrivate = jsonProperty.ReadAsBool(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets the store Id of the calendar event.
///
@@ -179,4 +153,4 @@ public bool IsPrivate
get { return this.isPrivate; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Availability/Conflict.cs b/ComplexProperties/Availability/Conflict.cs
index 13aec1be..edcaa69a 100644
--- a/ComplexProperties/Availability/Conflict.cs
+++ b/ComplexProperties/Availability/Conflict.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Conflict class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -65,38 +80,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.NumberOfMembers:
- this.numberOfMembers = jsonProperty.ReadAsInt(key);
- break;
- case XmlElementNames.NumberOfMembersAvailable:
- this.numberOfMembersAvailable = jsonProperty.ReadAsInt(key);
- break;
- case XmlElementNames.NumberOfMembersWithConflict:
- this.numberOfMembersWithConflict = jsonProperty.ReadAsInt(key);
- break;
- case XmlElementNames.NumberOfMembersWithNoData:
- this.numberOfMembersWithNoData = jsonProperty.ReadAsInt(key);
- break;
- case XmlElementNames.BusyType:
- this.freeBusyStatus = jsonProperty.ReadEnumValue(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets the type of the conflict.
///
@@ -150,4 +133,4 @@ public LegacyFreeBusyStatus FreeBusyStatus
get { return this.freeBusyStatus; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Availability/OofSettings.cs b/ComplexProperties/Availability/OofSettings.cs
index 225f52ff..b2415c74 100644
--- a/ComplexProperties/Availability/OofSettings.cs
+++ b/ComplexProperties/Availability/OofSettings.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the OofSettings class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -87,41 +102,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.OofState:
- this.state = jsonProperty.ReadEnumValue(key);
- break;
- case XmlElementNames.ExternalAudience:
- this.externalAudience = jsonProperty.ReadEnumValue(key);
- break;
- case XmlElementNames.Duration:
- this.duration = new TimeWindow();
- this.duration.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- case XmlElementNames.InternalReply:
- this.internalReply = new OofReply();
- this.internalReply.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- case XmlElementNames.ExternalReply:
- this.externalReply = new OofReply();
- this.externalReply.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes elements to XML.
///
@@ -155,31 +135,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
XmlElementNames.ExternalReply);
}
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlElementNames.OofState, this.State);
- jsonProperty.Add(XmlElementNames.ExternalAudience, this.ExternalAudience);
-
- if (this.Duration != null && this.State == OofState.Scheduled)
- {
- jsonProperty.Add(XmlElementNames.Duration, this.Duration.InternalToJson(service));
- }
-
- if (this.InternalReply != null)
- {
- jsonProperty.Add(XmlElementNames.InternalReply, this.InternalReply.InternalToJson(service));
- }
-
- if (this.ExternalReply != null)
- {
- jsonProperty.Add(XmlElementNames.ExternalReply, this.ExternalReply.InternalToJson(service));
- }
-
- return jsonProperty;
- }
-
///
/// Gets or sets the user's OOF state.
///
@@ -255,4 +210,4 @@ void ISelfValidate.Validate()
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Availability/Suggestion.cs b/ComplexProperties/Availability/Suggestion.cs
index 92b7b1a9..d6d83b12 100644
--- a/ComplexProperties/Availability/Suggestion.cs
+++ b/ComplexProperties/Availability/Suggestion.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Suggestion class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -84,26 +99,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- this.date = DateTime.Parse(jsonProperty.ReadAsString(XmlElementNames.Date));
- this.quality = jsonProperty.ReadEnumValue(XmlElementNames.DayQuality);
-
- foreach (object jsonSuggestion in jsonProperty.ReadAsArray(XmlElementNames.SuggestionArray))
- {
- TimeSuggestion timeSuggestion = new TimeSuggestion();
-
- timeSuggestion.LoadFromJson(jsonSuggestion as JsonObject, service);
-
- this.timeSuggestions.Add(timeSuggestion);
- }
- }
-
///
/// Gets the date and time of the suggestion.
///
diff --git a/ComplexProperties/Availability/TimeSuggestion.cs b/ComplexProperties/Availability/TimeSuggestion.cs
index 82205898..584eea03 100644
--- a/ComplexProperties/Availability/TimeSuggestion.cs
+++ b/ComplexProperties/Availability/TimeSuggestion.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the TimeSuggestion class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -100,72 +115,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.MeetingTime:
- this.meetingTime = EwsUtilities.ParseAsUnbiasedDatetimescopedToServicetimeZone(jsonProperty.ReadAsString(key), service);
- break;
- case XmlElementNames.IsWorkTime:
- this.isWorkTime = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.SuggestionQuality:
- this.quality = jsonProperty.ReadEnumValue(key);
- break;
- case XmlElementNames.AttendeeConflictDataArray:
- object[] jsonConflictArray = jsonProperty.ReadAsArray(key);
- foreach (object conflictObject in jsonConflictArray)
- {
- JsonObject jsonConflict = conflictObject as JsonObject;
- if (jsonConflict != null)
- {
- Conflict conflict = null;
-
- switch (jsonConflict.ReadTypeString())
- {
- case XmlElementNames.UnknownAttendeeConflictData:
- conflict = new Conflict(ConflictType.UnknownAttendeeConflict);
- break;
- case XmlElementNames.TooBigGroupAttendeeConflictData:
- conflict = new Conflict(ConflictType.GroupTooBigConflict);
- break;
- case XmlElementNames.IndividualAttendeeConflictData:
- conflict = new Conflict(ConflictType.IndividualAttendeeConflict);
- break;
- case XmlElementNames.GroupAttendeeConflictData:
- conflict = new Conflict(ConflictType.GroupConflict);
- break;
- default:
- EwsUtilities.Assert(
- false,
- "TimeSuggestion.TryReadElementFromJson",
- string.Format("The {0} element name does not map to any AttendeeConflict descendant.", jsonConflict.ReadTypeString()));
-
- // The following line to please the compiler
- break;
- }
-
- conflict.LoadFromJson(jsonConflict, service);
-
- this.conflicts.Add(conflict);
- }
- }
-
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets the suggested time.
///
@@ -198,4 +147,4 @@ public Collection Conflicts
get { return this.conflicts; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Availability/WorkingHours.cs b/ComplexProperties/Availability/WorkingHours.cs
index b5c7f815..941d63e1 100644
--- a/ComplexProperties/Availability/WorkingHours.cs
+++ b/ComplexProperties/Availability/WorkingHours.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the WorkingHours class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -94,71 +109,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.TimeZone:
- LegacyAvailabilityTimeZone legacyTimeZone = new LegacyAvailabilityTimeZone();
- legacyTimeZone.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
-
- this.timeZone = legacyTimeZone.ToTimeZoneInfo();
-
- break;
- case XmlElementNames.WorkingPeriodArray:
- List workingPeriods = new List();
-
- object[] workingPeriodsArray = jsonProperty.ReadAsArray(key);
-
- foreach (object workingPeriodEntry in workingPeriodsArray)
- {
- JsonObject jsonWorkingPeriodEntry = workingPeriodEntry as JsonObject;
-
- if (jsonWorkingPeriodEntry != null)
- {
- WorkingPeriod workingPeriod = new WorkingPeriod();
-
- workingPeriod.LoadFromJson(jsonWorkingPeriodEntry, service);
-
- workingPeriods.Add(workingPeriod);
- }
- }
-
- // Availability supports a structure that can technically represent different working
- // times for each day of the week. This is apparently how the information is stored in
- // Exchange. However, no client (Outlook, OWA) either will let you specify different
- // working times for each day of the week, and Outlook won't either honor that complex
- // structure if it happens to be in Exchange.
- // So here we'll do what Outlook and OWA do: we'll use the start and end times of the
- // first working period, but we'll use the week days of all the periods.
- this.startTime = workingPeriods[0].StartTime;
- this.endTime = workingPeriods[0].EndTime;
-
- foreach (WorkingPeriod workingPeriod in workingPeriods)
- {
- foreach (DayOfTheWeek dayOfWeek in workingPeriods[0].DaysOfWeek)
- {
- if (!this.daysOfTheWeek.Contains(dayOfWeek))
- {
- this.daysOfTheWeek.Add(dayOfWeek);
- }
- }
- }
-
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets the time zone to which the working hours apply.
///
@@ -191,4 +141,4 @@ public TimeSpan EndTime
get { return this.endTime; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Availability/WorkingPeriod.cs b/ComplexProperties/Availability/WorkingPeriod.cs
index cc371ea9..d0b138a6 100644
--- a/ComplexProperties/Availability/WorkingPeriod.cs
+++ b/ComplexProperties/Availability/WorkingPeriod.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the WorkingPeriod class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -58,35 +73,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.DayOfWeek:
- EwsUtilities.ParseEnumValueList(
- this.daysOfWeek,
- jsonProperty.ReadAsString(key),
- ' ');
- break;
- case XmlElementNames.StartTimeInMinutes:
- this.startTime = TimeSpan.FromMinutes(jsonProperty.ReadAsInt(key));
- break;
- case XmlElementNames.EndTimeInMinutes:
- this.endTime = TimeSpan.FromMinutes(jsonProperty.ReadAsInt(key));
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets a collection of work days.
///
@@ -111,4 +97,4 @@ internal TimeSpan EndTime
get { return this.endTime; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ByteArrayArray.cs b/ComplexProperties/ByteArrayArray.cs
index 7e694175..2cc1e4c4 100644
--- a/ComplexProperties/ByteArrayArray.cs
+++ b/ComplexProperties/ByteArrayArray.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ByteArrayArray class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -18,7 +33,7 @@ namespace Microsoft.Exchange.WebServices.Data
///
/// Represents an array of byte arrays
///
- public sealed class ByteArrayArray : ComplexProperty, IJsonCollectionDeserializer
+ public sealed class ByteArrayArray : ComplexProperty
{
private const string ItemXmlElementName = "Base64Binary";
private List content = new List();
@@ -53,29 +68,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json collection.
- ///
- /// The json collection.
- /// The service.
- void IJsonCollectionDeserializer.CreateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- foreach (object element in jsonCollection)
- {
- this.content.Add(Convert.FromBase64String(element as string));
- }
- }
-
- ///
- /// Loads from json collection to update the existing collection element.
- ///
- /// The json collection.
- /// The service.
- void IJsonCollectionDeserializer.UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- throw new NotImplementedException();
- }
-
///
/// Writes the elements to XML.
///
@@ -89,22 +81,5 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
writer.WriteEndElement();
}
}
-
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- List base64Strings = new List(this.content.Count);
- foreach (byte[] item in this.content)
- {
- base64Strings.Add(Convert.ToBase64String(item));
- }
- return base64Strings.ToArray();
- }
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ChangeHighlights.cs b/ComplexProperties/ChangeHighlights.cs
index bd606b45..b2b066a8 100644
--- a/ComplexProperties/ChangeHighlights.cs
+++ b/ComplexProperties/ChangeHighlights.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ChangeHighlights class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -63,41 +78,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.HasLocationChanged:
- this.hasLocationChanged = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.Location:
- this.location = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.HasStartTimeChanged:
- this.hasStartTimeChanged = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.Start:
- this.start = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value;
- break;
- case XmlElementNames.HasEndTimeChanged:
- this.hasEndTimeChanged = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.End:
- this.end = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value;
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets a value indicating whether the location has changed.
///
@@ -146,4 +126,4 @@ public DateTime End
get { return this.end; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ClientAccessTokenRequest.cs b/ComplexProperties/ClientAccessTokenRequest.cs
index 9259477c..a8bf850d 100644
--- a/ComplexProperties/ClientAccessTokenRequest.cs
+++ b/ComplexProperties/ClientAccessTokenRequest.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ClientAccessTokenRequest class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -69,4 +84,4 @@ public string Scope
get { return this.scope; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ClientApp.cs b/ComplexProperties/ClientApp.cs
index 29f2cefa..281fbbe0 100644
--- a/ComplexProperties/ClientApp.cs
+++ b/ComplexProperties/ClientApp.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ClientApp class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -87,4 +102,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ClientAppMetadata.cs b/ComplexProperties/ClientAppMetadata.cs
index 0fc5671c..6e4f426d 100644
--- a/ComplexProperties/ClientAppMetadata.cs
+++ b/ComplexProperties/ClientAppMetadata.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ClientAppMetadata class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -78,4 +93,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ClientExtension.cs b/ComplexProperties/ClientExtension.cs
index 58573c87..2bb65d9f 100644
--- a/ComplexProperties/ClientExtension.cs
+++ b/ComplexProperties/ClientExtension.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ClientExtension class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -267,4 +282,4 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/CompleteName.cs b/ComplexProperties/CompleteName.cs
index 7c6e0b02..8ea7f41f 100644
--- a/ComplexProperties/CompleteName.cs
+++ b/ComplexProperties/CompleteName.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the CompleteName class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -159,53 +174,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.Title:
- this.title = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.FirstName:
- this.givenName = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.MiddleName:
- this.middleName = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.LastName:
- this.surname = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.Suffix:
- this.suffix = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.Initials:
- this.initials = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.FullName:
- this.fullName = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.NickName:
- this.nickname = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.YomiFirstName:
- this.yomiGivenName = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.YomiLastName:
- this.yomiSurname = jsonProperty.ReadAsString(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes the elements to XML.
///
@@ -223,30 +191,5 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.YomiFirstName, this.YomiGivenName);
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.YomiLastName, this.YomiSurname);
}
-
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlElementNames.Title, this.Title);
- jsonProperty.Add(XmlElementNames.FirstName, this.GivenName);
- jsonProperty.Add(XmlElementNames.MiddleName, this.MiddleName);
- jsonProperty.Add(XmlElementNames.LastName, this.Surname);
- jsonProperty.Add(XmlElementNames.Suffix, this.Suffix);
- jsonProperty.Add(XmlElementNames.Initials, this.Initials);
- jsonProperty.Add(XmlElementNames.FullName, this.FullName);
- jsonProperty.Add(XmlElementNames.NickName, this.NickName);
- jsonProperty.Add(XmlElementNames.YomiFirstName, this.YomiGivenName);
- jsonProperty.Add(XmlElementNames.YomiLastName, this.YomiSurname);
-
- return jsonProperty;
- }
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ComplexProperty.cs b/ComplexProperties/ComplexProperty.cs
index 5d160d61..20455abc 100644
--- a/ComplexProperties/ComplexProperty.cs
+++ b/ComplexProperties/ComplexProperty.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ComplexProperty class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -20,7 +35,7 @@ namespace Microsoft.Exchange.WebServices.Data
/// Represents a property that can be sent to or retrieved from EWS.
///
[EditorBrowsable(EditorBrowsableState.Never)]
- public abstract class ComplexProperty : ISelfValidate, IJsonSerializable
+ public abstract class ComplexProperty : ISelfValidate
{
private XmlNamespace xmlNamespace = XmlNamespace.Types;
@@ -246,16 +261,6 @@ internal virtual void UpdateFromXml(EwsServiceXmlReader reader, string xmlElemen
xmlElementName);
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal virtual void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- throw new NotImplementedException();
- }
-
///
/// Writes to XML.
///
@@ -286,31 +291,6 @@ internal virtual void WriteToXml(EwsServiceXmlWriter writer, string xmlElementNa
xmlElementName);
}
- ///
- /// Creates a JSON representation of this object.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- object IJsonSerializable.ToJson(ExchangeService service)
- {
- return this.InternalToJson(service);
- }
-
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- ////internal abstract object InternalToJson(ExchangeService service);
- internal virtual object InternalToJson(ExchangeService service)
- {
- throw new NotImplementedException();
- }
-
///
/// Occurs when property changed.
///
@@ -331,4 +311,4 @@ internal virtual void InternalValidate()
{
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ComplexPropertyCollection.cs b/ComplexProperties/ComplexPropertyCollection.cs
index d3322345..41b7a356 100644
--- a/ComplexProperties/ComplexPropertyCollection.cs
+++ b/ComplexProperties/ComplexPropertyCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ComplexPropertyCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -20,7 +35,7 @@ namespace Microsoft.Exchange.WebServices.Data
///
/// ComplexProperty type.
[EditorBrowsable(EditorBrowsableState.Never)]
- public abstract class ComplexPropertyCollection : ComplexProperty, IEnumerable, ICustomUpdateSerializer, IJsonCollectionDeserializer
+ public abstract class ComplexPropertyCollection : ComplexProperty, IEnumerable, ICustomUpdateSerializer
where TComplexProperty : ComplexProperty
{
private List items = new List();
@@ -35,12 +50,6 @@ public abstract class ComplexPropertyCollection : ComplexPrope
/// Complex property instance.
internal abstract TComplexProperty CreateComplexProperty(string xmlElementName);
- ///
- /// Creates the default complex property.
- ///
- /// Complex property instance.
- internal abstract TComplexProperty CreateDefaultComplexProperty();
-
///
/// Gets the name of the collection item XML element.
///
@@ -167,88 +176,6 @@ internal override void UpdateFromXml(
}
}
- ///
- /// Loads from json.
- ///
- /// The json collection.
- /// The service.
- void IJsonCollectionDeserializer.CreateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- foreach (object jsonObject in jsonCollection)
- {
- JsonObject jsonProperty = jsonObject as JsonObject;
-
- if (jsonProperty != null)
- {
- TComplexProperty complexProperty = null;
-
- // If type property is present, use it. Otherwise create default property instance.
- // Note: polymorphic collections (such as Attachments) need a type property so
- // the CreateDefaultComplexProperty call will fail.
- if (jsonProperty.HasTypeProperty())
- {
- complexProperty = this.CreateComplexProperty(jsonProperty.ReadTypeString());
- }
- else
- {
- complexProperty = this.CreateDefaultComplexProperty();
- }
-
- if (complexProperty != null)
- {
- complexProperty.LoadFromJson(jsonProperty, service);
- this.InternalAdd(complexProperty, true);
- }
- }
- }
- }
-
- ///
- /// Loads from json to update existing property.
- ///
- /// The json collection.
- /// The service.
- void IJsonCollectionDeserializer.UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- if (this.Count != jsonCollection.Length)
- {
- throw new ServiceLocalException(Strings.PropertyCollectionSizeMismatch);
- }
-
- int index = 0;
- foreach (object jsonObject in jsonCollection)
- {
- JsonObject jsonProperty = jsonObject as JsonObject;
-
- if (jsonProperty != null)
- {
- TComplexProperty expectedComplexProperty = null;
-
- if (jsonProperty.HasTypeProperty())
- {
- expectedComplexProperty = this.CreateComplexProperty(jsonProperty.ReadTypeString());
- }
- else
- {
- expectedComplexProperty = this.CreateDefaultComplexProperty();
- }
-
- TComplexProperty actualComplexProperty = this[index++];
-
- if (expectedComplexProperty == null || !expectedComplexProperty.GetType().IsInstanceOfType(actualComplexProperty))
- {
- throw new ServiceLocalException(Strings.PropertyTypeIncompatibleWhenUpdatingCollection);
- }
-
- actualComplexProperty.LoadFromJson(jsonProperty, service);
- }
- else
- {
- throw new ServiceLocalException();
- }
- }
- }
-
///
/// Writes to XML.
///
@@ -269,25 +196,6 @@ internal override void WriteToXml(
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- List jsonPropertyCollection = new List();
-
- foreach (TComplexProperty complexProperty in this)
- {
- jsonPropertyCollection.Add(complexProperty.InternalToJson(service));
- }
-
- return jsonPropertyCollection.ToArray();
- }
-
///
/// Determine whether we should write collection to XML or not.
///
@@ -574,50 +482,6 @@ bool ICustomUpdateSerializer.WriteDeleteUpdateToXml(EwsServiceXmlWriter writer,
return false;
}
- ///
- /// Writes the update to Json.
- ///
- /// The service.
- /// The ews object.
- /// Property definition.
- /// The updates.
- ///
- /// True if property generated serialization.
- ///
- bool ICustomUpdateSerializer.WriteSetUpdateToJson(ExchangeService service, ServiceObject ewsObject, PropertyDefinition propertyDefinition, List updates)
- {
- // If the collection is empty, delete the property.
- if (this.Count == 0)
- {
- JsonObject jsonUpdate = new JsonObject();
-
- jsonUpdate.AddTypeParameter(ewsObject.GetDeleteFieldXmlElementName());
- jsonUpdate.Add(JsonNames.Path, (propertyDefinition as IJsonSerializable).ToJson(service));
- return true;
- }
-
- // Otherwise, use the default Json serializer.
- else
- {
- return false;
- }
- }
-
- ///
- /// Writes the deletion update to Json.
- ///
- /// The service.
- /// The ews object.
- /// The updates.
- ///
- /// True if property generated serialization.
- ///
- bool ICustomUpdateSerializer.WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List updates)
- {
- // Use the default Json serializer.
- return false;
- }
-
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ContactEntity.cs b/ComplexProperties/ContactEntity.cs
index 11672727..e153366c 100644
--- a/ComplexProperties/ContactEntity.cs
+++ b/ComplexProperties/ContactEntity.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ContactEntity class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -107,4 +122,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ContactEntityCollection.cs b/ComplexProperties/ContactEntityCollection.cs
index 7fe70ee8..0e05a219 100644
--- a/ComplexProperties/ContactEntityCollection.cs
+++ b/ComplexProperties/ContactEntityCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ContactEntityCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -50,15 +65,6 @@ internal override ContactEntity CreateComplexProperty(string xmlElementName)
return new ContactEntity();
}
- ///
- /// Creates the default complex property.
- ///
- /// ContactEntity.
- internal override ContactEntity CreateDefaultComplexProperty()
- {
- return new ContactEntity();
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(ContactEntity complexPr
return XmlElementNames.NlgContact;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ContactPhoneEntity.cs b/ComplexProperties/ContactPhoneEntity.cs
index d1cd88a6..47c4117f 100644
--- a/ComplexProperties/ContactPhoneEntity.cs
+++ b/ComplexProperties/ContactPhoneEntity.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ContactPhoneEntity class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -67,4 +82,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ContactPhoneEntityCollection.cs b/ComplexProperties/ContactPhoneEntityCollection.cs
index 4b6fa3de..f73d7527 100644
--- a/ComplexProperties/ContactPhoneEntityCollection.cs
+++ b/ComplexProperties/ContactPhoneEntityCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ContactPhoneEntityCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -50,15 +65,6 @@ internal override ContactPhoneEntity CreateComplexProperty(string xmlElementName
return new ContactPhoneEntity();
}
- ///
- /// Creates the default complex property.
- ///
- /// ContactPhoneEntity.
- internal override ContactPhoneEntity CreateDefaultComplexProperty()
- {
- return new ContactPhoneEntity();
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(ContactPhoneEntity comp
return XmlElementNames.NlgPhone;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ConversationId.cs b/ComplexProperties/ConversationId.cs
index 21724753..811ac0b0 100644
--- a/ComplexProperties/ConversationId.cs
+++ b/ComplexProperties/ConversationId.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ConversationId class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -69,11 +84,6 @@ internal override string GetXmlElementName()
return XmlElementNames.ConversationId;
}
- internal override string GetJsonTypeName()
- {
- return XmlElementNames.ItemId;
- }
-
///
/// Initializes a new instance of ConversationId.
///
diff --git a/ComplexProperties/ConversationNode.cs b/ComplexProperties/ConversationNode.cs
index 6e7870fd..ae37abf8 100644
--- a/ComplexProperties/ConversationNode.cs
+++ b/ComplexProperties/ConversationNode.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ConversationNode class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -77,34 +92,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- this.InternetMessageId = jsonProperty.ReadAsString(XmlElementNames.ConversationIndex);
-
- if (jsonProperty.ContainsKey(XmlElementNames.ParentInternetMessageId))
- {
- this.ParentInternetMessageId = jsonProperty.ReadAsString(XmlElementNames.ParentInternetMessageId);
- }
-
- if (jsonProperty.ContainsKey(XmlElementNames.Items))
- {
- EwsServiceJsonReader jsonReader = new EwsServiceJsonReader(service);
-
- this.Items = jsonReader.ReadServiceObjectsCollectionFromJson- (
- jsonProperty,
- XmlElementNames.Items,
- this.GetObjectInstance,
- false, /* clearPropertyBag */
- this.propertySet, /* requestedPropertySet */
- false); /* summaryPropertiesOnly */
- }
- }
-
///
/// Gets the item instance.
///
@@ -125,4 +112,4 @@ internal string GetXmlElementName()
return XmlElementNames.ConversationNode;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ConversationNodeCollection.cs b/ComplexProperties/ConversationNodeCollection.cs
index f878003a..df11edf8 100644
--- a/ComplexProperties/ConversationNodeCollection.cs
+++ b/ComplexProperties/ConversationNodeCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ConversationNodeCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data
/// Represents a collection of conversation items.
///
[EditorBrowsable(EditorBrowsableState.Never)]
- public sealed class ConversationNodeCollection : ComplexPropertyCollection, IJsonCollectionDeserializer
+ public sealed class ConversationNodeCollection : ComplexPropertyCollection
{
private PropertySet propertySet;
@@ -41,15 +56,6 @@ internal override ConversationNode CreateComplexProperty(string xmlElementName)
return new ConversationNode(this.propertySet);
}
- ///
- /// Creates the default complex property.
- ///
- /// ConversationItem.
- internal override ConversationNode CreateDefaultComplexProperty()
- {
- return new ConversationNode(this.propertySet);
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -59,39 +65,5 @@ internal override string GetCollectionItemXmlElementName(ConversationNode comple
{
return complexProperty.GetXmlElementName();
}
-
- #region IJsonCollectionDeserializer Members
-
- ///
- /// Loads from json collection.
- ///
- /// The json collection.
- /// The service.
- void IJsonCollectionDeserializer.CreateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- foreach (object collectionEntry in jsonCollection)
- {
- JsonObject jsonEntry = collectionEntry as JsonObject;
-
- if (jsonEntry != null)
- {
- ConversationNode node = new ConversationNode(this.propertySet);
- node.LoadFromJson(jsonEntry, service);
- this.InternalAdd(node);
- }
- }
- }
-
- ///
- /// Loads from json collection to update the existing collection element.
- ///
- /// The json collection.
- /// The service.
- void IJsonCollectionDeserializer.UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- throw new NotImplementedException();
- }
-
- #endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ConversationRequest.cs b/ComplexProperties/ConversationRequest.cs
index 52ea5b5e..586d6b16 100644
--- a/ComplexProperties/ConversationRequest.cs
+++ b/ComplexProperties/ConversationRequest.cs
@@ -1,19 +1,34 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ConversationRequest class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
///
///
///
- public sealed class ConversationRequest : ComplexProperty, ISelfValidate, IJsonSerializable
+ public sealed class ConversationRequest : ComplexProperty, ISelfValidate
{
///
/// Initializes a new instance of the class.
@@ -62,26 +77,6 @@ internal override void WriteToXml(EwsServiceXmlWriter writer, string xmlElementN
writer.WriteEndElement();
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlElementNames.ConversationId, this.ConversationId.InternalToJson(service));
- if (!string.IsNullOrEmpty(this.SyncState))
- {
- jsonProperty.Add(XmlElementNames.SyncState, this.SyncState);
- }
-
- return jsonProperty;
- }
-
///
/// Validates this instance.
///
@@ -90,4 +85,4 @@ internal override void InternalValidate()
EwsUtilities.ValidateParam(this.ConversationId, "ConversationId");
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ConversationResponse.cs b/ComplexProperties/ConversationResponse.cs
index 4d40b035..9dc07024 100644
--- a/ComplexProperties/ConversationResponse.cs
+++ b/ComplexProperties/ConversationResponse.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ConversationResponseType class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -74,26 +89,5 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
return false;
}
}
-
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- this.ConversationId = new ConversationId();
- this.ConversationId.LoadFromJson(jsonProperty.ReadAsJsonObject(XmlElementNames.ConversationId), service);
-
- if (jsonProperty.ContainsKey(XmlElementNames.SyncState))
- {
- this.SyncState = jsonProperty.ReadAsString(XmlElementNames.SyncState);
- }
-
- this.ConversationNodes = new ConversationNodeCollection(this.propertySet);
- ((IJsonCollectionDeserializer)this.ConversationNodes).CreateFromJsonCollection(
- jsonProperty.ReadAsArray(XmlElementNames.ConversationNodes),
- service);
- }
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/CreateRuleOperation.cs b/ComplexProperties/CreateRuleOperation.cs
index b71a17d4..913aed3c 100644
--- a/ComplexProperties/CreateRuleOperation.cs
+++ b/ComplexProperties/CreateRuleOperation.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the CreateRuleOperation class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -63,22 +78,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
this.Rule.WriteToXml(writer, XmlElementNames.Rule);
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlElementNames.Rule, this.Rule.InternalToJson(service));
-
- return jsonProperty;
- }
-
///
/// Validates this instance.
///
@@ -98,4 +97,4 @@ internal override string XmlElementName
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/DelegatePermissions.cs b/ComplexProperties/DelegatePermissions.cs
index 45cc3715..3efbb8c8 100644
--- a/ComplexProperties/DelegatePermissions.cs
+++ b/ComplexProperties/DelegatePermissions.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the DelegatePermissions class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -119,24 +134,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
return delegateFolderPermission != null;
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- DelegateFolderPermission delegateFolderPermission = null;
-
- if (this.delegateFolderPermissions.TryGetValue(key, out delegateFolderPermission))
- {
- delegateFolderPermission.Initialize(jsonProperty.ReadEnumValue(key));
- }
- }
- }
-
///
/// Writes elements to XML.
///
@@ -168,61 +165,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
XmlElementNames.JournalFolderPermissionLevel);
}
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- this.WritePermissionToJson(
- jsonProperty,
- XmlElementNames.CalendarFolderPermissionLevel);
-
- this.WritePermissionToJson(
- jsonProperty,
- XmlElementNames.TasksFolderPermissionLevel);
-
- this.WritePermissionToJson(
- jsonProperty,
- XmlElementNames.InboxFolderPermissionLevel);
-
- this.WritePermissionToJson(
- jsonProperty,
- XmlElementNames.ContactsFolderPermissionLevel);
-
- this.WritePermissionToJson(
- jsonProperty,
- XmlElementNames.NotesFolderPermissionLevel);
-
- this.WritePermissionToJson(
- jsonProperty,
- XmlElementNames.JournalFolderPermissionLevel);
-
- return jsonProperty;
- }
-
- ///
- /// Writes the permission to json.
- ///
- /// The json property.
- /// Name of the element.
- private void WritePermissionToJson(JsonObject jsonProperty, string elementName)
- {
- DelegateFolderPermissionLevel delegateFolderPermissionLevel = this.delegateFolderPermissions[elementName].PermissionLevel;
-
- // UpdateDelegate fails if Custom permission level is round tripped
- //
- if (delegateFolderPermissionLevel != DelegateFolderPermissionLevel.Custom)
- {
- jsonProperty.Add(elementName, delegateFolderPermissionLevel);
- }
- }
-
///
/// Write permission to Xml.
///
@@ -305,4 +247,4 @@ internal void Reset()
internal bool IsExistingPermissionLevelCustom { get; private set; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/DelegateUser.cs b/ComplexProperties/DelegateUser.cs
index 303eb6ff..356002f1 100644
--- a/ComplexProperties/DelegateUser.cs
+++ b/ComplexProperties/DelegateUser.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the DelegateUser class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -119,37 +134,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.UserId:
- this.userId = new UserId();
- this.userId.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- case XmlElementNames.DelegatePermissions:
- this.permissions.Reset();
- this.permissions.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- case XmlElementNames.ReceiveCopiesOfMeetingMessages:
- this.receiveCopiesOfMeetingMessages = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.ViewPrivateItems:
- this.viewPrivateItems = jsonProperty.ReadAsBool(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes elements to XML.
///
@@ -170,26 +154,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
this.ViewPrivateItems);
}
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlElementNames.UserId, this.UserId.InternalToJson(service));
- jsonProperty.Add(XmlElementNames.DelegatePermissions, this.Permissions.InternalToJson(service));
-
- jsonProperty.Add(XmlElementNames.ReceiveCopiesOfMeetingMessages, this.ReceiveCopiesOfMeetingMessages);
- jsonProperty.Add(XmlElementNames.ViewPrivateItems, this.ViewPrivateItems);
-
- return jsonProperty;
- }
-
///
/// Validates this instance.
///
@@ -221,4 +185,4 @@ internal void ValidateUpdateDelegate()
this.permissions.ValidateUpdateDelegate();
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/DeleteRuleOperation.cs b/ComplexProperties/DeleteRuleOperation.cs
index 6bbb093b..1e7900e8 100644
--- a/ComplexProperties/DeleteRuleOperation.cs
+++ b/ComplexProperties/DeleteRuleOperation.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the DeleteRuleOperation class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -63,22 +78,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.RuleId, this.RuleId);
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlElementNames.RuleId, this.RuleId);
-
- return jsonProperty;
- }
-
///
/// Validates this instance.
///
@@ -98,4 +97,4 @@ internal override string XmlElementName
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/DeletedOccurrenceInfo.cs b/ComplexProperties/DeletedOccurrenceInfo.cs
index a5e1bcd8..65582cb8 100644
--- a/ComplexProperties/DeletedOccurrenceInfo.cs
+++ b/ComplexProperties/DeletedOccurrenceInfo.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the DeletedOccurrenceInfo class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -50,19 +65,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- if (jsonProperty.ContainsKey(XmlElementNames.Start))
- {
- this.originalStart = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(XmlElementNames.Start)).Value;
- }
- }
-
///
/// Gets the original start date and time of the deleted occurrence.
///
@@ -71,4 +73,4 @@ public DateTime OriginalStart
get { return this.originalStart; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/DeletedOccurrenceInfoCollection.cs b/ComplexProperties/DeletedOccurrenceInfoCollection.cs
index 574d6980..2dfb02a8 100644
--- a/ComplexProperties/DeletedOccurrenceInfoCollection.cs
+++ b/ComplexProperties/DeletedOccurrenceInfoCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the DeletedOccurrenceInfoCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -42,15 +57,6 @@ internal override DeletedOccurrenceInfo CreateComplexProperty(string xmlElementN
}
}
- ///
- /// Creates the default complex property.
- ///
- ///
- internal override DeletedOccurrenceInfo CreateDefaultComplexProperty()
- {
- return new DeletedOccurrenceInfo();
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -61,4 +67,4 @@ internal override string GetCollectionItemXmlElementName(DeletedOccurrenceInfo c
return XmlElementNames.Occurrence;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/DictionaryEntryProperty.cs b/ComplexProperties/DictionaryEntryProperty.cs
index b5a0955c..145c61c4 100644
--- a/ComplexProperties/DictionaryEntryProperty.cs
+++ b/ComplexProperties/DictionaryEntryProperty.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the DictionaryEntryProperty class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -88,23 +103,6 @@ internal virtual bool WriteSetUpdateToXml(
return false;
}
- ///
- /// Writes the set update to json.
- ///
- /// The service.
- /// The ews object.
- /// The property definition.
- /// The updates.
- ///
- internal virtual bool WriteSetUpdateToJson(
- ExchangeService service,
- ServiceObject ewsObject,
- PropertyDefinition propertyDefinition,
- List updates)
- {
- return false;
- }
-
///
/// Writes the delete update to XML.
///
@@ -115,17 +113,5 @@ internal virtual bool WriteDeleteUpdateToXml(EwsServiceXmlWriter writer, Service
{
return false;
}
-
- ///
- /// Writes the delete update to json.
- ///
- /// The service.
- /// The ews object.
- /// The updates.
- ///
- internal virtual bool WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List updates)
- {
- return false;
- }
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/DictionaryProperty.cs b/ComplexProperties/DictionaryProperty.cs
index 9c2ed220..e72b7fa3 100644
--- a/ComplexProperties/DictionaryProperty.cs
+++ b/ComplexProperties/DictionaryProperty.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the DictionaryProperty class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -20,7 +35,7 @@ namespace Microsoft.Exchange.WebServices.Data
/// The type of key.
/// The type of entry.
[EditorBrowsable(EditorBrowsableState.Never)]
- public abstract class DictionaryProperty : ComplexProperty, ICustomUpdateSerializer, IJsonCollectionDeserializer
+ public abstract class DictionaryProperty : ComplexProperty, ICustomUpdateSerializer
where TEntry : DictionaryEntryProperty
{
private Dictionary entries = new Dictionary();
@@ -56,22 +71,6 @@ private void WriteUriToXml(EwsServiceXmlWriter writer, TKey key)
writer.WriteEndElement();
}
- ///
- /// Writes the URI to json.
- ///
- /// The key.
- ///
- private JsonObject WriteUriToJson(TKey key)
- {
- JsonObject jsonUri = new JsonObject();
-
- jsonUri.AddTypeParameter(JsonNames.PathToIndexedFieldType);
- jsonUri.Add(XmlAttributeNames.FieldURI, this.GetFieldURI());
- jsonUri.Add(XmlAttributeNames.FieldIndex, this.GetFieldIndex(key));
-
- return jsonUri;
- }
-
///
/// Gets the index of the field.
///
@@ -203,6 +202,7 @@ internal void InternalRemove(TKey key)
}
this.addedEntries.Remove(key);
+ this.modifiedEntries.Remove(key);
}
///
@@ -239,36 +239,6 @@ internal override void LoadFromXml(EwsServiceXmlReader reader, string localEleme
}
}
- ///
- /// Loads from json collection.
- ///
- /// The json collection.
- /// The service.
- void IJsonCollectionDeserializer.CreateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- foreach (object collectionEntry in jsonCollection)
- {
- JsonObject jsonEntry = collectionEntry as JsonObject;
-
- if (jsonEntry != null)
- {
- TEntry entry = this.CreateEntryInstance();
- entry.LoadFromJson(jsonEntry, service);
- this.InternalAdd(entry);
- }
- }
- }
-
- ///
- /// Loads from json collection to update the existing collection element.
- ///
- /// The json collection.
- /// The service.
- void IJsonCollectionDeserializer.UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- throw new NotImplementedException();
- }
-
///
/// Writes to XML.
///
@@ -302,25 +272,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- List jsonArray = new List();
-
- foreach (KeyValuePair keyValuePair in this.entries)
- {
- jsonArray.Add(keyValuePair.Value.InternalToJson(service));
- }
-
- return jsonArray.ToArray();
- }
-
///
/// Gets the entries.
///
@@ -402,86 +353,6 @@ bool ICustomUpdateSerializer.WriteSetUpdateToXml(
return true;
}
- ///
- /// Writes the set update to json.
- ///
- /// The service.
- /// The ews object.
- /// The property definition.
- /// The updates.
- ///
- bool ICustomUpdateSerializer.WriteSetUpdateToJson(
- ExchangeService service,
- ServiceObject ewsObject,
- PropertyDefinition propertyDefinition,
- List updates)
- {
- List tempEntries = new List();
-
- foreach (TKey key in this.addedEntries)
- {
- tempEntries.Add(this.entries[key]);
- }
- foreach (TKey key in this.modifiedEntries)
- {
- tempEntries.Add(this.entries[key]);
- }
-
- foreach (TEntry entry in tempEntries)
- {
- if (!entry.WriteSetUpdateToJson(
- service,
- ewsObject,
- propertyDefinition,
- updates))
- {
- JsonObject jsonUpdate = new JsonObject();
-
- jsonUpdate.AddTypeParameter(ewsObject.GetSetFieldXmlElementName());
-
- JsonObject jsonUri = new JsonObject();
-
- jsonUri.AddTypeParameter(JsonNames.PathToIndexedFieldType);
- jsonUri.Add(XmlAttributeNames.FieldURI, this.GetFieldURI());
- jsonUri.Add(XmlAttributeNames.FieldIndex, entry.Key.ToString());
-
- jsonUpdate.Add(JsonNames.Path, jsonUri);
-
- object jsonProperty = entry.InternalToJson(service);
-
- JsonObject jsonServiceObject = new JsonObject();
- jsonServiceObject.AddTypeParameter(ewsObject.GetXmlElementName());
- jsonServiceObject.Add(propertyDefinition.XmlElementName, new object[] { jsonProperty });
-
- jsonUpdate.Add(PropertyBag.GetPropertyUpdateItemName(ewsObject), jsonServiceObject);
-
- updates.Add(jsonUpdate);
- }
- }
-
- foreach (TEntry entry in this.removedEntries.Values)
- {
- if (!entry.WriteDeleteUpdateToJson(service, ewsObject, updates))
- {
- JsonObject jsonUpdate = new JsonObject();
-
- jsonUpdate.AddTypeParameter(ewsObject.GetDeleteFieldXmlElementName());
-
- JsonObject jsonUri = new JsonObject();
-
- jsonUri.AddTypeParameter(JsonNames.PathToIndexedFieldType);
- jsonUri.Add(XmlAttributeNames.FieldURI, this.GetFieldURI());
- jsonUri.Add(XmlAttributeNames.FieldIndex, entry.Key.ToString());
-
- jsonUpdate.Add(JsonNames.Path, jsonUri);
-
- updates.Add(jsonUpdate);
- }
- }
-
- return true;
- }
-
///
/// Writes deletion update to XML.
///
@@ -495,18 +366,6 @@ bool ICustomUpdateSerializer.WriteDeleteUpdateToXml(EwsServiceXmlWriter writer,
return false;
}
- ///
- /// Writes the delete update to json.
- ///
- /// The service.
- /// The ews object.
- /// The updates.
- ///
- bool ICustomUpdateSerializer.WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List updates)
- {
- return false;
- }
-
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/EmailAddress.cs b/ComplexProperties/EmailAddress.cs
index 89987e0b..1554fdc0 100644
--- a/ComplexProperties/EmailAddress.cs
+++ b/ComplexProperties/EmailAddress.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EmailAddress class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -266,39 +281,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.Name:
- this.name = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.EmailAddress:
- this.address = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.RoutingType:
- this.routingType = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.MailboxType:
- this.mailboxType = jsonProperty.ReadEnumValue(key);
- break;
- case XmlElementNames.ItemId:
- this.id = new ItemId();
- this.id.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes elements to XML.
///
@@ -316,30 +298,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlElementNames.Name, this.Name);
- jsonProperty.Add(XmlElementNames.EmailAddress, this.Address);
- jsonProperty.Add(XmlElementNames.RoutingType, this.RoutingType);
- jsonProperty.Add(XmlElementNames.MailboxType, this.MailboxType);
-
- if (this.Id != null)
- {
- jsonProperty.Add(XmlElementNames.ItemId, this.Id.InternalToJson(service));
- }
-
- return jsonProperty;
- }
-
#region ISearchStringProvider methods
///
/// Get a string representation for using this instance in a search filter.
@@ -387,4 +345,4 @@ public override string ToString()
}
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/EmailAddressCollection.cs b/ComplexProperties/EmailAddressCollection.cs
index 4ee8d29f..986cf204 100644
--- a/ComplexProperties/EmailAddressCollection.cs
+++ b/ComplexProperties/EmailAddressCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Implements an e-mail address collection.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -157,15 +172,6 @@ internal override EmailAddress CreateComplexProperty(string xmlElementName)
}
}
- ///
- /// Creates the default complex property.
- ///
- ///
- internal override EmailAddress CreateDefaultComplexProperty()
- {
- return new EmailAddress();
- }
-
///
/// Retrieves the XML element name corresponding to the provided EmailAddress object.
///
@@ -185,4 +191,4 @@ internal override bool ShouldWriteToRequest()
return true;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/EmailAddressDictionary.cs b/ComplexProperties/EmailAddressDictionary.cs
index f75e4a9f..00232388 100644
--- a/ComplexProperties/EmailAddressDictionary.cs
+++ b/ComplexProperties/EmailAddressDictionary.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EmailAddressDictionary class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
diff --git a/ComplexProperties/EmailAddressEntity.cs b/ComplexProperties/EmailAddressEntity.cs
index 6d384bc3..f16fdbdc 100644
--- a/ComplexProperties/EmailAddressEntity.cs
+++ b/ComplexProperties/EmailAddressEntity.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EmailAddressEntity class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -49,4 +64,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/EmailAddressEntityCollection.cs b/ComplexProperties/EmailAddressEntityCollection.cs
index e6d7df4d..20a78f8c 100644
--- a/ComplexProperties/EmailAddressEntityCollection.cs
+++ b/ComplexProperties/EmailAddressEntityCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EmailAddressEntityCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -50,15 +65,6 @@ internal override EmailAddressEntity CreateComplexProperty(string xmlElementName
return new EmailAddressEntity();
}
- ///
- /// Creates the default complex property.
- ///
- /// EmailAddressEntity.
- internal override EmailAddressEntity CreateDefaultComplexProperty()
- {
- return new EmailAddressEntity();
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(EmailAddressEntity comp
return XmlElementNames.NlgEmailAddress;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/EmailAddressEntry.cs b/ComplexProperties/EmailAddressEntry.cs
index 0705e837..358ab0f2 100644
--- a/ComplexProperties/EmailAddressEntry.cs
+++ b/ComplexProperties/EmailAddressEntry.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EmailAddressEntry class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -80,36 +95,6 @@ internal override void ReadTextValueFromXml(EwsServiceXmlReader reader)
this.EmailAddress.Address = reader.ReadValue();
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlAttributeNames.Key:
- this.Key = jsonProperty.ReadEnumValue(key);
- break;
- case XmlAttributeNames.Name:
- this.EmailAddress.Name = jsonProperty.ReadAsString(key);
- break;
- case XmlAttributeNames.RoutingType:
- this.EmailAddress.RoutingType = jsonProperty.ReadAsString(key);
- break;
- case XmlAttributeNames.MailboxType:
- this.EmailAddress.MailboxType = jsonProperty.ReadEnumValue(key);
- break;
- case XmlElementNames.EmailAddress:
- this.EmailAddress.Address = jsonProperty.ReadAsString(key);
- break;
- }
- }
- }
-
///
/// Writes the attributes to XML.
///
@@ -138,31 +123,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
writer.WriteValue(this.EmailAddress.Address, XmlElementNames.EmailAddress);
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlAttributeNames.Key, this.Key);
- jsonProperty.Add(XmlAttributeNames.Name, this.EmailAddress.Name);
- jsonProperty.Add(XmlAttributeNames.RoutingType, this.EmailAddress.RoutingType);
-
- if (this.EmailAddress.MailboxType.HasValue)
- {
- jsonProperty.Add(XmlAttributeNames.MailboxType, this.EmailAddress.MailboxType.Value);
- }
-
- jsonProperty.Add(XmlElementNames.EmailAddress, this.EmailAddress.Address);
-
- return jsonProperty;
- }
-
///
/// Gets or sets the e-mail address of the entry.
///
diff --git a/ComplexProperties/EmailUserEntity.cs b/ComplexProperties/EmailUserEntity.cs
index 1337cbb4..baacf2ed 100644
--- a/ComplexProperties/EmailUserEntity.cs
+++ b/ComplexProperties/EmailUserEntity.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EmailUserEntity class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -59,4 +74,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/EmailUserEntityCollection.cs b/ComplexProperties/EmailUserEntityCollection.cs
index e97b7ee3..5c0cc2cf 100644
--- a/ComplexProperties/EmailUserEntityCollection.cs
+++ b/ComplexProperties/EmailUserEntityCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EmailUserEntityCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -50,15 +65,6 @@ internal override EmailUserEntity CreateComplexProperty(string xmlElementName)
return new EmailUserEntity();
}
- ///
- /// Creates the default complex property.
- ///
- /// EmailUserEntity.
- internal override EmailUserEntity CreateDefaultComplexProperty()
- {
- return new EmailUserEntity();
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(EmailUserEntity complex
return XmlElementNames.NlgEmailUser;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/EnhancedLocation.cs b/ComplexProperties/EnhancedLocation.cs
index a6477893..0f22e488 100644
--- a/ComplexProperties/EnhancedLocation.cs
+++ b/ComplexProperties/EnhancedLocation.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EnhancedLocation class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -90,34 +105,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.LocationDisplayName:
- this.displayName = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.LocationAnnotation:
- this.annotation = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.PersonaPostalAddress:
- this.personaPostalAddress = new PersonaPostalAddress();
- this.personaPostalAddress.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- this.personaPostalAddress.OnChange += new ComplexPropertyChangedDelegate(PersonaPostalAddress_OnChange);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets or sets the Location DisplayName.
///
@@ -169,27 +156,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
this.personaPostalAddress.WriteToXml(writer);
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlElementNames.LocationDisplayName, this.displayName);
- jsonProperty.Add(XmlElementNames.LocationAnnotation, this.annotation);
- if (this.personaPostalAddress != null)
- {
- jsonProperty.Add(XmlElementNames.PersonaPostalAddress, this.personaPostalAddress.InternalToJson(service));
- }
-
- return jsonProperty;
- }
-
///
/// Validates this instance.
///
@@ -210,4 +176,4 @@ private void PersonaPostalAddress_OnChange(ComplexProperty complexProperty)
this.Changed();
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/EntityExtractionResult.cs b/ComplexProperties/EntityExtractionResult.cs
index 419c322b..1c7b3052 100644
--- a/ComplexProperties/EntityExtractionResult.cs
+++ b/ComplexProperties/EntityExtractionResult.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EntityExtractionResult class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -111,4 +126,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ExtendedProperty.cs b/ComplexProperties/ExtendedProperty.cs
index 872366d7..adeec1c2 100644
--- a/ComplexProperties/ExtendedProperty.cs
+++ b/ComplexProperties/ExtendedProperty.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ExtendedProperty class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -78,46 +93,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.ExtendedFieldURI:
- this.propertyDefinition = new ExtendedPropertyDefinition();
- this.propertyDefinition.LoadFromJson(jsonProperty.ReadAsJsonObject(key));
- break;
- case XmlElementNames.Value:
- EwsUtilities.Assert(
- this.PropertyDefinition != null,
- "ExtendedProperty.TryReadElementFromXml",
- "PropertyDefintion is missing");
-
- string stringValue = jsonProperty.ReadAsString(key);
- this.value = MapiTypeConverter.ConvertToValue(this.PropertyDefinition.MapiType, stringValue);
- break;
- case XmlElementNames.Values:
- EwsUtilities.Assert(
- this.PropertyDefinition != null,
- "ExtendedProperty.TryReadElementFromXml",
- "PropertyDefintion is missing");
-
- StringList stringList = new StringList(XmlElementNames.Value);
- ((IJsonCollectionDeserializer)stringList).CreateFromJsonCollection(jsonProperty.ReadAsArray(key), service);
- this.value = MapiTypeConverter.ConvertToValue(this.PropertyDefinition.MapiType, stringList);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes elements to XML.
///
@@ -148,43 +123,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonExtendedProp = new JsonObject();
-
- JsonObject jsonExtendedFieldUri = new JsonObject();
- this.PropertyDefinition.AddJsonProperties(jsonExtendedFieldUri, service);
-
- jsonExtendedProp.Add(XmlElementNames.ExtendedFieldURI, jsonExtendedFieldUri);
-
- if (MapiTypeConverter.IsArrayType(this.PropertyDefinition.MapiType))
- {
- List values = new List();
-
- foreach (object value in this.Value as Array)
- {
- values.Add(MapiTypeConverter.ConvertToString(this.PropertyDefinition.MapiType, value));
- }
-
- jsonExtendedProp.Add(XmlElementNames.Values, values.ToArray());
- }
- else
- {
- jsonExtendedProp.Add(
- XmlElementNames.Value,
- MapiTypeConverter.ConvertToString(this.PropertyDefinition.MapiType, this.Value));
- }
-
- return jsonExtendedProp;
- }
-
///
/// Gets the definition of the extended property.
///
@@ -282,4 +220,4 @@ public override int GetHashCode()
this.GetStringValue()).GetHashCode();
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ExtendedPropertyCollection.cs b/ComplexProperties/ExtendedPropertyCollection.cs
index 9bd5995c..066dc87f 100644
--- a/ComplexProperties/ExtendedPropertyCollection.cs
+++ b/ComplexProperties/ExtendedPropertyCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ExtendedPropertyCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -30,15 +45,6 @@ internal override ExtendedProperty CreateComplexProperty(string xmlElementName)
return new ExtendedProperty();
}
- ///
- /// Creates the default complex property.
- ///
- ///
- internal override ExtendedProperty CreateDefaultComplexProperty()
- {
- return new ExtendedProperty();
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -76,23 +82,6 @@ internal override void WriteToXml(EwsServiceXmlWriter writer, string xmlElementN
}
}
- ///
- /// Internals to json.
- ///
- /// The service.
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- List values = new List();
-
- foreach (ExtendedProperty extendedProperty in this)
- {
- values.Add(extendedProperty.InternalToJson(service));
- }
-
- return values.ToArray();
- }
-
///
/// Gets existing or adds new extended property.
///
@@ -227,42 +216,6 @@ bool ICustomUpdateSerializer.WriteSetUpdateToXml(
return true;
}
- ///
- /// Writes the set update to json.
- ///
- /// The service.
- /// The ews object.
- /// The property definition.
- /// The updates.
- ///
- bool ICustomUpdateSerializer.WriteSetUpdateToJson(
- ExchangeService service,
- ServiceObject ewsObject,
- PropertyDefinition propertyDefinition,
- List updates)
- {
- List propertiesToSet = new List();
-
- propertiesToSet.AddRange(this.AddedItems);
- propertiesToSet.AddRange(this.ModifiedItems);
-
- foreach (ExtendedProperty extendedProperty in propertiesToSet)
- {
- updates.Add(
- PropertyBag.CreateJsonSetUpdate(
- extendedProperty,
- service,
- ewsObject));
- }
-
- foreach (ExtendedProperty extendedProperty in this.RemovedItems)
- {
- updates.Add(PropertyBag.CreateJsonDeleteUpdate(extendedProperty.PropertyDefinition, service, ewsObject));
- }
-
- return true;
- }
-
///
/// Writes the deletion update to XML.
///
@@ -283,23 +236,6 @@ bool ICustomUpdateSerializer.WriteDeleteUpdateToXml(EwsServiceXmlWriter writer,
return true;
}
- ///
- /// Writes the delete update to json.
- ///
- /// The service.
- /// The ews object.
- /// The updates.
- ///
- bool ICustomUpdateSerializer.WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List updates)
- {
- foreach (ExtendedProperty extendedProperty in this.Items)
- {
- updates.Add(PropertyBag.CreateJsonDeleteUpdate(extendedProperty.PropertyDefinition, service, ewsObject));
- }
-
- return true;
- }
-
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ExtractedEntity.cs b/ComplexProperties/ExtractedEntity.cs
index 05d189c5..977c65a2 100644
--- a/ComplexProperties/ExtractedEntity.cs
+++ b/ComplexProperties/ExtractedEntity.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ExtractedEntity class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -55,4 +70,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/FileAttachment.cs b/ComplexProperties/FileAttachment.cs
index a0a02a2e..f9611145 100644
--- a/ComplexProperties/FileAttachment.cs
+++ b/ComplexProperties/FileAttachment.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the FileAttachment class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -127,57 +142,6 @@ internal override bool TryReadElementFromXmlToPatch(EwsServiceXmlReader reader)
return base.TryReadElementFromXml(reader);
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.LoadFromJson(jsonProperty, service);
-
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.IsContactPhoto:
- this.isContactPhoto = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.Content:
- if (this.loadToStream != null)
- {
- jsonProperty.ReadAsBase64Content(key, this.loadToStream);
- }
- else
- {
- // If there's a file attachment content handler, use it. Otherwise
- // load the content into a byte array.
- // TODO: Should we mark the attachment to indicate that content is stored elsewhere?
- if (service.FileAttachmentContentHandler != null)
- {
- Stream outputStream = service.FileAttachmentContentHandler.GetOutputStream(this.Id);
-
- if (outputStream != null)
- {
- jsonProperty.ReadAsBase64Content(key, outputStream);
- }
- else
- {
- this.content = jsonProperty.ReadAsBase64Content(key);
- }
- }
- else
- {
- this.content = jsonProperty.ReadAsBase64Content(key);
- }
- }
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes elements and content to XML.
///
@@ -219,48 +183,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
writer.WriteEndElement();
}
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonAttachment = base.InternalToJson(service) as JsonObject;
-
- if (service.RequestedServerVersion > ExchangeVersion.Exchange2007_SP1)
- {
- jsonAttachment.Add(XmlElementNames.IsContactPhoto, this.isContactPhoto);
- }
-
- if (!string.IsNullOrEmpty(this.FileName))
- {
- using (FileStream fileStream = new FileStream(this.FileName, FileMode.Open, FileAccess.Read))
- {
- jsonAttachment.AddBase64(XmlElementNames.Content, fileStream);
- }
- }
- else if (this.ContentStream != null)
- {
- jsonAttachment.AddBase64(XmlElementNames.Content, this.ContentStream);
- }
- else if (this.Content != null)
- {
- jsonAttachment.AddBase64(XmlElementNames.Content, this.Content);
- }
- else
- {
- EwsUtilities.Assert(
- false,
- "FileAttachment.WriteElementsToXml",
- "The attachment's content is not set.");
- }
-
- return jsonAttachment;
- }
-
///
/// Loads the content of the file attachment into the specified stream. Calling this method results in a call to EWS.
///
@@ -385,4 +307,4 @@ public bool IsContactPhoto
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Flag.cs b/ComplexProperties/Flag.cs
index 36a54961..90dbcaed 100644
--- a/ComplexProperties/Flag.cs
+++ b/ComplexProperties/Flag.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Flag class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -55,35 +70,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.FlagStatus:
- this.flagStatus = jsonProperty.ReadEnumValue(key);
- break;
- case XmlElementNames.StartDate:
- this.startDate = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value;
- break;
- case XmlElementNames.DueDate:
- this.dueDate = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value;
- break;
- case XmlElementNames.CompleteDate:
- this.completeDate = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value;
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes elements to XML.
///
@@ -92,42 +78,17 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.FlagStatus, this.FlagStatus);
- if (this.FlagStatus == ItemFlagStatus.Flagged && this.StartDate != null && this.DueDate != null)
+ if (this.FlagStatus == ItemFlagStatus.Flagged)
{
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.StartDate, this.StartDate);
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.DueDate, this.DueDate);
}
- else if (this.FlagStatus == ItemFlagStatus.Complete && this.CompleteDate != null)
+ else if (this.FlagStatus == ItemFlagStatus.Complete)
{
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.CompleteDate, this.CompleteDate);
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonObject = new JsonObject();
-
- jsonObject.Add(XmlElementNames.FlagStatus, this.FlagStatus);
- if (this.FlagStatus == ItemFlagStatus.Flagged && this.StartDate != null && this.DueDate != null)
- {
- jsonObject.Add(XmlElementNames.StartDate, this.StartDate);
- jsonObject.Add(XmlElementNames.DueDate, this.DueDate);
- }
- else if (this.FlagStatus == ItemFlagStatus.Complete && this.CompleteDate != null)
- {
- jsonObject.Add(XmlElementNames.CompleteDate, this.CompleteDate);
- }
-
- return jsonObject;
- }
-
///
/// Validates this instance.
///
@@ -200,4 +161,4 @@ public DateTime CompleteDate
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/FolderId.cs b/ComplexProperties/FolderId.cs
index b1c00c9b..f2793fb6 100644
--- a/ComplexProperties/FolderId.cs
+++ b/ComplexProperties/FolderId.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the FolderId class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -92,35 +107,6 @@ internal override void WriteAttributesToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- if (this.FolderName.HasValue)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.AddTypeParameter(this.GetXmlElementName());
- jsonProperty.Add(XmlAttributeNames.Id, this.FolderName.Value.ToString().ToLowerInvariant());
-
- if (this.Mailbox != null)
- {
- jsonProperty.Add(XmlElementNames.Mailbox, this.Mailbox.InternalToJson(service));
- }
-
- return jsonProperty;
- }
- else
- {
- return base.InternalToJson(service);
- }
- }
-
///
/// Validates FolderId against a specified request version.
///
@@ -294,4 +280,4 @@ public override string ToString()
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/FolderIdCollection.cs b/ComplexProperties/FolderIdCollection.cs
index 4d164d7f..680e9f39 100644
--- a/ComplexProperties/FolderIdCollection.cs
+++ b/ComplexProperties/FolderIdCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the FolderIdCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -50,15 +65,6 @@ internal override FolderId CreateComplexProperty(string xmlElementName)
return new FolderId();
}
- ///
- /// Creates the default complex property.
- ///
- /// FolderId.
- internal override FolderId CreateDefaultComplexProperty()
- {
- return new FolderId();
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -148,4 +154,4 @@ public bool Remove(WellKnownFolderName folderName)
return this.InternalRemove(folderName);
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/FolderPermission.cs b/ComplexProperties/FolderPermission.cs
index 13830bf0..cbbec60f 100644
--- a/ComplexProperties/FolderPermission.cs
+++ b/ComplexProperties/FolderPermission.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the FolderPermission class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -639,57 +654,6 @@ internal override void LoadFromXml(
this.AdjustPermissionLevel();
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.UserId:
- this.UserId = new UserId();
- this.UserId.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- case XmlElementNames.CanCreateItems:
- this.canCreateItems = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.CanCreateSubFolders:
- this.canCreateSubFolders = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.IsFolderOwner:
- this.isFolderOwner = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.IsFolderVisible:
- this.isFolderVisible = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.IsFolderContact:
- this.isFolderContact = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.EditItems:
- this.editItems = jsonProperty.ReadEnumValue(key);
- break;
- case XmlElementNames.DeleteItems:
- this.deleteItems = jsonProperty.ReadEnumValue(key);
- break;
- case XmlElementNames.ReadItems:
- this.readItems = jsonProperty.ReadEnumValue(key);
- break;
- case XmlElementNames.PermissionLevel:
- case XmlElementNames.CalendarPermissionLevel:
- this.permissionLevel = jsonProperty.ReadEnumValue(key);
- break;
- default:
- break;
- }
- }
-
- this.AdjustPermissionLevel();
- }
-
///
/// Writes elements to XML.
///
@@ -767,64 +731,5 @@ internal void WriteToXml(
this.WriteElementsToXml(writer, isCalendarFolder);
writer.WriteEndElement();
}
-
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- /// if set to true [is calendar folder].
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal object InternalToJson(ExchangeService service, bool isCalendarFolder)
- {
- JsonObject jsonPermission = new JsonObject();
-
- jsonPermission.Add(XmlElementNames.UserId, this.UserId.InternalToJson(service));
-
- if (this.PermissionLevel == FolderPermissionLevel.Custom)
- {
- jsonPermission.Add(
- XmlElementNames.CanCreateItems,
- this.CanCreateItems);
-
- jsonPermission.Add(
- XmlElementNames.CanCreateSubFolders,
- this.CanCreateSubFolders);
-
- jsonPermission.Add(
- XmlElementNames.IsFolderOwner,
- this.IsFolderOwner);
-
- jsonPermission.Add(
- XmlElementNames.IsFolderVisible,
- this.IsFolderVisible);
-
- jsonPermission.Add(
- XmlElementNames.IsFolderContact,
- this.IsFolderContact);
-
- jsonPermission.Add(
- XmlElementNames.EditItems,
- this.EditItems);
-
- jsonPermission.Add(
- XmlElementNames.DeleteItems,
- this.DeleteItems);
-
- jsonPermission.Add(
- XmlElementNames.ReadItems,
- this.ReadItems);
- }
-
- jsonPermission.Add(
- isCalendarFolder ? XmlElementNames.CalendarPermissionLevel : XmlElementNames.PermissionLevel,
- this.PermissionLevel);
-
- jsonPermission.AddTypeParameter(
- isCalendarFolder ? XmlElementNames.CalendarPermission : XmlElementNames.Permission);
-
- return jsonPermission;
- }
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/FolderPermissionCollection.cs b/ComplexProperties/FolderPermissionCollection.cs
index 89ca8ca5..8d590624 100644
--- a/ComplexProperties/FolderPermissionCollection.cs
+++ b/ComplexProperties/FolderPermissionCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the FolderPermissionCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -92,30 +107,6 @@ internal override void LoadFromXml(EwsServiceXmlReader reader, string localEleme
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- object[] jsonFolderPermissions = jsonProperty.ReadAsArray(this.InnerCollectionXmlElementName);
-
- foreach (object jsonFolderPermission in jsonFolderPermissions)
- {
- FolderPermission permission = new FolderPermission();
- permission.LoadFromJson(jsonFolderPermission as JsonObject, service);
- this.InternalAdd(permission);
- }
-
- object[] jsonUnknownEntries = jsonProperty.ReadAsArray(XmlElementNames.UnknownEntries);
-
- foreach (object jsonUnknownEntry in jsonUnknownEntries)
- {
- this.unknownEntries.Add(jsonUnknownEntry as string);
- }
- }
-
///
/// Validates this instance.
///
@@ -145,29 +136,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
writer.WriteEndElement(); // this.InnerCollectionXmlElementName
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
- List permissions = new List();
-
- foreach (FolderPermission folderPermission in this)
- {
- permissions.Add(folderPermission.InternalToJson(service, this.isCalendarFolder));
- }
-
- jsonProperty.AddTypeParameter(this.InnerCollectionXmlElementName);
- jsonProperty.Add(this.InnerCollectionXmlElementName, permissions.ToArray());
-
- return jsonProperty;
- }
-
///
/// Creates the complex property.
///
@@ -178,15 +146,6 @@ internal override FolderPermission CreateComplexProperty(string xmlElementName)
return new FolderPermission();
}
- ///
- /// Creates the default complex property.
- ///
- /// FolderPermission instance.
- internal override FolderPermission CreateDefaultComplexProperty()
- {
- return new FolderPermission();
- }
-
///
/// Adds a permission to the collection.
///
@@ -245,4 +204,4 @@ public Collection UnknownEntries
get { return this.unknownEntries; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/GenericItemAttachment.cs b/ComplexProperties/GenericItemAttachment.cs
index 14d05235..2663ecf1 100644
--- a/ComplexProperties/GenericItemAttachment.cs
+++ b/ComplexProperties/GenericItemAttachment.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the GenericItemAttachment enumeration.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -39,4 +54,4 @@ internal ItemAttachment(Item owner)
internal set { base.Item = value; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/GroupMember.cs b/ComplexProperties/GroupMember.cs
index 87269d7a..5964f765 100644
--- a/ComplexProperties/GroupMember.cs
+++ b/ComplexProperties/GroupMember.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the GroupMember class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -259,31 +274,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.Status:
- this.status = jsonProperty.ReadEnumValue(key);
- break;
-
- case XmlElementNames.Mailbox:
- this.AddressInformation = new EmailAddress();
- this.AddressInformation.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes the member key attribute to XML.
///
@@ -308,23 +298,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
XmlElementNames.Mailbox);
}
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlAttributeNames.Key, this.key);
- jsonProperty.Add(XmlElementNames.Mailbox, this.AddressInformation.InternalToJson(service));
-
- return jsonProperty;
- }
-
///
/// AddressInformation instance is changed.
///
@@ -334,4 +307,4 @@ private void AddressInformationChanged(ComplexProperty complexProperty)
this.Changed();
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/GroupMemberCollection.cs b/ComplexProperties/GroupMemberCollection.cs
index 1bc8dade..d1094a53 100644
--- a/ComplexProperties/GroupMemberCollection.cs
+++ b/ComplexProperties/GroupMemberCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the GroupMemberCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -281,24 +296,6 @@ bool ICustomUpdateSerializer.WriteSetUpdateToXml(
return true;
}
- ///
- /// Writes the set update to json.
- ///
- /// The service.
- /// The ews object.
- /// The property definition.
- /// The updates.
- ///
- bool ICustomUpdateSerializer.WriteSetUpdateToJson(
- ExchangeService service,
- ServiceObject ewsObject,
- PropertyDefinition propertyDefinition,
- List updates)
- {
- // TODO: Implement
- throw new NotImplementedException();
- }
-
///
/// Writes the deletion update to XML.
///
@@ -310,18 +307,6 @@ bool ICustomUpdateSerializer.WriteDeleteUpdateToXml(EwsServiceXmlWriter writer,
return false;
}
- ///
- /// Writes the delete update to json.
- ///
- /// The service.
- /// The ews object.
- /// The updates.
- ///
- bool ICustomUpdateSerializer.WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List updates)
- {
- return false;
- }
-
///
/// Creates a GroupMember object from an XML element name.
///
@@ -332,15 +317,6 @@ internal override GroupMember CreateComplexProperty(string xmlElementName)
return new GroupMember();
}
- ///
- /// Creates the default complex property.
- ///
- /// An GroupMember object.
- internal override GroupMember CreateDefaultComplexProperty()
- {
- return new GroupMember();
- }
-
///
/// Clears the change log.
///
@@ -440,4 +416,4 @@ internal override void InternalValidate()
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/HighlightTerm.cs b/ComplexProperties/HighlightTerm.cs
index 838f8d23..cb4ee8c8 100644
--- a/ComplexProperties/HighlightTerm.cs
+++ b/ComplexProperties/HighlightTerm.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the HighlightTerm class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -74,23 +89,5 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
return false;
}
}
-
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- if (jsonProperty.ContainsKey(XmlElementNames.HighlightTermScope))
- {
- this.scope = jsonProperty.ReadAsString(XmlElementNames.HighlightTermScope);
- }
-
- if (jsonProperty.ContainsKey(XmlElementNames.HighlightTermValue))
- {
- this.value = jsonProperty.ReadAsString(XmlElementNames.HighlightTermValue);
- }
- }
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ImAddressDictionary.cs b/ComplexProperties/ImAddressDictionary.cs
index fd2c29f5..d5b7b72b 100644
--- a/ComplexProperties/ImAddressDictionary.cs
+++ b/ComplexProperties/ImAddressDictionary.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ImAddressDictionary class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -101,4 +116,4 @@ public bool TryGetValue(ImAddressKey key, out string imAddress)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ImAddressEntry.cs b/ComplexProperties/ImAddressEntry.cs
index 8c3bbf9e..b3d23722 100644
--- a/ComplexProperties/ImAddressEntry.cs
+++ b/ComplexProperties/ImAddressEntry.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ImAddressEntry class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -68,26 +83,5 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
writer.WriteValue(this.ImAddress, XmlElementNames.ImAddress);
}
-
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlAttributeNames.Key, this.Key);
- jsonProperty.Add(XmlElementNames.ImAddress, this.ImAddress);
-
- return jsonProperty;
- }
-
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- this.Key = jsonProperty.ReadEnumValue(XmlAttributeNames.Key);
- this.ImAddress = jsonProperty.ReadAsString(XmlElementNames.ImAddress);
- }
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/InternetMessageHeader.cs b/ComplexProperties/InternetMessageHeader.cs
index 97075e86..cbcab114 100644
--- a/ComplexProperties/InternetMessageHeader.cs
+++ b/ComplexProperties/InternetMessageHeader.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the InternetMessageHeader class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -47,29 +62,6 @@ internal override void ReadTextValueFromXml(EwsServiceXmlReader reader)
this.value = reader.ReadValue();
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlAttributeNames.HeaderName:
- this.name = jsonProperty.ReadAsString(key);
- break;
- case JsonObject.JsonValueString:
- this.value = jsonProperty.ReadAsString(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes the attributes to XML.
///
@@ -88,23 +80,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
writer.WriteValue(this.Value, this.Name);
}
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlAttributeNames.HeaderName, this.Name);
- jsonProperty.Add(JsonObject.JsonValueString, this.Value);
-
- return jsonProperty;
- }
-
///
/// Obtains a string representation of the header.
///
@@ -132,4 +107,4 @@ public string Value
set { this.SetFieldValue(ref this.value, value); }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/InternetMessageHeaderCollection.cs b/ComplexProperties/InternetMessageHeaderCollection.cs
index 640ea09c..1cbdbd77 100644
--- a/ComplexProperties/InternetMessageHeaderCollection.cs
+++ b/ComplexProperties/InternetMessageHeaderCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the InternetMessageHeaderCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -39,15 +54,6 @@ internal override InternetMessageHeader CreateComplexProperty(string xmlElementN
return new InternetMessageHeader();
}
- ///
- /// Creates the default complex property.
- ///
- /// InternetMessageHeader instance.
- internal override InternetMessageHeader CreateDefaultComplexProperty()
- {
- return new InternetMessageHeader();
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -76,4 +82,4 @@ public InternetMessageHeader Find(string name)
return null;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ItemAttachment.cs b/ComplexProperties/ItemAttachment.cs
index 2c38bbdf..a903e61e 100644
--- a/ComplexProperties/ItemAttachment.cs
+++ b/ComplexProperties/ItemAttachment.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ItemAttachment class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -138,32 +153,6 @@ internal override bool TryReadElementFromXmlToPatch(EwsServiceXmlReader reader)
return false;
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.LoadFromJson(jsonProperty, service);
-
- if (jsonProperty.ContainsKey(XmlElementNames.Item))
- {
- JsonObject jsonItem = jsonProperty.ReadAsJsonObject(XmlElementNames.Item);
-
- // skip this - "Item" : null
- if (jsonItem != null)
- {
- this.item = EwsUtilities.CreateItemFromXmlElementName(this, jsonItem.ReadTypeString());
-
- if (this.item != null)
- {
- this.item.LoadFromJson(jsonItem, service, true /* clearPropertyBag */);
- }
- }
- }
- }
-
///
/// Writes the properties of this object as XML elements.
///
@@ -175,22 +164,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
this.Item.WriteToXml(writer);
}
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonAttachment = base.InternalToJson(service) as JsonObject;
-
- jsonAttachment.Add(XmlElementNames.Item, this.item.ToJson(service, false /* isUpdateOperation */) as JsonObject);
-
- return jsonAttachment;
- }
-
///
/// Validates this instance.
///
@@ -252,4 +225,4 @@ public void Load(BodyType bodyType, IEnumerable addition
additionalProperties);
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ItemCollection.cs b/ComplexProperties/ItemCollection.cs
index 7a3eb154..c3735c1d 100644
--- a/ComplexProperties/ItemCollection.cs
+++ b/ComplexProperties/ItemCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ItemCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -21,7 +36,7 @@ namespace Microsoft.Exchange.WebServices.Data
///
/// The type of item the collection contains.
[EditorBrowsable(EditorBrowsableState.Never)]
- public sealed class ItemCollection : ComplexProperty, IEnumerable, IJsonCollectionDeserializer
+ public sealed class ItemCollection : ComplexProperty, IEnumerable
where TItem : Item
{
private List items = new List();
@@ -70,37 +85,6 @@ internal override void LoadFromXml(EwsServiceXmlReader reader, string localEleme
}
}
- ///
- /// Loads from json collection.
- ///
- /// The json collection.
- /// The service.
- void IJsonCollectionDeserializer.CreateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- foreach (object entry in jsonCollection)
- {
- JsonObject jsonServiceObject = entry as JsonObject;
-
- TItem item = EwsUtilities.CreateEwsObjectFromXmlElementName- (
- service,
- jsonServiceObject.ReadTypeString()) as TItem;
-
- item.LoadFromJson(jsonServiceObject, service, true);
-
- this.items.Add(item);
- }
- }
-
- ///
- /// Loads from json collection to update the existing collection element.
- ///
- /// The json collection.
- /// The service.
- void IJsonCollectionDeserializer.UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- throw new NotImplementedException();
- }
-
///
/// Gets the total number of items in the collection.
///
@@ -153,4 +137,4 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ItemId.cs b/ComplexProperties/ItemId.cs
index 29eb8f5b..94045575 100644
--- a/ComplexProperties/ItemId.cs
+++ b/ComplexProperties/ItemId.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ItemId class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data
///
/// Represents the Id of an Exchange item.
///
- public class ItemId : ServiceId, IJsonSerializable
+ public class ItemId : ServiceId
{
///
/// Initializes a new instance of the class.
@@ -55,4 +70,4 @@ public ItemId(string uniqueId)
{
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ItemIdCollection.cs b/ComplexProperties/ItemIdCollection.cs
index 16bb34ef..41109e6c 100644
--- a/ComplexProperties/ItemIdCollection.cs
+++ b/ComplexProperties/ItemIdCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ItemIdCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -36,15 +51,6 @@ internal override ItemId CreateComplexProperty(string xmlElementName)
return new ItemId();
}
- ///
- /// Creates the default complex property.
- ///
- /// ItemId.
- internal override ItemId CreateDefaultComplexProperty()
- {
- return new ItemId();
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -55,4 +61,4 @@ internal override string GetCollectionItemXmlElementName(ItemId complexProperty)
return complexProperty.GetXmlElementName();
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Mailbox.cs b/ComplexProperties/Mailbox.cs
index 0fc5272b..a615aa9d 100644
--- a/ComplexProperties/Mailbox.cs
+++ b/ComplexProperties/Mailbox.cs
@@ -1,12 +1,28 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
-//-----------------------------------------------------------------------
-// Defines the EmailAddress class.
-//-----------------------------------------------------------------------
namespace Microsoft.Exchange.WebServices.Data
{
///
@@ -124,46 +140,8 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
#endregion
- #region Json Methods
-
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- if (jsonProperty.ContainsKey(XmlElementNames.EmailAddress))
- {
- this.Address = jsonProperty.ReadAsString(XmlElementNames.EmailAddress);
- }
-
- if (jsonProperty.ContainsKey(XmlElementNames.RoutingType))
- {
- this.RoutingType = jsonProperty.ReadAsString(XmlElementNames.RoutingType);
- }
- }
-
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonObject = new JsonObject();
-
- jsonObject.Add(XmlElementNames.EmailAddress, this.Address);
- jsonObject.Add(XmlElementNames.RoutingType, this.RoutingType);
-
- return jsonObject;
- }
-
- #endregion
-
#region ISearchStringProvider methods
+
///
/// Get a string representation for using this instance in a search filter.
///
@@ -172,6 +150,7 @@ string ISearchStringProvider.GetSearchString()
{
return this.Address;
}
+
#endregion
///
@@ -269,4 +248,4 @@ public override string ToString()
}
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ManagedFolderInformation.cs b/ComplexProperties/ManagedFolderInformation.cs
index eae8657e..43bf166b 100644
--- a/ComplexProperties/ManagedFolderInformation.cs
+++ b/ComplexProperties/ManagedFolderInformation.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ManagedFolderInformation class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -82,61 +97,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.CanDelete:
- this.canDelete = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.CanRenameOrMove:
- this.canRenameOrMove = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.MustDisplayComment:
- this.mustDisplayComment = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.HasQuota:
- this.hasQuota = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.IsManagedFoldersRoot:
- this.isManagedFoldersRoot = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.ManagedFolderId:
- this.managedFolderId = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.Comment:
- string commentValue = jsonProperty.ReadAsString(key);
- if (commentValue != null)
- {
- this.comment = commentValue;
- }
- break;
- case XmlElementNames.StorageQuota:
- this.storageQuota = jsonProperty.ReadAsInt(key);
- break;
- case XmlElementNames.FolderSize:
- this.folderSize = jsonProperty.ReadAsInt(key);
- break;
- case XmlElementNames.HomePage:
- string homePageValue = jsonProperty.ReadAsString(key);
- if (homePageValue != null)
- {
- this.homePage = homePageValue;
- }
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets a value indicating whether the user can delete objects in the folder.
///
@@ -217,4 +177,4 @@ public string HomePage
get { return this.homePage; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/MeetingSuggestion.cs b/ComplexProperties/MeetingSuggestion.cs
index e331fbe1..501b22eb 100644
--- a/ComplexProperties/MeetingSuggestion.cs
+++ b/ComplexProperties/MeetingSuggestion.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the MeetingSuggestion class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -95,4 +110,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/MeetingSuggestionCollection.cs b/ComplexProperties/MeetingSuggestionCollection.cs
index 5fd22743..ebefb458 100644
--- a/ComplexProperties/MeetingSuggestionCollection.cs
+++ b/ComplexProperties/MeetingSuggestionCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the MeetingSuggestionCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -50,15 +65,6 @@ internal override MeetingSuggestion CreateComplexProperty(string xmlElementName)
return new MeetingSuggestion();
}
- ///
- /// Creates the default complex property.
- ///
- /// MeetingSuggestion.
- internal override MeetingSuggestion CreateDefaultComplexProperty()
- {
- return new MeetingSuggestion();
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(MeetingSuggestion compl
return XmlElementNames.NlgMeetingSuggestion;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/MeetingTimeZone.cs b/ComplexProperties/MeetingTimeZone.cs
index 024e58df..4e63cfe4 100644
--- a/ComplexProperties/MeetingTimeZone.cs
+++ b/ComplexProperties/MeetingTimeZone.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the MeetingTimeZone class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -91,37 +106,6 @@ internal override void ReadAttributesFromXml(EwsServiceXmlReader reader)
this.name = reader.ReadAttributeValue(XmlAttributeNames.TimeZoneName);
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.BaseOffset:
- this.baseOffset = EwsUtilities.XSDurationToTimeSpan(jsonProperty.ReadAsString(key));
- break;
- case XmlElementNames.Standard:
- this.standard = new TimeChange();
- this.standard.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- case XmlElementNames.Daylight:
- this.daylight = new TimeChange();
- this.daylight.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- case XmlAttributeNames.TimeZoneName:
- this.name = jsonProperty.ReadAsString(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes the attributes to XML.
///
@@ -156,39 +140,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- if (this.BaseOffset.HasValue)
- {
- jsonProperty.Add(
- XmlElementNames.BaseOffset,
- EwsUtilities.TimeSpanToXSDuration(this.BaseOffset.Value));
- }
-
- if (this.Standard != null)
- {
- jsonProperty.Add(XmlElementNames.Standard, this.Standard.InternalToJson(service));
- }
-
- if (this.Daylight != null)
- {
- jsonProperty.Add(XmlElementNames.Daylight, this.Daylight.InternalToJson(service));
- }
-
- jsonProperty.Add(XmlAttributeNames.TimeZoneName, this.Name);
-
- return jsonProperty;
- }
-
///
/// Converts this meeting time zone into a TimeZoneInfo structure.
///
diff --git a/ComplexProperties/MessageBody.cs b/ComplexProperties/MessageBody.cs
index d29244a0..78b04dd8 100644
--- a/ComplexProperties/MessageBody.cs
+++ b/ComplexProperties/MessageBody.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the MessageBody class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -86,29 +101,6 @@ internal override void ReadTextValueFromXml(EwsServiceXmlReader reader)
this.text = reader.ReadValue();
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlAttributeNames.BodyType:
- this.bodyType = jsonProperty.ReadEnumValue(key);
- break;
- case JsonObject.JsonValueString:
- this.text = jsonProperty.ReadAsString(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes attributes to XML.
///
@@ -130,26 +122,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlAttributeNames.BodyType, this.BodyType);
-
- if (!string.IsNullOrEmpty(this.Text))
- {
- jsonProperty.Add(JsonObject.JsonValueString, this.Text);
- }
- return jsonProperty;
- }
-
///
/// Gets or sets the type of the message body's text.
///
@@ -181,4 +153,4 @@ public override string ToString()
}
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/MimeContent.cs b/ComplexProperties/MimeContent.cs
index 6474bf45..df0f53e5 100644
--- a/ComplexProperties/MimeContent.cs
+++ b/ComplexProperties/MimeContent.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the MimeContent class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -71,4 +86,4 @@ public override string ToString()
}
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/MimeContentBase.cs b/ComplexProperties/MimeContentBase.cs
index a2d4d2b1..1d65b9f3 100644
--- a/ComplexProperties/MimeContentBase.cs
+++ b/ComplexProperties/MimeContentBase.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the MimeContentBase class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
using System.Security.Cryptography;
@@ -49,29 +64,6 @@ internal override void ReadTextValueFromXml(EwsServiceXmlReader reader)
this.content = System.Convert.FromBase64String(reader.ReadValue());
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlAttributeNames.CharacterSet:
- this.characterSet = jsonProperty.ReadAsString(key);
- break;
- case JsonObject.JsonValueString:
- this.content = jsonProperty.ReadAsBase64Content(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes attributes to XML.
///
@@ -93,27 +85,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlAttributeNames.ChangeKey, this.CharacterSet);
-
- if (this.Content != null && this.Content.Length > 0)
- {
- jsonProperty.AddBase64(JsonObject.JsonValueString, this.Content);
- }
-
- return jsonProperty;
- }
-
///
/// Gets or sets the character set of the content.
///
@@ -132,4 +103,4 @@ public byte[] Content
set { this.SetFieldValue(ref this.content, value); }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/MimeContentUTF8.cs b/ComplexProperties/MimeContentUTF8.cs
index 2be46e08..bfed9c7d 100644
--- a/ComplexProperties/MimeContentUTF8.cs
+++ b/ComplexProperties/MimeContentUTF8.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the MimeContentUTF8 class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -67,4 +82,4 @@ public override string ToString()
}
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/NormalizedBody.cs b/ComplexProperties/NormalizedBody.cs
index 4a5310c1..2e3af8aa 100644
--- a/ComplexProperties/NormalizedBody.cs
+++ b/ComplexProperties/NormalizedBody.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the NormalizedBody class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -61,32 +76,6 @@ internal override void ReadTextValueFromXml(EwsServiceXmlReader reader)
this.text = reader.ReadValue();
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlAttributeNames.BodyType:
- this.bodyType = jsonProperty.ReadEnumValue(key);
- break;
- case XmlAttributeNames.IsTruncated:
- this.isTruncated = jsonProperty.ReadAsBool(key);
- break;
- case JsonObject.JsonValueString:
- this.text = jsonProperty.ReadAsString(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes attributes to XML.
///
@@ -108,28 +97,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlAttributeNames.BodyType, this.BodyType);
- jsonProperty.Add(XmlAttributeNames.IsTruncated, this.IsTruncated);
-
- if (!string.IsNullOrEmpty(this.Text))
- {
- jsonProperty.Add(JsonObject.JsonValueString, this.Text);
- }
-
- return jsonProperty;
- }
-
///
/// Gets the type of the normalized body's text.
///
@@ -191,4 +158,4 @@ public override string ToString()
}
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/OccurrenceInfo.cs b/ComplexProperties/OccurrenceInfo.cs
index 53db4dbd..54b161cf 100644
--- a/ComplexProperties/OccurrenceInfo.cs
+++ b/ComplexProperties/OccurrenceInfo.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the OccurrenceInfo class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -56,36 +71,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.ItemId:
- this.itemId = new ItemId();
- this.itemId.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- case XmlElementNames.Start:
- this.start = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value;
- break;
- case XmlElementNames.End:
- this.end = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value;
- break;
- case XmlElementNames.OriginalStart:
- this.originalStart = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key)).Value;
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets the Id of the occurrence.
///
@@ -118,4 +103,4 @@ public DateTime OriginalStart
get { return this.originalStart; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/OccurrenceInfoCollection.cs b/ComplexProperties/OccurrenceInfoCollection.cs
index 65493609..42596ba3 100644
--- a/ComplexProperties/OccurrenceInfoCollection.cs
+++ b/ComplexProperties/OccurrenceInfoCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the OccurrenceInfoCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -42,15 +57,6 @@ internal override OccurrenceInfo CreateComplexProperty(string xmlElementName)
}
}
- ///
- /// Creates the default complex property.
- ///
- /// OccurenceInfo instance.
- internal override OccurrenceInfo CreateDefaultComplexProperty()
- {
- return new OccurrenceInfo();
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -61,4 +67,4 @@ internal override string GetCollectionItemXmlElementName(OccurrenceInfo complexP
return XmlElementNames.Occurrence;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/OnlineMeetingSettings.cs b/ComplexProperties/OnlineMeetingSettings.cs
index f720593b..7171ac7c 100644
--- a/ComplexProperties/OnlineMeetingSettings.cs
+++ b/ComplexProperties/OnlineMeetingSettings.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the OnlineMeetingSettings class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -213,4 +228,4 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.Presenters, this.Presenters);
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/CompanyInsightValue.cs b/ComplexProperties/PeopleInsights/CompanyInsightValue.cs
new file mode 100644
index 00000000..8a87f9ed
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/CompanyInsightValue.cs
@@ -0,0 +1,239 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents the CompanyInsightValue.
+ ///
+ public sealed class CompanyInsightValue : InsightValue
+ {
+ private string name;
+ private string satoriId;
+ private string description;
+ private string descriptionAttribution;
+ private string imageUrl;
+ private string imageUrlAttribution;
+ private string yearFound;
+ private string financeSymbol;
+ private string websiteUrl;
+
+ ///
+ /// Gets the Name
+ ///
+ public string Name
+ {
+ get
+ {
+ return this.name;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.name, value);
+ }
+ }
+
+ ///
+ /// Gets the SatoriId
+ ///
+ public string SatoriId
+ {
+ get
+ {
+ return this.satoriId;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.satoriId, value);
+ }
+ }
+
+ ///
+ /// Gets the Description
+ ///
+ public string Description
+ {
+ get
+ {
+ return this.description;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.description, value);
+ }
+ }
+
+ ///
+ /// Gets the DescriptionAttribution
+ ///
+ public string DescriptionAttribution
+ {
+ get
+ {
+ return this.descriptionAttribution;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.descriptionAttribution, value);
+ }
+ }
+
+ ///
+ /// Gets the ImageUrl
+ ///
+ public string ImageUrl
+ {
+ get
+ {
+ return this.imageUrl;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.imageUrl, value);
+ }
+ }
+
+ ///
+ /// Gets the ImageUrlAttribution
+ ///
+ public string ImageUrlAttribution
+ {
+ get
+ {
+ return this.imageUrlAttribution;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.imageUrlAttribution, value);
+ }
+ }
+
+ ///
+ /// Gets the YearFound
+ ///
+ public string YearFound
+ {
+ get
+ {
+ return this.yearFound;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.yearFound, value);
+ }
+ }
+
+ ///
+ /// Gets the FinanceSymbol
+ ///
+ public string FinanceSymbol
+ {
+ get
+ {
+ return this.financeSymbol;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.financeSymbol, value);
+ }
+ }
+
+ ///
+ /// Gets the WebsiteUrl
+ ///
+ public string WebsiteUrl
+ {
+ get
+ {
+ return this.websiteUrl;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.websiteUrl, value);
+ }
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// XML reader
+ /// Whether the element was read
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.InsightSource:
+ this.InsightSource = reader.ReadElementValue();
+ break;
+ case XmlElementNames.UpdatedUtcTicks:
+ this.UpdatedUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Name:
+ this.Name = reader.ReadElementValue();
+ break;
+ case XmlElementNames.SatoriId:
+ this.SatoriId = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Description:
+ this.Description = reader.ReadElementValue();
+ break;
+ case XmlElementNames.DescriptionAttribution:
+ this.DescriptionAttribution = reader.ReadElementValue();
+ break;
+ case XmlElementNames.ImageUrl:
+ this.ImageUrl = reader.ReadElementValue();
+ break;
+ case XmlElementNames.ImageUrlAttribution:
+ this.ImageUrlAttribution = reader.ReadElementValue();
+ break;
+ case XmlElementNames.YearFound:
+ this.YearFound = reader.ReadElementValue();
+ break;
+ case XmlElementNames.FinanceSymbol:
+ this.FinanceSymbol = reader.ReadElementValue();
+ break;
+ case XmlElementNames.WebsiteUrl:
+ this.WebsiteUrl = reader.ReadElementValue();
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/CompanyInsightValueCollection.cs b/ComplexProperties/PeopleInsights/CompanyInsightValueCollection.cs
new file mode 100644
index 00000000..0b51ec81
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/CompanyInsightValueCollection.cs
@@ -0,0 +1,95 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System;
+ using System.Collections.Generic;
+
+ ///
+ /// Represents the collection of job insights.
+ ///
+ public sealed class CompanyInsightValueCollection : ComplexPropertyCollection
+ {
+ ///
+ /// XML element name
+ ///
+ private readonly string collectionItemXmlElementName;
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ internal CompanyInsightValueCollection()
+ : this(XmlElementNames.CompanyInsightValue)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ /// Name of the collection item XML element.
+ internal CompanyInsightValueCollection(string collectionItemXmlElementName)
+ : base()
+ {
+ this.collectionItemXmlElementName = collectionItemXmlElementName;
+ }
+
+ ///
+ /// Creates a CompanyInsightValue object from an XML element name.
+ ///
+ /// The XML element name from which to create the CompanyInsightValue.
+ /// A CompanyInsightValue object.
+ internal override CompanyInsightValue CreateComplexProperty(string xmlElementName)
+ {
+ if (xmlElementName == this.collectionItemXmlElementName)
+ {
+ return new CompanyInsightValue();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Retrieves the XML element name corresponding to the provided PersonInsight object.
+ ///
+ /// The CompanyInsightValue object from which to determine the XML element name.
+ /// The XML element name corresponding to the provided CompanyInsightValue object.
+ internal override string GetCollectionItemXmlElementName(CompanyInsightValue insight)
+ {
+ return this.collectionItemXmlElementName;
+ }
+
+ ///
+ /// Determine whether we should write collection to XML or not.
+ ///
+ /// Always true, even if the collection is empty.
+ internal override bool ShouldWriteToRequest()
+ {
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/ComputedInsightValue.cs b/ComplexProperties/PeopleInsights/ComputedInsightValue.cs
new file mode 100644
index 00000000..f8433d20
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/ComputedInsightValue.cs
@@ -0,0 +1,50 @@
+// ---------------------------------------------------------------------------
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+//
+// ---------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------
+// Implements the class for company insight value.
+//-----------------------------------------------------------------------
+namespace Microsoft.Exchange.WebServices.Data
+{
+ ///
+ /// Represents the ComputedInsightValue.
+ ///
+ public sealed class ComputedInsightValue : InsightValue
+ {
+ ///
+ /// Gets the collection of computed insight
+ /// value properties.
+ ///
+ public ComputedInsightValuePropertyCollection Properties
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// XML reader
+ /// Whether the element was read
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.InsightSource:
+ this.InsightSource = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Properties:
+ this.Properties = new ComputedInsightValuePropertyCollection();
+ this.Properties.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Properties);
+ break;
+ default:
+ return base.TryReadElementFromXml(reader);
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/ComplexProperties/PeopleInsights/ComputedInsightValueProperty.cs b/ComplexProperties/PeopleInsights/ComputedInsightValueProperty.cs
new file mode 100644
index 00000000..e7bdeae4
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/ComputedInsightValueProperty.cs
@@ -0,0 +1,74 @@
+// ---------------------------------------------------------------------------
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+//
+// ---------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------
+// Implements the class for computed insight value property.
+//-----------------------------------------------------------------------
+namespace Microsoft.Exchange.WebServices.Data
+{
+ ///
+ /// Represents a computed insight value.
+ ///
+ public sealed class ComputedInsightValueProperty : ComplexProperty
+ {
+ private string key;
+ private string value;
+
+ ///
+ /// Gets or sets the Key
+ ///
+ public string Key
+ {
+ get
+ {
+ return this.key;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.key, value);
+ }
+ }
+
+ ///
+ /// Gets or sets the Value
+ ///
+ public string Value
+ {
+ get
+ {
+ return this.value;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.value, value);
+ }
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// XML reader
+ /// Whether the element was read
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.Key:
+ this.Key = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Value:
+ this.Value = reader.ReadElementValue();
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/ComplexProperties/PeopleInsights/ComputedInsightValuePropertyCollection.cs b/ComplexProperties/PeopleInsights/ComputedInsightValuePropertyCollection.cs
new file mode 100644
index 00000000..178b6cab
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/ComputedInsightValuePropertyCollection.cs
@@ -0,0 +1,60 @@
+// ---------------------------------------------------------------------------
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+//
+// ---------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------
+// Implements the class for computed insight value property collection.
+//-----------------------------------------------------------------------
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System;
+ using System.Collections.Generic;
+
+ ///
+ /// Represents a collection of computed insight values.
+ ///
+ public sealed class ComputedInsightValuePropertyCollection : ComplexPropertyCollection
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ internal ComputedInsightValuePropertyCollection()
+ : base()
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The collection of objects to include.
+ internal ComputedInsightValuePropertyCollection(IEnumerable collection)
+ {
+ if (collection != null)
+ {
+ collection.ForEach(this.InternalAdd);
+ }
+ }
+
+ ///
+ /// Creates the complex property.
+ ///
+ /// Name of the XML element.
+ /// ComputedInsightValueProperty.
+ internal override ComputedInsightValueProperty CreateComplexProperty(string xmlElementName)
+ {
+ return new ComputedInsightValueProperty();
+ }
+
+ ///
+ /// Gets the name of the collection item XML element.
+ ///
+ /// The complex property.
+ /// XML element name.
+ internal override string GetCollectionItemXmlElementName(ComputedInsightValueProperty complexProperty)
+ {
+ return XmlElementNames.Property;
+ }
+ }
+}
diff --git a/ComplexProperties/PeopleInsights/DelveDocument.cs b/ComplexProperties/PeopleInsights/DelveDocument.cs
new file mode 100644
index 00000000..43ff63de
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/DelveDocument.cs
@@ -0,0 +1,259 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents the DelveDocument.
+ ///
+ public sealed class DelveDocument : InsightValue
+ {
+ private double rank;
+ private string author;
+ private string created;
+ private string lastModifiedTime;
+ private string defaultEncodingURL;
+ private string fileType;
+ private string title;
+ private string lastEditor;
+ private string documentId;
+ private string previewURL;
+
+ ///
+ /// Gets the Rank
+ ///
+ public double Rank
+ {
+ get
+ {
+ return this.rank;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.rank, value);
+ }
+ }
+
+ ///
+ /// Gets the Author
+ ///
+ public string Author
+ {
+ get
+ {
+ return this.author;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.author, value);
+ }
+ }
+
+ ///
+ /// Gets the Created
+ ///
+ public string Created
+ {
+ get
+ {
+ return this.created;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.created, value);
+ }
+ }
+
+ ///
+ /// Gets the LastModifiedTime
+ ///
+ public string LastModifiedTime
+ {
+ get
+ {
+ return this.lastModifiedTime;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.lastModifiedTime, value);
+ }
+ }
+
+ ///
+ /// Gets the DefaultEncodingURL
+ ///
+ public string DefaultEncodingURL
+ {
+ get
+ {
+ return this.defaultEncodingURL;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.defaultEncodingURL, value);
+ }
+ }
+
+ ///
+ /// Gets the FileType
+ ///
+ public string FileType
+ {
+ get
+ {
+ return this.fileType;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.fileType, value);
+ }
+ }
+
+ ///
+ /// Gets the Title
+ ///
+ public string Title
+ {
+ get
+ {
+ return this.title;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.title, value);
+ }
+ }
+
+ ///
+ /// Gets the DocumentId
+ ///
+ public string DocumentId
+ {
+ get
+ {
+ return this.documentId;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.documentId, value);
+ }
+ }
+
+ ///
+ /// Gets the PreviewURL
+ ///
+ public string PreviewURL
+ {
+ get
+ {
+ return this.previewURL;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.previewURL, value);
+ }
+ }
+
+ ///
+ /// Gets the LastEditor
+ ///
+ public string LastEditor
+ {
+ get
+ {
+ return this.lastEditor;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.lastEditor, value);
+ }
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// XML reader
+ /// Whether the element was read
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.InsightSource:
+ this.InsightSource = reader.ReadElementValue();
+ break;
+ case XmlElementNames.UpdatedUtcTicks:
+ this.UpdatedUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Rank:
+ this.Rank = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Author:
+ this.Author = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Created:
+ this.Created = reader.ReadElementValue();
+ break;
+ case XmlElementNames.LastModifiedTime:
+ this.LastModifiedTime = reader.ReadElementValue();
+ break;
+ case XmlElementNames.DefaultEncodingURL:
+ this.DefaultEncodingURL = reader.ReadElementValue();
+ break;
+ case XmlElementNames.FileType:
+ this.FileType = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Title:
+ this.Title = reader.ReadElementValue();
+ break;
+ case XmlElementNames.DocumentId:
+ this.DocumentId = reader.ReadElementValue();
+ break;
+ case XmlElementNames.PreviewURL:
+ this.PreviewURL = reader.ReadElementValue();
+ break;
+ case XmlElementNames.LastEditor:
+ this.LastEditor = reader.ReadElementValue();
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/EducationInsightValue.cs b/ComplexProperties/PeopleInsights/EducationInsightValue.cs
new file mode 100644
index 00000000..2deb11bd
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/EducationInsightValue.cs
@@ -0,0 +1,139 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents the EducationInsightValue.
+ ///
+ public sealed class EducationInsightValue : InsightValue
+ {
+ private string institute;
+ private string degree;
+ private long startUtcTicks;
+ private long endUtcTicks;
+
+ ///
+ /// Gets the Institute
+ ///
+ public string Institute
+ {
+ get
+ {
+ return this.institute;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.institute, value);
+ }
+ }
+
+ ///
+ /// Gets the Degree
+ ///
+ public string Degree
+ {
+ get
+ {
+ return this.degree;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.degree, value);
+ }
+ }
+
+ ///
+ /// Gets the StartUtcTicks
+ ///
+ public long StartUtcTicks
+ {
+ get
+ {
+ return this.startUtcTicks;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.startUtcTicks, value);
+ }
+ }
+
+ ///
+ /// Gets the EndUtcTicks
+ ///
+ public long EndUtcTicks
+ {
+ get
+ {
+ return this.endUtcTicks;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.endUtcTicks, value);
+ }
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// XML reader
+ /// Whether the element was read
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.InsightSource:
+ this.InsightSource = reader.ReadElementValue();
+ break;
+ case XmlElementNames.UpdatedUtcTicks:
+ this.UpdatedUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Institute:
+ this.Institute = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Degree:
+ this.Degree = reader.ReadElementValue();
+ break;
+ case XmlElementNames.StartUtcTicks:
+ this.StartUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.EndUtcTicks:
+ this.EndUtcTicks = reader.ReadElementValue();
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/EmailInsightValue.cs b/ComplexProperties/PeopleInsights/EmailInsightValue.cs
new file mode 100644
index 00000000..877c9045
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/EmailInsightValue.cs
@@ -0,0 +1,143 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents the EmailInsightValue.
+ ///
+ public sealed class EmailInsightValue : InsightValue
+ {
+ ///
+ /// Gets the Id
+ ///
+ public string Id
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the ThreadId
+ ///
+ public string ThreadId
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the Subject
+ ///
+ public string Subject
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the LastEmailDateUtcTicks
+ ///
+ public long LastEmailDateUtcTicks
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the Body
+ ///
+ public string Body
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the LastEmailSender
+ ///
+ public ProfileInsightValue LastEmailSender
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the EmailsCount
+ ///
+ public int EmailsCount
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// XML reader
+ /// Whether the element was read
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.InsightSource:
+ this.InsightSource = reader.ReadElementValue();
+ break;
+ case XmlElementNames.UpdatedUtcTicks:
+ this.UpdatedUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Id:
+ this.Id = reader.ReadElementValue();
+ break;
+ case XmlElementNames.ThreadId:
+ this.ThreadId = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Subject:
+ this.Subject = reader.ReadElementValue();
+ break;
+ case XmlElementNames.LastEmailDateUtcTicks:
+ this.LastEmailDateUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Body:
+ this.Body = reader.ReadElementValue();
+ break;
+ case XmlElementNames.LastEmailSender:
+ this.LastEmailSender = new ProfileInsightValue();
+ this.LastEmailSender.LoadFromXml(reader, reader.LocalName);
+ break;
+ case XmlElementNames.EmailsCount:
+ this.EmailsCount = reader.ReadElementValue();
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/InsightValue.cs b/ComplexProperties/PeopleInsights/InsightValue.cs
new file mode 100644
index 00000000..ed39610e
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/InsightValue.cs
@@ -0,0 +1,59 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents the InsightValue.
+ ///
+ public class InsightValue : ComplexProperty
+ {
+ private long updatedUtcTicks;
+
+ ///
+ /// Gets the InsightSource
+ ///
+ public string InsightSource { get; set; }
+
+ ///
+ /// Gets the UpdatedUtcTicks
+ ///
+ public long UpdatedUtcTicks
+ {
+ get
+ {
+ return this.updatedUtcTicks;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.updatedUtcTicks, value);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/InsightValueCollection.cs b/ComplexProperties/PeopleInsights/InsightValueCollection.cs
new file mode 100644
index 00000000..3e0a078c
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/InsightValueCollection.cs
@@ -0,0 +1,76 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents the collection of InsightValue.
+ ///
+ public class InsightValueCollection : ComplexPropertyCollection
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ internal InsightValueCollection()
+ : base()
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The collection of objects to include.
+ internal InsightValueCollection(IEnumerable collection)
+ {
+ if (collection != null)
+ {
+ collection.ForEach(this.InternalAdd);
+ }
+ }
+
+ ///
+ /// Creates the complex property.
+ ///
+ /// Name of the XML element.
+ /// InsightValue.
+ internal override InsightValue CreateComplexProperty(string xmlElementName)
+ {
+ return new InsightValue();
+ }
+
+ ///
+ /// Gets the name of the collection item XML element.
+ ///
+ /// The complex property.
+ /// XML element name.
+ internal override string GetCollectionItemXmlElementName(InsightValue complexProperty)
+ {
+ return XmlElementNames.Item;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/JobInsightValue.cs b/ComplexProperties/PeopleInsights/JobInsightValue.cs
new file mode 100644
index 00000000..a33bc53e
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/JobInsightValue.cs
@@ -0,0 +1,224 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents the JobInsightValue.
+ ///
+ public sealed class JobInsightValue : InsightValue
+ {
+ private string company;
+ private string companyDescription;
+ private string companyTicker;
+ private string companyLogoUrl;
+ private string companyWebsiteUrl;
+ private string companyLinkedInUrl;
+ private string title;
+ private long startUtcTicks;
+ private long endUtcTicks;
+
+ ///
+ /// Gets the Company
+ ///
+ public string Company
+ {
+ get
+ {
+ return this.company;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.company, value);
+ }
+ }
+
+ ///
+ /// Gets the CompanyDescription
+ ///
+ public string CompanyDescription
+ {
+ get
+ {
+ return this.companyDescription;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.companyDescription, value);
+ }
+ }
+
+ ///
+ /// Gets the CompanyTicker
+ ///
+ public string CompanyTicker
+ {
+ get
+ {
+ return this.companyTicker;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.companyTicker, value);
+ }
+ }
+
+ ///
+ /// Gets the CompanyLogoUrl
+ ///
+ public string CompanyLogoUrl
+ {
+ get
+ {
+ return this.companyLogoUrl;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.companyLogoUrl, value);
+ }
+ }
+
+ ///
+ /// Gets the CompanyWebsiteUrl
+ ///
+ public string CompanyWebsiteUrl
+ {
+ get
+ {
+ return this.companyWebsiteUrl;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.companyWebsiteUrl, value);
+ }
+ }
+
+ ///
+ /// Gets the CompanyLinkedInUrl
+ ///
+ public string CompanyLinkedInUrl
+ {
+ get
+ {
+ return this.companyLinkedInUrl;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.companyLinkedInUrl, value);
+ }
+ }
+
+ ///
+ /// Gets the Title
+ ///
+ public string Title
+ {
+ get
+ {
+ return this.title;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.title, value);
+ }
+ }
+
+ ///
+ /// Gets the StartUtcTicks
+ ///
+ public long StartUtcTicks
+ {
+ get
+ {
+ return this.startUtcTicks;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.startUtcTicks, value);
+ }
+ }
+
+ ///
+ /// Gets the EndUtcTicks
+ ///
+ public long EndUtcTicks
+ {
+ get
+ {
+ return this.endUtcTicks;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.endUtcTicks, value);
+ }
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// XML reader
+ /// Whether the element was read
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.InsightSource:
+ this.InsightSource = reader.ReadElementValue();
+ break;
+ case XmlElementNames.UpdatedUtcTicks:
+ this.UpdatedUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Company:
+ this.Company = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Title:
+ this.Title = reader.ReadElementValue();
+ break;
+ case XmlElementNames.StartUtcTicks:
+ this.StartUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.EndUtcTicks:
+ this.EndUtcTicks = reader.ReadElementValue();
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/JobInsightValueCollection.cs b/ComplexProperties/PeopleInsights/JobInsightValueCollection.cs
new file mode 100644
index 00000000..e2b55a3f
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/JobInsightValueCollection.cs
@@ -0,0 +1,95 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System;
+ using System.Collections.Generic;
+
+ ///
+ /// Represents the collection of job insights.
+ ///
+ public sealed class JobInsightValueCollection : ComplexPropertyCollection
+ {
+ ///
+ /// XML element name
+ ///
+ private readonly string collectionItemXmlElementName;
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ internal JobInsightValueCollection()
+ : this(XmlElementNames.JobInsight)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ /// Name of the collection item XML element.
+ internal JobInsightValueCollection(string collectionItemXmlElementName)
+ : base()
+ {
+ this.collectionItemXmlElementName = collectionItemXmlElementName;
+ }
+
+ ///
+ /// Creates a SkillInsightValue object from an XML element name.
+ ///
+ /// The XML element name from which to create the JobInsightValue.
+ /// A JobInsightValue object.
+ internal override JobInsightValue CreateComplexProperty(string xmlElementName)
+ {
+ if (xmlElementName == this.collectionItemXmlElementName)
+ {
+ return new JobInsightValue();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Retrieves the XML element name corresponding to the provided PersonInsight object.
+ ///
+ /// The SkillInsightValue object from which to determine the XML element name.
+ /// The XML element name corresponding to the provided JobInsightValue object.
+ internal override string GetCollectionItemXmlElementName(JobInsightValue insight)
+ {
+ return this.collectionItemXmlElementName;
+ }
+
+ ///
+ /// Determine whether we should write collection to XML or not.
+ ///
+ /// Always true, even if the collection is empty.
+ internal override bool ShouldWriteToRequest()
+ {
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/MeetingInsightValue.cs b/ComplexProperties/PeopleInsights/MeetingInsightValue.cs
new file mode 100644
index 00000000..f7d6b37e
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/MeetingInsightValue.cs
@@ -0,0 +1,153 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents the MeetingInsightValue.
+ ///
+ public sealed class MeetingInsightValue : InsightValue
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public MeetingInsightValue()
+ : base()
+ {
+ this.Attendees = new ProfileInsightValueCollection();
+ }
+
+ ///
+ /// Gets the Id
+ ///
+ public string Id
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the Subject
+ ///
+ public string Subject
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the StartUtcTicks
+ ///
+ public long StartUtcTicks
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the EndUtcTicks
+ ///
+ public long EndUtcTicks
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the Location
+ ///
+ public string Location
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the Organizer
+ ///
+ public ProfileInsightValue Organizer
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the Attendees
+ ///
+ public ProfileInsightValueCollection Attendees
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// XML reader
+ /// Whether the element was read
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.InsightSource:
+ this.InsightSource = reader.ReadElementValue();
+ break;
+ case XmlElementNames.UpdatedUtcTicks:
+ this.UpdatedUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Id:
+ this.Id = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Subject:
+ this.Subject = reader.ReadElementValue();
+ break;
+ case XmlElementNames.StartUtcTicks:
+ this.StartUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.EndUtcTicks:
+ this.EndUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Location:
+ this.Location = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Organizer:
+ this.Organizer = new ProfileInsightValue();
+ this.Organizer.LoadFromXml(reader, reader.LocalName);
+ break;
+ case XmlElementNames.Attendees:
+ this.Attendees = new ProfileInsightValueCollection(XmlElementNames.Item);
+ this.Attendees.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Attendees);
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/MultiValueInsightContent.cs b/ComplexProperties/PeopleInsights/MultiValueInsightContent.cs
new file mode 100644
index 00000000..eda3d246
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/MultiValueInsightContent.cs
@@ -0,0 +1,129 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents the MultiValueInsightContent.
+ ///
+ public sealed class MultiValueInsightContent : ComplexProperty
+ {
+ ///
+ /// Gets the ItemList
+ ///
+ public InsightValueCollection ItemList { get; internal set; }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public MultiValueInsightContent()
+ : base()
+ {
+ this.ItemList = new InsightValueCollection();
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// The reader.
+ /// True if element was read.
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ do
+ {
+ reader.Read();
+ InsightValue item = null;
+
+ if (reader.NodeType == XmlNodeType.Element && reader.LocalName == XmlElementNames.Item)
+ {
+ switch (reader.ReadAttributeValue("xsi:type"))
+ {
+ case XmlElementNames.StringInsightValue:
+ item = new StringInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.ProfileInsightValue:
+ item = new ProfileInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.JobInsightValue:
+ item = new JobInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.UserProfilePicture:
+ item = new UserProfilePicture();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.EducationInsightValue:
+ item = new EducationInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.SkillInsightValue:
+ item = new SkillInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.ComputedInsightValue:
+ item = new ComputedInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.MeetingInsightValue:
+ item = new MeetingInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.EmailInsightValue:
+ item = new EmailInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.DelveDocument:
+ item = new DelveDocument();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ default:
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ } while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.ItemList));
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/OutOfOfficeInsightValue.cs b/ComplexProperties/PeopleInsights/OutOfOfficeInsightValue.cs
new file mode 100644
index 00000000..61f23591
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/OutOfOfficeInsightValue.cs
@@ -0,0 +1,118 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Globalization;
+ using System.Xml;
+
+ ///
+ /// Represents the OutOfOfficeInsightValue.
+ ///
+ public sealed class OutOfOfficeInsightValue : InsightValue
+ {
+ private DateTime startTime;
+ private DateTime endTime;
+ private string culture = CultureInfo.CurrentCulture.Name;
+ private string message;
+
+ ///
+ /// Get the start date and time.
+ ///
+ public DateTime StartTime
+ {
+ get
+ {
+ return this.startTime;
+ }
+ }
+
+ ///
+ /// Get the end date and time.
+ ///
+ public DateTime EndTime
+ {
+ get
+ {
+ return this.endTime;
+ }
+ }
+
+ ///
+ /// Get the culture of the reply.
+ ///
+ public string Culture
+ {
+ get
+ {
+ return this.culture;
+ }
+ }
+
+ ///
+ /// Get the reply message.
+ ///
+ public string Message
+ {
+ get
+ {
+ return this.message;
+ }
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// XML reader
+ /// Whether the element was read
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.InsightSource:
+ this.InsightSource = reader.ReadElementValue();
+ break;
+ case XmlElementNames.StartTime:
+ this.startTime = reader.ReadElementValueAsDateTime(XmlNamespace.Types, XmlElementNames.StartTime).Value;
+ break;
+ case XmlElementNames.EndTime:
+ this.endTime = reader.ReadElementValueAsDateTime(XmlNamespace.Types, XmlElementNames.EndTime).Value;
+ break;
+ case XmlElementNames.Culture:
+ this.culture = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Message:
+ this.message = reader.ReadElementValue();
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/ComplexProperties/PeopleInsights/Person.cs b/ComplexProperties/PeopleInsights/Person.cs
new file mode 100644
index 00000000..412b476a
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/Person.cs
@@ -0,0 +1,415 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ ///
+ /// Represents the Person.
+ ///
+ public class Person : ComplexProperty
+ {
+ ///
+ /// Initializes a local instance of
+ ///
+ public Person()
+ : base()
+ {
+ }
+
+ ///
+ /// Gets the EmailAddress.
+ ///
+ public string EmailAddress
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the collection of insights.
+ ///
+ public PersonInsightCollection Insights
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the display name.
+ ///
+ public string FullName
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the display name.
+ ///
+ public string DisplayName
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the given name.
+ ///
+ public string GivenName
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the surname.
+ ///
+ public string Surname
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the phone number.
+ ///
+ public string PhoneNumber
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the sms number.
+ ///
+ public string SMSNumber
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the facebook profile link.
+ ///
+ public string FacebookProfileLink
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the linkedin profile link.
+ ///
+ public string LinkedInProfileLink
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the list of skills.
+ ///
+ public SkillInsightValueCollection Skills
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the professional biography.
+ ///
+ public string ProfessionalBiography
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the management chain.
+ ///
+ public ProfileInsightValueCollection ManagementChain
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the list of direct reports.
+ ///
+ public ProfileInsightValueCollection DirectReports
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the list of peers.
+ ///
+ public ProfileInsightValueCollection Peers
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the team size.
+ ///
+ public string TeamSize
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the current job.
+ ///
+ public JobInsightValueCollection CurrentJob
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the birthday.
+ ///
+ public string Birthday
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the hometown.
+ ///
+ public string Hometown
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the current location.
+ ///
+ public string CurrentLocation
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the company profile.
+ ///
+ public CompanyInsightValueCollection CompanyProfile
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the office.
+ ///
+ public string Office
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the headline.
+ ///
+ public string Headline
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the list of mutual connections.
+ ///
+ public ProfileInsightValueCollection MutualConnections
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the title.
+ ///
+ public string Title
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the mutual manager.
+ ///
+ public ProfileInsightValue MutualManager
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the alias.
+ ///
+ public string Alias
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the Department.
+ ///
+ public string Department
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Gets the user profile picture.
+ ///
+ public UserProfilePicture UserProfilePicture
+ {
+ get;
+ internal set;
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// The reader.
+ /// True if element was read.
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.EmailAddress:
+ this.EmailAddress = reader.ReadElementValue();
+ break;
+ case XmlElementNames.FullName:
+ this.FullName = reader.ReadElementValue();
+ break;
+ case XmlElementNames.DisplayName:
+ this.DisplayName = reader.ReadElementValue();
+ break;
+ case XmlElementNames.GivenName:
+ this.GivenName = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Surname:
+ this.Surname = reader.ReadElementValue();
+ break;
+ case XmlElementNames.PhoneNumber:
+ this.PhoneNumber = reader.ReadElementValue();
+ break;
+ case XmlElementNames.SMSNumber:
+ this.SMSNumber = reader.ReadElementValue();
+ break;
+ case XmlElementNames.FacebookProfileLink:
+ this.FacebookProfileLink = reader.ReadElementValue();
+ break;
+ case XmlElementNames.LinkedInProfileLink:
+ this.LinkedInProfileLink = reader.ReadElementValue();
+ break;
+ case XmlElementNames.ProfessionalBiography:
+ this.ProfessionalBiography = reader.ReadElementValue();
+ break;
+ case XmlElementNames.TeamSize:
+ this.TeamSize = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Birthday:
+ this.Birthday = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Hometown:
+ this.Hometown = reader.ReadElementValue();
+ break;
+ case XmlElementNames.CurrentLocation:
+ this.CurrentLocation = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Office:
+ this.Office = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Headline:
+ this.Headline = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Title:
+ this.Title = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Alias:
+ this.Alias = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Department:
+ this.Department = reader.ReadElementValue();
+ break;
+ case XmlElementNames.MutualManager:
+ this.MutualManager = new ProfileInsightValue();
+ this.MutualManager.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.MutualManager);
+ break;
+ case XmlElementNames.ManagementChain:
+ this.ManagementChain = new ProfileInsightValueCollection(XmlElementNames.Item);
+ this.ManagementChain.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.ManagementChain);
+ break;
+ case XmlElementNames.DirectReports:
+ this.DirectReports = new ProfileInsightValueCollection(XmlElementNames.Item);
+ this.DirectReports.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.DirectReports);
+ break;
+ case XmlElementNames.Peers:
+ this.Peers = new ProfileInsightValueCollection(XmlElementNames.Item);
+ this.Peers.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Peers);
+ break;
+ case XmlElementNames.MutualConnections:
+ this.MutualConnections = new ProfileInsightValueCollection(XmlElementNames.Item);
+ this.MutualConnections.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.MutualConnections);
+ break;
+ case XmlElementNames.Skills:
+ this.Skills = new SkillInsightValueCollection(XmlElementNames.Item);
+ this.Skills.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Skills);
+ break;
+ case XmlElementNames.CurrentJob:
+ this.CurrentJob = new JobInsightValueCollection(XmlElementNames.Item);
+ this.CurrentJob.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.CurrentJob);
+ break;
+ case XmlElementNames.CompanyProfile:
+ this.CompanyProfile = new CompanyInsightValueCollection(XmlElementNames.Item);
+ this.CompanyProfile.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.CompanyProfile);
+ break;
+ case XmlElementNames.Insights:
+ this.Insights = new PersonInsightCollection();
+ this.Insights.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Insights);
+ break;
+ case XmlElementNames.UserProfilePicture:
+ this.UserProfilePicture = new UserProfilePicture();
+ this.UserProfilePicture.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.UserProfilePicture);
+ break;
+ default:
+ return base.TryReadElementFromXml(reader);
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/PersonInsight.cs b/ComplexProperties/PeopleInsights/PersonInsight.cs
new file mode 100644
index 00000000..9d0fd688
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/PersonInsight.cs
@@ -0,0 +1,189 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents the PersonInsight.
+ ///
+ public sealed class PersonInsight : ComplexProperty
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public PersonInsight() : base()
+ {
+ this.ItemList = new InsightValueCollection();
+ }
+
+ ///
+ /// Gets the string
+ ///
+ public string InsightType { get; internal set; }
+
+ ///
+ /// Gets the Rank
+ ///
+ public double Rank { get; internal set; }
+
+ ///
+ /// Gets the Content
+ ///
+ public ComplexProperty Content { get; internal set; }
+
+ ///
+ /// Gets the ItemList
+ ///
+ public InsightValueCollection ItemList { get; internal set; }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// The reader.
+ /// True if element was read.
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ while (true)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.InsightType:
+ this.InsightType = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Rank:
+ this.Rank = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Content:
+ var type = reader.ReadAttributeValue("xsi:type");
+ switch (type)
+ {
+ case XmlElementNames.SingleValueInsightContent:
+ this.Content = new SingleValueInsightContent();
+ ((SingleValueInsightContent)this.Content).LoadFromXml(reader, reader.LocalName);
+ break;
+ case XmlElementNames.MultiValueInsightContent:
+ this.Content = new MultiValueInsightContent();
+ ((MultiValueInsightContent)this.Content).LoadFromXml(reader, reader.LocalName);
+ break;
+ default:
+ return false;
+ }
+ break;
+ case XmlElementNames.ItemList:
+ this.ReadItemList(reader);
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+ }
+
+ ///
+ /// Reads ItemList from XML
+ ///
+ /// The reader.
+ private void ReadItemList(EwsServiceXmlReader reader)
+ {
+ do
+ {
+ reader.Read();
+ InsightValue item = null;
+
+ if (reader.NodeType == XmlNodeType.Element && reader.LocalName == XmlElementNames.Item)
+ {
+ switch (reader.ReadAttributeValue("xsi:type"))
+ {
+ case XmlElementNames.StringInsightValue:
+ item = new StringInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.ProfileInsightValue:
+ item = new ProfileInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.JobInsightValue:
+ item = new JobInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.UserProfilePicture:
+ item = new UserProfilePicture();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.EducationInsightValue:
+ item = new EducationInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.SkillInsightValue:
+ item = new SkillInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.ComputedInsightValue:
+ item = new ComputedInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.MeetingInsightValue:
+ item = new MeetingInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.EmailInsightValue:
+ item = new EmailInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.DelveDocument:
+ item = new DelveDocument();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.CompanyInsightValue:
+ item = new CompanyInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ case XmlElementNames.OutOfOfficeInsightValue:
+ item = new OutOfOfficeInsightValue();
+ item.LoadFromXml(reader, reader.LocalName);
+ this.ItemList.InternalAdd(item);
+ break;
+ }
+ }
+ }
+ while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.ItemList));
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/PersonInsightCollection.cs b/ComplexProperties/PeopleInsights/PersonInsightCollection.cs
new file mode 100644
index 00000000..6c2b1d1e
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/PersonInsightCollection.cs
@@ -0,0 +1,153 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System;
+ using System.Collections.Generic;
+
+ ///
+ /// Represents the collection of person insights.
+ ///
+ public sealed class PersonInsightCollection : ComplexPropertyCollection
+ {
+ ///
+ /// XML element name
+ ///
+ private readonly string collectionItemXmlElementName;
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ internal PersonInsightCollection()
+ : this(XmlElementNames.Insight)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ /// Name of the collection item XML element.
+ internal PersonInsightCollection(string collectionItemXmlElementName)
+ : base()
+ {
+ this.collectionItemXmlElementName = collectionItemXmlElementName;
+ }
+
+ ///
+ /// Adds an insight to the collection.
+ ///
+ /// The insight to add.
+ public void Add(PersonInsight insight)
+ {
+ this.InternalAdd(insight);
+ }
+
+ ///
+ /// Adds multiple person insights to the collection.
+ ///
+ /// The collection of person insights to add.
+ public void AddRange(IEnumerable insights)
+ {
+ if (insights != null)
+ {
+ foreach (PersonInsight insight in insights)
+ {
+ this.Add(insight);
+ }
+ }
+ }
+
+ ///
+ /// Clears the collection.
+ ///
+ public void Clear()
+ {
+ this.InternalClear();
+ }
+
+ ///
+ /// Removes a person insight from the collection.
+ ///
+ /// The index of the person insight to remove.
+ public void RemoveAt(int index)
+ {
+ if (index < 0 || index >= this.Count)
+ {
+ throw new ArgumentOutOfRangeException("index", Strings.IndexIsOutOfRange);
+ }
+
+ this.InternalRemoveAt(index);
+ }
+
+ ///
+ /// Removes a person insight from the collection.
+ ///
+ /// The person sight to remove.
+ /// Whether removed from the collection
+ public bool Remove(PersonInsight insight)
+ {
+ EwsUtilities.ValidateParam(insight, "insight");
+
+ return this.InternalRemove(insight);
+ }
+
+ ///
+ /// Creates a PersonInsight object from an XML element name.
+ ///
+ /// The XML element name from which to create the PersonInsight.
+ /// A PersonInsight object.
+ internal override PersonInsight CreateComplexProperty(string xmlElementName)
+ {
+ if (xmlElementName == this.collectionItemXmlElementName)
+ {
+ return new PersonInsight();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Retrieves the XML element name corresponding to the provided PersonInsight object.
+ ///
+ /// The PersonInsight object from which to determine the XML element name.
+ /// The XML element name corresponding to the provided PersonInsight object.
+ internal override string GetCollectionItemXmlElementName(PersonInsight insight)
+ {
+ return this.collectionItemXmlElementName;
+ }
+
+ ///
+ /// Determine whether we should write collection to XML or not.
+ ///
+ /// Always true, even if the collection is empty.
+ internal override bool ShouldWriteToRequest()
+ {
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/ProfileInsightValue.cs b/ComplexProperties/PeopleInsights/ProfileInsightValue.cs
new file mode 100644
index 00000000..2f29aec7
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/ProfileInsightValue.cs
@@ -0,0 +1,181 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents the ProfileInsightValue.
+ ///
+ public sealed class ProfileInsightValue : InsightValue
+ {
+ private string fullName;
+ private string firstName;
+ private string lastName;
+ private string emailAddress;
+ private string avatar;
+ private long joinedUtcTicks;
+ private UserProfilePicture profilePicture;
+ private string title;
+
+ ///
+ /// Gets the FullName
+ ///
+ public string FullName
+ {
+ get
+ {
+ return this.fullName;
+ }
+ }
+
+ ///
+ /// Gets the FirstName
+ ///
+ public string FirstName
+ {
+ get
+ {
+ return this.firstName;
+ }
+ }
+
+ ///
+ /// Gets the LastName
+ ///
+ public string LastName
+ {
+ get
+ {
+ return this.lastName;
+ }
+ }
+
+ ///
+ /// Gets the EmailAddress
+ ///
+ public string EmailAddress
+ {
+ get
+ {
+ return this.emailAddress;
+ }
+ }
+
+ ///
+ /// Gets the Avatar
+ ///
+ public string Avatar
+ {
+ get
+ {
+ return this.avatar;
+ }
+ }
+
+ ///
+ /// Gets the JoinedUtcTicks
+ ///
+ public long JoinedUtcTicks
+ {
+ get
+ {
+ return this.joinedUtcTicks;
+ }
+ }
+
+ ///
+ /// Gets the ProfilePicture
+ ///
+ public UserProfilePicture ProfilePicture
+ {
+ get
+ {
+ return this.profilePicture;
+ }
+ }
+
+ ///
+ /// Gets the Title
+ ///
+ public string Title
+ {
+ get
+ {
+ return this.title;
+ }
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// XML reader
+ /// Whether the element was read
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.InsightSource:
+ this.InsightSource = reader.ReadElementValue();
+ break;
+ case XmlElementNames.UpdatedUtcTicks:
+ this.UpdatedUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.FullName:
+ this.fullName = reader.ReadElementValue();
+ break;
+ case XmlElementNames.FirstName:
+ this.firstName = reader.ReadElementValue();
+ break;
+ case XmlElementNames.LastName:
+ this.lastName = reader.ReadElementValue();
+ break;
+ case XmlElementNames.EmailAddress:
+ this.emailAddress = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Avatar:
+ this.avatar = reader.ReadElementValue();
+ break;
+ case XmlElementNames.JoinedUtcTicks:
+ this.joinedUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.ProfilePicture:
+ var picture = new UserProfilePicture();
+ picture.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.UserProfilePicture);
+ this.profilePicture = new UserProfilePicture();
+ break;
+ case XmlElementNames.Title:
+ this.title = reader.ReadElementValue();
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/ProfileInsightValueCollection.cs b/ComplexProperties/PeopleInsights/ProfileInsightValueCollection.cs
new file mode 100644
index 00000000..96a1f325
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/ProfileInsightValueCollection.cs
@@ -0,0 +1,95 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System;
+ using System.Collections.Generic;
+
+ ///
+ /// Represents the collection of profile insight values.
+ ///
+ public sealed class ProfileInsightValueCollection : ComplexPropertyCollection
+ {
+ ///
+ /// XML element name
+ ///
+ private readonly string collectionItemXmlElementName;
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ internal ProfileInsightValueCollection()
+ : this(XmlElementNames.ProfileInsightValue)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ /// Name of the collection item XML element.
+ internal ProfileInsightValueCollection(string collectionItemXmlElementName)
+ : base()
+ {
+ this.collectionItemXmlElementName = collectionItemXmlElementName;
+ }
+
+ ///
+ /// Creates a ProfileInsightValue object from an XML element name.
+ ///
+ /// The XML element name from which to create the ProfileInsightValue.
+ /// A ProfileInsightValue object.
+ internal override ProfileInsightValue CreateComplexProperty(string xmlElementName)
+ {
+ if (xmlElementName == this.collectionItemXmlElementName)
+ {
+ return new ProfileInsightValue();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Retrieves the XML element name corresponding to the provided PersonInsight object.
+ ///
+ /// The ProfileInsightValue object from which to determine the XML element name.
+ /// The XML element name corresponding to the provided ProfileInsightValue object.
+ internal override string GetCollectionItemXmlElementName(ProfileInsightValue insight)
+ {
+ return this.collectionItemXmlElementName;
+ }
+
+ ///
+ /// Determine whether we should write collection to XML or not.
+ ///
+ /// Always true, even if the collection is empty.
+ internal override bool ShouldWriteToRequest()
+ {
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/SingleValueInsightContent.cs b/ComplexProperties/PeopleInsights/SingleValueInsightContent.cs
new file mode 100644
index 00000000..5068670c
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/SingleValueInsightContent.cs
@@ -0,0 +1,97 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents the SingleValueInsightContent.
+ ///
+ public sealed class SingleValueInsightContent : ComplexProperty
+ {
+ ///
+ /// Gets the Item
+ ///
+ public InsightValue Item { get; internal set; }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// The reader.
+ /// True if element was read.
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.ReadAttributeValue("xsi:type"))
+ {
+ case XmlElementNames.StringInsightValue:
+ this.Item = new StringInsightValue();
+ this.Item.LoadFromXml(reader, reader.LocalName);
+ break;
+ case XmlElementNames.ProfileInsightValue:
+ this.Item = new ProfileInsightValue();
+ this.Item.LoadFromXml(reader, reader.LocalName);
+ break;
+ case XmlElementNames.JobInsightValue:
+ this.Item = new JobInsightValue();
+ this.Item.LoadFromXml(reader, reader.LocalName);
+ break;
+ case XmlElementNames.UserProfilePicture:
+ this.Item = new UserProfilePicture();
+ this.Item.LoadFromXml(reader, reader.LocalName);
+ break;
+ case XmlElementNames.EducationInsightValue:
+ this.Item = new EducationInsightValue();
+ this.Item.LoadFromXml(reader, reader.LocalName);
+ break;
+ case XmlElementNames.SkillInsightValue:
+ this.Item = new SkillInsightValue();
+ this.Item.LoadFromXml(reader, reader.LocalName);
+ break;
+ case XmlElementNames.DelveDocument:
+ this.Item = new DelveDocument();
+ this.Item.LoadFromXml(reader, reader.LocalName);
+ break;
+ case XmlElementNames.CompanyInsightValue:
+ this.Item = new CompanyInsightValue();
+ this.Item.LoadFromXml(reader, reader.LocalName);
+ break;
+ case XmlElementNames.ComputedInsightValue:
+ this.Item = new ComputedInsightValue();
+ this.Item.LoadFromXml(reader, reader.LocalName);
+ break;
+ case XmlElementNames.OutOfOfficeInsightValue:
+ this.Item = new OutOfOfficeInsightValue();
+ this.Item.LoadFromXml(reader, reader.LocalName);
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/SkillInsightValue.cs b/ComplexProperties/PeopleInsights/SkillInsightValue.cs
new file mode 100644
index 00000000..5cd99d3d
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/SkillInsightValue.cs
@@ -0,0 +1,99 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents the SkillInsightValue.
+ ///
+ public sealed class SkillInsightValue : InsightValue
+ {
+ private string name;
+ private string strength;
+
+ ///
+ /// Gets the Name
+ ///
+ public string Name
+ {
+ get
+ {
+ return this.name;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.name, value);
+ }
+ }
+
+ ///
+ /// Gets the Strength
+ ///
+ public string Strength
+ {
+ get
+ {
+ return this.strength;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.strength, value);
+ }
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// XML reader
+ /// Whether the element was read
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.InsightSource:
+ this.InsightSource = reader.ReadElementValue();
+ break;
+ case XmlElementNames.UpdatedUtcTicks:
+ this.UpdatedUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Name:
+ this.Name = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Strength:
+ this.Strength = reader.ReadElementValue();
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/SkillInsightValueCollection.cs b/ComplexProperties/PeopleInsights/SkillInsightValueCollection.cs
new file mode 100644
index 00000000..8375992a
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/SkillInsightValueCollection.cs
@@ -0,0 +1,95 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System;
+ using System.Collections.Generic;
+
+ ///
+ /// Represents the collection of person insights.
+ ///
+ public sealed class SkillInsightValueCollection : ComplexPropertyCollection
+ {
+ ///
+ /// XML element name
+ ///
+ private readonly string collectionItemXmlElementName;
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ internal SkillInsightValueCollection()
+ : this(XmlElementNames.SkillInsightValue)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ /// Name of the collection item XML element.
+ internal SkillInsightValueCollection(string collectionItemXmlElementName)
+ : base()
+ {
+ this.collectionItemXmlElementName = collectionItemXmlElementName;
+ }
+
+ ///
+ /// Creates a SkillInsightValue object from an XML element name.
+ ///
+ /// The XML element name from which to create the SkillInsightValue.
+ /// A SkillInsightValue object.
+ internal override SkillInsightValue CreateComplexProperty(string xmlElementName)
+ {
+ if (xmlElementName == this.collectionItemXmlElementName)
+ {
+ return new SkillInsightValue();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Retrieves the XML element name corresponding to the provided PersonInsight object.
+ ///
+ /// The SkillInsightValue object from which to determine the XML element name.
+ /// The XML element name corresponding to the provided SkillInsightValue object.
+ internal override string GetCollectionItemXmlElementName(SkillInsightValue insight)
+ {
+ return this.collectionItemXmlElementName;
+ }
+
+ ///
+ /// Determine whether we should write collection to XML or not.
+ ///
+ /// Always true, even if the collection is empty.
+ internal override bool ShouldWriteToRequest()
+ {
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/StringInsightValue.cs b/ComplexProperties/PeopleInsights/StringInsightValue.cs
new file mode 100644
index 00000000..baf44311
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/StringInsightValue.cs
@@ -0,0 +1,79 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents the StringInsightValue.
+ ///
+ public sealed class StringInsightValue : InsightValue
+ {
+ private string data;
+
+ ///
+ /// Gets the Data
+ ///
+ public string Data
+ {
+ get
+ {
+ return this.data;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.data, value);
+ }
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// XML reader
+ /// Whether the element was read
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.InsightSource:
+ this.InsightSource = reader.ReadElementValue();
+ break;
+ case XmlElementNames.UpdatedUtcTicks:
+ this.UpdatedUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Data:
+ this.Data = reader.ReadElementValue();
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PeopleInsights/UserProfilePicture.cs b/ComplexProperties/PeopleInsights/UserProfilePicture.cs
new file mode 100644
index 00000000..2146da6d
--- /dev/null
+++ b/ComplexProperties/PeopleInsights/UserProfilePicture.cs
@@ -0,0 +1,139 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System.Collections.Generic;
+ using System.Xml;
+
+ ///
+ /// Represents the UserProfilePicture.
+ ///
+ public sealed class UserProfilePicture : InsightValue
+ {
+ private string blob;
+ private string photoSize;
+ private string url;
+ private string imageType;
+
+ ///
+ /// Gets the Blob
+ ///
+ public string Blob
+ {
+ get
+ {
+ return this.blob;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.blob, value);
+ }
+ }
+
+ ///
+ /// Gets the PhotoSize
+ ///
+ public string PhotoSize
+ {
+ get
+ {
+ return this.photoSize;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.photoSize, value);
+ }
+ }
+
+ ///
+ /// Gets the Url
+ ///
+ public string Url
+ {
+ get
+ {
+ return this.url;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.url, value);
+ }
+ }
+
+ ///
+ /// Gets the ImageType
+ ///
+ public string ImageType
+ {
+ get
+ {
+ return this.imageType;
+ }
+
+ set
+ {
+ this.SetFieldValue(ref this.imageType, value);
+ }
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// XML reader
+ /// Whether the element was read
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.InsightSource:
+ this.InsightSource = reader.ReadElementValue();
+ break;
+ case XmlElementNames.UpdatedUtcTicks:
+ this.UpdatedUtcTicks = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Blob:
+ this.Blob = reader.ReadElementValue();
+ break;
+ case XmlElementNames.PhotoSize:
+ this.PhotoSize = reader.ReadElementValue();
+ break;
+ case XmlElementNames.Url:
+ this.Url = reader.ReadElementValue();
+ break;
+ case XmlElementNames.ImageType:
+ this.ImageType = reader.ReadElementValue();
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PersonaEmailAddress.cs b/ComplexProperties/PersonaEmailAddress.cs
new file mode 100644
index 00000000..28ec63e5
--- /dev/null
+++ b/ComplexProperties/PersonaEmailAddress.cs
@@ -0,0 +1,282 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ ///
+ /// Represents an e-mail address.
+ ///
+ public sealed class PersonaEmailAddress : ComplexProperty, ISearchStringProvider
+ {
+ ///
+ /// Creates a new instance of the class.
+ ///
+ public PersonaEmailAddress()
+ : base()
+ {
+ _emailAddress = new EmailAddress();
+ }
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ /// The SMTP address used to initialize the PersonaEmailAddress.
+ public PersonaEmailAddress(string smtpAddress)
+ : this()
+ {
+ EwsUtilities.ValidateParam(smtpAddress, "smtpAddress");
+ this.Address = smtpAddress;
+ }
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ /// The name used to initialize the PersonaEmailAddress.
+ /// The SMTP address used to initialize the PersonaEmailAddress.
+ public PersonaEmailAddress(string name, string smtpAddress)
+ : this(smtpAddress)
+ {
+ EwsUtilities.ValidateParam(name, "name");
+ this.Name = name;
+ }
+
+ ///
+ /// Name accessors
+ ///
+ public string Name
+ {
+ get
+ {
+ return _emailAddress.Name;
+ }
+
+ set
+ {
+ _emailAddress.Name = value;
+ }
+ }
+
+ ///
+ /// Email address accessors. The type of the Address property must match the specified routing type.
+ /// If RoutingType is not set, Address is assumed to be an SMTP address.
+ ///
+ public string Address
+ {
+ get
+ {
+ return _emailAddress.Address;
+ }
+
+ set
+ {
+ _emailAddress.Address = value;
+ }
+ }
+
+ ///
+ /// Routing type accessors. If RoutingType is not set, Address is assumed to be an SMTP address.
+ ///
+ public string RoutingType
+ {
+ get
+ {
+ return _emailAddress.RoutingType;
+ }
+
+ set
+ {
+ _emailAddress.RoutingType = value;
+ }
+ }
+
+ ///
+ /// Mailbox type accessors
+ ///
+ public MailboxType? MailboxType
+ {
+ get
+ {
+ return _emailAddress.MailboxType;
+ }
+
+ set
+ {
+ _emailAddress.MailboxType = value;
+ }
+ }
+
+ ///
+ /// PersonaEmailAddress Id accessors
+ ///
+ public ItemId Id
+ {
+ get
+ {
+ return _emailAddress.Id;
+ }
+
+ set
+ {
+ _emailAddress.Id = value;
+ }
+ }
+
+ ///
+ /// Original display name accessors
+ ///
+ public string OriginalDisplayName { get; set; }
+
+ ///
+ /// Email address details
+ ///
+ private EmailAddress _emailAddress;
+
+ ///
+ /// Defines an implicit conversion from a string representing an SMTP address to PeronaEmailAddress.
+ ///
+ /// The SMTP address to convert to EmailAddress.
+ /// An EmailAddress initialized with the specified SMTP address.
+ public static implicit operator PersonaEmailAddress(string smtpAddress)
+ {
+ return new PersonaEmailAddress(smtpAddress);
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// XML reader
+ /// Whether the element was read
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ while (true)
+ {
+ switch (reader.LocalName)
+ {
+ case XmlElementNames.Name:
+ this.Name = reader.ReadElementValue();
+ break;
+ case XmlElementNames.EmailAddress:
+ this.Address = reader.ReadElementValue();
+
+ // Process the next node before returning. Otherwise, the current node
+ // makes ComplexProperty.InternalLoadFromXml think that this ends the outer
+ // node, causing the remaining children of the outer EmailAddress node to be skipped.
+ reader.Read();
+ if (reader.NodeType == System.Xml.XmlNodeType.Element)
+ {
+ continue;
+ }
+ break;
+ case XmlElementNames.RoutingType:
+ this.RoutingType = reader.ReadElementValue();
+ break;
+ case XmlElementNames.MailboxType:
+ this.MailboxType = reader.ReadElementValue();
+ break;
+ case XmlElementNames.ItemId:
+ this.Id = new ItemId();
+ this.Id.LoadFromXml(reader, reader.LocalName);
+ break;
+ case XmlElementNames.OriginalDisplayName:
+ this.OriginalDisplayName = reader.ReadElementValue();
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+ }
+
+ ///
+ /// Writes elements to XML.
+ ///
+ /// XML writer
+ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
+ {
+ writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.Name, this.Name);
+ writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.EmailAddress, this.Address);
+ writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.RoutingType, this.RoutingType);
+ writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.MailboxType, this.MailboxType);
+
+ if (!string.IsNullOrEmpty(this.OriginalDisplayName))
+ {
+ writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.OriginalDisplayName, this.OriginalDisplayName);
+ }
+
+ if (this.Id != null)
+ {
+ this.Id.WriteToXml(writer, XmlElementNames.ItemId);
+ }
+ }
+
+ #region ISearchStringProvider methods
+ ///
+ /// Get a string representation for using this instance in a search filter.
+ ///
+ /// String representation of instance.
+ string ISearchStringProvider.GetSearchString()
+ {
+ return this.Address;
+ }
+ #endregion
+
+ #region Object method overrides
+ ///
+ /// Returns a that represents the current .
+ ///
+ ///
+ /// A that represents the current .
+ ///
+ public override string ToString()
+ {
+ string addressPart;
+
+ if (string.IsNullOrEmpty(this.Address))
+ {
+ return string.Empty;
+ }
+
+ if (!string.IsNullOrEmpty(this.RoutingType))
+ {
+ addressPart = this.RoutingType + ":" + this.Address;
+ }
+ else
+ {
+ addressPart = this.Address;
+ }
+
+ if (!string.IsNullOrEmpty(this.Name))
+ {
+ return this.Name + " <" + addressPart + ">";
+ }
+ else
+ {
+ return addressPart;
+ }
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PersonaEmailAddressCollection.cs b/ComplexProperties/PersonaEmailAddressCollection.cs
new file mode 100644
index 00000000..0a2acf12
--- /dev/null
+++ b/ComplexProperties/PersonaEmailAddressCollection.cs
@@ -0,0 +1,200 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System;
+ using System.Collections.Generic;
+
+ ///
+ /// Represents a collection of persona e-mail addresses.
+ ///
+ public sealed class PersonaEmailAddressCollection : ComplexPropertyCollection
+ {
+ ///
+ /// XML element name
+ ///
+ private readonly string collectionItemXmlElementName;
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ ///
+ /// MSDN example incorrectly shows root element as EmailAddress. In fact, it is Address.
+ ///
+ internal PersonaEmailAddressCollection()
+ : this(XmlElementNames.Address)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the class.
+ ///
+ /// Name of the collection item XML element.
+ internal PersonaEmailAddressCollection(string collectionItemXmlElementName)
+ : base()
+ {
+ this.collectionItemXmlElementName = collectionItemXmlElementName;
+ }
+
+ ///
+ /// Adds a persona e-mail address to the collection.
+ ///
+ /// The persona e-mail address to add.
+ public void Add(PersonaEmailAddress emailAddress)
+ {
+ this.InternalAdd(emailAddress);
+ }
+
+ ///
+ /// Adds multiple persona e-mail addresses to the collection.
+ ///
+ /// The collection of persona e-mail addresses to add.
+ public void AddRange(IEnumerable emailAddresses)
+ {
+ if (emailAddresses != null)
+ {
+ foreach (PersonaEmailAddress emailAddress in emailAddresses)
+ {
+ this.Add(emailAddress);
+ }
+ }
+ }
+
+ ///
+ /// Adds a persona e-mail address to the collection.
+ ///
+ /// The SMTP address used to initialize the persona e-mail address.
+ /// An PersonaEmailAddress object initialized with the provided SMTP address.
+ public PersonaEmailAddress Add(string smtpAddress)
+ {
+ PersonaEmailAddress emailAddress = new PersonaEmailAddress(smtpAddress);
+
+ this.Add(emailAddress);
+
+ return emailAddress;
+ }
+
+ ///
+ /// Adds multiple e-mail addresses to the collection.
+ ///
+ /// The SMTP addresses to be added as persona email addresses
+ public void AddRange(IEnumerable smtpAddresses)
+ {
+ if (smtpAddresses != null)
+ {
+ foreach (string smtpAddress in smtpAddresses)
+ {
+ this.Add(smtpAddress);
+ }
+ }
+ }
+
+ ///
+ /// Adds an e-mail address to the collection.
+ ///
+ /// The name used to initialize the persona e-mail address.
+ /// The SMTP address used to initialize the persona e-mail address.
+ /// An PersonaEmailAddress object initialized with the provided SMTP address.
+ public PersonaEmailAddress Add(string name, string smtpAddress)
+ {
+ PersonaEmailAddress emailAddress = new PersonaEmailAddress(name, smtpAddress);
+
+ this.Add(emailAddress);
+
+ return emailAddress;
+ }
+
+ ///
+ /// Clears the collection.
+ ///
+ public void Clear()
+ {
+ this.InternalClear();
+ }
+
+ ///
+ /// Removes a persona e-mail address from the collection.
+ ///
+ /// The index of the e-mail address to remove.
+ public void RemoveAt(int index)
+ {
+ if (index < 0 || index >= this.Count)
+ {
+ throw new ArgumentOutOfRangeException("index", Strings.IndexIsOutOfRange);
+ }
+
+ this.InternalRemoveAt(index);
+ }
+
+ ///
+ /// Removes a persona e-mail address from the collection.
+ ///
+ /// The e-mail address to remove.
+ /// Whether removed from the collection
+ public bool Remove(PersonaEmailAddress personaEmailAddress)
+ {
+ EwsUtilities.ValidateParam(personaEmailAddress, "personaEmailAddress");
+
+ return this.InternalRemove(personaEmailAddress);
+ }
+
+ ///
+ /// Creates a PersonaEmailAddress object from an XML element name.
+ ///
+ /// The XML element name from which to create the persona e-mail address.
+ /// A PersonaEmailAddress object.
+ internal override PersonaEmailAddress CreateComplexProperty(string xmlElementName)
+ {
+ if (xmlElementName == this.collectionItemXmlElementName)
+ {
+ return new PersonaEmailAddress();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// Retrieves the XML element name corresponding to the provided PersonaEmailAddress object.
+ ///
+ /// The PersonaEmailAddress object from which to determine the XML element name.
+ /// The XML element name corresponding to the provided PersonaEmailAddress object.
+ internal override string GetCollectionItemXmlElementName(PersonaEmailAddress personaEmailAddress)
+ {
+ return this.collectionItemXmlElementName;
+ }
+
+ ///
+ /// Determine whether we should write collection to XML or not.
+ ///
+ /// Always true, even if the collection is empty.
+ internal override bool ShouldWriteToRequest()
+ {
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PersonaId.cs b/ComplexProperties/PersonaId.cs
new file mode 100644
index 00000000..be821478
--- /dev/null
+++ b/ComplexProperties/PersonaId.cs
@@ -0,0 +1,104 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System;
+
+ ///
+ /// Represents the Id of a Persona.
+ ///
+ public sealed class PersonaId : ServiceId
+ {
+ ///
+ /// Creates a new instance of the class.
+ ///
+ internal PersonaId()
+ : base()
+ {
+ }
+
+ ///
+ /// Defines an implicit conversion from Id string to PersonaId.
+ ///
+ /// The unique Id to convert to PersonaId.
+ /// A PersonaId initialized with the specified unique Id.
+ public static implicit operator PersonaId(string uniqueId)
+ {
+ return new PersonaId(uniqueId);
+ }
+
+ ///
+ /// Defines an implicit conversion from PersonaId to a Id string.
+ ///
+ /// The PersonaId to be converted
+ /// A PersonaId initialized with the specified unique Id.
+ public static implicit operator String(PersonaId PersonaId)
+ {
+ if (PersonaId == null)
+ {
+ throw new ArgumentNullException("PersonaId");
+ }
+
+ if (String.IsNullOrEmpty(PersonaId.UniqueId))
+ {
+ return string.Empty;
+ }
+ else
+ {
+ // Ignoring the change key info
+ return PersonaId.UniqueId;
+ }
+ }
+
+ ///
+ /// Gets the name of the XML element.
+ ///
+ /// XML element name.
+ internal override string GetXmlElementName()
+ {
+ return XmlElementNames.PersonaId;
+ }
+
+ ///
+ /// Creates a new instance of PersonaId.
+ ///
+ /// The unique Id used to initialize the .
+ public PersonaId(string uniqueId)
+ : base(uniqueId)
+ {
+ }
+
+ ///
+ /// Gets a string representation of the Persona Id.
+ ///
+ /// The string representation of the Persona id.
+ public override string ToString()
+ {
+ // We have ignored the change key portion
+ return this.UniqueId;
+ }
+ }
+}
\ No newline at end of file
diff --git a/ComplexProperties/PersonaPostalAddress.cs b/ComplexProperties/PersonaPostalAddress.cs
index 0acf1d5d..d857b0fb 100644
--- a/ComplexProperties/PersonaPostalAddress.cs
+++ b/ComplexProperties/PersonaPostalAddress.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the PersonaPostalAddress class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -168,65 +183,6 @@ internal void LoadFromXml(EwsServiceXmlReader reader)
while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.PersonaPostalAddress));
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.Street:
- this.street = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.City:
- this.city = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.Country:
- this.country = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.PostalCode:
- this.postalCode = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.PostOfficeBox:
- this.postOfficeBox = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.PostalAddressType:
- this.type = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.Latitude:
- this.latitude = jsonProperty.ReadAsDouble(key);
- break;
- case XmlElementNames.Longitude:
- this.longitude = jsonProperty.ReadAsDouble(key);
- break;
- case XmlElementNames.Accuracy:
- this.accuracy = jsonProperty.ReadAsDouble(key);
- break;
- case XmlElementNames.Altitude:
- this.altitude = jsonProperty.ReadAsDouble(key);
- break;
- case XmlElementNames.AltitudeAccuracy:
- this.altitudeAccuracy = jsonProperty.ReadAsDouble(key);
- break;
- case XmlElementNames.FormattedAddress:
- this.formattedAddress = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.LocationUri:
- this.uri = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.LocationSource:
- this.source = jsonProperty.ReadEnumValue(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets or sets the street.
///
@@ -385,35 +341,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.LocationSource, this.source);
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlElementNames.Street, this.street);
- jsonProperty.Add(XmlElementNames.City, this.city);
- jsonProperty.Add(XmlElementNames.Country, this.country);
- jsonProperty.Add(XmlElementNames.PostalCode, this.postalCode);
- jsonProperty.Add(XmlElementNames.PostOfficeBox, this.postOfficeBox);
- jsonProperty.Add(XmlElementNames.PostalAddressType, this.type);
- jsonProperty.Add(XmlElementNames.Latitude, this.latitude);
- jsonProperty.Add(XmlElementNames.Longitude, this.longitude);
- jsonProperty.Add(XmlElementNames.Accuracy, this.accuracy);
- jsonProperty.Add(XmlElementNames.Altitude, this.altitude);
- jsonProperty.Add(XmlElementNames.AltitudeAccuracy, this.altitudeAccuracy);
- jsonProperty.Add(XmlElementNames.FormattedAddress, this.formattedAddress);
- jsonProperty.Add(XmlElementNames.LocationUri, this.uri);
- jsonProperty.Add(XmlElementNames.LocationSource, this.source);
-
- return jsonProperty;
- }
-
///
/// Writes to XML.
///
@@ -427,4 +354,4 @@ internal void WriteToXml(EwsServiceXmlWriter writer)
writer.WriteEndElement(); // xmlElementName
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/PhoneEntity.cs b/ComplexProperties/PhoneEntity.cs
index dba111e2..41a7db8a 100644
--- a/ComplexProperties/PhoneEntity.cs
+++ b/ComplexProperties/PhoneEntity.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the PhoneEntity class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -67,4 +82,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/PhoneEntityCollection.cs b/ComplexProperties/PhoneEntityCollection.cs
index 59a58b23..4e1a7852 100644
--- a/ComplexProperties/PhoneEntityCollection.cs
+++ b/ComplexProperties/PhoneEntityCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the PhoneEntityCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -50,15 +65,6 @@ internal override PhoneEntity CreateComplexProperty(string xmlElementName)
return new PhoneEntity();
}
- ///
- /// Creates the default complex property.
- ///
- /// PhoneEntity.
- internal override PhoneEntity CreateDefaultComplexProperty()
- {
- return new PhoneEntity();
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(PhoneEntity complexProp
return XmlElementNames.NlgPhone;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/PhoneNumberDictionary.cs b/ComplexProperties/PhoneNumberDictionary.cs
index ea27a549..ad16e065 100644
--- a/ComplexProperties/PhoneNumberDictionary.cs
+++ b/ComplexProperties/PhoneNumberDictionary.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the PhoneNumberDictionary class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -101,4 +116,4 @@ public bool TryGetValue(PhoneNumberKey key, out string phoneNumber)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/PhoneNumberEntry.cs b/ComplexProperties/PhoneNumberEntry.cs
index 35f93376..e21e340b 100644
--- a/ComplexProperties/PhoneNumberEntry.cs
+++ b/ComplexProperties/PhoneNumberEntry.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the PhoneNumberEntry class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -60,34 +75,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
writer.WriteValue(this.PhoneNumber, XmlElementNames.PhoneNumber);
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlAttributeNames.Key, this.Key);
- jsonProperty.Add(XmlElementNames.PhoneNumber, this.PhoneNumber);
-
- return jsonProperty;
- }
-
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- this.Key = jsonProperty.ReadEnumValue(XmlAttributeNames.Key);
- this.PhoneNumber = jsonProperty.ReadAsString(XmlElementNames.PhoneNumber);
- }
-
///
/// Gets or sets the phone number of the entry.
///
@@ -97,4 +84,4 @@ public string PhoneNumber
set { this.SetFieldValue(ref this.phoneNumber, value); }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/PhysicalAddressDictionary.cs b/ComplexProperties/PhysicalAddressDictionary.cs
index f6facc58..8b08ba89 100644
--- a/ComplexProperties/PhysicalAddressDictionary.cs
+++ b/ComplexProperties/PhysicalAddressDictionary.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the PhysicalAddressDictionary class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -69,4 +84,4 @@ public bool TryGetValue(PhysicalAddressKey key, out PhysicalAddressEntry physica
return this.Entries.TryGetValue(key, out physicalAddress);
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/PhysicalAddressEntry.cs b/ComplexProperties/PhysicalAddressEntry.cs
index 151c7c7e..c123017e 100644
--- a/ComplexProperties/PhysicalAddressEntry.cs
+++ b/ComplexProperties/PhysicalAddressEntry.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Implements the representation of a physical address.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -191,59 +206,6 @@ internal override bool WriteSetUpdateToXml(
return true;
}
- ///
- /// Writes the set update to json.
- ///
- /// The service.
- /// The ews object.
- /// The property definition.
- /// The updates.
- ///
- internal override bool WriteSetUpdateToJson(ExchangeService service, ServiceObject ewsObject, PropertyDefinition propertyDefinition, List updates)
- {
- List propertiesToSet = new List();
-
- propertiesToSet.AddRange(this.propertyBag.AddedItems);
- propertiesToSet.AddRange(this.propertyBag.ModifiedItems);
-
- foreach (string propertyName in propertiesToSet)
- {
- JsonObject jsonUpdate = new JsonObject();
-
- jsonUpdate.AddTypeParameter(ewsObject.GetSetFieldXmlElementName());
-
- JsonObject jsonUri = new JsonObject();
-
- jsonUri.AddTypeParameter(JsonNames.PathToIndexedFieldType);
- jsonUri.Add(XmlAttributeNames.FieldURI, GetFieldUri(propertyName));
- jsonUri.Add(XmlAttributeNames.FieldIndex, this.Key.ToString());
-
- jsonUpdate.Add(JsonNames.Path, jsonUri);
-
- JsonObject jsonProperty = new JsonObject();
- jsonProperty.Add(XmlAttributeNames.Key, this.Key);
- jsonProperty.Add(propertyName, this.propertyBag[propertyName]);
-
- JsonObject jsonServiceObject = new JsonObject();
- jsonServiceObject.AddTypeParameter(ewsObject.GetXmlElementName());
- jsonServiceObject.Add(propertyDefinition.XmlElementName, new JsonObject[] { jsonProperty });
-
- jsonUpdate.Add(PropertyBag.GetPropertyUpdateItemName(ewsObject), jsonServiceObject);
-
- updates.Add(jsonUpdate);
- }
-
- foreach (string propertyName in this.propertyBag.RemovedItems)
- {
- this.InternalWriteDeleteUpdateToJson(
- ewsObject,
- propertyName,
- updates);
- }
-
- return true;
- }
-
///
/// Writes the delete update to XML.
///
@@ -263,86 +225,6 @@ internal override bool WriteDeleteUpdateToXml(EwsServiceXmlWriter writer, Servic
return true;
}
- ///
- /// Writes field deletion to json.
- ///
- /// The service.
- /// The ews object.
- /// The updates.
- ///
- internal override bool WriteDeleteUpdateToJson(ExchangeService service, ServiceObject ewsObject, List updates)
- {
- foreach (string propertyName in PhysicalAddressSchema.XmlElementNames)
- {
- this.InternalWriteDeleteUpdateToJson(
- ewsObject,
- propertyName,
- updates);
- }
-
- return true;
- }
-
- ///
- /// Internal the write delete update to json.
- ///
- /// The ews object.
- /// Name of the property.
- /// The updates.
- internal void InternalWriteDeleteUpdateToJson(ServiceObject ewsObject, string propertyName, List updates)
- {
- JsonObject jsonUpdate = new JsonObject();
-
- jsonUpdate.AddTypeParameter(ewsObject.GetDeleteFieldXmlElementName());
-
- JsonObject jsonUri = new JsonObject();
-
- jsonUri.AddTypeParameter(JsonNames.PathToIndexedFieldType);
- jsonUri.Add(XmlAttributeNames.FieldURI, GetFieldUri(propertyName));
- jsonUri.Add(XmlAttributeNames.FieldIndex, this.Key.ToString());
-
- jsonUpdate.Add(JsonNames.Path, jsonUri);
-
- updates.Add(jsonUpdate);
- }
-
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlAttributeNames.Key, this.Key);
- jsonProperty.Add(XmlElementNames.Street, this.Street);
- jsonProperty.Add(XmlElementNames.City, this.City);
- jsonProperty.Add(XmlElementNames.State, this.State);
- jsonProperty.Add(XmlElementNames.CountryOrRegion, this.CountryOrRegion);
- jsonProperty.Add(XmlElementNames.PostalCode, this.PostalCode);
-
- return jsonProperty;
- }
-
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- this.Key = jsonProperty.ReadEnumValue(XmlAttributeNames.Key);
- this.Street = jsonProperty.ReadAsString(XmlElementNames.Street);
- this.City = jsonProperty.ReadAsString(XmlElementNames.City);
- this.State = jsonProperty.ReadAsString(XmlElementNames.State);
- this.Street = jsonProperty.ReadAsString(XmlElementNames.Street);
- this.CountryOrRegion = jsonProperty.ReadAsString(XmlElementNames.CountryOrRegion);
- this.PostalCode = jsonProperty.ReadAsString(XmlElementNames.PostalCode);
- }
-
#endregion
#region Private methods
@@ -426,4 +308,4 @@ public static List XmlElementNames
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/PolicyTag.cs b/ComplexProperties/PolicyTag.cs
index 3b0d629b..09f89efb 100644
--- a/ComplexProperties/PolicyTag.cs
+++ b/ComplexProperties/PolicyTag.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the PolicyTag class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -37,4 +52,4 @@ public PolicyTag(bool isExplicit, Guid retentionId)
this.RetentionId = retentionId;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Recurrence/DayOfTheWeekCollection.cs b/ComplexProperties/Recurrence/DayOfTheWeekCollection.cs
index 808a4d91..fc32ccfb 100644
--- a/ComplexProperties/Recurrence/DayOfTheWeekCollection.cs
+++ b/ComplexProperties/Recurrence/DayOfTheWeekCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the DayOfTheWeekCollection enumeration.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -32,7 +47,7 @@ internal DayOfTheWeekCollection()
///
/// The separator.
/// String representation of collection.
- private string ToString(string separator)
+ internal string ToString(string separator)
{
if (this.Count == 0)
{
@@ -66,29 +81,6 @@ internal override void LoadFromXml(EwsServiceXmlReader reader, string xmlElement
' ');
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- // DayOfTheWeekCollection is implemented as a Json primitive, rather than as a Json object.
- throw new InvalidOperationException();
- }
-
- ///
- /// Loads from json value.
- ///
- /// The json value.
- internal void LoadFromJsonValue(string jsonValue)
- {
- EwsUtilities.ParseEnumValueList(
- this.items,
- jsonValue,
- ' ');
- }
-
///
/// Writes to XML.
///
@@ -107,18 +99,6 @@ internal override void WriteToXml(EwsServiceXmlWriter writer, string xmlElementN
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- return this.ToString(" ");
- }
-
///
/// Builds string representation of the collection.
///
@@ -244,4 +224,4 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.DailyPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.DailyPattern.cs
index c1a0a607..8ae46d60 100644
--- a/ComplexProperties/Recurrence/Patterns/Recurrence.DailyPattern.cs
+++ b/ComplexProperties/Recurrence/Patterns/Recurrence.DailyPattern.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Recurrence.DailyPattern class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.DailyRegenerationPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.DailyRegenerationPattern.cs
index b2cb11e8..08a16eea 100644
--- a/ComplexProperties/Recurrence/Patterns/Recurrence.DailyRegenerationPattern.cs
+++ b/ComplexProperties/Recurrence/Patterns/Recurrence.DailyRegenerationPattern.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Recurrence.DailyRegenerationPattern class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.IntervalPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.IntervalPattern.cs
index 0e36ece8..2e687d38 100644
--- a/ComplexProperties/Recurrence/Patterns/Recurrence.IntervalPattern.cs
+++ b/ComplexProperties/Recurrence/Patterns/Recurrence.IntervalPattern.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the IntervalPattern class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -65,21 +80,6 @@ internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer)
this.Interval);
}
- ///
- /// Patterns to json.
- ///
- /// The service.
- ///
- internal override JsonObject PatternToJson(ExchangeService service)
- {
- JsonObject jsonPattern = new JsonObject();
-
- jsonPattern.AddTypeParameter(this.XmlElementName);
- jsonPattern.Add(XmlElementNames.Interval, this.Interval);
-
- return jsonPattern;
- }
-
///
/// Tries to read element from XML.
///
@@ -104,28 +104,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.LoadFromJson(jsonProperty, service);
-
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.Interval:
- this.interval = jsonProperty.ReadAsInt(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets or sets the interval between occurrences.
///
@@ -146,6 +124,16 @@ public int Interval
this.SetFieldValue(ref this.interval, value);
}
}
+
+ ///
+ /// Checks if two recurrence objects are identical.
+ ///
+ /// The recurrence to compare this one to.
+ /// true if the two recurrences are identical, false otherwise.
+ public override bool IsSame(Recurrence otherRecurrence)
+ {
+ return base.IsSame(otherRecurrence) && this.interval == ((IntervalPattern)otherRecurrence).interval;
+ }
}
}
}
\ No newline at end of file
diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyPattern.cs
index e46ff38f..86f3ef7c 100644
--- a/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyPattern.cs
+++ b/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyPattern.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Recurrence.MonthlyPattern class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -73,20 +88,6 @@ internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer)
this.DayOfMonth);
}
- ///
- /// Patterns to json.
- ///
- /// The service.
- ///
- internal override JsonObject PatternToJson(ExchangeService service)
- {
- JsonObject jsonPattern = base.PatternToJson(service);
-
- jsonPattern.Add(XmlElementNames.DayOfMonth, this.DayOfMonth);
-
- return jsonPattern;
- }
-
///
/// Tries to read element from XML.
///
@@ -111,28 +112,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.LoadFromJson(jsonProperty, service);
-
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.DayOfMonth:
- this.dayOfMonth = jsonProperty.ReadAsInt(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Validates this instance.
///
@@ -166,6 +145,16 @@ public int DayOfMonth
this.SetFieldValue(ref this.dayOfMonth, value);
}
}
+
+ ///
+ /// Checks if two recurrence objects are identical.
+ ///
+ /// The recurrence to compare this one to.
+ /// true if the two recurrences are identical, false otherwise.
+ public override bool IsSame(Recurrence otherRecurrence)
+ {
+ return base.IsSame(otherRecurrence) && this.dayOfMonth == ((MonthlyPattern)otherRecurrence).dayOfMonth;
+ }
}
}
}
\ No newline at end of file
diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyRegenerationPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyRegenerationPattern.cs
index d4d7d6ab..ff8b9a39 100644
--- a/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyRegenerationPattern.cs
+++ b/ComplexProperties/Recurrence/Patterns/Recurrence.MonthlyRegenerationPattern.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Recurrence.MonthlyRegenerationPattern class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeMonthlyPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeMonthlyPattern.cs
index 64748693..fe90ae81 100644
--- a/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeMonthlyPattern.cs
+++ b/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeMonthlyPattern.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Recurrence.RelativeMonthlyPattern class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -82,21 +97,6 @@ internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer)
this.DayOfTheWeekIndex);
}
- ///
- /// Patterns to json.
- ///
- /// The service.
- ///
- internal override JsonObject PatternToJson(ExchangeService service)
- {
- JsonObject jsonPattern = base.PatternToJson(service);
-
- jsonPattern.Add(XmlElementNames.DaysOfWeek, this.DayOfTheWeek);
- jsonPattern.Add(XmlElementNames.DayOfWeekIndex, this.DayOfTheWeekIndex);
-
- return jsonPattern;
- }
-
///
/// Tries to read element from XML.
///
@@ -124,31 +124,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.LoadFromJson(jsonProperty, service);
-
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.DaysOfWeek:
- this.dayOfTheWeek = jsonProperty.ReadEnumValue(key);
- break;
- case XmlElementNames.DayOfWeekIndex:
- this.dayOfTheWeekIndex = jsonProperty.ReadEnumValue(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Validates this instance.
///
@@ -167,6 +142,20 @@ internal override void InternalValidate()
}
}
+ ///
+ /// Checks if two recurrence objects are identical.
+ ///
+ /// The recurrence to compare this one to.
+ /// true if the two recurrences are identical, false otherwise.
+ public override bool IsSame(Recurrence otherRecurrence)
+ {
+ RelativeMonthlyPattern otherRelativeMonthlyPattern = (RelativeMonthlyPattern)otherRecurrence;
+
+ return base.IsSame(otherRecurrence) &&
+ this.dayOfTheWeek == otherRelativeMonthlyPattern.dayOfTheWeek &&
+ this.dayOfTheWeekIndex == otherRelativeMonthlyPattern.dayOfTheWeekIndex;
+ }
+
///
/// Gets or sets the relative position of the day specified in DayOfTheWeek within the month.
///
diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeYearlyPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeYearlyPattern.cs
index 39b335fc..ea7d61b3 100644
--- a/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeYearlyPattern.cs
+++ b/ComplexProperties/Recurrence/Patterns/Recurrence.RelativeYearlyPattern.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Recurrence.RelativeYearlyPattern class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -61,24 +76,6 @@ internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer)
this.Month);
}
- ///
- /// Patterns to json.
- ///
- /// The service.
- ///
- internal override JsonObject PatternToJson(ExchangeService service)
- {
- JsonObject jsonPattern = new JsonObject();
-
- jsonPattern.AddTypeParameter(this.XmlElementName);
-
- jsonPattern.Add(XmlElementNames.DaysOfWeek, this.DayOfTheWeek);
- jsonPattern.Add(XmlElementNames.DayOfWeekIndex, this.DayOfTheWeekIndex);
- jsonPattern.Add(XmlElementNames.Month, this.Month);
-
- return jsonPattern;
- }
-
///
/// Tries to read element from XML.
///
@@ -109,34 +106,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.LoadFromJson(jsonProperty, service);
-
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.DaysOfWeek:
- this.dayOfTheWeek = jsonProperty.ReadEnumValue(key);
- break;
- case XmlElementNames.DayOfWeekIndex:
- this.dayOfTheWeekIndex = jsonProperty.ReadEnumValue(key);
- break;
- case XmlElementNames.Month:
- this.month = jsonProperty.ReadEnumValue(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Initializes a new instance of the class.
///
@@ -187,6 +156,21 @@ internal override void InternalValidate()
}
}
+ ///
+ /// Checks if two recurrence objects are identical.
+ ///
+ /// The recurrence to compare this one to.
+ /// true if the two recurrences are identical, false otherwise.
+ public override bool IsSame(Recurrence otherRecurrence)
+ {
+ RelativeYearlyPattern otherYearlyPattern = (RelativeYearlyPattern)otherRecurrence;
+
+ return base.IsSame(otherRecurrence) &&
+ this.dayOfTheWeek == otherYearlyPattern.dayOfTheWeek &&
+ this.dayOfTheWeekIndex == otherYearlyPattern.dayOfTheWeekIndex &&
+ this.month == otherYearlyPattern.month;
+ }
+
///
/// Gets or sets the relative position of the day specified in DayOfTheWeek within the month.
///
diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyPattern.cs
index 21ffbeb9..05cb123e 100644
--- a/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyPattern.cs
+++ b/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyPattern.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Recurrence.WeeklyPattern class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -96,35 +111,6 @@ internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Patterns to json.
- ///
- /// The service.
- ///
- internal override JsonObject PatternToJson(ExchangeService service)
- {
- JsonObject jsonPattern = base.PatternToJson(service);
-
- jsonPattern.Add(XmlElementNames.DayOfWeek, this.DaysOfTheWeek.InternalToJson(service));
-
- if (this.firstDayOfWeek.HasValue)
- {
- // We only allow the "FirstDayOfWeek" parameter for the Exchange2010_SP1 schema
- // version.
- //
- EwsUtilities.ValidatePropertyVersion(
- service,
- ExchangeVersion.Exchange2010_SP1,
- "FirstDayOfWeek");
-
- jsonPattern.Add(
- XmlElementNames.FirstDayOfWeek,
- this.firstDayOfWeek.Value);
- }
-
- return jsonPattern;
- }
-
///
/// Tries to read element from XML.
///
@@ -155,41 +141,30 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
///
- /// Loads from json.
+ /// Validates this instance.
///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
+ internal override void InternalValidate()
{
- base.LoadFromJson(jsonProperty, service);
+ base.InternalValidate();
- foreach (string key in jsonProperty.Keys)
+ if (this.DaysOfTheWeek.Count == 0)
{
- switch (key)
- {
- case XmlElementNames.DaysOfWeek:
- this.DaysOfTheWeek.LoadFromJsonValue(jsonProperty.ReadAsString(key));
- break;
- case XmlElementNames.FirstDayOfWeek:
- this.FirstDayOfWeek = jsonProperty.ReadEnumValue(key);
- break;
- default:
- break;
- }
+ throw new ServiceValidationException(Strings.DaysOfTheWeekNotSpecified);
}
}
///
- /// Validates this instance.
+ /// Checks if two recurrence objects are identical.
///
- internal override void InternalValidate()
+ /// The recurrence to compare this one to.
+ /// true if the two recurrences are identical, false otherwise.
+ public override bool IsSame(Recurrence otherRecurrence)
{
- base.InternalValidate();
+ WeeklyPattern otherWeeklyPattern = (WeeklyPattern)otherRecurrence;
- if (this.DaysOfTheWeek.Count == 0)
- {
- throw new ServiceValidationException(Strings.DaysOfTheWeekNotSpecified);
- }
+ return base.IsSame(otherRecurrence) &&
+ this.daysOfTheWeek.ToString(",") == otherWeeklyPattern.daysOfTheWeek.ToString(",") &&
+ this.firstDayOfWeek == otherWeeklyPattern.firstDayOfWeek;
}
///
diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyRegenerationPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyRegenerationPattern.cs
index 4cbf6d8c..afe2d281 100644
--- a/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyRegenerationPattern.cs
+++ b/ComplexProperties/Recurrence/Patterns/Recurrence.WeeklyRegenerationPattern.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Recurrence.WeeklyRegenerationPattern class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyPattern.cs
index 431fc923..9aa1e84d 100644
--- a/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyPattern.cs
+++ b/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyPattern.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Recurrence.YearlyPattern class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -79,22 +94,6 @@ internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer)
this.Month);
}
- ///
- /// Patterns to json.
- ///
- /// The service.
- ///
- internal override JsonObject PatternToJson(ExchangeService service)
- {
- JsonObject jsonPattern = new JsonObject();
-
- jsonPattern.AddTypeParameter(this.XmlElementName);
- jsonPattern.Add(XmlElementNames.DayOfMonth, this.DayOfMonth);
- jsonPattern.Add(XmlElementNames.Month, this.Month);
-
- return jsonPattern;
- }
-
///
/// Tries to read element from XML.
///
@@ -122,31 +121,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.LoadFromJson(jsonProperty, service);
-
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.DayOfMonth:
- this.dayOfMonth = jsonProperty.ReadAsInt(key);
- break;
- case XmlElementNames.Month:
- this.month = jsonProperty.ReadEnumValue(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Validates this instance.
///
@@ -165,6 +139,20 @@ internal override void InternalValidate()
}
}
+ ///
+ /// Checks if two recurrence objects are identical.
+ ///
+ /// The recurrence to compare this one to.
+ /// true if the two recurrences are identical, false otherwise.
+ public override bool IsSame(Recurrence otherRecurrence)
+ {
+ YearlyPattern otherYearlyPattern = (YearlyPattern)otherRecurrence;
+
+ return base.IsSame(otherRecurrence) &&
+ this.month == otherYearlyPattern.month &&
+ this.dayOfMonth == otherYearlyPattern.dayOfMonth;
+ }
+
///
/// Gets or sets the month of the year when each occurrence happens.
///
diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyRegenerationPattern.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyRegenerationPattern.cs
index 169f1dc5..ea39ebe7 100644
--- a/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyRegenerationPattern.cs
+++ b/ComplexProperties/Recurrence/Patterns/Recurrence.YearlyRegenerationPattern.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Recurrence.YearlyRegenerationPatternclass.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
diff --git a/ComplexProperties/Recurrence/Patterns/Recurrence.cs b/ComplexProperties/Recurrence/Patterns/Recurrence.cs
index f5f74128..a2c2162b 100644
--- a/ComplexProperties/Recurrence/Patterns/Recurrence.cs
+++ b/ComplexProperties/Recurrence/Patterns/Recurrence.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Recurrence class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -96,65 +111,6 @@ internal override sealed void WriteElementsToXml(EwsServiceXmlWriter writer)
range.WriteToXml(writer, range.XmlElementName);
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(JsonNames.RecurrencePattern, this.PatternToJson(service));
- jsonProperty.Add(JsonNames.RecurrenceRange, this.RangeToJson(service));
-
- return jsonProperty;
- }
-
- ///
- /// Ranges to json.
- ///
- /// The service.
- ///
- private object RangeToJson(ExchangeService service)
- {
- RecurrenceRange range;
-
- if (!this.HasEnd)
- {
- range = new NoEndRecurrenceRange(this.StartDate);
- }
- else if (this.NumberOfOccurrences.HasValue)
- {
- range = new NumberedRecurrenceRange(this.StartDate, this.NumberOfOccurrences);
- }
- else
- {
- range = new EndDateRecurrenceRange(this.StartDate, this.EndDate.Value);
- }
-
- return range.InternalToJson(service);
- }
-
- ///
- /// Patterns to json.
- ///
- /// The service.
- ///
- internal abstract JsonObject PatternToJson(ExchangeService service);
-
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.LoadFromJson(jsonProperty, service);
- }
-
///
/// Gets a property value or throw if null.
///
@@ -253,42 +209,23 @@ public DateTime? EndDate
this.numberOfOccurrences = null;
}
}
-
+
///
- /// Compares two objects by converting them to JSON and comparing their string values
+ /// Checks if two recurrence objects are identical.
///
- /// object to compare to
- /// true if the objects serialize to the same string
- public bool IsSame(Recurrence otherRecurrence)
+ /// The recurrence to compare this one to.
+ /// true if the two recurrences are identical, false otherwise.
+ public virtual bool IsSame(Recurrence otherRecurrence)
{
if (otherRecurrence == null)
{
return false;
}
- string jsonString;
- using (MemoryStream memoryStream = new MemoryStream())
- {
- ((JsonObject)this.InternalToJson(null)).SerializeToJson(memoryStream);
- memoryStream.Position = 0;
- using (StreamReader reader = new StreamReader(memoryStream))
- {
- jsonString = reader.ReadToEnd();
- }
- }
-
- string otherJsonString;
- using (MemoryStream memoryStream = new MemoryStream())
- {
- ((JsonObject)otherRecurrence.InternalToJson(null)).SerializeToJson(memoryStream);
- memoryStream.Position = 0;
- using (StreamReader reader = new StreamReader(memoryStream))
- {
- otherJsonString = reader.ReadToEnd();
- }
- }
-
- return String.Equals(jsonString, otherJsonString, StringComparison.Ordinal);
+ return (this.GetType() == otherRecurrence.GetType() &&
+ this.numberOfOccurrences == otherRecurrence.numberOfOccurrences &&
+ this.endDate == otherRecurrence.endDate &&
+ this.startDate == otherRecurrence.startDate);
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Recurrence/Ranges/EndDateRecurrenceRange.cs b/ComplexProperties/Recurrence/Ranges/EndDateRecurrenceRange.cs
index 367300d0..44090bdd 100644
--- a/ComplexProperties/Recurrence/Ranges/EndDateRecurrenceRange.cs
+++ b/ComplexProperties/Recurrence/Ranges/EndDateRecurrenceRange.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EndDateRecurrenceRange class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -74,18 +89,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
EwsUtilities.DateTimeToXSDate(this.EndDate));
}
- ///
- /// Adds the properties to json.
- ///
- /// The json property.
- /// The service.
- internal override void AddPropertiesToJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.AddPropertiesToJson(jsonProperty, service);
-
- jsonProperty.Add(XmlElementNames.EndDate, EwsUtilities.DateTimeToXSDate(this.EndDate));
- }
-
///
/// Tries to read element from XML.
///
@@ -110,28 +113,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.LoadFromJson(jsonProperty, service);
-
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.EndDate:
- this.endDate = service.ConvertStartDateToUnspecifiedDateTime(jsonProperty.ReadAsString(key)).Value;
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets or sets the end date.
///
@@ -142,4 +123,4 @@ public DateTime EndDate
set { this.SetFieldValue(ref this.endDate, value); }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Recurrence/Ranges/NoEndRecurrenceRange.cs b/ComplexProperties/Recurrence/Ranges/NoEndRecurrenceRange.cs
index 377dd198..61d9d34b 100644
--- a/ComplexProperties/Recurrence/Ranges/NoEndRecurrenceRange.cs
+++ b/ComplexProperties/Recurrence/Ranges/NoEndRecurrenceRange.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the NoEndRecurrenceRange class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -56,4 +71,4 @@ internal override void SetupRecurrence(Recurrence recurrence)
recurrence.NeverEnds();
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Recurrence/Ranges/NumberedRecurrenceRange.cs b/ComplexProperties/Recurrence/Ranges/NumberedRecurrenceRange.cs
index ff37c7e4..439100a5 100644
--- a/ComplexProperties/Recurrence/Ranges/NumberedRecurrenceRange.cs
+++ b/ComplexProperties/Recurrence/Ranges/NumberedRecurrenceRange.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the NumberedRecurrenceRange class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -74,18 +89,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Adds the properties to json.
- ///
- /// The json property.
- /// The service.
- internal override void AddPropertiesToJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.AddPropertiesToJson(jsonProperty, service);
-
- jsonProperty.Add(XmlElementNames.NumberOfOccurrences, this.NumberOfOccurrences);
- }
-
///
/// Tries to read element from XML.
///
@@ -110,28 +113,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.LoadFromJson(jsonProperty, service);
-
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.NumberOfOccurrences:
- this.numberOfOccurrences = jsonProperty.ReadAsInt(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets or sets the number of occurrences.
///
@@ -149,4 +130,4 @@ public int? NumberOfOccurrences
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Recurrence/Ranges/RecurrenceRange.cs b/ComplexProperties/Recurrence/Ranges/RecurrenceRange.cs
index c180f830..1798c2c8 100644
--- a/ComplexProperties/Recurrence/Ranges/RecurrenceRange.cs
+++ b/ComplexProperties/Recurrence/Ranges/RecurrenceRange.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the RecurrenceRange class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -72,33 +87,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
EwsUtilities.DateTimeToXSDate(this.StartDate));
}
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- this.AddPropertiesToJson(jsonProperty, service);
-
- return jsonProperty;
- }
-
- ///
- /// Adds the properties to json.
- ///
- /// The json property.
- /// The service.
- internal virtual void AddPropertiesToJson(JsonObject jsonProperty, ExchangeService service)
- {
- jsonProperty.AddTypeParameter(this.XmlElementName);
- jsonProperty.Add(XmlElementNames.StartDate, EwsUtilities.DateTimeToXSDate(this.StartDate));
- }
-
///
/// Tries to read element from XML.
///
@@ -124,33 +112,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.LoadFromJson(jsonProperty, service);
-
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.StartDate:
-
- DateTime? startDate = service.ConvertStartDateToUnspecifiedDateTime(jsonProperty.ReadAsString(key));
- if (startDate.HasValue)
- {
- this.startDate = startDate.Value;
- }
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets the name of the XML element.
///
@@ -177,4 +138,4 @@ internal DateTime StartDate
set { this.SetFieldValue(ref this.startDate, value); }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/RecurringAppointmentMasterId.cs b/ComplexProperties/RecurringAppointmentMasterId.cs
index d809d2f3..e8aae298 100644
--- a/ComplexProperties/RecurringAppointmentMasterId.cs
+++ b/ComplexProperties/RecurringAppointmentMasterId.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the RecurringAppointmentMasterId class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -42,23 +57,5 @@ internal override void WriteAttributesToXml(EwsServiceXmlWriter writer)
writer.WriteAttributeValue(XmlAttributeNames.OccurrenceId, this.UniqueId);
writer.WriteAttributeValue(XmlAttributeNames.ChangeKey, this.ChangeKey);
}
-
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.AddTypeParameter(this.GetXmlElementName());
- jsonProperty.Add(XmlAttributeNames.OccurrenceId, this.UniqueId);
- jsonProperty.Add(XmlAttributeNames.ChangeKey, this.ChangeKey);
-
- return jsonProperty;
- }
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ReferenceAttachment.cs b/ComplexProperties/ReferenceAttachment.cs
new file mode 100644
index 00000000..212c520e
--- /dev/null
+++ b/ComplexProperties/ReferenceAttachment.cs
@@ -0,0 +1,242 @@
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+namespace Microsoft.Exchange.WebServices.Data
+{
+ using System;
+ using System.Collections.Generic;
+ using System.IO;
+ using System.Text;
+
+ ///
+ /// Represents an attachment by reference.
+ ///
+ public sealed class ReferenceAttachment : Attachment
+ {
+ ///
+ /// The AttachLongPathName of the attachment.
+ ///
+ private string attachLongPathName;
+
+ ///
+ /// The ProviderType of the attachment.
+ ///
+ private string providerType;
+
+ ///
+ /// The ProviderEndpointUrl of the attachment.
+ ///
+ private string providerEndpointUrl;
+
+ ///
+ /// The AttachmentThumbnailUrl of the attachment.
+ ///
+ private string attachmentThumbnailUrl;
+
+ ///
+ /// The AttachmentPreviewUrl of the attachment.
+ ///
+ private string attachmentPreviewUrl;
+
+ ///
+ /// The PermissionType of the attachment.
+ ///
+ private int permissionType;
+
+ ///
+ /// The AttachmentIsFolder of the attachment.
+ ///
+ private bool attachmentIsFolder;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The owner.
+ internal ReferenceAttachment(Item owner)
+ : base(owner)
+ {
+ EwsUtilities.ValidateClassVersion(
+ this.Owner.Service,
+ ExchangeVersion.Exchange2015,
+ this.GetType().Name);
+ }
+
+ ///
+ /// Gets the name of the XML element.
+ ///
+ /// XML element name.
+ internal override string GetXmlElementName()
+ {
+ return XmlElementNames.ReferenceAttachment;
+ }
+
+ ///
+ /// Tries to read element from XML.
+ ///
+ /// The reader.
+ /// True if element was read.
+ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
+ {
+ bool result = base.TryReadElementFromXml(reader);
+
+ if (!result)
+ {
+ if (reader.LocalName == XmlElementNames.AttachLongPathName)
+ {
+ this.attachLongPathName = reader.ReadElementValue();
+ return true;
+ }
+
+ if (reader.LocalName == XmlElementNames.ProviderType)
+ {
+ this.providerType = reader.ReadElementValue();
+ return true;
+ }
+
+ if (reader.LocalName == XmlElementNames.ProviderEndpointUrl)
+ {
+ this.providerEndpointUrl = reader.ReadElementValue();
+ return true;
+ }
+
+ if (reader.LocalName == XmlElementNames.AttachmentThumbnailUrl)
+ {
+ this.attachmentThumbnailUrl = reader.ReadElementValue();
+ return true;
+ }
+
+ if (reader.LocalName == XmlElementNames.AttachmentPreviewUrl)
+ {
+ this.attachmentPreviewUrl = reader.ReadElementValue();
+ return true;
+ }
+
+ if (reader.LocalName == XmlElementNames.PermissionType)
+ {
+ this.permissionType = reader.ReadElementValue();
+ return true;
+ }
+
+ if (reader.LocalName == XmlElementNames.AttachmentIsFolder)
+ {
+ this.attachmentIsFolder = reader.ReadElementValue();
+ return true;
+ }
+ }
+
+ return result;
+ }
+
+ ///
+ /// For ReferenceAttachment, the only thing need to patch is the AttachmentId.
+ ///
+ /// The reader.
+ /// True if element was read.
+ internal override bool TryReadElementFromXmlToPatch(EwsServiceXmlReader reader)
+ {
+ return base.TryReadElementFromXml(reader);
+ }
+
+ ///
+ /// Writes elements and content to XML.
+ ///
+ /// The writer.
+ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
+ {
+ base.WriteElementsToXml(writer);
+
+ writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.AttachLongPathName, this.AttachLongPathName);
+ writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.ProviderType, this.ProviderType);
+ writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.ProviderEndpointUrl, this.ProviderEndpointUrl);
+ writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.AttachmentThumbnailUrl, this.AttachmentThumbnailUrl);
+ writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.AttachmentPreviewUrl, this.AttachmentPreviewUrl);
+ writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.PermissionType, this.PermissionType);
+ writer.WriteElementValue(XmlNamespace.Types, XmlElementNames.AttachmentIsFolder, this.AttachmentIsFolder);
+ }
+
+ ///
+ /// Gets or sets a fully-qualified path identifying the attachment.
+ ///
+ public string AttachLongPathName
+ {
+ get { return this.attachLongPathName; }
+ set { this.SetFieldValue(ref this.attachLongPathName, value); }
+ }
+
+ ///
+ /// Gets or sets the type of the attachment provider.
+ ///
+ public string ProviderType
+ {
+ get { return this.providerType; }
+ set { this.SetFieldValue(ref this.providerType, value); }
+ }
+
+ ///
+ /// Gets or sets the URL of the attachment provider.
+ ///
+ public string ProviderEndpointUrl
+ {
+ get { return this.providerEndpointUrl; }
+ set { this.SetFieldValue(ref this.providerEndpointUrl, value); }
+ }
+
+ ///
+ /// Gets or sets the URL of the attachment thumbnail.
+ ///
+ public string AttachmentThumbnailUrl
+ {
+ get { return this.attachmentThumbnailUrl; }
+ set { this.SetFieldValue(ref this.attachmentThumbnailUrl, value); }
+ }
+
+ ///
+ /// Gets or sets the URL of the attachment preview.
+ ///
+ public string AttachmentPreviewUrl
+ {
+ get { return this.attachmentPreviewUrl; }
+ set { this.SetFieldValue(ref this.attachmentPreviewUrl, value); }
+ }
+
+ ///
+ /// Gets or sets the permission of the attachment.
+ ///
+ public int PermissionType
+ {
+ get { return this.permissionType; }
+ set { this.SetFieldValue(ref this.permissionType, value); }
+ }
+
+ ///
+ /// Gets or sets a value indicating whether the attachment points to a folder.
+ ///
+ public bool AttachmentIsFolder
+ {
+ get { return this.attachmentIsFolder; }
+ set { this.SetFieldValue(ref this.attachmentIsFolder, value); }
+ }
+ }
+}
diff --git a/ComplexProperties/RetentionTagBase.cs b/ComplexProperties/RetentionTagBase.cs
index a46d6075..b4bb93f6 100644
--- a/ComplexProperties/RetentionTagBase.cs
+++ b/ComplexProperties/RetentionTagBase.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the RetentionTagBase class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -78,29 +93,6 @@ internal override void ReadTextValueFromXml(EwsServiceXmlReader reader)
this.retentionId = new Guid(reader.ReadValue());
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlAttributeNames.IsExplicit:
- this.isExplicit = jsonProperty.ReadAsBool(key);
- break;
- case JsonObject.JsonValueString:
- this.retentionId = new Guid(jsonProperty.ReadAsString(key));
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes attributes to XML.
///
@@ -116,33 +108,12 @@ internal override void WriteAttributesToXml(EwsServiceXmlWriter writer)
/// The writer.
internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
{
- if (this.retentionId != null && this.retentionId != Guid.Empty)
+ if (this.retentionId != Guid.Empty)
{
writer.WriteValue(this.retentionId.ToString(), this.xmlElementName);
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlAttributeNames.IsExplicit, this.isExplicit);
-
- if (this.retentionId != null && this.retentionId != Guid.Empty)
- {
- jsonProperty.Add(JsonObject.JsonValueString, this.retentionId);
- }
-
- return jsonProperty;
- }
-
#region Object method overrides
///
@@ -153,7 +124,7 @@ internal override object InternalToJson(ExchangeService service)
///
public override string ToString()
{
- if (this.retentionId == null || this.retentionId == Guid.Empty)
+ if (this.retentionId == Guid.Empty)
{
return string.Empty;
}
@@ -165,4 +136,4 @@ public override string ToString()
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/Rule.cs b/ComplexProperties/Rule.cs
index 74c71d8a..3b69333d 100644
--- a/ComplexProperties/Rule.cs
+++ b/ComplexProperties/Rule.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the Rule class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -247,50 +262,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.DisplayName:
- this.displayName = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.RuleId:
- this.ruleId = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.Priority:
- this.priority = jsonProperty.ReadAsInt(key);
- break;
- case XmlElementNames.IsEnabled:
- this.isEnabled = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.IsNotSupported:
- this.isNotSupported = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.IsInError:
- this.isInError = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.Conditions:
- this.conditions.LoadFromJson(jsonProperty, service);
- break;
- case XmlElementNames.Actions:
- this.actions.LoadFromJson(jsonProperty, service);
- break;
- case XmlElementNames.Exceptions:
- this.exceptions.LoadFromJson(jsonProperty, service);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes elements to XML.
///
@@ -326,34 +297,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
this.Actions.WriteToXml(writer, XmlElementNames.Actions);
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- if (!string.IsNullOrEmpty(this.Id))
- {
- jsonProperty.Add(XmlElementNames.RuleId, this.Id);
- }
-
- jsonProperty.Add(XmlElementNames.DisplayName, this.DisplayName);
- jsonProperty.Add(XmlElementNames.Priority, this.Priority);
- jsonProperty.Add(XmlElementNames.IsEnabled, this.IsEnabled);
- jsonProperty.Add(XmlElementNames.IsInError, this.IsInError);
-
- jsonProperty.Add(XmlElementNames.Conditions, this.Conditions.InternalToJson(service));
- jsonProperty.Add(XmlElementNames.Exceptions, this.Exceptions.InternalToJson(service));
- jsonProperty.Add(XmlElementNames.Actions, this.Actions.InternalToJson(service));
-
- return jsonProperty;
- }
-
///
/// Validates this instance.
///
@@ -366,4 +309,4 @@ internal override void InternalValidate()
EwsUtilities.ValidateParam(this.actions, "Actions");
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/RuleActions.cs b/ComplexProperties/RuleActions.cs
index b311882b..5a2b6a7a 100644
--- a/ComplexProperties/RuleActions.cs
+++ b/ComplexProperties/RuleActions.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the RuleActions class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -368,71 +383,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.AssignCategories:
- this.assignCategories.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- case XmlElementNames.CopyToFolder:
- this.copyToFolder = new FolderId();
- this.copyToFolder.LoadFromJson(
- jsonProperty.ReadAsJsonObject(key),
- service);
- break;
- case XmlElementNames.Delete:
- this.delete = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.ForwardAsAttachmentToRecipients:
- this.forwardAsAttachmentToRecipients.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- case XmlElementNames.ForwardToRecipients:
- this.forwardToRecipients.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- case XmlElementNames.MarkImportance:
- this.markImportance = jsonProperty.ReadEnumValue(key);
- break;
- case XmlElementNames.MarkAsRead:
- this.markAsRead = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.MoveToFolder:
- this.moveToFolder = new FolderId();
- this.moveToFolder.LoadFromJson(
- jsonProperty.ReadAsJsonObject(key),
- service);
- break;
- case XmlElementNames.PermanentDelete:
- this.permanentDelete = jsonProperty.ReadAsBool(key);
- break;
- case XmlElementNames.RedirectToRecipients:
- this.redirectToRecipients.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- case XmlElementNames.SendSMSAlertToRecipients:
- EmailAddressCollection smsRecipientCollection = new EmailAddressCollection(XmlElementNames.Address);
- smsRecipientCollection.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- this.sendSMSAlertToRecipients = ConvertSMSRecipientsFromEmailAddressCollectionToMobilePhoneCollection(smsRecipientCollection);
- break;
- case XmlElementNames.ServerReplyWithMessage:
- this.serverReplyWithMessage = new ItemId();
- this.serverReplyWithMessage.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- case XmlElementNames.StopProcessingRules:
- this.stopProcessingRules = jsonProperty.ReadAsBool(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes elements to XML.
///
@@ -525,86 +475,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- if (this.AssignCategories.Count > 0)
- {
- jsonProperty.Add(XmlElementNames.AssignCategories, this.AssignCategories.InternalToJson(service));
- }
-
- if (this.CopyToFolder != null)
- {
- jsonProperty.Add(XmlElementNames.CopyToFolder, this.CopyToFolder.InternalToJson(service));
- }
-
- if (this.Delete != false)
- {
- jsonProperty.Add(XmlElementNames.Delete, this.Delete);
- }
-
- if (this.ForwardAsAttachmentToRecipients.Count > 0)
- {
- jsonProperty.Add(XmlElementNames.ForwardAsAttachmentToRecipients, this.ForwardAsAttachmentToRecipients.InternalToJson(service));
- }
-
- if (this.ForwardToRecipients.Count > 0)
- {
- jsonProperty.Add(XmlElementNames.ForwardToRecipients, this.ForwardToRecipients.InternalToJson(service));
- }
-
- if (this.MarkImportance.HasValue)
- {
- jsonProperty.Add(XmlElementNames.MarkImportance, this.MarkImportance.Value);
- }
-
- if (this.MarkAsRead != false)
- {
- jsonProperty.Add(XmlElementNames.MarkAsRead, this.MarkAsRead);
- }
-
- if (this.MoveToFolder != null)
- {
- jsonProperty.Add(XmlElementNames.MoveToFolder, this.MoveToFolder.InternalToJson(service));
- }
-
- if (this.PermanentDelete != false)
- {
- jsonProperty.Add(XmlElementNames.PermanentDelete, this.PermanentDelete);
- }
-
- if (this.RedirectToRecipients.Count > 0)
- {
- jsonProperty.Add(XmlElementNames.RedirectToRecipients, this.RedirectToRecipients.InternalToJson(service));
- }
-
- if (this.SendSMSAlertToRecipients.Count > 0)
- {
- EmailAddressCollection emailCollection = ConvertSMSRecipientsFromMobilePhoneCollectionToEmailAddressCollection(this.SendSMSAlertToRecipients);
- jsonProperty.Add(XmlElementNames.SendSMSAlertToRecipients, emailCollection.InternalToJson(service));
- }
-
- if (this.ServerReplyWithMessage != null)
- {
- jsonProperty.Add(XmlElementNames.ServerReplyWithMessage, this.ServerReplyWithMessage.InternalToJson(service));
- }
-
- if (this.StopProcessingRules != false)
- {
- jsonProperty.Add(XmlElementNames.StopProcessingRules, this.StopProcessingRules);
- }
-
- return jsonProperty;
- }
-
///
/// Validates this instance.
///
@@ -656,4 +526,4 @@ private static EmailAddressCollection ConvertSMSRecipientsFromMobilePhoneCollect
return emailCollection;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/RuleCollection.cs b/ComplexProperties/RuleCollection.cs
index f3bda1e9..c69cbd1f 100644
--- a/ComplexProperties/RuleCollection.cs
+++ b/ComplexProperties/RuleCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Implements a rule collection.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -18,7 +33,7 @@ namespace Microsoft.Exchange.WebServices.Data
///
/// Represents a collection of rules.
///
- public sealed class RuleCollection : ComplexProperty, IEnumerable, IJsonCollectionDeserializer
+ public sealed class RuleCollection : ComplexProperty, IEnumerable
{
///
/// The OutlookRuleBlobExists flag.
@@ -106,35 +121,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json collection.
- ///
- /// The json collection.
- /// The service.
- void IJsonCollectionDeserializer.CreateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- foreach (object entry in jsonCollection)
- {
- JsonObject jsonEntry = entry as JsonObject;
- if (jsonEntry != null)
- {
- Rule rule = new Rule();
- rule.LoadFromJson(jsonEntry, service);
- this.rules.Add(rule);
- }
- }
- }
-
- ///
- /// Loads from json collection to update the existing collection element.
- ///
- /// The json collection.
- /// The service.
- void IJsonCollectionDeserializer.UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- throw new NotImplementedException();
- }
-
#region IEnumerable Interface
///
/// Get an enumerator for the collection
@@ -155,4 +141,4 @@ public IEnumerator GetEnumerator()
}
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/RuleError.cs b/ComplexProperties/RuleError.cs
index 9a771a4d..2c2d52ca 100644
--- a/ComplexProperties/RuleError.cs
+++ b/ComplexProperties/RuleError.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the RuleError class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -112,33 +127,5 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
return false;
}
}
-
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- if (jsonProperty.ContainsKey(XmlElementNames.FieldURI))
- {
- this.ruleProperty = jsonProperty.ReadEnumValue(XmlElementNames.FieldURI);
- }
-
- if (jsonProperty.ContainsKey(XmlElementNames.ErrorCode))
- {
- this.errorCode = jsonProperty.ReadEnumValue(XmlElementNames.ErrorCode);
- }
-
- if (jsonProperty.ContainsKey(XmlElementNames.ErrorMessage))
- {
- this.errorMessage = jsonProperty.ReadAsString(XmlElementNames.ErrorMessage);
- }
-
- if (jsonProperty.ContainsKey(XmlElementNames.FieldValue))
- {
- this.value = jsonProperty.ReadAsString(XmlElementNames.FieldValue);
- }
- }
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/RuleErrorCollection.cs b/ComplexProperties/RuleErrorCollection.cs
index 239f3e69..76d3d304 100644
--- a/ComplexProperties/RuleErrorCollection.cs
+++ b/ComplexProperties/RuleErrorCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Implements a RuleErrorCollection collection.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -40,15 +55,6 @@ internal override RuleError CreateComplexProperty(string xmlElementName)
}
}
- ///
- /// Creates the default complex property.
- ///
- /// A RuleError object.
- internal override RuleError CreateDefaultComplexProperty()
- {
- return new RuleError();
- }
-
///
/// Retrieves the XML element name corresponding to the provided RuleError object.
///
@@ -59,4 +65,4 @@ internal override string GetCollectionItemXmlElementName(RuleError ruleValidatio
return XmlElementNames.Error;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/RuleOperation.cs b/ComplexProperties/RuleOperation.cs
index 82cb1d09..72eadaca 100644
--- a/ComplexProperties/RuleOperation.cs
+++ b/ComplexProperties/RuleOperation.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the RuleOperation class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -31,4 +46,4 @@ internal abstract string XmlElementName
get;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/RuleOperationError.cs b/ComplexProperties/RuleOperationError.cs
index 362f77dc..6cebe226 100644
--- a/ComplexProperties/RuleOperationError.cs
+++ b/ComplexProperties/RuleOperationError.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the RuleOperationError class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -96,25 +111,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- if (jsonProperty.ContainsKey(XmlElementNames.OperationIndex))
- {
- this.operationIndex = jsonProperty.ReadAsInt(XmlElementNames.OperationIndex);
- }
-
- if (jsonProperty.ContainsKey(XmlElementNames.ValidationErrors))
- {
- this.ruleErrors = new RuleErrorCollection();
- (this.ruleErrors as IJsonCollectionDeserializer).CreateFromJsonCollection(jsonProperty.ReadAsArray(XmlElementNames.ValidationErrors), service);
- }
- }
-
///
/// Set operation property by the index of a given opeation enumerator.
///
@@ -155,4 +151,4 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/RuleOperationErrorCollection.cs b/ComplexProperties/RuleOperationErrorCollection.cs
index 004b9011..fc9b3dcd 100644
--- a/ComplexProperties/RuleOperationErrorCollection.cs
+++ b/ComplexProperties/RuleOperationErrorCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Implements a RuleOperationErrorCollection collection.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -40,15 +55,6 @@ internal override RuleOperationError CreateComplexProperty(string xmlElementName
}
}
- ///
- /// Creates the default complex property.
- ///
- /// A RuleOperationError object.
- internal override RuleOperationError CreateDefaultComplexProperty()
- {
- return new RuleOperationError();
- }
-
///
/// Retrieves the XML element name corresponding to the provided RuleOperationError object.
///
@@ -59,4 +65,4 @@ internal override string GetCollectionItemXmlElementName(RuleOperationError oper
return XmlElementNames.RuleOperationError;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/RulePredicateDateRange.cs b/ComplexProperties/RulePredicateDateRange.cs
index ca462ed7..778c9e18 100644
--- a/ComplexProperties/RulePredicateDateRange.cs
+++ b/ComplexProperties/RulePredicateDateRange.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the RulePredicateDateRange class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -89,29 +104,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.StartDateTime:
- this.start = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key));
- break;
- case XmlElementNames.EndDateTime:
- this.end = service.ConvertUniversalDateTimeStringToLocalDateTime(jsonProperty.ReadAsString(key));
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes elements to XML.
///
@@ -128,29 +120,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- if (this.Start.HasValue)
- {
- jsonProperty.Add(XmlElementNames.StartDateTime, service.ConvertDateTimeToUniversalDateTimeString(this.Start.Value));
- }
- if (this.End.HasValue)
- {
- jsonProperty.Add(XmlElementNames.EndDateTime, service.ConvertDateTimeToUniversalDateTimeString(this.End.Value));
- }
-
- return jsonProperty;
- }
-
///
/// Validates this instance.
///
@@ -165,4 +134,4 @@ internal override void InternalValidate()
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/RulePredicateSizeRange.cs b/ComplexProperties/RulePredicateSizeRange.cs
index b36e83a0..f6399b4e 100644
--- a/ComplexProperties/RulePredicateSizeRange.cs
+++ b/ComplexProperties/RulePredicateSizeRange.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the RulePredicateSizeRange class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -87,29 +102,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.MinimumSize:
- this.minimumSize = jsonProperty.ReadAsInt(key);
- break;
- case XmlElementNames.MaximumSize:
- this.maximumSize = jsonProperty.ReadAsInt(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes elements to XML.
///
@@ -126,29 +118,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- if (this.MinimumSize.HasValue)
- {
- jsonProperty.Add(XmlElementNames.MinimumSize, this.MinimumSize.Value);
- }
- if (this.MaximumSize.HasValue)
- {
- jsonProperty.Add(XmlElementNames.MaximumSize, this.MaximumSize.Value);
- }
-
- return jsonProperty;
- }
-
///
/// Validates this instance.
///
@@ -163,4 +132,4 @@ internal override void InternalValidate()
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/RulePredicates.cs b/ComplexProperties/RulePredicates.cs
index 2eb5cd3d..c4825697 100644
--- a/ComplexProperties/RulePredicates.cs
+++ b/ComplexProperties/RulePredicates.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the RulePredicates class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -1101,4 +1116,4 @@ internal override void InternalValidate()
EwsUtilities.ValidateParam(this.withinSizeRange, "WithinSizeRange");
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/SearchFolderParameters.cs b/ComplexProperties/SearchFolderParameters.cs
index 76478587..0af93cbe 100644
--- a/ComplexProperties/SearchFolderParameters.cs
+++ b/ComplexProperties/SearchFolderParameters.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the SearchFolderParameters class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -68,34 +83,6 @@ internal override void ReadAttributesFromXml(EwsServiceXmlReader reader)
this.Traversal = reader.ReadAttributeValue(XmlAttributeNames.Traversal);
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.BaseFolderIds:
- this.RootFolderIds.InternalClear();
- ((IJsonCollectionDeserializer)this.RootFolderIds).CreateFromJsonCollection(jsonProperty.ReadAsArray(key), service);
- break;
- case XmlElementNames.Restriction:
- JsonObject restriction = jsonProperty.ReadAsJsonObject(key);
- this.searchFilter = SearchFilter.LoadSearchFilterFromJson(restriction.ReadAsJsonObject(XmlElementNames.Item), service);
- break;
- case XmlAttributeNames.Traversal:
- this.Traversal = jsonProperty.ReadEnumValue(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes the attributes to XML.
///
@@ -121,30 +108,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
this.RootFolderIds.WriteToXml(writer, XmlElementNames.BaseFolderIds);
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlAttributeNames.Traversal, this.Traversal);
- jsonProperty.Add(XmlElementNames.BaseFolderIds, this.RootFolderIds.InternalToJson(service));
-
- if (this.SearchFilter != null)
- {
- JsonObject restriction = new JsonObject();
- restriction.Add(XmlElementNames.Item, this.SearchFilter.InternalToJson(service));
- jsonProperty.Add(XmlElementNames.Restriction, restriction);
- }
-
- return jsonProperty;
- }
-
///
/// Validates this instance.
///
@@ -207,4 +170,4 @@ public SearchFilter SearchFilter
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/ServiceId.cs b/ComplexProperties/ServiceId.cs
index 90d259c0..ee3db44c 100644
--- a/ComplexProperties/ServiceId.cs
+++ b/ComplexProperties/ServiceId.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ServiceId class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -50,29 +65,6 @@ internal override void ReadAttributesFromXml(EwsServiceXmlReader reader)
this.changeKey = reader.ReadAttributeValue(XmlAttributeNames.ChangeKey);
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- ///
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlAttributeNames.Id:
- this.uniqueId = jsonProperty.ReadAsString(key);
- break;
- case XmlAttributeNames.ChangeKey:
- this.changeKey = jsonProperty.ReadAsString(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes attributes to XML.
///
@@ -83,39 +75,12 @@ internal override void WriteAttributesToXml(EwsServiceXmlWriter writer)
writer.WriteAttributeValue(XmlAttributeNames.ChangeKey, this.ChangeKey);
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.AddTypeParameter(this.GetJsonTypeName());
- jsonProperty.Add(XmlAttributeNames.Id, this.UniqueId);
- jsonProperty.Add(XmlAttributeNames.ChangeKey, this.ChangeKey);
-
- return jsonProperty;
- }
-
///
/// Gets the name of the XML element.
///
/// XML element name.
internal abstract string GetXmlElementName();
- ///
- /// Gets the name of the json type.
- ///
- ///
- internal virtual string GetJsonTypeName()
- {
- return this.GetXmlElementName();
- }
-
///
/// Writes to XML.
///
@@ -242,4 +207,4 @@ public override string ToString()
}
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/SetClientExtensionAction.cs b/ComplexProperties/SetClientExtensionAction.cs
index df07a87f..aab56d1a 100644
--- a/ComplexProperties/SetClientExtensionAction.cs
+++ b/ComplexProperties/SetClientExtensionAction.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the SetClientExtensionAction class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -65,4 +80,4 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/SetRuleOperation.cs b/ComplexProperties/SetRuleOperation.cs
index ee09c02c..18ab7c06 100644
--- a/ComplexProperties/SetRuleOperation.cs
+++ b/ComplexProperties/SetRuleOperation.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the SetRuleOperation class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -72,27 +87,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.Rule:
- this.rule = new Rule();
- this.rule.LoadFromJson(jsonProperty.ReadAsJsonObject(key), service);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes elements to XML.
///
@@ -102,22 +96,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
this.Rule.WriteToXml(writer, XmlElementNames.Rule);
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlElementNames.Rule, this.Rule.InternalToJson(service));
-
- return jsonProperty;
- }
-
///
/// Validates this instance.
///
@@ -137,4 +115,4 @@ internal override string XmlElementName
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/StringList.cs b/ComplexProperties/StringList.cs
index ef3f7fd4..f1f2c40a 100644
--- a/ComplexProperties/StringList.cs
+++ b/ComplexProperties/StringList.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the StringList class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -17,7 +32,7 @@ namespace Microsoft.Exchange.WebServices.Data
///
/// Represents a list of strings.
///
- public sealed class StringList : ComplexProperty, IEnumerable, IJsonCollectionDeserializer
+ public sealed class StringList : ComplexProperty, IEnumerable
{
private List items = new List();
private string itemXmlElementName = XmlElementNames.String;
@@ -66,29 +81,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json collection.
- ///
- /// The json collection.
- /// The service.
- void IJsonCollectionDeserializer.CreateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- foreach (object element in jsonCollection)
- {
- this.Add(element as string);
- }
- }
-
- ///
- /// Loads from json collection to update the existing collection element.
- ///
- /// The json collection.
- /// The service.
- void IJsonCollectionDeserializer.UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- throw new NotImplementedException();
- }
-
///
/// Writes elements to XML.
///
@@ -103,18 +95,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- return new List(this).ToArray();
- }
-
///
/// Adds a string to the list.
///
@@ -307,4 +287,4 @@ public override int GetHashCode()
return this.ToString().GetHashCode();
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/TaskSuggestion.cs b/ComplexProperties/TaskSuggestion.cs
index 9b2302b7..fc95f7d9 100644
--- a/ComplexProperties/TaskSuggestion.cs
+++ b/ComplexProperties/TaskSuggestion.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the TaskSuggestion class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -59,4 +74,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/TaskSuggestionCollection.cs b/ComplexProperties/TaskSuggestionCollection.cs
index 43fac02b..b109eb8b 100644
--- a/ComplexProperties/TaskSuggestionCollection.cs
+++ b/ComplexProperties/TaskSuggestionCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the TaskSuggestionCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -50,15 +65,6 @@ internal override TaskSuggestion CreateComplexProperty(string xmlElementName)
return new TaskSuggestion();
}
- ///
- /// Creates the default complex property.
- ///
- /// TaskSuggestion.
- internal override TaskSuggestion CreateDefaultComplexProperty()
- {
- return new TaskSuggestion();
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(TaskSuggestion complexP
return XmlElementNames.NlgTaskSuggestion;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/TextBody.cs b/ComplexProperties/TextBody.cs
index bf6e5173..7f5d8879 100644
--- a/ComplexProperties/TextBody.cs
+++ b/ComplexProperties/TextBody.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the TextBody class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -41,4 +56,4 @@ public static implicit operator TextBody(string textBody)
return new TextBody(textBody);
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/TimeChange.cs b/ComplexProperties/TimeChange.cs
index 79971dd1..516a8274 100644
--- a/ComplexProperties/TimeChange.cs
+++ b/ComplexProperties/TimeChange.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the TimeChange class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
diff --git a/ComplexProperties/TimeChangeRecurrence.cs b/ComplexProperties/TimeChangeRecurrence.cs
index e1b91d47..7c73d760 100644
--- a/ComplexProperties/TimeChangeRecurrence.cs
+++ b/ComplexProperties/TimeChangeRecurrence.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the TimeChangeRecurrence class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
diff --git a/ComplexProperties/TimeZones/AbsoluteDateTransition.cs b/ComplexProperties/TimeZones/AbsoluteDateTransition.cs
index be12b7a5..9d7d6c11 100644
--- a/ComplexProperties/TimeZones/AbsoluteDateTransition.cs
+++ b/ComplexProperties/TimeZones/AbsoluteDateTransition.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the AbsoluteDateTransition class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -104,4 +119,4 @@ internal DateTime DateTime
set { this.dateTime = value; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/TimeZones/AbsoluteDayOfMonthTransition.cs b/ComplexProperties/TimeZones/AbsoluteDayOfMonthTransition.cs
index 98894f6f..fe13b573 100644
--- a/ComplexProperties/TimeZones/AbsoluteDayOfMonthTransition.cs
+++ b/ComplexProperties/TimeZones/AbsoluteDayOfMonthTransition.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the AbsoluteDayOfMonthTransition class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -125,4 +140,4 @@ internal int DayOfMonth
get { return this.dayOfMonth; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/TimeZones/AbsoluteMonthTransition.cs b/ComplexProperties/TimeZones/AbsoluteMonthTransition.cs
index 92c2eede..4411997a 100644
--- a/ComplexProperties/TimeZones/AbsoluteMonthTransition.cs
+++ b/ComplexProperties/TimeZones/AbsoluteMonthTransition.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the AbsoluteMonthTransition class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -121,4 +136,4 @@ internal int Month
get { return this.month; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/TimeZones/RelativeDayOfMonthTransition.cs b/ComplexProperties/TimeZones/RelativeDayOfMonthTransition.cs
index 5fe2e3af..fd7e912b 100644
--- a/ComplexProperties/TimeZones/RelativeDayOfMonthTransition.cs
+++ b/ComplexProperties/TimeZones/RelativeDayOfMonthTransition.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the RelativeDayOfMonthTransition class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -140,4 +155,4 @@ internal int WeekIndex
get { return this.weekIndex; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/TimeZones/TimeZoneDefinition.cs b/ComplexProperties/TimeZones/TimeZoneDefinition.cs
index 84923ebd..cd1491e2 100644
--- a/ComplexProperties/TimeZones/TimeZoneDefinition.cs
+++ b/ComplexProperties/TimeZones/TimeZoneDefinition.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the TimeZoneDefinition class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -84,15 +99,15 @@ internal TimeZoneDefinition(TimeZoneInfo timeZoneInfo)
standardPeriod.Id = TimeZonePeriod.StandardPeriodId;
standardPeriod.Name = TimeZonePeriod.StandardPeriodName;
standardPeriod.Bias = -timeZoneInfo.BaseUtcOffset;
-
- this.periods.Add(standardPeriod.Id, standardPeriod);
-
+
TimeZoneInfo.AdjustmentRule[] adjustmentRules = timeZoneInfo.GetAdjustmentRules();
TimeZoneTransition transitionToStandardPeriod = new TimeZoneTransition(this, standardPeriod);
if (adjustmentRules.Length == 0)
{
+ this.periods.Add(standardPeriod.Id, standardPeriod);
+
// If the time zone info doesn't support Daylight Saving Time, we just need to
// create one transition to one group with one transition to the standard period.
TimeZoneTransitionGroup transitionGroup = new TimeZoneTransitionGroup(this, "0");
@@ -132,6 +147,7 @@ internal TimeZoneDefinition(TimeZoneInfo timeZoneInfo)
absoluteDateTransition.DateTime = adjustmentRules[i].DateStart;
transition = absoluteDateTransition;
+ this.periods.Add(standardPeriod.Id, standardPeriod);
}
else
{
@@ -235,7 +251,24 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
TimeZonePeriod period = new TimeZonePeriod();
period.LoadFromXml(reader);
- this.periods.Add(period.Id, period);
+ // OM:1648848 Bad timezone data from clients can include duplicate rules
+ // for one year, with duplicate ID. In that case, let the first one win.
+ if (!this.periods.ContainsKey(period.Id))
+ {
+ this.periods.Add(period.Id, period);
+ }
+ else
+ {
+ reader.Service.TraceMessage(
+ TraceFlags.EwsTimeZones,
+ string.Format(
+ "An entry with the same key (Id) '{0}' already exists in Periods. Cannot add another one. Existing entry: [Name='{1}', Bias='{2}']. Entry to skip: [Name='{3}', Bias='{4}'].",
+ period.Id,
+ this.Periods[period.Id].Name,
+ this.Periods[period.Id].Bias,
+ period.Name,
+ period.Bias));
+ }
}
}
while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.Periods));
@@ -291,76 +324,6 @@ internal void LoadFromXml(EwsServiceXmlReader reader)
this.transitions.Sort(this.CompareTransitions);
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.LoadFromJson(jsonProperty, service);
-
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlAttributeNames.Name:
- this.name = jsonProperty.ReadAsString(key);
- break;
- case XmlAttributeNames.Id:
- this.id = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.Periods:
- foreach (object jsonPeriod in jsonProperty.ReadAsArray(key))
- {
- TimeZonePeriod period = new TimeZonePeriod();
- period.LoadFromJson(jsonPeriod as JsonObject, service);
-
- this.periods.Add(period.Id, period);
- }
-
- break;
-
- case XmlElementNames.TransitionsGroups:
- foreach (object arrayOfTransitionsTypeInstance in jsonProperty.ReadAsArray(key))
- {
- TimeZoneTransitionGroup transitionGroup = new TimeZoneTransitionGroup(this);
- transitionGroup.LoadFromJson(arrayOfTransitionsTypeInstance as JsonObject, service);
-
- this.transitionGroups.Add(transitionGroup.Id, transitionGroup);
- }
-
- break;
-
- case XmlElementNames.Transitions:
- JsonObject arrayOfTransitionsType = jsonProperty.ReadAsJsonObject(key);
-
- foreach (object uncastJsonTransition in arrayOfTransitionsType.ReadAsArray(XmlElementNames.Transition))
- {
- JsonObject jsonTransition = uncastJsonTransition as JsonObject;
- TimeZoneTransition transition = TimeZoneTransition.Create(this, jsonTransition.ReadTypeString());
-
- transition.LoadFromJson(jsonTransition, service);
-
- this.transitions.Add(transition);
- }
-
- break;
- default:
- break;
- }
- }
-
- // EWS can return a TimeZone definition with no Id. Generate a new Id in this case.
- if (string.IsNullOrEmpty(this.id))
- {
- string nameValue = string.IsNullOrEmpty(this.Name) ? string.Empty : this.Name;
- this.Id = NoIdPrefix + Math.Abs(nameValue.GetHashCode()).ToString();
- }
-
- this.transitions.Sort(this.CompareTransitions);
- }
-
///
/// Writes elements to XML.
///
@@ -408,67 +371,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonTimeZoneDefinition = new JsonObject();
-
- jsonTimeZoneDefinition.Add(XmlAttributeNames.Id, this.id);
-
- // We only emit the full time zone definition against Exchange 2010 servers and above.
- if (service.RequestedServerVersion != ExchangeVersion.Exchange2007_SP1)
- {
- jsonTimeZoneDefinition.Add(XmlAttributeNames.Name, this.name);
-
- if (this.periods.Count > 0)
- {
- List jsonPeriods = new List();
-
- foreach (KeyValuePair keyValuePair in this.periods)
- {
- jsonPeriods.Add(keyValuePair.Value.InternalToJson(service));
- }
-
- jsonTimeZoneDefinition.Add(XmlElementNames.Periods, jsonPeriods.ToArray());
- }
-
- if (this.transitionGroups.Count > 0)
- {
- List jsonTransitionGroups = new List();
-
- foreach (KeyValuePair keyValuePair in this.transitionGroups)
- {
- jsonTransitionGroups.Add(keyValuePair.Value.InternalToJson(service));
- }
-
- jsonTimeZoneDefinition.Add(XmlElementNames.TransitionsGroups, jsonTransitionGroups.ToArray());
- }
-
- if (this.transitions.Count > 0)
- {
- JsonObject transisitionsJsonObject = new JsonObject();
-
- List jsonTransitions = new List();
-
- foreach (TimeZoneTransition transition in this.transitions)
- {
- jsonTransitions.Add(transition.InternalToJson(service));
- }
-
- transisitionsJsonObject.Add(XmlElementNames.Transition, jsonTransitions.ToArray());
- jsonTimeZoneDefinition.Add(XmlElementNames.Transitions, transisitionsJsonObject);
- }
- }
-
- return jsonTimeZoneDefinition;
- }
-
///
/// Writes to XML.
///
@@ -524,8 +426,9 @@ internal void Validate()
///
/// Converts this time zone definition into a TimeZoneInfo structure.
///
+ /// The service.
/// A TimeZoneInfo representing the same time zone as this definition.
- internal TimeZoneInfo ToTimeZoneInfo()
+ internal TimeZoneInfo ToTimeZoneInfo(ExchangeService service)
{
this.Validate();
@@ -556,14 +459,28 @@ internal TimeZoneInfo ToTimeZoneInfo()
effectiveEndDate = endDate;
}
- TimeZoneInfo.AdjustmentRule adjustmentRule = this.transitions[i].TargetGroup.CreateAdjustmentRule(startDate, effectiveEndDate);
+ // OM:1648848 Due to bad timezone data from clients the
+ // startDate may not always come before the effectiveEndDate
+ if (startDate < effectiveEndDate)
+ {
+ TimeZoneInfo.AdjustmentRule adjustmentRule = this.transitions[i].TargetGroup.CreateAdjustmentRule(startDate, effectiveEndDate);
- if (adjustmentRule != null)
+ if (adjustmentRule != null)
+ {
+ adjustmentRules.Add(adjustmentRule);
+ }
+
+ startDate = endDate;
+ }
+ else
{
- adjustmentRules.Add(adjustmentRule);
+ service.TraceMessage(
+ TraceFlags.EwsTimeZones,
+ string.Format(
+ "The startDate '{0}' is not before the effectiveEndDate '{1}'. Will skip creating adjustment rule.",
+ startDate,
+ effectiveEndDate));
}
-
- startDate = endDate;
}
if (adjustmentRules.Count == 0)
@@ -624,4 +541,4 @@ internal Dictionary TransitionGroups
get { return this.transitionGroups; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/TimeZones/TimeZonePeriod.cs b/ComplexProperties/TimeZones/TimeZonePeriod.cs
index 470d6fc8..57cee0e3 100644
--- a/ComplexProperties/TimeZones/TimeZonePeriod.cs
+++ b/ComplexProperties/TimeZones/TimeZonePeriod.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the TimeZonePeriod class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -50,24 +65,6 @@ internal override void WriteAttributesToXml(EwsServiceXmlWriter writer)
writer.WriteAttributeValue(XmlAttributeNames.Id, this.id);
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonTimeZonePeriod = new JsonObject();
-
- jsonTimeZonePeriod.Add(XmlAttributeNames.Bias, EwsUtilities.TimeSpanToXSDuration(this.bias));
- jsonTimeZonePeriod.Add(XmlAttributeNames.Name, this.name);
- jsonTimeZonePeriod.Add(XmlAttributeNames.Id, this.id);
-
- return jsonTimeZonePeriod;
- }
-
///
/// Loads from XML.
///
@@ -77,32 +74,6 @@ internal void LoadFromXml(EwsServiceXmlReader reader)
this.LoadFromXml(reader, XmlElementNames.Period);
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.LoadFromJson(jsonProperty, service);
-
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlAttributeNames.Id:
- this.id = jsonProperty.ReadAsString(key);
- break;
- case XmlAttributeNames.Name:
- this.name = jsonProperty.ReadAsString(key);
- break;
- case XmlAttributeNames.Bias:
- this.bias = EwsUtilities.XSDurationToTimeSpan(jsonProperty.ReadAsString(key));
- break;
- }
- }
- }
-
///
/// Writes to XML.
///
@@ -164,4 +135,4 @@ internal string Id
set { this.id = value; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/TimeZones/TimeZoneTransition.cs b/ComplexProperties/TimeZones/TimeZoneTransition.cs
index 3b0e640c..c3d07cd2 100644
--- a/ComplexProperties/TimeZones/TimeZoneTransition.cs
+++ b/ComplexProperties/TimeZones/TimeZoneTransition.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the TimeZoneTransition class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -151,81 +166,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.LoadFromJson(jsonProperty, service);
-
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.To:
- string targetKind = jsonProperty.ReadAsJsonObject(key).ReadAsString(XmlAttributeNames.Kind);
- string targetId = jsonProperty.ReadAsJsonObject(key).ReadAsString(XmlElementNames.Value);
-
- switch (targetKind)
- {
- case TimeZoneTransition.PeriodTarget:
- if (!this.timeZoneDefinition.Periods.TryGetValue(targetId, out this.targetPeriod))
- {
- throw new ServiceLocalException(
- string.Format(
- Strings.PeriodNotFound,
- targetId));
- }
-
- break;
- case TimeZoneTransition.GroupTarget:
- if (!this.timeZoneDefinition.TransitionGroups.TryGetValue(targetId, out this.targetGroup))
- {
- throw new ServiceLocalException(
- string.Format(
- Strings.TransitionGroupNotFound,
- targetId));
- }
-
- break;
- default:
- throw new ServiceLocalException(Strings.UnsupportedTimeZonePeriodTransitionTarget);
- }
- break;
- }
- }
- }
-
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonTimeZoneTransition = new JsonObject();
- JsonObject jsonToElement = new JsonObject();
-
- jsonTimeZoneTransition.Add(XmlElementNames.To, jsonToElement);
-
- if (this.targetPeriod != null)
- {
- jsonToElement.Add(XmlAttributeNames.Kind, PeriodTarget);
- jsonToElement.Add(XmlElementNames.Value, this.targetPeriod.Id);
- }
- else
- {
- jsonToElement.Add(XmlAttributeNames.Kind, GroupTarget);
- jsonToElement.Add(XmlElementNames.Value, this.targetGroup.Id);
- }
-
- return jsonTimeZoneTransition;
- }
-
///
/// Writes elements to XML.
///
@@ -314,4 +254,4 @@ internal TimeZoneTransitionGroup TargetGroup
get { return this.targetGroup; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/TimeZones/TimeZoneTransitionGroup.cs b/ComplexProperties/TimeZones/TimeZoneTransitionGroup.cs
index 2a68bae6..c9f4f9e7 100644
--- a/ComplexProperties/TimeZones/TimeZoneTransitionGroup.cs
+++ b/ComplexProperties/TimeZones/TimeZoneTransitionGroup.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the TimeZoneTransitionGroup class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -52,39 +67,6 @@ internal override void ReadAttributesFromXml(EwsServiceXmlReader reader)
this.id = reader.ReadAttributeValue(XmlAttributeNames.Id);
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- base.LoadFromJson(jsonProperty, service);
-
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlAttributeNames.Id:
- this.id = jsonProperty.ReadAsString(key);
- break;
-
- case XmlElementNames.Transition:
-
- foreach (object uncastJsonTransition in jsonProperty.ReadAsArray(key))
- {
- JsonObject jsonTransition = uncastJsonTransition as JsonObject;
- TimeZoneTransition transition = TimeZoneTransition.Create(this.timeZoneDefinition, jsonTransition.ReadTypeString());
-
- transition.LoadFromJson(jsonTransition, service);
-
- this.transitions.Add(transition);
- }
- break;
- }
- }
- }
-
///
/// Writes the attributes to XML.
///
@@ -129,30 +111,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonTimeZoneTransitionGroup = new JsonObject();
-
- jsonTimeZoneTransitionGroup.Add(XmlAttributeNames.Id, this.id);
-
- List jsonTransitions = new List();
- foreach (TimeZoneTransition transition in this.transitions)
- {
- jsonTransitions.Add(transition.InternalToJson(service));
- }
-
- jsonTimeZoneTransitionGroup.Add(XmlElementNames.Transitions, jsonTransitions.ToArray());
-
- return jsonTimeZoneTransitionGroup;
- }
-
///
/// Initializes this transition group based on the specified asjustment rule.
///
@@ -177,9 +135,18 @@ internal virtual void InitializeFromAdjustmentRule(TimeZoneInfo.AdjustmentRule a
daylightPeriod,
adjustmentRule.DaylightTransitionStart);
+ TimeZonePeriod standardPeriodToSet = new TimeZonePeriod();
+ standardPeriodToSet.Id = string.Format(
+ "{0}/{1}",
+ standardPeriod.Id,
+ adjustmentRule.DateStart.Year);
+ standardPeriodToSet.Name = standardPeriod.Name;
+ standardPeriodToSet.Bias = standardPeriod.Bias;
+ this.timeZoneDefinition.Periods.Add(standardPeriodToSet.Id, standardPeriodToSet);
+
this.transitionToStandard = TimeZoneTransition.CreateTimeZoneTransition(
this.timeZoneDefinition,
- standardPeriod,
+ standardPeriodToSet,
adjustmentRule.DaylightTransitionEnd);
this.transitions.Add(this.transitionToDaylight);
@@ -446,4 +413,4 @@ internal List Transitions
get { return this.transitions; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/UniqueBody.cs b/ComplexProperties/UniqueBody.cs
index b54fae39..33286b2f 100644
--- a/ComplexProperties/UniqueBody.cs
+++ b/ComplexProperties/UniqueBody.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the UniqueBody class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -61,32 +76,6 @@ internal override void ReadTextValueFromXml(EwsServiceXmlReader reader)
this.text = reader.ReadValue();
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlAttributeNames.BodyType:
- this.bodyType = jsonProperty.ReadEnumValue(key);
- break;
- case XmlAttributeNames.IsTruncated:
- this.isTruncated = jsonProperty.ReadAsBool(key);
- break;
- case JsonObject.JsonValueString:
- this.text = jsonProperty.ReadAsString(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes attributes to XML.
///
@@ -108,28 +97,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlAttributeNames.BodyType, this.BodyType);
- jsonProperty.Add(XmlAttributeNames.IsTruncated, this.IsTruncated);
-
- if (!string.IsNullOrEmpty(this.Text))
- {
- jsonProperty.Add(JsonObject.JsonValueString, this.Text);
- }
-
- return jsonProperty;
- }
-
///
/// Gets the type of the unique body's text.
///
@@ -176,4 +143,4 @@ public override string ToString()
}
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/UrlEntity.cs b/ComplexProperties/UrlEntity.cs
index 637f43a8..8316594c 100644
--- a/ComplexProperties/UrlEntity.cs
+++ b/ComplexProperties/UrlEntity.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the UrlEntity class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -49,4 +64,4 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/UrlEntityCollection.cs b/ComplexProperties/UrlEntityCollection.cs
index f4002950..766b0b81 100644
--- a/ComplexProperties/UrlEntityCollection.cs
+++ b/ComplexProperties/UrlEntityCollection.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the UrlEntityCollection class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -50,15 +65,6 @@ internal override UrlEntity CreateComplexProperty(string xmlElementName)
return new UrlEntity();
}
- ///
- /// Creates the default complex property.
- ///
- /// UrlEntity.
- internal override UrlEntity CreateDefaultComplexProperty()
- {
- return new UrlEntity();
- }
-
///
/// Gets the name of the collection item XML element.
///
@@ -69,4 +75,4 @@ internal override string GetCollectionItemXmlElementName(UrlEntity complexProper
return XmlElementNames.NlgUrl;
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/UserConfigurationDictionary.cs b/ComplexProperties/UserConfigurationDictionary.cs
index 788a08f5..8bbbc557 100644
--- a/ComplexProperties/UserConfigurationDictionary.cs
+++ b/ComplexProperties/UserConfigurationDictionary.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Implements a UserConfiguration's Dictionary property.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -23,7 +38,7 @@ namespace Microsoft.Exchange.WebServices.Data
/// Represents a user configuration's Dictionary property.
///
[EditorBrowsable(EditorBrowsableState.Never)]
- public sealed class UserConfigurationDictionary : ComplexProperty, IEnumerable, IJsonCollectionDeserializer
+ public sealed class UserConfigurationDictionary : ComplexProperty, IEnumerable
{
// TODO: Consider implementing IsDirty mechanism in ComplexProperty.
private Dictionary dictionary;
@@ -204,30 +219,6 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
}
}
- ///
- /// Serializes the property to a Json value.
- ///
- ///
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- List jsonArray = new List();
-
- foreach (KeyValuePair dictionaryEntry in this.dictionary)
- {
- JsonObject jsonDictionaryEntry = new JsonObject();
-
- jsonDictionaryEntry.Add(XmlElementNames.DictionaryKey, this.GetJsonObject(dictionaryEntry.Key, service));
- jsonDictionaryEntry.Add(XmlElementNames.DictionaryValue, this.GetJsonObject(dictionaryEntry.Value, service));
-
- jsonArray.Add(jsonDictionaryEntry);
- }
-
- return jsonArray.ToArray();
- }
-
///
/// Gets the type code.
///
@@ -291,46 +282,6 @@ private static UserConfigurationDictionaryObjectType GetObjectType(string type)
return (UserConfigurationDictionaryObjectType)Enum.Parse(typeof(UserConfigurationDictionaryObjectType), type, false);
}
- ///
- /// Gets the json object.
- ///
- /// The dictionary object.
- /// The service.
- ///
- private JsonObject GetJsonObject(object dictionaryObject, ExchangeService service)
- {
- UserConfigurationDictionaryObjectType dictionaryObjectType = UserConfigurationDictionaryObjectType.String;
- string[] valueAsStringArray = null;
-
- if (dictionaryObject == null)
- {
- return null;
- }
-
- if (dictionaryObject is string[])
- {
- dictionaryObjectType = UserConfigurationDictionaryObjectType.StringArray;
- valueAsStringArray = dictionaryObject as string[];
- }
- else if (dictionaryObject is byte[])
- {
- dictionaryObjectType = UserConfigurationDictionaryObjectType.ByteArray;
- valueAsStringArray = new string[] { Convert.ToBase64String(dictionaryObject as byte[]) };
- }
- else
- {
- valueAsStringArray = new string[1];
- GetTypeCode(service, dictionaryObject, ref dictionaryObjectType, ref valueAsStringArray[0]);
- }
-
- JsonObject jsonDictionaryObject = new JsonObject();
-
- jsonDictionaryObject.Add(XmlElementNames.Type, dictionaryObjectType);
- jsonDictionaryObject.Add(XmlElementNames.Value, valueAsStringArray);
-
- return jsonDictionaryObject;
- }
-
///
/// Writes a dictionary object (key or value) to Xml.
///
@@ -528,54 +479,6 @@ private void LoadEntry(EwsServiceXmlReader reader)
this.dictionary.Add(key, value);
}
- ///
- /// Loads from json collection.
- ///
- /// The json collection.
- /// The service.
- public void CreateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- foreach (object element in jsonCollection)
- {
- JsonObject jsonEntry = element as JsonObject;
-
- object parsedKey = this.GetDictionaryObject(jsonEntry.ReadAsJsonObject(XmlElementNames.DictionaryKey), service);
- object parsedValue = this.GetDictionaryObject(jsonEntry.ReadAsJsonObject(XmlElementNames.DictionaryValue), service);
-
- this.dictionary.Add(parsedKey, parsedValue);
- }
- }
-
- ///
- /// Loads from json collection to update.
- ///
- /// The json collection.
- /// The service.
- public void UpdateFromJsonCollection(object[] jsonCollection, ExchangeService service)
- {
- throw new NotImplementedException();
- }
-
- ///
- /// Gets the dictionary object.
- ///
- /// The json object.
- /// The service.
- ///
- private object GetDictionaryObject(JsonObject jsonObject, ExchangeService service)
- {
- if (jsonObject == null)
- {
- return null;
- }
-
- UserConfigurationDictionaryObjectType type = GetObjectType(jsonObject.ReadAsString(XmlElementNames.Type));
-
- List values = this.GetObjectValue(jsonObject.ReadAsArray(XmlElementNames.Value));
-
- return this.ConstructObject(type, values, service);
- }
-
///
/// Gets the object value.
///
@@ -872,4 +775,4 @@ private void ValidateObjectType(Type type)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/UserId.cs b/ComplexProperties/UserId.cs
index 97c94306..f1f452da 100644
--- a/ComplexProperties/UserId.cs
+++ b/ComplexProperties/UserId.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the UserId class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -144,35 +159,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.SID:
- this.sID = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.PrimarySmtpAddress:
- this.primarySmtpAddress = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.DisplayName:
- this.displayName = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.DistinguishedUser:
- this.standardUser = jsonProperty.ReadEnumValue(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Writes elements to XML.
///
@@ -199,28 +185,5 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
XmlElementNames.DistinguishedUser,
this.StandardUser);
}
-
- ///
- /// Serializes the property to a Json value.
- ///
- /// The service.
- ///
- /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
- ///
- internal override object InternalToJson(ExchangeService service)
- {
- JsonObject jsonProperty = new JsonObject();
-
- jsonProperty.Add(XmlElementNames.SID, this.SID);
- jsonProperty.Add(XmlElementNames.PrimarySmtpAddress, this.PrimarySmtpAddress);
- jsonProperty.Add(XmlElementNames.DisplayName, this.DisplayName);
-
- if (this.StandardUser.HasValue)
- {
- jsonProperty.Add(XmlElementNames.DistinguishedUser, this.StandardUser.Value);
- }
-
- return jsonProperty;
- }
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/VotingInformation.cs b/ComplexProperties/VotingInformation.cs
index e1a9131b..68ee49ce 100644
--- a/ComplexProperties/VotingInformation.cs
+++ b/ComplexProperties/VotingInformation.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the VotingInformation class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -62,40 +77,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.UserOptions:
- Object[] votingOptionObjects = jsonProperty.ReadAsArray(XmlElementNames.UserOptions);
- if (votingOptionObjects != null)
- {
- foreach (object votingOptionObject in votingOptionObjects)
- {
- JsonObject jsonObject = votingOptionObject as JsonObject;
- VotingOptionData option = new VotingOptionData();
-
- option.LoadFromJson(jsonObject, service);
- this.userOptions.Add(option);
- }
- }
- break;
- case XmlElementNames.VotingResponse:
- this.votingResponse = jsonProperty.ReadAsString(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets the list of user options.
///
@@ -112,4 +93,4 @@ public string VotingResponse
get { return this.votingResponse; }
}
}
-}
+}
\ No newline at end of file
diff --git a/ComplexProperties/VotingOptionData.cs b/ComplexProperties/VotingOptionData.cs
index 30d82c49..252dbb20 100644
--- a/ComplexProperties/VotingOptionData.cs
+++ b/ComplexProperties/VotingOptionData.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the VotingOptionData class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -47,29 +62,6 @@ internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
}
}
- ///
- /// Loads from json.
- ///
- /// The json property.
- /// The service.
- internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
- {
- foreach (string key in jsonProperty.Keys)
- {
- switch (key)
- {
- case XmlElementNames.VotingOptionDisplayName:
- this.displayName = jsonProperty.ReadAsString(key);
- break;
- case XmlElementNames.SendPrompt:
- this.sendPrompt = jsonProperty.ReadEnumValue(key);
- break;
- default:
- break;
- }
- }
- }
-
///
/// Gets the display name for the voting option.
///
@@ -86,4 +78,4 @@ public SendPrompt SendPrompt
get { return this.sendPrompt; }
}
}
-}
+}
\ No newline at end of file
diff --git a/Core/EwsHttpWebRequest.cs b/Core/EwsHttpWebRequest.cs
index 0d56e589..dc5705b4 100644
--- a/Core/EwsHttpWebRequest.cs
+++ b/Core/EwsHttpWebRequest.cs
@@ -1,15 +1,34 @@
-//-----------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// Defines the EwsHttpWebRequest class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
using System;
using System.IO;
using System.Net;
+ using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
///
@@ -276,4 +295,4 @@ public string ConnectionGroupName
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/Core/EwsHttpWebRequestFactory.cs b/Core/EwsHttpWebRequestFactory.cs
index 830c68d2..9d80dda9 100644
--- a/Core/EwsHttpWebRequestFactory.cs
+++ b/Core/EwsHttpWebRequestFactory.cs
@@ -1,9 +1,27 @@
-//-----------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// Defines the EwsHttpWebRequestFactory class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -45,4 +63,4 @@ IEwsHttpWebResponse IEwsHttpWebRequestFactory.CreateExceptionResponse(WebExcepti
}
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/Core/EwsHttpWebResponse.cs b/Core/EwsHttpWebResponse.cs
index a08d045d..b4a4c6dc 100644
--- a/Core/EwsHttpWebResponse.cs
+++ b/Core/EwsHttpWebResponse.cs
@@ -1,9 +1,27 @@
-//-----------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// Defines the EwsHttpWebResponse class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -128,4 +146,4 @@ void IDisposable.Dispose()
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/Core/EwsServiceJsonReader.cs b/Core/EwsServiceJsonReader.cs
deleted file mode 100644
index 28b6545e..00000000
--- a/Core/EwsServiceJsonReader.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EwsServiceJsonReader class.
-//-----------------------------------------------------------------------
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Microsoft.Exchange.WebServices.Data
-{
- ///
- /// JSON reader.
- ///
- internal class EwsServiceJsonReader
- {
- ///
- /// Initializes a new instance of the class.
- ///
- /// The service.
- internal EwsServiceJsonReader(ExchangeService service)
- {
- this.Service = service;
- }
-
- ///
- /// Reads the service objects collection from JSON.
- ///
- /// The type of the service object.
- /// The json response.
- /// Name of the collection XML element.
- /// The get object instance delegate.
- /// if set to true [clear property bag].
- /// The requested property set.
- /// if set to true [summary properties only].
- /// List of service objects.
- internal List ReadServiceObjectsCollectionFromJson(
- JsonObject jsonResponse,
- string collectionJsonElementName,
- GetObjectInstanceDelegate getObjectInstanceDelegate,
- bool clearPropertyBag,
- PropertySet requestedPropertySet,
- bool summaryPropertiesOnly) where TServiceObject : ServiceObject
- {
- List serviceObjects = new List();
- TServiceObject serviceObject = null;
-
- object[] jsonServiceObjects = jsonResponse.ReadAsArray(collectionJsonElementName);
- foreach (object arrayEntry in jsonServiceObjects)
- {
- JsonObject jsonServiceObject = arrayEntry as JsonObject;
-
- if (jsonServiceObject != null)
- {
- serviceObject = getObjectInstanceDelegate(this.Service, jsonServiceObject.ReadTypeString());
-
- if (serviceObject != null)
- {
- if (string.Compare(jsonServiceObject.ReadTypeString(), serviceObject.GetXmlElementName(), StringComparison.Ordinal) != 0)
- {
- throw new ServiceLocalException(
- string.Format(
- "The type of the object in the store ({0}) does not match that of the local object ({1}).",
- jsonServiceObject.ReadTypeString(),
- serviceObject.GetXmlElementName()));
- }
-
- serviceObject.LoadFromJson(
- jsonServiceObject,
- this.Service,
- clearPropertyBag,
- requestedPropertySet,
- summaryPropertiesOnly);
-
- serviceObjects.Add(serviceObject);
- }
- }
- }
-
- return serviceObjects;
- }
-
- ///
- /// Gets or sets the service.
- ///
- internal ExchangeService Service { get; set; }
- }
-}
diff --git a/Core/EwsServiceMultiResponseXmlReader.cs b/Core/EwsServiceMultiResponseXmlReader.cs
index 18ebeb16..344a8d55 100644
--- a/Core/EwsServiceMultiResponseXmlReader.cs
+++ b/Core/EwsServiceMultiResponseXmlReader.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EwsServiceXmlReader class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -91,4 +106,4 @@ protected override XmlReader InitializeXmlReader(Stream stream)
return CreateXmlReader(stream);
}
}
-}
+}
\ No newline at end of file
diff --git a/Core/EwsServiceXmlReader.cs b/Core/EwsServiceXmlReader.cs
index 6019def5..b8d04a7b 100644
--- a/Core/EwsServiceXmlReader.cs
+++ b/Core/EwsServiceXmlReader.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EwsServiceXmlReader class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
diff --git a/Core/EwsServiceXmlWriter.cs b/Core/EwsServiceXmlWriter.cs
index 71472f9a..45613bd4 100644
--- a/Core/EwsServiceXmlWriter.cs
+++ b/Core/EwsServiceXmlWriter.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EwsServiceXmlWriter class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
diff --git a/Core/EwsUtilities.cs b/Core/EwsUtilities.cs
index b5c93c4a..2076f36b 100644
--- a/Core/EwsUtilities.cs
+++ b/Core/EwsUtilities.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EwsUtilities class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -46,15 +61,24 @@ internal static class EwsUtilities
private static LazyMember buildVersion = new LazyMember(
delegate()
{
- FileVersionInfo fileInfo = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
- return fileInfo.FileVersion;
+ try
+ {
+ FileVersionInfo fileInfo = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
+ return fileInfo.FileVersion;
+ }
+ catch
+ {
+ // OM:2026839 When run in an environment with partial trust, fetching the build version blows up.
+ // Just return a hardcoded value on failure.
+ return "0.0";
+ }
});
///
/// Dictionary of enum type to ExchangeVersion maps.
///
private static LazyMember>> enumVersionDictionaries = new LazyMember>>(
- () => new Dictionary>()
+ () => new Dictionary>()
{
{ typeof(WellKnownFolderName), BuildEnumDict(typeof(WellKnownFolderName)) },
{ typeof(ItemTraversal), BuildEnumDict(typeof(ItemTraversal)) },
@@ -69,7 +93,7 @@ internal static class EwsUtilities
/// Dictionary of enum type to schema-name-to-enum-value maps.
///
private static LazyMember>> schemaToEnumDictionaries = new LazyMember>>(
- () => new Dictionary>
+ () => new Dictionary>
{
{ typeof(EventType), BuildSchemaToEnumDict(typeof(EventType)) },
{ typeof(MailboxType), BuildSchemaToEnumDict(typeof(MailboxType)) },
@@ -82,7 +106,7 @@ internal static class EwsUtilities
/// Dictionary of enum type to enum-value-to-schema-name maps.
///
private static LazyMember>> enumToSchemaDictionaries = new LazyMember>>(
- () => new Dictionary>
+ () => new Dictionary>
{
{ typeof(EventType), BuildEnumToSchemaDict(typeof(EventType)) },
{ typeof(MailboxType), BuildEnumToSchemaDict(typeof(MailboxType)) },
@@ -95,7 +119,7 @@ internal static class EwsUtilities
/// Dictionary to map from special CLR type names to their "short" names.
///
private static LazyMember> typeNameToShortNameMap = new LazyMember>(
- () => new Dictionary
+ () => new Dictionary
{
{ "Boolean", "bool" },
{ "Int16", "short" },
@@ -637,6 +661,11 @@ internal static void ParseEnumValueList(
"EwsUtilities.ParseEnumValueList",
"T is not an enum type.");
+ if (string.IsNullOrEmpty(value))
+ {
+ return;
+ }
+
string[] enumValues = value.Split(separators);
foreach (string enumValue in enumValues)
@@ -696,6 +725,30 @@ internal static T Parse(string value)
}
}
+ ///
+ /// Tries to parses the specified value to the specified type.
+ ///
+ /// The type into which to cast the provided value.
+ /// The value to parse.
+ /// The value cast to the specified type, if TryParse succeeds. Otherwise, the value of result is indeterminate.
+ /// True if value could be parsed; otherwise, false.
+ internal static bool TryParse(string value, out T result)
+ {
+ try
+ {
+ result = EwsUtilities.Parse(value);
+
+ return true;
+ }
+ //// Catch all exceptions here, we're not interested in the reason why TryParse failed.
+ catch (Exception)
+ {
+ result = default(T);
+
+ return false;
+ }
+ }
+
///
/// Converts the specified date and time from one time zone to another.
///
diff --git a/Core/EwsXmlReader.cs b/Core/EwsXmlReader.cs
index bb1baa93..0078c31a 100644
--- a/Core/EwsXmlReader.cs
+++ b/Core/EwsXmlReader.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the EwsXmlReader class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -806,4 +821,4 @@ public XmlNodeType PrevNodeType
get { return this.prevNodeType; }
}
}
-}
+}
\ No newline at end of file
diff --git a/Core/ExchangeServerInfo.cs b/Core/ExchangeServerInfo.cs
index 6b6aeb56..8baac559 100644
--- a/Core/ExchangeServerInfo.cs
+++ b/Core/ExchangeServerInfo.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ExchangeServerInfo class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -51,22 +66,6 @@ internal static ExchangeServerInfo Parse(EwsServiceXmlReader reader)
return info;
}
- ///
- /// Parses the specified json object.
- ///
- /// The json object.
- ///
- internal static ExchangeServerInfo Parse(JsonObject jsonObject)
- {
- ExchangeServerInfo info = new ExchangeServerInfo();
- info.MajorVersion = jsonObject.ReadAsInt("MajorVersion");
- info.MinorVersion = jsonObject.ReadAsInt("MinorVersion");
- info.MajorBuildNumber = jsonObject.ReadAsInt("MajorBuildNumber");
- info.MinorBuildNumber = jsonObject.ReadAsInt("MinorBuildNumber");
- info.VersionString = jsonObject.ReadAsString("Version");
- return info;
- }
-
///
/// Gets the Major Exchange server version number
///
@@ -130,4 +129,4 @@ public override string ToString()
this.MinorBuildNumber);
}
}
-}
+}
\ No newline at end of file
diff --git a/Core/ExchangeService.cs b/Core/ExchangeService.cs
index 75f2374b..cdc22cd3 100644
--- a/Core/ExchangeService.cs
+++ b/Core/ExchangeService.cs
@@ -1,12 +1,27 @@
-//-----------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-//-----------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ExchangeService class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -19,6 +34,8 @@ namespace Microsoft.Exchange.WebServices.Data
using System.Net;
using System.Xml;
using Microsoft.Exchange.WebServices.Autodiscover;
+ using Microsoft.Exchange.WebServices.Data.Enumerations;
+ using Microsoft.Exchange.WebServices.Data.Groups;
///
/// Represents a binding to the Exchange Web Services.
@@ -42,7 +59,6 @@ public sealed class ExchangeService : ExchangeServiceBase
private IFileAttachmentContentHandler fileAttachmentContentHandler;
private UnifiedMessaging unifiedMessaging;
private bool enableScpLookup = true;
- private ExchangeService.RenderingMode renderingMode = RenderingMode.Xml;
private bool traceEnablePrettyPrinting = true;
private string targetServerVersion = null;
@@ -272,12 +288,11 @@ internal Folder BindToFolder(FolderId folderId, PropertySet propertySet)
EwsUtilities.ValidateParam(folderId, "folderId");
EwsUtilities.ValidateParam(propertySet, "propertySet");
- GetFolderRequest request = new GetFolderRequest(this, ServiceErrorHandling.ThrowOnError);
-
- request.FolderIds.Add(folderId);
- request.PropertySet = propertySet;
-
- ServiceResponseCollection responses = request.Execute();
+ ServiceResponseCollection responses = this.InternalBindToFolders(
+ new[] { folderId },
+ propertySet,
+ ServiceErrorHandling.ThrowOnError
+ );
return responses[0].Folder;
}
@@ -308,6 +323,46 @@ internal TFolder BindToFolder(FolderId folderId, PropertySet propertySe
}
}
+ ///
+ /// Binds to multiple folders in a single call to EWS.
+ ///
+ /// The Ids of the folders to bind to.
+ /// The set of properties to load.
+ /// A ServiceResponseCollection providing results for each of the specified folder Ids.
+ public ServiceResponseCollection BindToFolders(
+ IEnumerable folderIds,
+ PropertySet propertySet)
+ {
+ EwsUtilities.ValidateParamCollection(folderIds, "folderIds");
+ EwsUtilities.ValidateParam(propertySet, "propertySet");
+
+ return this.InternalBindToFolders(
+ folderIds,
+ propertySet,
+ ServiceErrorHandling.ReturnErrors
+ );
+ }
+
+ ///
+ /// Binds to multiple folders in a single call to EWS.
+ ///
+ /// The Ids of the folders to bind to.
+ /// The set of properties to load.
+ /// Type of error handling to perform.
+ /// A ServiceResponseCollection providing results for each of the specified folder Ids.
+ private ServiceResponseCollection InternalBindToFolders(
+ IEnumerable folderIds,
+ PropertySet propertySet,
+ ServiceErrorHandling errorHandling)
+ {
+ GetFolderRequest request = new GetFolderRequest(this, errorHandling);
+
+ request.FolderIds.AddRange(folderIds);
+ request.PropertySet = propertySet;
+
+ return request.Execute();
+ }
+
///
/// Deletes a folder. Calling this method results in a call to EWS.
///
@@ -1235,17 +1290,20 @@ internal ServiceResponseCollection InternalLoadPropertiesForIte
///
/// The Ids of the items to bind to.
/// The set of properties to load.
+ /// The SmtpAddress of mailbox that hosts all items we need to bind to
/// Type of error handling to perform.
/// A ServiceResponseCollection providing results for each of the specified item Ids.
private ServiceResponseCollection InternalBindToItems(
IEnumerable itemIds,
PropertySet propertySet,
+ string anchorMailbox,
ServiceErrorHandling errorHandling)
{
GetItemRequest request = new GetItemRequest(this, errorHandling);
request.ItemIds.AddRange(itemIds);
request.PropertySet = propertySet;
+ request.AnchorMailbox = anchorMailbox;
return request.Execute();
}
@@ -1264,6 +1322,34 @@ public ServiceResponseCollection BindToItems(IEnumerable
+ /// Binds to multiple items in a single call to EWS.
+ ///
+ /// The Ids of the items to bind to.
+ /// The set of properties to load.
+ /// The SmtpAddress of mailbox that hosts all items we need to bind to
+ /// A ServiceResponseCollection providing results for each of the specified item Ids.
+ ///
+ /// This API designed to be used primarily in groups scenarios where we want to set the
+ /// anchor mailbox header so that request is routed directly to the group mailbox backend server.
+ ///
+ public ServiceResponseCollection BindToGroupItems(
+ IEnumerable itemIds,
+ PropertySet propertySet,
+ string anchorMailbox)
+ {
+ EwsUtilities.ValidateParamCollection(itemIds, "itemIds");
+ EwsUtilities.ValidateParam(propertySet, "propertySet");
+ EwsUtilities.ValidateParam(propertySet, "anchorMailbox");
+
+ return this.InternalBindToItems(
+ itemIds,
+ propertySet,
+ anchorMailbox,
ServiceErrorHandling.ReturnErrors);
}
@@ -1281,6 +1367,7 @@ internal Item BindToItem(ItemId itemId, PropertySet propertySet)
ServiceResponseCollection responses = this.InternalBindToItems(
new ItemId[] { itemId },
propertySet,
+ null, /* anchorMailbox */
ServiceErrorHandling.ThrowOnError);
return responses[0].Item;
@@ -1445,6 +1532,255 @@ public ServiceResponseCollection MarkAsJunk(IEnumerable-
+ /// This method is for search scenarios. Retrieves a set of personas satisfying the specified search conditions.
+ ///
+ /// Id of the folder being searched
+ /// The search filter. Available search filter classes
+ /// include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and
+ /// SearchFilter.SearchFilterCollection
+ /// The view which defines the number of persona being returned
+ /// The query string for which the search is being performed
+ /// A collection of personas matching the search conditions
+ public ICollection FindPeople(FolderId folderId, SearchFilter searchFilter, ViewBase view, string queryString)
+ {
+ EwsUtilities.ValidateParamAllowNull(folderId, "folderId");
+ EwsUtilities.ValidateParamAllowNull(searchFilter, "searchFilter");
+ EwsUtilities.ValidateParam(view, "view");
+ EwsUtilities.ValidateParam(queryString, "queryString");
+ EwsUtilities.ValidateMethodVersion(this, ExchangeVersion.Exchange2013_SP1, "FindPeople");
+
+ FindPeopleRequest request = new FindPeopleRequest(this);
+
+ request.FolderId = folderId;
+ request.SearchFilter = searchFilter;
+ request.View = view;
+ request.QueryString = queryString;
+
+ return request.Execute().Personas;
+ }
+
+ ///
+ /// This method is for search scenarios. Retrieves a set of personas satisfying the specified search conditions.
+ ///
+ /// Name of the folder being searched
+ /// The search filter. Available search filter classes
+ /// include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and
+ /// SearchFilter.SearchFilterCollection
+ /// The view which defines the number of persona being returned
+ /// The query string for which the search is being performed
+ /// A collection of personas matching the search conditions
+ public ICollection FindPeople(WellKnownFolderName folderName, SearchFilter searchFilter, ViewBase view, string queryString)
+ {
+ return this.FindPeople(new FolderId(folderName), searchFilter, view, queryString);
+ }
+
+ ///
+ /// This method is for browse scenarios. Retrieves a set of personas satisfying the specified browse conditions.
+ /// Browse scenariosdon't require query string.
+ ///
+ /// Id of the folder being browsed
+ /// Search filter
+ /// The view which defines paging and the number of persona being returned
+ /// A result object containing resultset for browsing
+ public FindPeopleResults FindPeople(FolderId folderId, SearchFilter searchFilter, ViewBase view)
+ {
+ EwsUtilities.ValidateParamAllowNull(folderId, "folderId");
+ EwsUtilities.ValidateParamAllowNull(searchFilter, "searchFilter");
+ EwsUtilities.ValidateParamAllowNull(view, "view");
+ EwsUtilities.ValidateMethodVersion(this, ExchangeVersion.Exchange2013_SP1, "FindPeople");
+
+ FindPeopleRequest request = new FindPeopleRequest(this);
+
+ request.FolderId = folderId;
+ request.SearchFilter = searchFilter;
+ request.View = view;
+
+ return request.Execute().Results;
+ }
+
+ ///
+ /// This method is for browse scenarios. Retrieves a set of personas satisfying the specified browse conditions.
+ /// Browse scenarios don't require query string.
+ ///
+ /// Name of the folder being browsed
+ /// Search filter
+ /// The view which defines paging and the number of personas being returned
+ /// A result object containing resultset for browsing
+ public FindPeopleResults FindPeople(WellKnownFolderName folderName, SearchFilter searchFilter, ViewBase view)
+ {
+ return this.FindPeople(new FolderId(folderName), searchFilter, view);
+ }
+
+ ///
+ /// Retrieves all people who are relevant to the user
+ ///
+ /// The view which defines the number of personas being returned
+ /// A collection of personas matching the query string
+ public PeopleQueryResults BrowsePeople(ViewBase view)
+ {
+ return this.BrowsePeople(view, null);
+ }
+
+ ///
+ /// Retrieves all people who are relevant to the user
+ ///
+ /// The view which defines the number of personas being returned
+ /// The context for this query. See PeopleQueryContextKeys for keys
+ /// A collection of personas matching the query string
+ public PeopleQueryResults BrowsePeople(ViewBase view, Dictionary context)
+ {
+ return this.PerformPeopleQuery(view, string.Empty, context, null);
+ }
+
+ ///
+ /// Searches for people who are relevant to the user, automatically determining
+ /// the best sources to use.
+ ///
+ /// The view which defines the number of personas being returned
+ /// The query string for which the search is being performed
+ /// A collection of personas matching the query string
+ public PeopleQueryResults SearchPeople(ViewBase view, string queryString)
+ {
+ return this.SearchPeople(view, queryString, null, null);
+ }
+
+ ///
+ /// Searches for people who are relevant to the user
+ ///
+ /// The view which defines the number of personas being returned
+ /// The query string for which the search is being performed
+ /// The context for this query. See PeopleQueryContextKeys for keys
+ /// The scope of the query.
+ /// A collection of personas matching the query string
+ public PeopleQueryResults SearchPeople(ViewBase view, string queryString, Dictionary context, PeopleQueryMode queryMode)
+ {
+ EwsUtilities.ValidateParam(queryString, "queryString");
+
+ return this.PerformPeopleQuery(view, queryString, context, queryMode);
+ }
+
+ ///
+ /// Performs a People Query FindPeople call
+ ///
+ /// The view which defines the number of personas being returned
+ /// The query string for which the search is being performed
+ /// The context for this query
+ /// The scope of the query.
+ ///
+ private PeopleQueryResults PerformPeopleQuery(ViewBase view, string queryString, Dictionary context, PeopleQueryMode queryMode)
+ {
+ EwsUtilities.ValidateParam(view, "view");
+ EwsUtilities.ValidateMethodVersion(this, ExchangeVersion.Exchange2015, "FindPeople");
+
+ if (context == null)
+ {
+ context = new Dictionary();
+ }
+
+ if (queryMode == null)
+ {
+ queryMode = PeopleQueryMode.Auto;
+ }
+
+ FindPeopleRequest request = new FindPeopleRequest(this);
+ request.View = view;
+ request.QueryString = queryString;
+ request.SearchPeopleSuggestionIndex = true;
+ request.Context = context;
+ request.QueryMode = queryMode;
+
+ FindPeopleResponse response = request.Execute();
+
+ PeopleQueryResults results = new PeopleQueryResults();
+ results.Personas = response.Personas.ToList();
+ results.TransactionId = response.TransactionId;
+
+ return results;
+ }
+
+ ///
+ /// Get a user's photo.
+ ///
+ /// The user's email address
+ /// The desired size of the returned photo. Valid photo sizes are in UserPhotoSize
+ /// A photo's cache ID which will allow the caller to ensure their cached photo is up to date
+ /// A result object containing the photo state
+ public GetUserPhotoResults GetUserPhoto(string emailAddress, string userPhotoSize, string entityTag)
+ {
+ EwsUtilities.ValidateParam(emailAddress, "emailAddress");
+ EwsUtilities.ValidateParam(userPhotoSize, "userPhotoSize");
+ EwsUtilities.ValidateParamAllowNull(entityTag, "entityTag");
+
+ GetUserPhotoRequest request = new GetUserPhotoRequest(this);
+
+ request.EmailAddress = emailAddress;
+ request.UserPhotoSize = userPhotoSize;
+ request.EntityTag = entityTag;
+
+ return request.Execute().Results;
+ }
+
+ ///
+ /// Begins an async request for a user photo
+ ///
+ /// An AsyncCallback delegate
+ /// An object that contains state information for this request
+ /// The user's email address
+ /// The desired size of the returned photo. Valid photo sizes are in UserPhotoSize
+ /// A photo's cache ID which will allow the caller to ensure their cached photo is up to date
+ /// An IAsyncResult that references the asynchronous request.
+ public IAsyncResult BeginGetUserPhoto(
+ AsyncCallback callback,
+ object state,
+ string emailAddress,
+ string userPhotoSize,
+ string entityTag)
+ {
+ EwsUtilities.ValidateParam(emailAddress, "emailAddress");
+ EwsUtilities.ValidateParam(userPhotoSize, "userPhotoSize");
+ EwsUtilities.ValidateParamAllowNull(entityTag, "entityTag");
+
+ GetUserPhotoRequest request = new GetUserPhotoRequest(this);
+
+ request.EmailAddress = emailAddress;
+ request.UserPhotoSize = userPhotoSize;
+ request.EntityTag = entityTag;
+
+ return request.BeginExecute(callback, state);
+ }
+
+ ///
+ /// Ends an async request for a user's photo
+ ///
+ /// An IAsyncResult that references the asynchronous request.
+ /// A result object containing the photo state
+ public GetUserPhotoResults EndGetUserPhoto(IAsyncResult asyncResult)
+ {
+ GetUserPhotoRequest request = AsyncRequestResult.ExtractServiceRequest(this, asyncResult);
+ return request.EndExecute(asyncResult).Results;
+ }
+
+ #endregion
+
+ #region PeopleInsights operations
+
+ ///
+ /// This method is for retreiving people insight for given email addresses
+ ///
+ /// Specified eamiladdresses to retrieve
+ /// The collection of Person objects containing the insight info
+ public Collection GetPeopleInsights(IEnumerable emailAddresses)
+ {
+ GetPeopleInsightsRequest request = new GetPeopleInsightsRequest(this);
+ request.Emailaddresses.AddRange(emailAddresses);
+
+ return request.Execute().People;
+ }
+
+ #endregion
#region Attachment operations
///
@@ -2052,6 +2388,7 @@ public PushSubscription SubscribeToPushNotifications(
frequency,
watermark,
null,
+ null, // AnchorMailbox
eventTypes).Execute()[0].Subscription;
}
@@ -2083,6 +2420,7 @@ public IAsyncResult BeginSubscribeToPushNotifications(
frequency,
watermark,
null,
+ null, // AnchorMailbox
eventTypes).BeginExecute(callback, state);
}
@@ -2111,6 +2449,7 @@ public PushSubscription SubscribeToPushNotificationsOnAllFolders(
frequency,
watermark,
null,
+ null, // AnchorMailbox
eventTypes).Execute()[0].Subscription;
}
@@ -2143,6 +2482,7 @@ public IAsyncResult BeginSubscribeToPushNotificationsOnAllFolders(
frequency,
watermark,
null,
+ null, // AnchorMailbox
eventTypes).BeginExecute(callback, state);
}
@@ -2172,6 +2512,7 @@ public PushSubscription SubscribeToPushNotifications(
frequency,
watermark,
callerData,
+ null, // AnchorMailbox
eventTypes).Execute()[0].Subscription;
}
@@ -2205,6 +2546,69 @@ public IAsyncResult BeginSubscribeToPushNotifications(
frequency,
watermark,
callerData,
+ null, // AnchorMailbox
+ eventTypes).BeginExecute(callback, state);
+ }
+
+ ///
+ /// Subscribes to push notifications on a group mailbox. Calling this method results in a call to EWS.
+ ///
+ /// The smtpaddress of the group mailbox to subscribe to.
+ /// The URL of the Web Service endpoint the Exchange server should push events to.
+ /// The frequency, in minutes, at which the Exchange server should contact the Web Service endpoint. Frequency must be between 1 and 1440.
+ /// An optional watermark representing a previously opened subscription.
+ /// Optional caller data that will be returned the call back.
+ /// The event types to subscribe to.
+ /// A PushSubscription representing the new subscription.
+ public PushSubscription SubscribeToGroupPushNotifications(
+ string groupMailboxSmtp,
+ Uri url,
+ int frequency,
+ string watermark,
+ string callerData,
+ params EventType[] eventTypes)
+ {
+ var folderIds = new FolderId[] { new FolderId(WellKnownFolderName.Inbox, new Mailbox(groupMailboxSmtp)) };
+ return this.BuildSubscribeToPushNotificationsRequest(
+ folderIds,
+ url,
+ frequency,
+ watermark,
+ callerData,
+ groupMailboxSmtp, // AnchorMailbox
+ eventTypes).Execute()[0].Subscription;
+ }
+
+ ///
+ /// Begins an asynchronous request to subscribe to push notifications. Calling this method results in a call to EWS.
+ ///
+ /// The AsyncCallback delegate.
+ /// An object that contains state information for this request.
+ /// The smtpaddress of the group mailbox to subscribe to.
+ /// The URL of the Web Service endpoint the Exchange server should push events to.
+ /// The frequency, in minutes, at which the Exchange server should contact the Web Service endpoint. Frequency must be between 1 and 1440.
+ /// An optional watermark representing a previously opened subscription.
+ /// Optional caller data that will be returned the call back.
+ /// The event types to subscribe to.
+ /// An IAsyncResult that references the asynchronous request.
+ public IAsyncResult BeginSubscribeToGroupPushNotifications(
+ AsyncCallback callback,
+ object state,
+ string groupMailboxSmtp,
+ Uri url,
+ int frequency,
+ string watermark,
+ string callerData,
+ params EventType[] eventTypes)
+ {
+ var folderIds = new FolderId[] { new FolderId(WellKnownFolderName.Inbox, new Mailbox(groupMailboxSmtp)) };
+ return this.BuildSubscribeToPushNotificationsRequest(
+ folderIds,
+ url,
+ frequency,
+ watermark,
+ callerData,
+ groupMailboxSmtp, // AnchorMailbox
eventTypes).BeginExecute(callback, state);
}
@@ -2235,6 +2639,7 @@ public PushSubscription SubscribeToPushNotificationsOnAllFolders(
frequency,
watermark,
callerData,
+ null, // AnchorMailbox
eventTypes).Execute()[0].Subscription;
}
@@ -2269,6 +2674,7 @@ public IAsyncResult BeginSubscribeToPushNotificationsOnAllFolders(
frequency,
watermark,
callerData,
+ null, // AnchorMailbox
eventTypes).BeginExecute(callback, state);
}
@@ -2284,6 +2690,18 @@ public PushSubscription EndSubscribeToPushNotifications(IAsyncResult asyncResult
return request.EndExecute(asyncResult)[0].Subscription;
}
+ ///
+ /// Ends an asynchronous request to subscribe to push notifications in a group mailbox.
+ ///
+ /// An IAsyncResult that references the asynchronous request.
+ /// A PushSubscription representing the new subscription.
+ public PushSubscription EndSubscribeToGroupPushNotifications(IAsyncResult asyncResult)
+ {
+ var request = AsyncRequestResult.ExtractServiceRequest(this, asyncResult);
+
+ return request.EndExecute(asyncResult)[0].Subscription;
+ }
+
///
/// Set a TeamMailbox
///
@@ -2333,6 +2751,7 @@ public void UnpinTeamMailbox(EmailAddress emailAddress)
/// The frequency, in minutes, at which the Exchange server should contact the Web Service endpoint. Frequency must be between 1 and 1440.
/// An optional watermark representing a previously opened subscription.
/// Optional caller data that will be returned the call back.
+ /// The smtpaddress of the mailbox to subscribe to.
/// The event types to subscribe to.
/// A request to request to subscribe to push notifications in the authenticated user's mailbox.
private SubscribeToPushNotificationsRequest BuildSubscribeToPushNotificationsRequest(
@@ -2341,6 +2760,7 @@ private SubscribeToPushNotificationsRequest BuildSubscribeToPushNotificationsReq
int frequency,
string watermark,
string callerData,
+ string anchorMailbox,
EventType[] eventTypes)
{
EwsUtilities.ValidateParam(url, "url");
@@ -2353,6 +2773,7 @@ private SubscribeToPushNotificationsRequest BuildSubscribeToPushNotificationsReq
EwsUtilities.ValidateParamCollection(eventTypes, "eventTypes");
SubscribeToPushNotificationsRequest request = new SubscribeToPushNotificationsRequest(this);
+ request.AnchorMailbox = anchorMailbox;
if (folderIds != null)
{
@@ -2927,6 +3348,39 @@ public ICollection FindConversation(ViewBase view, FolderId folder
return request.Execute().Conversations;
}
+ ///
+ /// Retrieves a collection of all Conversations in the specified Folder.
+ ///
+ /// The view controlling the number of conversations returned.
+ /// The Id of the folder in which to search for conversations.
+ /// The anchorMailbox Smtp address to route the request directly to group mailbox.
+ /// Collection of conversations.
+ ///
+ /// This API designed to be used primarily in groups scenarios where we want to set the
+ /// anchor mailbox header so that request is routed directly to the group mailbox backend server.
+ ///
+ public Collection FindGroupConversation(
+ ViewBase view,
+ FolderId folderId,
+ string anchorMailbox)
+ {
+ EwsUtilities.ValidateParam(view, "view");
+ EwsUtilities.ValidateParam(folderId, "folderId");
+ EwsUtilities.ValidateParam(anchorMailbox, "anchorMailbox");
+ EwsUtilities.ValidateMethodVersion(
+ this,
+ ExchangeVersion.Exchange2015,
+ "FindConversation");
+
+ FindConversationRequest request = new FindConversationRequest(this);
+
+ request.View = view;
+ request.FolderId = new FolderIdWrapper(folderId);
+ request.AnchorMailbox = anchorMailbox;
+
+ return request.Execute().Conversations;
+ }
+
///
/// Retrieves a collection of all Conversations in the specified Folder.
///
@@ -3024,6 +3478,7 @@ public FindConversationResults FindConversation(ViewBase view, FolderId folderId
/// The folders to ignore.
/// Sort order of conversation tree nodes.
/// The mailbox scope to reference.
+ /// The smtpaddress of the mailbox that hosts the conversations
/// Maximum number of items to return.
/// What type of error handling should be performed.
/// GetConversationItems response.
@@ -3034,6 +3489,7 @@ internal ServiceResponseCollection InternalGetConv
ConversationSortOrder? sortOrder,
MailboxSearchLocation? mailboxScope,
int? maxItemsToReturn,
+ string anchorMailbox,
ServiceErrorHandling errorHandling)
{
EwsUtilities.ValidateParam(conversations, "conversations");
@@ -3050,6 +3506,7 @@ internal ServiceResponseCollection InternalGetConv
request.SortOrder = sortOrder;
request.MailboxScope = mailboxScope;
request.MaxItemsToReturn = maxItemsToReturn;
+ request.AnchorMailbox = anchorMailbox;
request.Conversations = conversations.ToList();
return request.Execute();
@@ -3076,6 +3533,7 @@ public ServiceResponseCollection GetConversationIt
null, /* sortOrder */
null, /* mailboxScope */
null, /* maxItemsToReturn*/
+ null, /* anchorMailbox */
ServiceErrorHandling.ReturnErrors);
}
@@ -3105,6 +3563,45 @@ public ConversationResponse GetConversationItems(
sortOrder,
null, /* mailboxScope */
null, /* maxItemsToReturn */
+ null, /* anchorMailbox */
+ ServiceErrorHandling.ThrowOnError)[0].Conversation;
+ }
+
+ ///
+ /// Gets the items for a conversation.
+ ///
+ /// The conversation id.
+ /// The set of properties to load.
+ /// The optional sync state representing the point in time when to start the synchronization.
+ /// The folders to ignore.
+ /// Conversation item sort order.
+ /// The smtp address of the mailbox hosting the conversations
+ /// ConversationResponseType response.
+ ///
+ /// This API designed to be used primarily in groups scenarios where we want to set the
+ /// anchor mailbox header so that request is routed directly to the group mailbox backend server.
+ ///
+ public ConversationResponse GetGroupConversationItems(
+ ConversationId conversationId,
+ PropertySet propertySet,
+ string syncState,
+ IEnumerable foldersToIgnore,
+ ConversationSortOrder? sortOrder,
+ string anchorMailbox)
+ {
+ EwsUtilities.ValidateParam(anchorMailbox, "anchorMailbox");
+
+ List conversations = new List();
+ conversations.Add(new ConversationRequest(conversationId, syncState));
+
+ return this.InternalGetConversationItems(
+ conversations,
+ propertySet,
+ foldersToIgnore,
+ sortOrder,
+ null, /* mailboxScope */
+ null, /* maxItemsToReturn */
+ anchorMailbox, /* anchorMailbox */
ServiceErrorHandling.ThrowOnError)[0].Conversation;
}
@@ -3131,6 +3628,7 @@ public ServiceResponseCollection GetConversationIt
null, /* sortOrder */
mailboxScope,
null, /* maxItemsToReturn*/
+ null, /* anchorMailbox */
ServiceErrorHandling.ReturnErrors);
}
@@ -4696,6 +5194,22 @@ public void DisableApp(string id, DisableReasonType disableReason)
request.Execute();
}
+ ///
+ /// Sets the consent state of an extension.
+ ///
+ /// Extension id.
+ /// Sets the consent state of an extension.
+ /// Exception will be thrown for errors.
+ public void RegisterConsent(string id, ConsentState state)
+ {
+ EwsUtilities.ValidateParam(id, "id");
+ EwsUtilities.ValidateParam(state, "state");
+
+ RegisterConsentRequest request = new RegisterConsentRequest(this, id, state);
+
+ request.Execute();
+ }
+
///
/// Get App Marketplace Url.
///
@@ -4790,6 +5304,28 @@ public void SetEncryptionConfiguration(string imageBase64, string emailText, str
request.Execute();
}
+ ///
+ /// Get the OME (i.e. Office Message Encryption) configuration data. This method is used in server-to-server calls to retrieve OME configuration
+ ///
+ /// OME Configuration response object
+ public GetOMEConfigurationResponse GetOMEConfiguration()
+ {
+ GetOMEConfigurationRequest request = new GetOMEConfigurationRequest(this);
+
+ return request.Execute();
+ }
+
+ ///
+ /// Set the OME (i.e. Office Message Encryption) configuration data. This method is used in server-to-server calls to set encryption configuration
+ ///
+ /// The xml
+ public void SetOMEConfiguration(string xml)
+ {
+ SetOMEConfigurationRequest request = new SetOMEConfigurationRequest(this, xml);
+
+ request.Execute();
+ }
+
///
/// Set the client extension data. This method is used in server-to-server calls to install/uninstall/configure ORG
/// extensions to support admin's management of ORG extensions via powershell/UMC.
@@ -4804,6 +5340,93 @@ public void SetClientExtension(List actions)
#endregion
+ #region Groups
+ ///
+ /// Gets the list of unified groups associated with the user
+ ///
+ /// The Requested Unified Groups Sets
+ /// The smtp address of accessing user.
+ /// UserUnified groups.
+ public Collection GetUserUnifiedGroups(
+ IEnumerable requestedUnifiedGroupsSets,
+ string userSmtpAddress)
+ {
+ EwsUtilities.ValidateParam(requestedUnifiedGroupsSets, "requestedUnifiedGroupsSets");
+ EwsUtilities.ValidateParam(userSmtpAddress, "userSmtpAddress");
+
+ return this.GetUserUnifiedGroupsInternal(requestedUnifiedGroupsSets, userSmtpAddress);
+ }
+
+ ///
+ /// Gets the list of unified groups associated with the user
+ ///
+ /// The Requested Unified Groups Sets
+ /// UserUnified groups.
+ public Collection GetUserUnifiedGroups(IEnumerable requestedUnifiedGroupsSets)
+ {
+ EwsUtilities.ValidateParam(requestedUnifiedGroupsSets, "requestedUnifiedGroupsSets");
+ return this.GetUserUnifiedGroupsInternal(requestedUnifiedGroupsSets, null);
+ }
+
+ ///
+ /// Gets the list of unified groups associated with the user
+ ///
+ /// The Requested Unified Groups Sets
+ /// The smtp address of accessing user.
+ /// UserUnified groups.
+ private Collection GetUserUnifiedGroupsInternal(
+ IEnumerable requestedUnifiedGroupsSets,
+ string userSmtpAddress)
+ {
+ GetUserUnifiedGroupsRequest request = new GetUserUnifiedGroupsRequest(this);
+
+ if (!string.IsNullOrEmpty(userSmtpAddress))
+ {
+ request.UserSmtpAddress = userSmtpAddress;
+ }
+
+ if (requestedUnifiedGroupsSets != null)
+ {
+ request.RequestedUnifiedGroupsSets = requestedUnifiedGroupsSets;
+ }
+
+ return request.Execute().GroupsSets;
+ }
+
+ ///
+ /// Gets the UnifiedGroupsUnseenCount for the group specfied
+ ///
+ /// The smtpaddress of group for which unseendata is desired
+ /// The LastVisitedTimeUtc of group for which unseendata is desired
+ /// UnifiedGroupsUnseenCount
+ public int GetUnifiedGroupUnseenCount(string groupMailboxSmtpAddress, DateTime lastVisitedTimeUtc)
+ {
+ EwsUtilities.ValidateParam(groupMailboxSmtpAddress, "groupMailboxSmtpAddress");
+
+ GetUnifiedGroupUnseenCountRequest request = new GetUnifiedGroupUnseenCountRequest(
+ this, lastVisitedTimeUtc, UnifiedGroupIdentityType.SmtpAddress, groupMailboxSmtpAddress);
+
+ request.AnchorMailbox = groupMailboxSmtpAddress;
+
+ return request.Execute().UnseenCount;
+ }
+
+ ///
+ /// Sets the LastVisitedTime for the group specfied
+ ///
+ /// The smtpaddress of group for which unseendata is desired
+ /// The LastVisitedTimeUtc of group for which unseendata is desired
+ public void SetUnifiedGroupLastVisitedTime(string groupMailboxSmtpAddress, DateTime lastVisitedTimeUtc)
+ {
+ EwsUtilities.ValidateParam(groupMailboxSmtpAddress, "groupMailboxSmtpAddress");
+
+ SetUnifiedGroupLastVisitedTimeRequest request = new SetUnifiedGroupLastVisitedTimeRequest(this, lastVisitedTimeUtc, UnifiedGroupIdentityType.SmtpAddress, groupMailboxSmtpAddress);
+
+ request.Execute();
+ }
+
+ #endregion
+
#region Diagnostic Method -- Only used by test
///
@@ -5033,16 +5656,7 @@ internal IEwsHttpWebRequest PrepareHttpWebRequest(string methodName)
Uri endpoint = this.Url;
this.RegisterCustomBasicAuthModule();
- if (this.RenderingMethod == RenderingMode.JSON)
- {
- endpoint = new Uri(
- endpoint,
- String.Format("{0}/{1}{2}", endpoint.AbsolutePath, methodName, endpoint.Query));
- }
- else
- {
- endpoint = this.AdjustServiceUriFromCredentials(endpoint);
- }
+ endpoint = this.AdjustServiceUriFromCredentials(endpoint);
IEwsHttpWebRequest request = this.PrepareHttpWebRequestForUrl(
endpoint,
@@ -5063,20 +5677,8 @@ internal IEwsHttpWebRequest PrepareHttpWebRequest(string methodName)
/// The request.
internal override void SetContentType(IEwsHttpWebRequest request)
{
- if (this.renderingMode == RenderingMode.Xml)
- {
- request.ContentType = "text/xml; charset=utf-8";
- request.Accept = "text/xml";
- }
- else if (this.renderingMode == RenderingMode.JSON)
- {
- request.ContentType = "application/json; charset=utf-8";
- request.Accept = "application/json";
- }
- else
- {
- base.SetContentType(request);
- }
+ request.ContentType = "text/xml; charset=utf-8";
+ request.Accept = "text/xml";
}
///
@@ -5213,15 +5815,6 @@ internal bool Exchange2007CompatibilityMode
set { this.exchange2007CompatibilityMode = value; }
}
- ///
- /// Gets or sets the method by which the service will serialize the request.
- ///
- internal ExchangeService.RenderingMode RenderingMethod
- {
- get { return this.renderingMode; }
- set { this.renderingMode = value; }
- }
-
///
/// Gets or sets a value indicating whether trace output is pretty printed.
///
@@ -5249,23 +5842,5 @@ internal string TargetServerVersion
}
#endregion
-
- #region Private enums
- ///
- /// The rendering method.
- ///
- public enum RenderingMode
- {
- ///
- /// XML
- ///
- Xml,
-
- ///
- /// Javascript Object Notation
- ///
- JSON
- }
- #endregion
}
-}
+}
\ No newline at end of file
diff --git a/Core/ExchangeServiceBase.cs b/Core/ExchangeServiceBase.cs
index b93e902e..2d133f55 100644
--- a/Core/ExchangeServiceBase.cs
+++ b/Core/ExchangeServiceBase.cs
@@ -1,12 +1,27 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the ExchangeServiceBase class.
-//-----------------------------------------------------------------------
+/*
+ * Exchange Web Services Managed API
+ *
+ * Copyright (c) Microsoft Corporation
+ * All rights reserved.
+ *
+ * MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
+ * software and associated documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
namespace Microsoft.Exchange.WebServices.Data
{
@@ -328,16 +343,20 @@ private void TraceHttpResponseHeaders(TraceFlags traceType, IEwsHttpWebResponse
/// The response headers
private void SaveHttpResponseHeaders(WebHeaderCollection headers)
{
- EwsUtilities.Assert(
- this.httpResponseHeaders.Count == 0,
- "ExchangeServiceBase.SaveHttpResponseHeaders",
- "expect no headers in the dictionary yet.");
-
this.httpResponseHeaders.Clear();
foreach (string key in headers.AllKeys)
{
- this.httpResponseHeaders.Add(key, headers[key]);
+ string existingValue;
+
+ if (this.httpResponseHeaders.TryGetValue(key, out existingValue))
+ {
+ this.httpResponseHeaders[key] = existingValue + "," + headers[key];
+ }
+ else
+ {
+ this.httpResponseHeaders.Add(key, headers[key]);
+ }
}
if (this.OnResponseHeadersCaptured != null)
@@ -905,4 +924,4 @@ internal IEwsHttpWebRequestFactory HttpWebRequestFactory
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/Core/JsonNames.cs b/Core/JsonNames.cs
deleted file mode 100644
index d3d72273..00000000
--- a/Core/JsonNames.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------
-// Defines the XmlElementNames class.
-//-----------------------------------------------------------------------
-
-namespace Microsoft.Exchange.WebServices.Data
-{
- ///
- /// JSON names not shared with the XmlElementNames or XmlAttributeNames classes.
- ///
- internal static class JsonNames
- {
- public const string Events = "Events";
- public const string NotificationType = "NotificationType";
- public const string OldFolderId = "OldFolderId";
- public const string OldItemId = "OldItemId";
- public const string PathToExtendedFieldType = "ExtendedPropertyUri";
- public const string PathToIndexedFieldType = "DictionaryPropertyUri";
- public const string PathToUnindexedFieldType = "PropertyUri";
- public const string Path = "Path";
- public const string RecurrencePattern = "RecurrencePattern";
- public const string RecurrenceRange = "RecurrenceRange";
- }
-}
diff --git a/Core/JsonObject.cs b/Core/JsonObject.cs
deleted file mode 100644
index 000d262e..00000000
--- a/Core/JsonObject.cs
+++ /dev/null
@@ -1,559 +0,0 @@
-// ---------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// ---------------------------------------------------------------------------
-
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Text;
-
-namespace Microsoft.Exchange.WebServices.Data
-{
- ///
- /// Represents a JSON construction of an object.
- /// Used for serialization and deserialization.
- ///
- internal class JsonObject : Dictionary
- {
- ///
- /// Special property name used by EWS JSON endpoint to indicate the object type.
- ///
- private const string TypeAttribute = "__type";
-
- ///
- /// Namespace for Exchange JSON types.
- ///
- private const string JsonTypeNamespace = "Exchange";
-
- ///
- /// Used for existing XmlElements that have attributes and a text value.
- /// Eg., "Hello, World!