/// <summary>
        /// Tries to read element from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <returns>True if element was read.</returns>
        internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
        {
            if (base.TryReadElementFromXml(reader))
            {
                return(true);
            }
            else
            {
                switch (reader.LocalName)
                {
                case XmlElementNames.TimeOffset:
                    this.timeOffset = EwsUtilities.XSDurationToTimeSpan(reader.ReadElementValue());
                    return(true);

                case XmlElementNames.Month:
                    this.month = reader.ReadElementValue <int>();

                    EwsUtilities.Assert(
                        this.month > 0 && this.month <= 12,
                        "AbsoluteMonthTransition.TryReadElementFromXml",
                        "month is not in the valid 1 - 12 range.");

                    return(true);

                default:
                    return(false);
                }
            }
        }
        /// <summary>
        /// Loads from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        internal void LoadDomainSettingsFromXml(EwsXmlReader reader)
        {
            if (!reader.IsEmptyElement)
            {
                do
                {
                    reader.Read();

                    if ((reader.NodeType == XmlNodeType.Element) && (reader.LocalName == XmlElementNames.DomainSetting))
                    {
                        string settingClass = reader.ReadAttributeValue(XmlNamespace.XmlSchemaInstance, XmlAttributeNames.Type);

                        switch (settingClass)
                        {
                        case XmlElementNames.DomainStringSetting:
                            this.ReadSettingFromXml(reader);
                            break;

                        default:
                            EwsUtilities.Assert(
                                false,
                                "GetDomainSettingsResponse.LoadDomainSettingsFromXml",
                                string.Format("Invalid setting class '{0}' returned", settingClass));
                            break;
                        }
                    }
                }while (!reader.IsEndElement(XmlNamespace.Autodiscover, XmlElementNames.DomainSettings));
            }
        }
        /// <summary>
        /// Convert instance to string.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns>TaskDelegationState value.</returns>
        internal override string ToString(object value)
        {
            TaskDelegationState taskDelegationState = (TaskDelegationState)value;

            switch (taskDelegationState)
            {
            case TaskDelegationState.NoDelegation:
                return(NoMatch);

            case TaskDelegationState.Unknown:
                return(OwnNew);

            case TaskDelegationState.Accepted:
                return(Owned);

            case TaskDelegationState.Declined:
                return(Accepted);

            default:
                EwsUtilities.Assert(
                    false,
                    "TaskDelegationStatePropertyDefinition.ToString",
                    "Invalid TaskDelegationState value.");
                return(null);    // To keep the compiler happy
            }
        }
        /// <summary>
        /// Tries to read element from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <returns>True if element was read.</returns>
        internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
        {
            switch (reader.LocalName)
            {
            case XmlElementNames.ExtendedFieldURI:
                this.propertyDefinition = new ExtendedPropertyDefinition();
                this.propertyDefinition.LoadFromXml(reader);
                return(true);

            case XmlElementNames.Value:
                EwsUtilities.Assert(
                    this.PropertyDefinition != null,
                    "ExtendedProperty.TryReadElementFromXml",
                    "PropertyDefintion is missing");

                string stringValue = reader.ReadElementValue();
                this.value = MapiTypeConverter.ConvertToValue(this.PropertyDefinition.MapiType, stringValue);
                return(true);

            case XmlElementNames.Values:
                EwsUtilities.Assert(
                    this.PropertyDefinition != null,
                    "ExtendedProperty.TryReadElementFromXml",
                    "PropertyDefintion is missing");

                StringList stringList = new StringList(XmlElementNames.Value);
                stringList.LoadFromXml(reader, reader.LocalName);
                this.value = MapiTypeConverter.ConvertToValue(this.PropertyDefinition.MapiType, stringList);
                return(true);

            default:
                return(false);
            }
        }
