Exemplo n.º 1
0
 protected void CreateAirSyncNode(string airSyncTagName, string strData)
 {
     AirSyncDiagnostics.TraceInfo <string, string>(ExTraceGlobals.AirSyncTracer, this, "Creating Node={0} Value={1}", airSyncTagName, AirSyncProperty.GetValueToTrace(strData, airSyncTagName));
     this.xmlNode           = this.xmlParentNode.OwnerDocument.CreateElement(airSyncTagName, this.xmlNodeNamespace);
     this.xmlNode.InnerText = strData;
     this.xmlParentNode.AppendChild(this.xmlNode);
 }
Exemplo n.º 2
0
        // Token: 0x060013F3 RID: 5107 RVA: 0x000735A4 File Offset: 0x000717A4
        public IEnumerator <AttendeeData> GetEnumerator()
        {
            CalendarItemBase calItem = base.XsoItem as CalendarItemBase;

            if (calItem == null)
            {
                throw new UnexpectedTypeException("CalendarItemBase", base.XsoItem);
            }
            AirSyncDiagnostics.TraceInfo <int, GlobalObjectId>(ExTraceGlobals.XsoTracer, this, "Adding Attendees to meeting request.Count :{0}, GlobalObjectID: {1}", calItem.AttendeeCollection.Count, calItem.GlobalObjectId);
            bool anyAttendeeAdded = false;

            foreach (Attendee attendee in calItem.AttendeeCollection)
            {
                if (!attendee.IsOrganizer)
                {
                    if (attendee.Participant.EmailAddress != null)
                    {
                        anyAttendeeAdded = true;
                        yield return(new AttendeeData(EmailAddressConverter.LookupEmailAddressString(attendee.Participant, calItem.Session.MailboxOwner), attendee.Participant.DisplayName));
                    }
                    else
                    {
                        AirSyncDiagnostics.TraceDebug <string, string>(ExTraceGlobals.XsoTracer, this, "Attendee '{0}' skipped because there is no email address. Meeting Subject:'{1}'.", (attendee.Participant.DisplayName == null) ? "<Null>" : attendee.Participant.DisplayName, calItem.Subject);
                    }
                }
            }
            if (!anyAttendeeAdded && !calItem.IsOrganizer() && calItem.IsMeeting && calItem.AttendeeCollection.Count > 0)
            {
                AirSyncDiagnostics.TraceDebug <int, GlobalObjectId, string>(ExTraceGlobals.XsoTracer, this, "No Attendees were added for this meeting, Adding current user as default attendee. Actual Attendees Count: {0}, GlobalObjectId:{1}, Subject:{2}", calItem.AttendeeCollection.Count, calItem.GlobalObjectId, calItem.Subject);
                Command.CurrentCommand.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "ExplictlyAddingUserToMeeting");
                MailboxSession session = (MailboxSession)calItem.Session;
                yield return(new AttendeeData(session.MailboxOwner.MailboxInfo.PrimarySmtpAddress.ToString(), session.MailboxOwner.MailboxInfo.DisplayName));
            }
            yield break;
        }
