예제 #1
0
        static public Event Create(iCalendar iCal)
        {
            Event evt = (Event)iCal.Create(iCal, "VEVENT");

            evt.UID = UniqueComponent.NewUID();

            return(evt);
        }
예제 #2
0
        static public Journal Create(iCalendar iCal)
        {
            Journal j = (Journal)iCal.Create(iCal, "VJOURNAL");

            j.UID = UniqueComponent.NewUID();

            return(j);
        }
예제 #3
0
        static public Todo Create(iCalendar iCal)
        {
            Todo t = (Todo)iCal.Create(iCal, "VTODO");

            t.UID = UniqueComponent.NewUID();

            return(t);
        }
예제 #4
0
        static public Event Create(iCalendar iCal)
        {
            Event evt = new Event(iCal);

            evt.UID = UniqueComponent.NewUID();

            return(evt);
        }
예제 #5
0
        static public Todo Create(iCalendar iCal)
        {
            Todo t = new Todo(iCal);

            t.UID = UniqueComponent.NewUID();

            return(t);
        }
예제 #6
0
        static public Journal Create(iCalendar iCal)
        {
            Journal j = new Journal(iCal);

            j.UID = UniqueComponent.NewUID();

            return(j);
        }
예제 #7
0
        static public Event Create(iCalendar iCal)
        {
            Event evt = (Event)iCal.Create(iCal, "VEVENT");

            evt.UID     = UniqueComponent.NewUID();
            evt.Created = DateTime.Now;
            evt.DTStamp = DateTime.Now;

            return(evt);
        }
예제 #8
0
        static public Journal Create(iCalendar iCal)
        {
            Journal j = (Journal)iCal.Create(iCal, "VJOURNAL");

            j.UID     = UniqueComponent.NewUID();
            j.Created = DateTime.Now;
            j.DTStamp = DateTime.Now;

            return(j);
        }
예제 #9
0
        static public Todo Create(iCalendar iCal)
        {
            Todo t = iCal.Create <Todo>();

            t.UID     = UniqueComponent.NewUID();
            t.Created = DateTime.Now;
            t.DTStamp = DateTime.Now;

            return(t);
        }
예제 #10
0
 /// <summary>
 /// Re-links the UID dictionary to the actual components in our list.
 /// Also, if any items do not have a UID assigned to them, they will
 /// automatically have a UID assigned.
 /// </summary>
 public void ResolveUIDs()
 {
     m_Dictionary.Clear();
     foreach (T item in m_Components)
     {
         if ((item as UniqueComponent).UID == null)
         {
             (item as UniqueComponent).UID = UniqueComponent.NewUID();
         }
         m_Dictionary[(item as UniqueComponent).UID] = item;
     }
 }
예제 #11
0
        public override void CreateInitialize()
        {
            base.CreateInitialize();

            // Create a new UID for the component
            UID = UniqueComponent.NewUID();

            // Here, we don't simply set to DateTime.Now because DateTime.Now contains milliseconds, and
            // the iCalendar standard doesn't care at all about milliseconds.  Therefore, when comparing
            // two calendars, one generated, and one loaded from file, they may be functionally identical,
            // but be determined to be different due to millisecond differences.
            Created = new Date_Time(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
            DTStamp = Created.Copy();
        }
예제 #12
0
        public void Add(T item)
        {
            if (!m_Components.Contains(item))
            {
                m_Components.Add(item);

                UniqueComponent uc = item as UniqueComponent;
                uc.UIDChanged += new UniqueComponent.UIDChangedEventHandler(UIDChangedHandler);

                if (uc.UID != null)
                {
                    m_Dictionary[uc.UID] = item;
                }
            }
        }
예제 #13
0
 public UniqueComponentSerializer(UniqueComponent uc) : base(uc) { }