Beispiel #5
0
     : super()
 {
     EwsUtilities.Assert(
         service != null,
         "ExecuteDiagnosticMethodResponse.ctor",
         "service is null");
 }
        /// <summary>
        /// Reads response elements from Json.
        /// </summary>
        /// <param name="responseObject">The response object.</param>
        /// <param name="service">The service.</param>
        internal override void ReadElementsFromJson(JsonObject responseObject, ExchangeService service)
        {
            string alternateIdClass = responseObject.ReadTypeString();

            switch (alternateIdClass)
            {
            case AlternateId.SchemaTypeName:
                this.convertedId = new AlternateId();
                break;

            case AlternatePublicFolderId.SchemaTypeName:
                this.convertedId = new AlternatePublicFolderId();
                break;

            case AlternatePublicFolderItemId.SchemaTypeName:
                this.convertedId = new AlternatePublicFolderItemId();
                break;

            default:
                EwsUtilities.Assert(
                    false,
                    "ConvertIdResponse.ReadElementsFromXml",
                    string.Format("Unknown alternate Id class: {0}", alternateIdClass));
                break;
            }

            this.convertedId.LoadAttributesFromJson(responseObject);
        }
        /// <summary>
        /// Reads domain setting from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        private void ReadSettingFromXml(EwsXmlReader reader)
        {
            DomainSettingName?name  = null;
            object            value = null;

            do
            {
                reader.Read();

                if (reader.NodeType == XmlNodeType.Element)
                {
                    switch (reader.LocalName)
                    {
                    case XmlElementNames.Name:
                        name = reader.ReadElementValue <DomainSettingName>();
                        break;

                    case XmlElementNames.Value:
                        value = reader.ReadElementValue();
                        break;
                    }
                }
            }while (!reader.IsEndElement(XmlNamespace.Autodiscover, XmlElementNames.DomainSetting));

            EwsUtilities.Assert(
                name.HasValue,
                "GetDomainSettingsResponse.ReadSettingFromXml",
                "Missing name element in domain setting");

            this.settings.Add(name.Value, value);
        }
Beispiel #8
0
        /// <summary>
        /// Traces the response.
        /// </summary>
        /// <param name="response">The response.</param>
        /// <param name="memoryStream">The response content in a MemoryStream.</param>
        private void TraceResponse(HttpWebResponse response, MemoryStream memoryStream)
        {
            EwsUtilities.Assert(
                memoryStream != null,
                "WindowsLiveCredentials.TraceResponse",
                "memoryStream cannot be null");

            if (!this.TraceEnabled)
            {
                return;
            }

            if (!string.IsNullOrEmpty(response.ContentType) &&
                (response.ContentType.StartsWith("text/", StringComparison.OrdinalIgnoreCase) ||
                 response.ContentType.StartsWith("application/soap", StringComparison.OrdinalIgnoreCase)))
            {
                this.traceListener.Trace(
                    "WindowsLiveResponse",
                    EwsUtilities.FormatLogMessageWithXmlContent("WindowsLiveResponse", memoryStream));
            }
            else
            {
                this.traceListener.Trace(
                    "WindowsLiveResponse",
                    "Non-textual response");
            }
        }
Beispiel #9
0
    /// <summary>
    /// Loads an entry, consisting of a key value pair, into this dictionary from the specified reader.
    /// </summary>
    /// <param name="reader">The reader.</param>
    /* private */ void LoadEntry(EwsServiceXmlReader reader)
    {
        EwsUtilities.Assert(
            reader != null,
            "UserConfigurationDictionary.LoadEntry",
            "reader is null");

        object key;
        object value = null;

        // Position at DictionaryKey
        reader.ReadStartElement(this.Namespace, XmlElementNames.DictionaryKey);

        key = this.GetDictionaryObject(reader);

        // Position at DictionaryValue
        reader.ReadStartElement(this.Namespace, XmlElementNames.DictionaryValue);

        String nil      = reader.ReadAttributeValue(XmlNamespace.XmlSchemaInstance, XmlAttributeNames.Nil);
        bool   hasValue = (nil == null) || (!Convert.ToBoolean(nil));

        if (hasValue)
        {
            value = this.GetDictionaryObject(reader);
        }

        this.dictionary.Add(key, value);
    }
Beispiel #10
0
    /// <summary>
    /// Writes to Xml.
    /// </summary>
    /// <param name="writer">The writer.</param>
    /// <param name="xmlNamespace">The XML namespace.</param>
    /// <param name="name">The user configuration name.</param>
    /// <param name="parentFolderId">The Id of the folder containing the user configuration.</param>
    static void WriteUserConfigurationNameToXml(
        EwsServiceXmlWriter writer,
        XmlNamespace xmlNamespace,
        String name,
        FolderId parentFolderId)
    {
        EwsUtilities.Assert(
            writer != null,
            "UserConfiguration.WriteUserConfigurationNameToXml",
            "writer is null");
        EwsUtilities.Assert(
            name != null,
            "UserConfiguration.WriteUserConfigurationNameToXml",
            "name is null");
        EwsUtilities.Assert(
            parentFolderId != null,
            "UserConfiguration.WriteUserConfigurationNameToXml",
            "parentFolderId is null");

        writer.WriteStartElement(xmlNamespace, XmlElementNames.UserConfigurationName);

        writer.WriteAttributeValue(XmlAttributeNames.Name, name);

        parentFolderId.WriteToXml(writer);

        writer.WriteEndElement();
    }