Exemplo n.º 3
0
        protected override void InternalSetToDefault(IProperty srcProperty)
        {
            if (this.recurrenceType != TypeOfRecurrence.Calendar)
            {
                if (this.recurrenceType == TypeOfRecurrence.Task)
                {
                    Task task = base.XsoItem as Task;
                    if (task == null)
                    {
                        throw new UnexpectedTypeException("Task", base.XsoItem);
                    }
                    task.Recurrence = null;
                }
                return;
            }
            CalendarItem calendarItem = base.XsoItem as CalendarItem;

            if (calendarItem == null)
            {
                throw new UnexpectedTypeException("CalendarItem", base.XsoItem);
            }
            if (calendarItem.IsOrganizer())
            {
                calendarItem.Recurrence = null;
                base.XsoItem[CalendarItemBaseSchema.TimeZone] = TimeZoneHelper.GetPromotedTimeZoneFromItem(calendarItem).LocalizableDisplayName.ToString();
                return;
            }
            AirSyncDiagnostics.TraceInfo(ExTraceGlobals.CommonTracer, null, "Skip Recurrence change in case of attendee.");
        }
        // Token: 0x06000F94 RID: 3988 RVA: 0x000590D4 File Offset: 0x000572D4
        protected override void InternalCopyFrom(IProperty srcProperty)
        {
            IStringProperty stringProperty = srcProperty as IStringProperty;

            if (stringProperty == null)
            {
                throw new UnexpectedTypeException("IStringProperty", srcProperty, base.AirSyncTagNames[0]);
            }
            string text = stringProperty.StringData;
            bool   flag = string.Equals(base.AirSyncTagNames[0], "Location");

            if (PropertyState.Modified == srcProperty.State)
            {
                if (string.IsNullOrEmpty(text) && !flag)
                {
                    AirSyncDiagnostics.TraceInfo <string>(ExTraceGlobals.AirSyncTracer, this, "Node={0} String data is null or empty.", base.AirSyncTagNames[0]);
                    this.InternalSetToDefault(srcProperty);
                    return;
                }
                if (text.Length > 32000)
                {
                    text = text.Substring(0, 32000);
                }
                base.CreateAirSyncNode(text, flag);
            }
        }
Exemplo n.º 5
0
        protected void CreateAirSyncNode(string airSyncTagName, byte[] data)
        {
            AirSyncDiagnostics.TraceInfo <string>(ExTraceGlobals.AirSyncTracer, this, "Creating Node={0}", airSyncTagName);
            AirSyncBlobXmlNode airSyncBlobXmlNode = new AirSyncBlobXmlNode(null, airSyncTagName, this.xmlNodeNamespace, this.xmlParentNode.OwnerDocument);

            airSyncBlobXmlNode.ByteArray = data;
            this.xmlParentNode.AppendChild(airSyncBlobXmlNode);
        }
Exemplo n.º 6
0
        protected void AppendChildNode(string elementName, string value)
        {
            AirSyncDiagnostics.TraceInfo <string, string>(ExTraceGlobals.AirSyncTracer, this, "Creating Node={0} Value={1}", elementName, AirSyncProperty.GetValueToTrace(value, elementName));
            XmlNode xmlNode = this.xmlParentNode.OwnerDocument.CreateElement(elementName, this.xmlNodeNamespace);

            xmlNode.InnerText = value;
            this.xmlNode.AppendChild(xmlNode);
        }
Exemplo n.º 7
0
        protected void AppendChildCData(XmlNode parentNode, string elementName, string value)
        {
            AirSyncDiagnostics.TraceInfo <string, string, string>(ExTraceGlobals.AirSyncTracer, this, "Creating CData Node={0} Value={1} to {2}", elementName, AirSyncProperty.GetValueToTrace(value, elementName), parentNode.Name);
            XmlNode         xmlNode  = this.xmlParentNode.OwnerDocument.CreateElement(elementName, this.xmlNodeNamespace);
            XmlCDataSection newChild = this.xmlParentNode.OwnerDocument.CreateCDataSection(value);

            xmlNode.AppendChild(newChild);
            parentNode.AppendChild(xmlNode);
        }
Exemplo n.º 8
0
        protected void CreateAirSyncNode(string airSyncTagName, Stream mimeData, long mimeSize, XmlNodeType originalNodeType)
        {
            AirSyncDiagnostics.TraceInfo <string>(ExTraceGlobals.AirSyncTracer, this, "Creating Node={0}", airSyncTagName);
            AirSyncBlobXmlNode airSyncBlobXmlNode = new AirSyncBlobXmlNode(null, airSyncTagName, this.xmlNodeNamespace, this.xmlParentNode.OwnerDocument);

            airSyncBlobXmlNode.Stream           = mimeData;
            airSyncBlobXmlNode.StreamDataSize   = mimeSize;
            airSyncBlobXmlNode.OriginalNodeType = originalNodeType;
            this.xmlParentNode.AppendChild(airSyncBlobXmlNode);
        }
