public TilerColor getColorNode(XmlNode Arg1) { XmlNode var1 = Arg1.SelectSingleNode("Color"); int b = Convert.ToInt32(var1.SelectSingleNode("Blue").InnerText); int g = Convert.ToInt32(var1.SelectSingleNode("Green").InnerText); int r = Convert.ToInt32(var1.SelectSingleNode("Red").InnerText); double o = Convert.ToDouble(var1.SelectSingleNode("Opacity").InnerText); XmlNode userSelectionNode = var1.SelectSingleNode("UserSelection"); string userSelection_String = ""; if (userSelectionNode != null) { userSelection_String = userSelectionNode.InnerText; } if (string.IsNullOrEmpty(userSelection_String)) { userSelection_String = "-1"; } int UserSelection = Convert.ToInt32(userSelection_String); TilerColor retValue = new TilerColor(r, g, b, o, UserSelection); return(retValue); }
public EventDisplay getDisplayUINode(XmlNode Arg1) { XmlNode var1 = Arg1.SelectSingleNode("UIParams"); int DefaultFlag = Convert.ToInt32(var1.SelectSingleNode("Type").InnerText); bool DisplayFlag = Convert.ToBoolean(var1.SelectSingleNode("Visible").InnerText); EventDisplay retValue; TilerColor colorNode = getColorNode(var1); if (DefaultFlag == 0) { retValue = new EventDisplay(); } else { retValue = new EventDisplay(DisplayFlag, colorNode, DefaultFlag); } return(retValue); }
public static SubCalEvent ToSubCalEvent(this TilerElements.PausedTimeLineEntry pausedTimeline, TilerElements.CalendarEvent CalendarEventEntry, bool includeCalendarEvent = true) { SubCalendarEvent pausedSubEvent = CalendarEventEntry.getSubEvent(pausedTimeline.getSubEventId()); DateTimeOffset CurrentTime = DateTimeOffset.UtcNow; SubCalEvent retValue = new SubCalEvent(); retValue.ThirdPartyUserID = CalendarEventEntry.getCreator.Id; retValue.ThirdPartyType = CalendarEventEntry.ThirdpartyType.ToString(); retValue.ThirdPartyEventID = CalendarEventEntry.ThirdPartyID; retValue.ID = pausedTimeline.Id; retValue.CalendarID = CalendarEventEntry.Calendar_EventID.getRepeatCalendarEventID(); retValue.SubCalStartDate = (long)(pausedTimeline.Start - JSStartTime).TotalMilliseconds; retValue.SubCalEndDate = (long)(pausedTimeline.End - JSStartTime).TotalMilliseconds; retValue.SubCalTotalDuration = pausedTimeline.TimelineSpan; retValue.SubCalRigid = CalendarEventEntry.isRigid; retValue.SubCalAddressDescription = pausedSubEvent.Location.Description; retValue.SubCalAddress = pausedSubEvent.Location.Address; retValue.ThirdPartyEventID = pausedSubEvent.ThirdPartyID; retValue.SubCalCalendarName = pausedSubEvent.Name?.NameValue; retValue.Notes = pausedSubEvent?.Notes?.UserNote; if (CalendarEventEntry != null) { retValue.CalRigid = CalendarEventEntry.isRigid; retValue.SubCalCalEventStart = (long)(CalendarEventEntry.Start - JSStartTime).TotalMilliseconds; retValue.SubCalCalEventEnd = (long)(CalendarEventEntry.End - JSStartTime).TotalMilliseconds; retValue.SuggestedDeadline = CalendarEventEntry.DeadlineSuggestion.ToUnixTimeMilliseconds(); retValue.SleepSuggestedDeadline = CalendarEventEntry.SleepDeadlineSuggestion.ToUnixTimeMilliseconds(); if (string.IsNullOrEmpty(CalendarEventEntry.ThirdPartyID)) { } else { retValue.ID = retValue.ThirdPartyEventID; } } retValue.SubCalEventLong = pausedSubEvent.Location.Longitude; retValue.SubCalEventLat = pausedSubEvent.Location.Latitude; retValue.SubCalCalendarName = pausedSubEvent.getName?.NameValue; TilerColor uiColor = TilerColor.pausedUIColor(); if (uiColor != null) { retValue.RColor = uiColor.R; retValue.GColor = uiColor.G; retValue.BColor = uiColor.B; retValue.OColor = uiColor.O; retValue.ColorSelection = uiColor.User; } retValue.isComplete = false; retValue.isEnabled = true; retValue.Duration = (long)pausedTimeline.TimelineSpan.TotalMilliseconds; retValue.ThirdPartyEventID = pausedSubEvent.ThirdPartyID; retValue.EventPreDeadline = (long)pausedSubEvent.getPreDeadline.TotalMilliseconds; retValue.Priority = pausedSubEvent.getEventPriority; retValue.Conflict = String.Join(",", pausedSubEvent.Conflicts.getConflictingEventIDs()); retValue.isPaused = false; retValue.isPauseAble = false; retValue.PauseStart = (long)(pausedTimeline.Start - JSStartTime).TotalMilliseconds; retValue.PauseEnd = (long)(pausedTimeline.End - JSStartTime).TotalMilliseconds; retValue.IsLocked = true; retValue.UserLocked = false; retValue.isThirdParty = pausedSubEvent.isThirdParty; retValue.isReadOnly = true; retValue.isTardy = false; retValue.isProcrastinateAll = false; retValue.isAllDay = pausedSubEvent.getActiveDuration >= Utility.LeastAllDaySubeventDuration; if (CalendarEventEntry != null && includeCalendarEvent) { retValue.CalEvent = CalendarEventEntry.ToCalEvent(includeSubevents: false); } return(retValue); }