public static SubCalEvent ToRepeatInstance(this Event googleEvent, EventID CalendarID, uint CurrentCount) { SubCalEvent retValue = new SubCalEvent(); retValue.ThirdPartyEventID = googleEvent.Id; retValue.ThirdPartyType = ThirdPartyControl.CalendarTool.google.ToString(); retValue.ThirdPartyUserID = googleEvent.Organizer.Email; EventID SubEVentID = EventID.generateRepeatGoogleSubCalendarEventID(CalendarID, CurrentCount); retValue.ID = SubEVentID.ToString(); retValue.CalendarID = SubEVentID.getRepeatCalendarEventID(); retValue.SubCalStartDate = (long)(new DateTimeOffset(googleEvent.Start.DateTime.Value) - TilerElementExtension.JSStartTime).TotalMilliseconds; retValue.SubCalEndDate = (long)(new DateTimeOffset(googleEvent.End.DateTime.Value) - TilerElementExtension.JSStartTime).TotalMilliseconds; retValue.SubCalTotalDuration = (googleEvent.End.DateTime.Value - googleEvent.Start.DateTime.Value); retValue.SubCalRigid = true; retValue.SubCalAddressDescription = googleEvent.Location;// SubCalendarEventEntry.Location.Description; retValue.SubCalAddress = googleEvent.Location; retValue.SubCalCalendarName = googleEvent.Summary; retValue.SubCalCalEventStart = retValue.SubCalStartDate; retValue.SubCalCalEventEnd = retValue.SubCalEndDate; retValue.isThirdParty = true; retValue.isReadOnly = false; if (googleEvent.ExtendedProperties != null && googleEvent.ExtendedProperties.Private__ != null && googleEvent.ExtendedProperties.Private__.ContainsKey(GoogleTilerEventControl.tilerReadonlyKey)) { retValue.isReadOnly = Convert.ToBoolean(googleEvent.ExtendedProperties.Private__[GoogleTilerEventControl.tilerReadonlyKey]); } retValue.isComplete = false; retValue.isEnabled = true; retValue.Duration = (long)retValue.SubCalTotalDuration.TotalMilliseconds; //retValue.EventPreDeadline = (long)SubCalendarEventEntry.PreDeadline.TotalMilliseconds; retValue.Priority = 0; //retValue.Conflict = String.Join(",", SubCalendarEventEntry.Conflicts.getConflictingEventIDs()); retValue.ColorSelection = 0; return(retValue); }