Exemplo n.º 9
0
 protected void CreateAirSyncNode(string strData, bool allowEmptyNode)
 {
     AirSyncDiagnostics.TraceInfo <string, string>(ExTraceGlobals.AirSyncTracer, this, "Creating Node={0} Value={1}", this.airSyncTagNames[0], AirSyncProperty.GetValueToTrace(strData, this.airSyncTagNames[0]));
     if (allowEmptyNode || !string.IsNullOrEmpty(strData))
     {
         this.xmlNode           = this.xmlParentNode.OwnerDocument.CreateElement(this.airSyncTagNames[0], this.xmlNodeNamespace);
         this.xmlNode.InnerText = strData;
         this.xmlParentNode.AppendChild(this.xmlNode);
     }
 }
Exemplo n.º 10
0
        protected XmlNode AppendChildNode(XmlNode parentNode, string elementName, Stream streamData, long dataSize, XmlNodeType orginalNodeType)
        {
            AirSyncDiagnostics.TraceInfo <string, string>(ExTraceGlobals.AirSyncTracer, this, "Appending Node={0} to {1}", elementName, parentNode.Name);
            AirSyncBlobXmlNode airSyncBlobXmlNode = new AirSyncBlobXmlNode(null, elementName, this.xmlNodeNamespace, this.xmlParentNode.OwnerDocument);

            airSyncBlobXmlNode.Stream           = streamData;
            airSyncBlobXmlNode.StreamDataSize   = dataSize;
            airSyncBlobXmlNode.OriginalNodeType = orginalNodeType;
            parentNode.AppendChild(airSyncBlobXmlNode);
            return(airSyncBlobXmlNode);
        }
Exemplo n.º 11
0
        public static Participant CreateParticipant(string textString)
        {
            if (string.IsNullOrEmpty(textString))
            {
                throw new ArgumentNullException("Participant string null");
            }
            AirSyncDiagnostics.TraceInfo <string>(ExTraceGlobals.CommonTracer, null, "CreateParticipant = {0}", textString);
            Participant participant = Participant.Parse(textString);

            EmailAddressConverter.ValidateParticipant(participant);
            return(participant);
        }
Exemplo n.º 12
0
        protected void AppendChildNode(XmlNode parentNode, string elementName, string value, string nodeNamespace)
        {
            AirSyncDiagnostics.TraceInfo(ExTraceGlobals.AirSyncTracer, this, "Appending Namespace = {0} Node={1} Value={2} to {3}", new object[]
            {
                nodeNamespace,
                elementName,
                AirSyncProperty.GetValueToTrace(value, elementName),
                parentNode.Name
            });
            XmlNode xmlNode = this.xmlParentNode.OwnerDocument.CreateElement(elementName, nodeNamespace);

            xmlNode.InnerText = value;
            parentNode.AppendChild(xmlNode);
        }
Exemplo n.º 13
0
 public bool IsBoundToEmptyTag()
 {
     if (this.xmlNode == null)
     {
         AirSyncDiagnostics.TraceInfo <AirSyncProperty>(ExTraceGlobals.AirSyncTracer, this, "AirSyncProperty={0} IsBoundToEmptyTag=false due to null xmlNode", this);
         return(false);
     }
     if (this.xmlNode.ChildNodes.Count == 0 && this.xmlNode.InnerText.Length == 0)
     {
         AirSyncDiagnostics.TraceInfo <AirSyncProperty>(ExTraceGlobals.AirSyncTracer, this, "AirSyncProperty={0} IsBoundToEmptyTag=true", this);
         return(true);
     }
     AirSyncDiagnostics.TraceInfo <AirSyncProperty, int, int>(ExTraceGlobals.AirSyncTracer, this, "AirSyncProperty={0} IsBoundToEmptyTag=false, ChildNodes count={1}, InnerText length={2}", this, this.xmlNode.ChildNodes.Count, this.xmlNode.InnerText.Length);
     return(false);
 }
Exemplo n.º 14
0
        // Token: 0x06001480 RID: 5248 RVA: 0x00076864 File Offset: 0x00074A64
        private static string GetFullEmailString(string displayName, string emailAddress)
        {
            StringBuilder stringBuilder = new StringBuilder(100);

            if (displayName.StartsWith("\"") && displayName.EndsWith("\""))
            {
                stringBuilder.Append(displayName);
                stringBuilder.Append(" <");
            }
            else
            {
                stringBuilder.Append('"');
                stringBuilder.Append(displayName);
                stringBuilder.Append("\" <");
            }
            stringBuilder.Append(emailAddress);
            stringBuilder.Append('>');
            AirSyncDiagnostics.TraceInfo <StringBuilder>(ExTraceGlobals.CommonTracer, null, "GetFullEmailString = {0}", stringBuilder);
            return(stringBuilder.ToString());
        }