Beispiel #11
0
        /// <summary>
        /// Reads user setting from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        private void ReadSettingFromXml(EwsXmlReader reader)
        {
            string name  = null;
            object value = null;

            do
            {
                reader.Read();

                if (reader.NodeType == XmlNodeType.Element)
                {
                    switch (reader.LocalName)
                    {
                    case XmlElementNames.Name:
                        name = reader.ReadElementValue <string>();
                        break;

                    case XmlElementNames.Value:
                        value = reader.ReadElementValue();
                        break;

                    case XmlElementNames.WebClientUrls:
                        value = WebClientUrlCollection.LoadFromXml(reader);
                        break;

                    case XmlElementNames.ProtocolConnections:
                        value = ProtocolConnectionCollection.LoadFromXml(reader);
                        break;

                    case XmlElementNames.AlternateMailboxes:
                        value = AlternateMailboxCollection.LoadFromXml(reader);
                        break;

                    case XmlElementNames.DocumentSharingLocations:
                        value = DocumentSharingLocationCollection.LoadFromXml(reader);
                        break;
                    }
                }
            }while (!reader.IsEndElement(XmlNamespace.Autodiscover, XmlElementNames.UserSetting));

            // EWS Managed API is broken with AutoDSvc endpoint in RedirectUrl scenario
            try
            {
                UserSettingName userSettingName = EwsUtilities.Parse <UserSettingName>(name);
                this.Settings.Add(userSettingName, value);
            }
            catch (ArgumentException)
            {
                // ignore unexpected UserSettingName in the response (due to the server-side bugs).
                // it'd be better if this is hooked into ITraceListener, but that is unavailable here.
                //
                // in case "name" is null, EwsUtilities.Parse throws ArgumentNullException
                // (which derives from ArgumentException).
                //
                EwsUtilities.Assert(
                    false,
                    "GetUserSettingsResponse.ReadSettingFromXml",
                    "Unexpected or empty name element in user setting");
            }
        }
Beispiel #12
0
    /// <summary>
    /// Writes a dictionary object (key or value) to Xml.
    /// </summary>
    /// <param name="writer">The writer.</param>
    /// <param name="xmlElementName">The Xml element name.</param>
    /// <param name="dictionaryObject">The object to write.</param>
    /* private */ void WriteObjectToXml(
        EwsServiceXmlWriter writer,
        String xmlElementName,
        object dictionaryObject)
    {
        EwsUtilities.Assert(
            writer != null,
            "UserConfigurationDictionary.WriteObjectToXml",
            "writer is null");
        EwsUtilities.Assert(
            xmlElementName != null,
            "UserConfigurationDictionary.WriteObjectToXml",
            "xmlElementName is null");

        writer.WriteStartElement(XmlNamespace.Types, xmlElementName);

        if (dictionaryObject == null)
        {
            EwsUtilities.Assert(
                xmlElementName != XmlElementNames.DictionaryKey,
                "UserConfigurationDictionary.WriteObjectToXml",
                "Key is null");

            writer.WriteAttributeValue(
                EwsUtilities.EwsXmlSchemaInstanceNamespacePrefix,
                XmlAttributeNames.Nil,
                EwsUtilities.XSTrue);
        }
        else
        {
            this.WriteObjectValueToXml(writer, dictionaryObject);
        }

        writer.WriteEndElement();
    }
        /// <summary>
        /// Processes an HTTP error response
        /// </summary>
        /// <param name="httpWebResponse">The HTTP web response.</param>
        /// <param name="webException">The web exception.</param>
        /// <param name="responseHeadersTraceFlag">The trace flag for response headers.</param>
        /// <param name="responseTraceFlag">The trace flag for responses.</param>
        /// <remarks>
        /// This method doesn't handle 500 ISE errors. This is handled by the caller since
        /// 500 ISE typically indicates that a SOAP fault has occurred and the handling of
        /// a SOAP fault is currently service specific.
        /// </remarks>
        internal void InternalProcessHttpErrorResponse(
            IEwsHttpWebResponse httpWebResponse,
            WebException webException,
            TraceFlags responseHeadersTraceFlag,
            TraceFlags responseTraceFlag)
        {
            EwsUtilities.Assert(
                httpWebResponse.StatusCode != HttpStatusCode.InternalServerError,
                "ExchangeServiceBase.InternalProcessHttpErrorResponse",
                "InternalProcessHttpErrorResponse does not handle 500 ISE errors, the caller is supposed to handle this.");

            this.ProcessHttpResponseHeaders(responseHeadersTraceFlag, httpWebResponse);

            // Deal with new HTTP error code indicating that account is locked.
            // The "unlock" URL is returned as the status description in the response.
            if (httpWebResponse.StatusCode == ExchangeServiceBase.AccountIsLocked)
            {
                string location = httpWebResponse.StatusDescription;

                Uri accountUnlockUrl = null;
                if (Uri.IsWellFormedUriString(location, UriKind.Absolute))
                {
                    accountUnlockUrl = new Uri(location);
                }

                this.TraceMessage(responseTraceFlag, string.Format("Account is locked. Unlock URL is {0}", accountUnlockUrl));

                throw new AccountIsLockedException(
                          string.Format(Strings.AccountIsLocked, accountUnlockUrl),
                          accountUnlockUrl,
                          webException);
            }
        }
