private static Dictionary <REG_TIMEZONE_INFO, string> CollectTimeZones(IList <Item> items) { Dictionary <REG_TIMEZONE_INFO, string> dictionary = new Dictionary <REG_TIMEZONE_INFO, string>(); foreach (Item item in items) { ExTimeZone exTimeZoneFromItem = TimeZoneHelper.GetExTimeZoneFromItem(item); REG_TIMEZONE_INFO key = TimeZoneHelper.RegTimeZoneInfoFromExTimeZone(exTimeZoneFromItem); string text = CalendarUtil.RemoveDoubleQuotes(string.IsNullOrEmpty(exTimeZoneFromItem.AlternativeId) ? exTimeZoneFromItem.DisplayName : exTimeZoneFromItem.AlternativeId); if (!string.IsNullOrEmpty(text) && text.EndsWith("\r\n")) { text = text.Substring(0, text.Length - 2); } string value = text; if (!dictionary.ContainsKey(key)) { int num = 0; while (string.IsNullOrEmpty(value) || dictionary.ContainsValue(value)) { value = string.Format("{0} {1}", text, ++num); } dictionary.Add(key, value); } } return(dictionary); }
protected override bool ProcessParameter(CalendarParameter parameter) { ParameterId parameterId = parameter.ParameterId; if (parameterId <= ParameterId.Delegatee) { if (parameterId <= ParameterId.CalendarUserType) { if (parameterId != ParameterId.CommonName) { if (parameterId == ParameterId.CalendarUserType) { this.calendarUserType = (string)parameter.Value; } } else { this.name = CalendarUtil.RemoveDoubleQuotes((string)parameter.Value); } } else if (parameterId != ParameterId.Delegator && parameterId != ParameterId.Delegatee) { } } else if (parameterId <= ParameterId.ParticipationRole) { if (parameterId != ParameterId.ParticipationStatus) { if (parameterId == ParameterId.ParticipationRole) { this.role = (string)parameter.Value; } } else { this.partstat = (string)parameter.Value; } } else if (parameterId != ParameterId.RsvpExpectation) { if (parameterId == ParameterId.SentBy) { string text = CalendarUtil.RemoveDoubleQuotes((string)parameter.Value); if (text != null) { text = CalendarUtil.RemoveMailToPrefix(text); } this.sentBy = text; } } else if (!bool.TryParse(parameter.Value as string, out this.isResponseRequested)) { this.isResponseRequested = true; } return(true); }
protected override void ProcessProperty(CalendarPropertyBase calendarProperty) { PropertyId propertyId = calendarProperty.CalendarPropertyId.PropertyId; if (propertyId != PropertyId.TimeZoneId) { return; } this.timeZoneId = CalendarUtil.RemoveDoubleQuotes((string)calendarProperty.Value); }