Exemplo n.º 15
0
 public void PostProcessPropertyBag(AirSyncDataObject airSyncDataObject)
 {
     if (airSyncDataObject == null)
     {
         throw new ArgumentNullException("airSyncDataObject");
     }
     foreach (IProperty property in airSyncDataObject.Children)
     {
         AirSyncProperty airSyncProperty = (AirSyncProperty)property;
         if (airSyncProperty.State == PropertyState.Uninitialized)
         {
             airSyncProperty.State = PropertyState.Unmodified;
         }
         else if (airSyncProperty.IsBoundToEmptyTag())
         {
             airSyncProperty.State = PropertyState.SetToDefault;
         }
         AirSyncDiagnostics.TraceInfo <AirSyncProperty, PropertyState>(ExTraceGlobals.AirSyncTracer, this, "Property={0} State={1}", airSyncProperty, airSyncProperty.State);
     }
 }
Exemplo n.º 16
0
        private void ExecuteApplicationStart(object sender, EventArgs e)
        {
            int num = 0;

            num = Privileges.RemoveAllExcept(new string[]
            {
                "SeAuditPrivilege",
                "SeChangeNotifyPrivilege",
                "SeCreateGlobalPrivilege",
                "SeImpersonatePrivilege",
                "SeIncreaseQuotaPrivilege",
                "SeAssignPrimaryTokenPrivilege",
                "SeTcbPrivilege"
            }, "MSExchangeServicesSyncPool");
            if (num != 0)
            {
                string name;
                using (WindowsIdentity current = WindowsIdentity.GetCurrent())
                {
                    name = current.Name;
                }
                AirSyncDiagnostics.LogPeriodicEvent(AirSyncEventLogConstants.Tuple_SetPrivilegesFailure, "SetPrivilegesFailure: " + name, new string[]
                {
                    name,
                    num.ToString(CultureInfo.InvariantCulture)
                });
                Environment.Exit(num);
            }
            ExWatson.Init("E12");
            AppDomain.CurrentDomain.UnhandledException += Global.HandledExceptionProxy;
            Globals.InitializeMultiPerfCounterInstance("AirSync");
            ExRpcModule.Bind();
            AirSyncDiagnostics.TraceInfo <ResourceManagerHandle>(ExTraceGlobals.RequestsTracer, null, "AuthzAuthorization.ResourceManagerHandle static instance loaded", AuthzAuthorization.ResourceManagerHandle);
            AirSyncSyncStateTypeFactory.EnsureSyncStateTypesRegistered();
            FolderSyncState.RegisterCustomDataVersioningHandler(new FolderSyncState.HandleCustomDataVersioningDelegate(FolderSyncStateCustomDataInfo.HandlerCustomDataVersioning));
            FolderHierarchySyncState.RegisterCustomDataVersioningHandler(new FolderHierarchySyncState.HandleCustomDataVersioningDelegate(FolderHierarchySyncStateCustomDataInfo.HandlerCustomDataVersioning));
            EventQueue.PollingInterval = GlobalSettings.EventQueuePollingInterval;
            this.resetAutoBlockedDeviceCounterTimer = new Timer(new TimerCallback(Global.ResetAutoBlockedDeviceCounter), null, 86400000, 86400000);
        }