Beispiel #14
0
        /// <summary>
        /// Loads from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        internal void LoadUserSettingsFromXml(EwsXmlReader reader)
        {
            if (!reader.IsEmptyElement)
            {
                do
                {
                    reader.Read();

                    if ((reader.NodeType == XmlNodeType.Element) && (reader.LocalName == XmlElementNames.UserSetting))
                    {
                        string settingClass = reader.ReadAttributeValue(XmlNamespace.XmlSchemaInstance, XmlAttributeNames.Type);

                        switch (settingClass)
                        {
                        case XmlElementNames.StringSetting:
                        case XmlElementNames.WebClientUrlCollectionSetting:
                        case XmlElementNames.AlternateMailboxCollectionSetting:
                        case XmlElementNames.ProtocolConnectionCollectionSetting:
                        case XmlElementNames.DocumentSharingLocationCollectionSetting:
                            this.ReadSettingFromXml(reader);
                            break;

                        default:
                            EwsUtilities.Assert(
                                false,
                                "GetUserSettingsResponse.LoadUserSettingsFromXml",
                                string.Format("Invalid setting class '{0}' returned", settingClass));
                            break;
                        }
                    }
                }while (!reader.IsEndElement(XmlNamespace.Autodiscover, XmlElementNames.UserSettings));
            }
        }