Exemplo n.º 17
0
 // Token: 0x06000F46 RID: 3910 RVA: 0x000571D0 File Offset: 0x000553D0
 protected virtual void FixupXml(IEnumerable <IGrouping <AttachmentId, AirSyncAttachmentInfo> > allAttachments)
 {
     foreach (IGrouping <AttachmentId, AirSyncAttachmentInfo> grouping in allAttachments)
     {
         AirSyncAttachmentInfo airSyncAttachmentInfo = grouping.First <AirSyncAttachmentInfo>();
         if (grouping.Count <AirSyncAttachmentInfo>() != 1)
         {
             foreach (AirSyncAttachmentInfo airSyncAttachmentInfo2 in grouping)
             {
                 AirSyncDiagnostics.TraceInfo <AttachmentId, bool, string>(ExTraceGlobals.AirSyncTracer, this, "AttachmentId = {0}, IsInline = {1}, ContentId = {2}", airSyncAttachmentInfo2.AttachmentId, airSyncAttachmentInfo2.IsInline, airSyncAttachmentInfo2.ContentId);
                 if (airSyncAttachmentInfo2.IsInline && !string.IsNullOrEmpty(airSyncAttachmentInfo2.ContentId))
                 {
                     if (airSyncAttachmentInfo.IsInline && !string.IsNullOrEmpty(airSyncAttachmentInfo.ContentId) && !string.Equals(airSyncAttachmentInfo.ContentId, airSyncAttachmentInfo2.ContentId))
                     {
                         throw new InvalidOperationException(string.Format("Different ContentId generated for the same attachment! contentId1: {0}, contentId2: {1}", airSyncAttachmentInfo.ContentId, airSyncAttachmentInfo2.ContentId));
                     }
                     airSyncAttachmentInfo = airSyncAttachmentInfo2;
                 }
             }
         }
         XmlNode parentNode;
         if (this.nodeMap.TryGetValue(grouping.Key, out parentNode))
         {
             if (airSyncAttachmentInfo.IsInline)
             {
                 base.ReplaceValueOrCreateNode(parentNode, "IsInline", "1");
                 if (!string.IsNullOrEmpty(airSyncAttachmentInfo.ContentId))
                 {
                     base.ReplaceValueOrCreateNode(parentNode, "ContentId", airSyncAttachmentInfo.ContentId);
                 }
             }
             else
             {
                 base.RemoveNode(parentNode, "IsInline");
                 base.RemoveNode(parentNode, "ContentId");
             }
         }
     }
 }
Exemplo n.º 18
0
        public static string GetParticipantString(Participant participant, IExchangePrincipal exchangePrincipal)
        {
            if (null == participant)
            {
                throw new ArgumentNullException("participant null");
            }
            StringBuilder stringBuilder = new StringBuilder(100);

            if (participant.DisplayName.StartsWith("\"") && participant.DisplayName.EndsWith("\""))
            {
                stringBuilder.Append(participant.DisplayName);
                stringBuilder.Append(" ");
            }
            else
            {
                stringBuilder.Append('"');
                stringBuilder.Append(participant.DisplayName);
                stringBuilder.Append("\" ");
            }
            stringBuilder.Append(EmailAddressConverter.LookupEmailAddressString(participant, exchangePrincipal, true));
            AirSyncDiagnostics.TraceInfo <StringBuilder>(ExTraceGlobals.CommonTracer, null, "GetParticipantString = {0}", stringBuilder);
            return(stringBuilder.ToString());
        }
        // Token: 0x06000FBD RID: 4029 RVA: 0x0005982C File Offset: 0x00057A2C
        protected override void InternalCopyFrom(IProperty sourceProperty)
        {
            List <BodyPartPreference> list = base.Options["BodyPartPreference"] as List <BodyPartPreference>;

            if (list != null && list.Count > 0)
            {
                List <BodyPreference> list2 = base.Options["BodyPreference"] as List <BodyPreference>;
                if (list2 == null || list2.Count <= 0)
                {
                    AirSyncDiagnostics.TraceInfo(ExTraceGlobals.AirSyncTracer, this, "No <BodyPreference> in the request while <BodyPartPreference> presends. Skip generating <Body>");
                    return;
                }
            }
            base.InternalCopyFrom(sourceProperty);
            int previewLength = this.GetPreviewLength();

            if (previewLength == 0)
            {
                return;
            }
            string text = ((IContent14Property)sourceProperty).Preview;

            if (string.IsNullOrEmpty(text))
            {
                return;
            }
            if (text.Length > previewLength)
            {
                text = text.Remove(previewLength);
            }
            text = text.TrimEnd(new char[0]);
            if (!string.IsNullOrEmpty(text))
            {
                base.AppendChildNode(base.XmlNode, "Preview", text);
            }
        }
Exemplo n.º 20
0
        protected override void InternalCopyFromModified(IProperty srcProperty)
        {
            CalendarItem calendarItem = null;
            Task         task         = null;

            if (this.recurrenceType == TypeOfRecurrence.Calendar)
            {
                calendarItem = (base.XsoItem as CalendarItem);
                if (calendarItem == null)
                {
                    throw new UnexpectedTypeException("CalendarItem", base.XsoItem);
                }
                if (!calendarItem.IsOrganizer())
                {
                    AirSyncDiagnostics.TraceInfo(ExTraceGlobals.CommonTracer, null, "InternalCopyFromModified::Skip Recurrence change in case of attendee.");
                    return;
                }
            }
            else if (this.recurrenceType == TypeOfRecurrence.Task)
            {
                task = (base.XsoItem as Task);
                if (task == null)
                {
                    throw new UnexpectedTypeException("Task", base.XsoItem);
                }
            }
            INestedProperty nestedProperty = srcProperty as INestedProperty;

            if (nestedProperty == null)
            {
                throw new UnexpectedTypeException("INestedProperty", srcProperty);
            }
            RecurrenceData recurrenceData = nestedProperty.NestedData as RecurrenceData;

            if (recurrenceData == null)
            {
                throw new UnexpectedTypeException("RecurrenceData", nestedProperty.NestedData);
            }
            Recurrence        recurrence        = (this.recurrenceType == TypeOfRecurrence.Calendar) ? calendarItem.Recurrence : task.Recurrence;
            RecurrencePattern recurrencePattern = XsoRecurrenceProperty.CreateRecurrencePattern(this.recurrenceType, recurrenceData, recurrence);
            ExDateTime        startDate         = ExDateTime.MinValue;
            ExDateTime        endDate           = ExDateTime.MinValue;

            if (this.recurrenceType == TypeOfRecurrence.Calendar)
            {
                ExDateTime startTime          = calendarItem.StartTime;
                ExTimeZone exTimeZoneFromItem = TimeZoneHelper.GetExTimeZoneFromItem(calendarItem);
                startDate = exTimeZoneFromItem.ConvertDateTime(startTime);
                if (recurrenceData.HasUntil())
                {
                    ExDateTime until = recurrenceData.Until;
                    endDate = exTimeZoneFromItem.ConvertDateTime(until);
                }
            }
            else if (this.recurrenceType == TypeOfRecurrence.Task)
            {
                startDate = recurrenceData.Start;
                if (recurrenceData.HasUntil())
                {
                    endDate = recurrenceData.Until;
                }
            }
            RecurrenceRange range;

            try
            {
                if (recurrenceData.HasOccurences())
                {
                    range = new NumberedRecurrenceRange(startDate, (int)recurrenceData.Occurrences);
                }
                else if (recurrenceData.HasUntil())
                {
                    range = new EndDateRecurrenceRange(startDate, endDate);
                }
                else
                {
                    range = new NoEndRecurrenceRange(startDate);
                }
            }
            catch (ArgumentException ex)
            {
                throw new ConversionException(ex.Message);
            }
            bool ignoreCalendarTypeAndIsLeapMonth = recurrenceData.ProtocolVersion < 140;

            if (recurrence != null && recurrence.Pattern != null && recurrence.Pattern.Equals(recurrencePattern, ignoreCalendarTypeAndIsLeapMonth))
            {
                recurrencePattern = recurrence.Pattern;
            }
            try
            {
                if (this.recurrenceType == TypeOfRecurrence.Calendar)
                {
                    ExTimeZone exTimeZoneFromItem2 = TimeZoneHelper.GetExTimeZoneFromItem(calendarItem);
                    try
                    {
                        calendarItem.Recurrence = new Recurrence(recurrencePattern, range, exTimeZoneFromItem2, null);
                        goto IL_295;
                    }
                    catch (ArgumentOutOfRangeException)
                    {
                        if (recurrenceData.CalendarType == CalendarType.Default)
                        {
                            recurrenceData.CalendarType = CalendarType.Gregorian;
                            AirSyncDiagnostics.TraceInfo(ExTraceGlobals.CommonTracer, null, "Replace calendar recurrence calendar type with Gregorian.");
                            recurrencePattern       = XsoRecurrenceProperty.CreateRecurrencePattern(this.recurrenceType, recurrenceData, recurrence);
                            calendarItem.Recurrence = new Recurrence(recurrencePattern, range, exTimeZoneFromItem2, null);
                            goto IL_295;
                        }
                        throw;
                    }
                }
                try
                {
                    task.Recurrence = new Recurrence(recurrencePattern, range);
                }
                catch (ArgumentOutOfRangeException)
                {
                    if (recurrenceData.CalendarType != CalendarType.Default)
                    {
                        throw;
                    }
                    recurrenceData.CalendarType = CalendarType.Gregorian;
                    AirSyncDiagnostics.TraceInfo(ExTraceGlobals.CommonTracer, null, "Replace task recurrence calendar type with Gregorian.");
                    recurrencePattern = XsoRecurrenceProperty.CreateRecurrencePattern(this.recurrenceType, recurrenceData, recurrence);
                    task.Recurrence   = new Recurrence(recurrencePattern, range);
                }
                task[TaskSchema.IsOneOff] = recurrenceData.DeadOccur;
                IL_295 :;
            }
            catch (NotSupportedException ex2)
            {
                throw new ConversionException(ex2.Message);
            }
        }