Beispiel #15
0
        /// <summary>
        /// Remove specified complex property.
        /// </summary>
        /// <param name="complexProperty">The complex property.</param>
        /// <returns>True if the complex property was successfully removed from the collection, false otherwise.</returns>
        internal bool InternalRemove(TComplexProperty complexProperty)
        {
            EwsUtilities.Assert(
                complexProperty != null,
                "ComplexPropertyCollection.InternalRemove",
                "complexProperty is null");

            if (this.items.Remove(complexProperty))
            {
                complexProperty.OnChange -= this.ItemChanged;

                if (!this.addedItems.Contains(complexProperty))
                {
                    this.removedItems.Add(complexProperty);
                }
                else
                {
                    this.addedItems.Remove(complexProperty);
                }
                this.modifiedItems.Remove(complexProperty);
                this.Changed();
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #16
0
        /// <summary>
        /// Writes the attributes to XML.
        /// </summary>
        /// <param name="writer">The writer.</param>
        internal override void WriteAttributesToXml(EwsServiceXmlWriter writer)
        {
            writer.WriteAttributeValue(
                XmlAttributeNames.ReturnFullContactData,
                this.ReturnFullContactData);

            string searchScope = null;

            searchScopeMap.Member.TryGetValue(this.SearchLocation, out searchScope);

            EwsUtilities.Assert(
                !string.IsNullOrEmpty(searchScope),
                "ResolveNameRequest.WriteAttributesToXml",
                "The specified search location cannot be mapped to an EWS search scope.");

            string propertySet = null;

            if (this.contactDataPropertySet != null)
            {
                PropertySet.DefaultPropertySetMap.Member.TryGetValue(this.contactDataPropertySet.BasePropertySet, out propertySet);
            }

            if (!this.Service.Exchange2007CompatibilityMode)
            {
                writer.WriteAttributeValue(XmlAttributeNames.SearchScope, searchScope);
            }
            if (!string.IsNullOrEmpty(propertySet))
            {
                writer.WriteAttributeValue(XmlAttributeNames.ContactDataShape, propertySet);
            }
        }
        /// <summary>
        /// GetXmlElementName retrieves the XmlElementName of this type based on the
        /// EwsObjectDefinition attribute that decorates it, if present.
        /// </summary>
        /// <returns>The XML element name associated with this type.</returns>
        internal string GetXmlElementName()
        {
            if (string.IsNullOrEmpty(this.xmlElementName))
            {
                this.xmlElementName = this.GetXmlElementNameOverride();

                if (string.IsNullOrEmpty(this.xmlElementName))
                {
                    lock (this.lockObject)
                    {
                        foreach (Attribute attribute in this.GetType().GetCustomAttributes(false))
                        {
                            ServiceObjectDefinitionAttribute definitionAttribute = attribute as ServiceObjectDefinitionAttribute;

                            if (definitionAttribute != null)
                            {
                                this.xmlElementName = definitionAttribute.XmlElementName;
                            }
                        }
                    }
                }
            }

            EwsUtilities.Assert(
                !string.IsNullOrEmpty(this.xmlElementName),
                "EwsObject.GetXmlElementName",
                string.Format("The class {0} does not have an associated XML element name.", this.GetType().Name));

            return(this.xmlElementName);
        }
Beispiel #18
0
        /// <summary>
        /// Tries to read element from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <returns>True if element was read.</returns>
        internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
        {
            if (base.TryReadElementFromXml(reader))
            {
                return(true);
            }
            else
            {
                if (reader.LocalName == XmlElementNames.Day)
                {
                    this.dayOfMonth = reader.ReadElementValue <int>();

                    EwsUtilities.Assert(
                        this.dayOfMonth > 0 && this.dayOfMonth <= 31,
                        "AbsoluteDayOfMonthTransition.TryReadElementFromXml",
                        "dayOfMonth is not in the valid 1 - 31 range.");

                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
        /// <summary>
        /// Creates the WS-Security header necessary to send with an outgoing request.
        /// </summary>
        /// <param name="xmlWriter">The XML writer to serialize the header to.</param>
        internal override void SerializeWSSecurityHeaders(XmlWriter xmlWriter)
        {
            EwsUtilities.Assert(
                this.securityToken != null,
                "WSSecurityBasedCredentials.SerializeWSSecurityHeaders",
                "Security token cannot be null!");

            // <wsu:Timestamp wsu:Id="_timestamp">
            //   <wsu:Created>2007-09-20T01:13:10.468Z</wsu:Created>
            //   <wsu:Expires>2007-09-20T01:18:10.468Z</wsu:Expires>
            // </wsu:Timestamp>
            //
            string timestamp = null;

            if (this.addTimestamp)
            {
                DateTime utcNow = DateTime.UtcNow;
                timestamp = string.Format(
                    WSSecurityBasedCredentials.WsuTimeStampFormat,
                    utcNow,
                    utcNow.AddMinutes(5));
            }

            // Format the WS-Security header based on all the information we have.
            string wsSecurityHeader = String.Format(
                WSSecurityBasedCredentials.WsSecurityHeaderFormat,
                timestamp + this.securityToken);

            // And write the header out...
            xmlWriter.WriteRaw(wsSecurityHeader);
        }
Beispiel #20
0
    /// <summary>
    /// Determines whether the specified property was updated.
    /// </summary>
    /// <param name="property">property to evaluate.</param>
    /// <returns>Boolean indicating whether to send the property Xml.</returns>
    /* private */ bool IsPropertyUpdated(UserConfigurationProperties property)
    {
        bool isPropertyDirty = false;
        bool isPropertyEmpty = false;

        switch (property)
        {
        case UserConfigurationProperties.Dictionary:
            isPropertyDirty = this.Dictionary.IsDirty;
            isPropertyEmpty = this.Dictionary.Count == 0;
            break;

        case UserConfigurationProperties.XmlData:
            isPropertyDirty = (property & this.updatedProperties) == property;
            isPropertyEmpty = (this.xmlData == null) || (this.xmlData.Length == 0);
            break;

        case UserConfigurationProperties.BinaryData:
            isPropertyDirty = (property & this.updatedProperties) == property;
            isPropertyEmpty = (this.binaryData == null) || (this.binaryData.Length == 0);
            break;

        default:
            EwsUtilities.Assert(
                false,
                "UserConfiguration.IsPropertyUpdated",
                "property not supported: " + property.ToString());
            break;
        }

        // Consider the property updated, if it's been modified, and either
        //    . there's a value or
        //    . there's no value but the operation is update.
        return(isPropertyDirty && ((!isPropertyEmpty) || (!this.isNew)));
    }
Beispiel #21
0
        /// <summary>
        /// Serializes the property to a Json value.
        /// </summary>
        /// <param name="service"></param>
        /// <returns>
        /// A Json value (either a JsonObject, an array of Json values, or a Json primitive)
        /// </returns>
        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);
        }
        /// <summary>Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object with the parameter name and additional exception information.</summary>
        /// <param name="info">The object that holds the serialized object data. </param>
        /// <param name="context">The contextual information about the source or destination. </param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> object is a null reference (Nothing in Visual Basic). </exception>
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            EwsUtilities.Assert(info != null, "AutodiscoverRemoteException.GetObjectData", "info is null");

            base.GetObjectData(info, context);

            info.AddValue("Error", this.error, typeof(Uri));
        }
        /// <summary>Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object with the parameter name and additional exception information.</summary>
        /// <param name="info">The object that holds the serialized object data. </param>
        /// <param name="context">The contextual information about the source or destination. </param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> object is a null reference (Nothing in Visual Basic). </exception>
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            EwsUtilities.Assert(info != null, "AutodiscoverResponseException.GetObjectData", "info is null");

            base.GetObjectData(info, context);

            info.AddValue("ErrorCode", (int)this.errorCode);
        }
        /// <summary>Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object with the parameter name and additional exception information.</summary>
        /// <param name="info">The object that holds the serialized object data. </param>
        /// <param name="context">The contextual information about the source or destination. </param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> object is a null reference (Nothing in Visual Basic). </exception>
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            EwsUtilities.Assert(info != null, "AccountIsLockedException.GetObjectData", "info is null");

            base.GetObjectData(info, context);

            info.AddValue("AccountUnlockUrl", this.AccountUnlockUrl, typeof(Uri));
        }