Exemplo n.º 21
0
        // Token: 0x06000FB5 RID: 4021 RVA: 0x00059390 File Offset: 0x00057590
        protected override void InternalCopyFrom(IProperty sourceProperty)
        {
            IContentProperty contentProperty = sourceProperty as IContentProperty;

            if (contentProperty == null)
            {
                throw new UnexpectedTypeException("IContentProperty", sourceProperty);
            }
            contentProperty.PreProcessProperty();
            try
            {
                long num = 0L;
                bool flag;
                long num3;
                if (BodyUtility.IsAskingForMIMEData(contentProperty, base.Options) && this.IsAcceptable(BodyType.Mime, out num, out flag))
                {
                    int num2 = -1;
                    this.bodyType = BodyType.Mime;
                    this.MIMEData = contentProperty.MIMEData;
                    if (base.Options.Contains("MIMETruncation"))
                    {
                        num2 = (int)base.Options["MIMETruncation"];
                    }
                    if (num2 >= 0 && (long)num2 < this.MIMEData.Length)
                    {
                        this.Truncated = true;
                        this.MIMESize  = (long)num2;
                    }
                    else
                    {
                        this.Truncated = false;
                        this.MIMESize  = this.MIMEData.Length;
                    }
                    num3 = contentProperty.MIMEData.Length;
                }
                else
                {
                    this.bodyType = contentProperty.GetNativeType();
                    if (this.bodyType == BodyType.None)
                    {
                        return;
                    }
                    num3 = contentProperty.Size;
                    foreach (BodyType bodyType in AirSyncContentProperty.GetPrioritizedBodyTypes(this.bodyType))
                    {
                        try
                        {
                            long num4;
                            if (this.ClientAccepts(contentProperty, bodyType, out num4, out num))
                            {
                                this.bodyType = bodyType;
                                num3          = num4;
                                break;
                            }
                        }
                        catch (ObjectNotFoundException arg)
                        {
                            AirSyncDiagnostics.TraceInfo <BodyType, ObjectNotFoundException>(ExTraceGlobals.AirSyncTracer, this, "ClientAccepts({0}) has thrown {1}", bodyType, arg);
                            num3          = 0L;
                            this.bodyType = BodyType.None;
                        }
                    }
                }
                if (contentProperty.IsIrmErrorMessage)
                {
                    this.Truncated = true;
                }
                base.XmlNode = base.XmlParentNode.OwnerDocument.CreateElement(base.AirSyncTagNames[0], base.Namespace);
                base.XmlParentNode.AppendChild(base.XmlNode);
                XmlNode xmlNode     = base.XmlNode;
                string  elementName = "Type";
                int     num5        = (int)this.bodyType;
                base.AppendChildNode(xmlNode, elementName, num5.ToString(CultureInfo.InvariantCulture));
                base.AppendChildNode(base.XmlNode, "EstimatedDataSize", num3.ToString(CultureInfo.InvariantCulture));
                if (this.Truncated)
                {
                    base.AppendChildNode(base.XmlNode, "Truncated", "1");
                }
                this.CopyData();
            }
            finally
            {
                contentProperty.PostProcessProperty();
            }
        }