Beispiel #25
0
        /// <summary>Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object with the parameter name and additional exception information.</summary>
        /// <param name="info">The object that holds the serialized object data. </param>
        /// <param name="context">The contextual information about the source or destination. </param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> object is a null reference (Nothing in Visual Basic). </exception>
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            EwsUtilities.Assert(info != null, "PropertyException.GetObjectData", "info is null");

            base.GetObjectData(info, context);

            info.AddValue("PropertyName", this.name);
        }
Beispiel #26
0
        /// <summary>Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object with the parameter name and additional exception information.</summary>
        /// <param name="info">The object that holds the serialized object data. </param>
        /// <param name="context">The contextual information about the source or destination. </param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> object is a null reference (Nothing in Visual Basic). </exception>
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            EwsUtilities.Assert(info != null, "ServiceResponseException.GetObjectData", "info is null");

            base.GetObjectData(info, context);

            info.AddValue("Response", this.response, typeof(ServiceResponse));
        }
Beispiel #27
0
        /// <summary>Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object with the parameter name and additional exception information.</summary>
        /// <param name="info">The object that holds the serialized object data. </param>
        /// <param name="context">The contextual information about the source or destination. </param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> object is a null reference (Nothing in Visual Basic). </exception>
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            EwsUtilities.Assert(info != null, "ServerBusyException.GetObjectData", "info is null");

            base.GetObjectData(info, context);

            info.AddValue("BackOffMilliseconds", this.backOffMilliseconds);
        }
Beispiel #28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExecuteDiagnosticMethodResponse"/> class.
 /// </summary>
 /// <param name="service">The service.</param>
 internal ExecuteDiagnosticMethodResponse(ExchangeService service)
     : base()
 {
     EwsUtilities.Assert(
         service != null,
         "ExecuteDiagnosticMethodResponse.ctor",
         "service is null");
 }
        /// <summary>Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object with the parameter name and additional exception information.</summary>
        /// <param name="info">The object that holds the serialized object data. </param>
        /// <param name="context">The contextual information about the source or destination. </param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> object is a null reference (Nothing in Visual Basic). </exception>
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            EwsUtilities.Assert(info != null, "ServiceObjectPropertyException.GetObjectData", "info is null");

            base.GetObjectData(info, context);

            info.AddValue("PropertyDefinition", this.propertyDefinition, typeof(PropertyDefinitionBase));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="NameResolutionCollection"/> class.
        /// </summary>
        /// <param name="service">The service.</param>
        internal NameResolutionCollection(ExchangeService service)
        {
            EwsUtilities.Assert(
                service != null,
                "NameResolutionSet.ctor",
                "service is null.");

            this.service = service;
        }