Exemplo n.º 22
0
        public static string GetRecipientString(RecipientCollection collection, RecipientItemType recipientItemType, IExchangePrincipal exchangePrincipal)
        {
            if (collection == null)
            {
                throw new ArgumentNullException("Recipient collection null");
            }
            if (collection.Count == 0)
            {
                return(string.Empty);
            }
            int num = 0;

            Participant[] array  = new Participant[collection.Count];
            Participant[] array2 = new Participant[collection.Count];
            foreach (Recipient recipient in collection)
            {
                if (recipient == null)
                {
                    throw new ArgumentNullException("recipient is null");
                }
                array2[num] = recipient.Participant;
                if (recipient.Participant.RoutingType == "EX" && !string.IsNullOrEmpty(recipient.Participant.EmailAddress))
                {
                    Participant cachedParticipant = EmailAddressConverter.GetCachedParticipant(recipient.Participant.EmailAddress);
                    array[num++] = ((cachedParticipant == null) ? recipient.Participant : cachedParticipant);
                }
                else
                {
                    array[num++] = recipient.Participant;
                }
            }
            ParticipantUpdater.GetSMTPAddressesForParticipantsIfNecessary(array, collection);
            for (int i = 0; i < array.Length; i++)
            {
                Participant participant  = array2[i];
                Participant participant2 = array[i];
                if (participant.RoutingType != participant2.RoutingType)
                {
                    EmailAddressConverter.CacheParticipant(participant.EmailAddress, participant2);
                }
            }
            StringBuilder stringBuilder = new StringBuilder(collection.Count * 100);
            int           num2          = 0;

            foreach (Recipient recipient2 in collection)
            {
                Participant participant3 = array[num2++];
                if (recipientItemType == RecipientItemType.Unknown || recipient2.RecipientItemType == recipientItemType)
                {
                    if (participant3.DisplayName.StartsWith("\"") && participant3.DisplayName.EndsWith("\""))
                    {
                        stringBuilder.Append(participant3.DisplayName);
                        stringBuilder.Append(" <");
                    }
                    else
                    {
                        stringBuilder.Append('"');
                        stringBuilder.Append(participant3.DisplayName);
                        stringBuilder.Append("\" ");
                    }
                    stringBuilder.Append(EmailAddressConverter.LookupEmailAddressString(participant3, exchangePrincipal, true));
                    stringBuilder.Append(", ");
                }
                if (stringBuilder.Length > 32000)
                {
                    break;
                }
            }
            if (stringBuilder.Length > 1)
            {
                stringBuilder.Length -= 2;
            }
            AirSyncDiagnostics.TraceInfo <StringBuilder>(ExTraceGlobals.CommonTracer, null, "GetRecipientString = {0}", stringBuilder);
            return(stringBuilder.ToString());
        }
Exemplo n.º 23
0
 public ExceptionInstance(ExDateTime exceptionStartTime, byte deleted)
 {
     AirSyncDiagnostics.TraceInfo <ExDateTime, byte>(ExTraceGlobals.CommonTracer, this, "ExceptionInstance Created exceptionStartTime={0} deleted={1}", exceptionStartTime, deleted);
     this.exceptionStartTime = exceptionStartTime;
     this.deleted            = deleted;
 }
Exemplo n.º 24
0
 // Token: 0x06001086 RID: 4230 RVA: 0x0005C9E9 File Offset: 0x0005ABE9
 public AttendeeData(string emailAddress, string displayName)
 {
     AirSyncDiagnostics.TraceInfo <string, string>(ExTraceGlobals.CommonTracer, null, "AttendeeData Created email={0} displayname={1}", emailAddress, displayName);
     this.emailAddress = emailAddress;
     this.displayName  = displayName;
 }