• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# iCalendar类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中iCalendar的典型用法代码示例。如果您正苦于以下问题:C# iCalendar类的具体用法?C# iCalendar怎么用?C# iCalendar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



iCalendar类属于命名空间,在下文中一共展示了iCalendar类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Create

        static public Todo Create(iCalendar iCal)
        {
            Todo t = new Todo(iCal);
            t.UID = UniqueComponent.NewUID();

            return t;
        }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:7,代码来源:Todo.cs


示例2: Create

        static public Journal Create(iCalendar iCal)
        {
            Journal j = (Journal)iCal.Create(iCal, "VJOURNAL");
            j.UID = UniqueComponent.NewUID();

            return j;
        }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:7,代码来源:Journal.cs


示例3: Create

        static public Todo Create(iCalendar iCal)
        {
            Todo t = (Todo)iCal.Create(iCal, "VTODO");
            t.UID = UniqueComponent.NewUID();

            return t;
        }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:7,代码来源:Todo.cs


示例4: Create

        static public Event Create(iCalendar iCal)
        {
            Event evt = new Event(iCal);
            evt.UID = UniqueComponent.NewUID();

            return evt;
        }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:7,代码来源:Event.cs


示例5: Create

        static public Journal Create(iCalendar iCal)
        {
            Journal j = new Journal(iCal);
            j.UID = UniqueComponent.NewUID();

            return j;
        }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:7,代码来源:Journal.cs


示例6: Create

        static public Todo Create(iCalendar iCal)
        {
            Todo t = (Todo)iCal.Create(iCal, "VTODO");
            t.UID = UniqueComponent.NewUID();
            t.Created = DateTime.Now;
            t.DTStamp = DateTime.Now;

            return t;
        }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:9,代码来源:Todo.cs


示例7: Create

        static public Journal Create(iCalendar iCal)
        {
            Journal j = iCal.Create<Journal>();
            j.UID = UniqueComponent.NewUID();
            j.Created = DateTime.Now;
            j.DTStamp = DateTime.Now;

            return j;
        }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:9,代码来源:Journal.cs


示例8: UniqueComponent1

        public void UniqueComponent1()
        {
            iCalendar iCal = new iCalendar();
            Event evt = iCal.Create<Event>();

            Assert.IsNotNull(evt.UID);
            Assert.IsNotNull(evt.Created);
            Assert.IsNotNull(evt.DTStamp);
        }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:9,代码来源:ComponentTest.cs


示例9: UniqueComponent1

        public void UniqueComponent1()
        {
            iCalendar iCal = new iCalendar();
            Event evt = iCal.Create<Event>();

            Assert.IsNotNull(evt.UID);
            Assert.IsNull(evt.Created); // We don't want this to be set automatically
            Assert.IsNotNull(evt.DTStamp);
        }
开发者ID:logikonline,项目名称:DDay.iCal,代码行数:9,代码来源:ComponentTest.cs


示例10: Add1

 public void Add1()
 {
     IICalendar iCal = new iCalendar();
     
     Event evt = new Event();
     evt.Summary = "Testing";
     evt.Start = new iCalDateTime(2010, 3, 25);
     evt.End = new iCalDateTime(2010, 3, 26);
     
     iCal.Events.Add(evt);
     Assert.AreEqual(1, iCal.Children.Count);
     Assert.AreSame(evt, iCal.Children[0]);            
 }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:13,代码来源:EventTest.cs


示例11: Category

        [Test, Category("DDay")] //Category(("FreeBusy")]
        public void GetFreeBusyStatus1()
        {
            IICalendar iCal = new iCalendar();

            IEvent evt = iCal.Create<DDayEvent>();
            evt.Summary = "Test event";
            evt.Start = new iCalDateTime(2010, 10, 1, 8, 0, 0);
            evt.End = new iCalDateTime(2010, 10, 1, 9, 0, 0);

            IFreeBusy freeBusy = iCal.GetFreeBusy(new iCalDateTime(2010, 10, 1, 0, 0, 0), new iCalDateTime(2010, 10, 7, 11, 59, 59));
            Assert.AreEqual(FreeBusyStatus.Free, freeBusy.GetFreeBusyStatus(new iCalDateTime(2010, 10, 1, 7, 59, 59)));
            Assert.AreEqual(FreeBusyStatus.Busy, freeBusy.GetFreeBusyStatus(new iCalDateTime(2010, 10, 1, 8, 0, 0)));
            Assert.AreEqual(FreeBusyStatus.Busy, freeBusy.GetFreeBusyStatus(new iCalDateTime(2010, 10, 1, 8, 59, 59)));
            Assert.AreEqual(FreeBusyStatus.Free, freeBusy.GetFreeBusyStatus(new iCalDateTime(2010, 10, 1, 9, 0, 0)));
        }
开发者ID:alexed1,项目名称:dtrack,代码行数:16,代码来源:FreeBusyTest.cs


示例12: CompareCalendars

 static public void CompareCalendars(iCalendar iCal1, iCalendar iCal2)
 {
     Assert.IsTrue(object.Equals(iCal1.Method, iCal2.Method), "Methods do not match");
     Assert.IsTrue(object.Equals(iCal1.ProductID, iCal2.ProductID), "ProductIDs do not match");
     Assert.IsTrue(object.Equals(iCal1.Scale, iCal2.Scale), "Scales do not match");
     Assert.IsTrue(object.Equals(iCal1.Version, iCal2.Version), "Versions do not match");
     
     for (int i = 0; i < iCal1.Events.Count; i++)
         CompareComponents(iCal1.Events[i], iCal2.Events[i]);
     for (int i = 0; i < iCal1.FreeBusy.Count; i++)
         CompareComponents(iCal1.FreeBusy[i], iCal2.FreeBusy[i]);
     for (int i = 0; i < iCal1.Journals.Count; i++)
         CompareComponents(iCal1.Journals[i], iCal2.Journals[i]);
     for (int i = 0; i < iCal1.Todos.Count; i++)
         CompareComponents(iCal1.Todos[i], iCal2.Todos[i]);
 }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:16,代码来源:Serialize.cs


示例13: TestCorrectInput

 public void TestCorrectInput()
 {
     vCalendar vcalendar = new vCalendar(@"BEGIN:VCALENDAR
     VERSION:2.0
     METHOD:PUBLISH
     X-WR-CALDESC:CheckMyTrip Calendar
     X-WR-CALNAME:2THQ73
     PRODID:-//Amadeus/trip//NONSGML v1.0//EN
     BEGIN:VEVENT
     DTSTAMP:20150408T101400Z
     UID:2THQ73FlightVIE_201504172000_201504172050
     DTSTART:20150417T180000Z
     DTEND:20150417T185000Z
     SUMMARY:2THQ73 / Hennies - Flight: Vienna - Prague (Austrian Airlines OS 711)
     LOCATION:Vienna International (Vienna\, Austria)
     TRANSP:TRANSPARENT
     DESCRIPTION:Trip status: Confirmed\n \n FLIGHT INFORMATION: \n \n Austrian Airlines OS 711: \n \n \n From: Vienna International (Vienna\, Austria) at Fri\, Apr 17\, 2015 20:00 (local time) \n To: Ruzyne (Prague\, Czech Republic) - Terminal2 at Fri\, Apr 17\, 2015 20:50 (local time) \n Cabin: Economy\n Duration: 00:50\n Stop(s): 0\n Aircraft: De Havilland DHC-8 400 Series\n Airline Recloc: 2THQ73\n \n http://www.checkmytrip.com/CMTServlet?R=2THQ73&L=US&N=Hennies\n
     END:VEVENT
     BEGIN:VEVENT
     DTSTAMP:20150408T101400Z
     UID:2THQ73FlightPRG_201504191840_201504191935
     DTSTART:20150419T164000
     DTEND:20150419T173500
     SUMMARY:2THQ73 / Hennies - Flight 1 : Prague - Vienna (Austrian Airlines OS 710)
     LOCATION:Ruzyne (Prague\, Czech Republic)
     TRANSP:TRANSPARENT
     DESCRIPTION:Trip status: Confirmed\n \n FLIGHT INFORMATION: \n \n Austrian Airlines OS 710: \n \n \n From: Ruzyne (Prague\, Czech Republic) - Terminal2 at Sun\, Apr 19\, 2015 18:40 (local time) \n To: Vienna International (Vienna\, Austria) at Sun\, Apr 19\, 2015 19:35 (local time) \n Cabin: Economy\n Duration: 00:55\n Stop(s): 0\n Aircraft: Fokker 70\n \n http://www.checkmytrip.com/CMTServlet?R=2THQ73&L=US&N=Hennies\n
     END:VEVENT
     BEGIN:VEVENT
     DTSTAMP:20150408T101400Z
     UID:2THQ73FlightVIE_201504192035_201504192130
     DTSTART:20150419T183500Z
     DTEND:20150419T193000Z
     SUMMARY:2THQ73 / Hennies - Flight 2 : Vienna - Innsbruck (Austrian Airlines OS 913)
     LOCATION:Vienna International (Vienna\, Austria)
     TRANSP:TRANSPARENT
     DESCRIPTION:Trip status: Confirmed\n \n FLIGHT INFORMATION: \n \n Austrian Airlines OS 913: \n \n \n From: Vienna International (Vienna\, Austria) at Sun\, Apr 19\, 2015 20:35 (local time) \n To: Innsbruck Airport (Innsbruck\, Austria) at Sun\, Apr 19\, 2015 21:30 (local time) \n Cabin: Economy\n Duration: 00:55\n Stop(s): 0\n Aircraft: Fokker 100\n \n http://www.checkmytrip.com/CMTServlet?R=2THQ73&L=US&N=Hennies\n
     END:VEVENT
     END:VCALENDAR");
     iCalendar ical = new iCalendar(vcalendar);
     var a = ical[0].StartTime.ToLocalTime();
 }
开发者ID:MSIH,项目名称:iCal-sync,代码行数:42,代码来源:TzidDeciderUnitTest.cs


示例14: Create

        static public IValidator Create(Type validatorType, iCalendar iCalendar, string iCalendarText)
        {
            IValidator validator = null;

            if (validatorType != null)
            {
                ConstructorInfo ci = null;

                if (iCalendar != null)
                    ci = validatorType.GetConstructor(new Type[] { typeof(iCalendar) });
                if (ci != null)
                    validator = ci.Invoke(new object[] { iCalendar }) as IValidator;
                else
                {
                    if (iCalendarText != null)
                        ci = validatorType.GetConstructor(new Type[] { typeof(string) });
                    if (ci != null)
                        validator = ci.Invoke(new object[] { iCalendarText }) as IValidator;
                }
            }

            return validator;
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:23,代码来源:ValidatorActivator.cs


示例15: EVALUATE1

        public void EVALUATE1()
        {
            iCalendar iCal = new iCalendar();
            Event evt = iCal.Create<Event>();
            evt.Summary = "Event summary";

            // Start at midnight, UTC time
            evt.Start = DateTime.SpecifyKind(DateTime.Today, DateTimeKind.Utc);

            evt.AddRecurrence(new Recur("FREQ=MINUTELY;INTERVAL=10;COUNT=5"));
            List<Occurrence> occurrences = evt.GetOccurrences(DateTime.Today.AddDays(1), DateTime.Today.AddDays(2));

            foreach (Occurrence o in occurrences)
                Assert.IsTrue(o.Period.StartTime.HasTime, "All recurrences of this event should have a time set.");
        }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:15,代码来源:Recurrence.cs


示例16: RECURPARSE6

        public void RECURPARSE6()
        {
            iCalendar iCal = new iCalendar();

            Event evt = iCal.Create<Event>();
            evt.Summary = "Test event";
            evt.Start = new Date_Time(2006, 1, 1, 9, 0, 0);
            evt.Duration = new TimeSpan(1, 0, 0);
            evt.AddRecurrence(new Recur("Every month on the first sunday, at 5:00PM, and at 7:00PM"));

            List<Occurrence> occurrences = evt.GetOccurrences(
                new Date_Time(2006, 1, 1), 
                new Date_Time(2006, 3, 31));

            Date_Time[] DateTimes = new Date_Time[]
            {
                new Date_Time(2006, 1, 1, 9, 0, 0),
                new Date_Time(2006, 1, 1, 17, 0, 0),
                new Date_Time(2006, 1, 1, 19, 0, 0),
                new Date_Time(2006, 2, 5, 17, 0, 0),
                new Date_Time(2006, 2, 5, 19, 0, 0),
                new Date_Time(2006, 3, 5, 17, 0, 0),
                new Date_Time(2006, 3, 5, 19, 0, 0)
            };

            for (int i = 0; i < DateTimes.Length; i++)
                Assert.AreEqual(DateTimes[i], occurrences[i].Period.StartTime, "Event should occur on " + DateTimes[i]);

            Assert.AreEqual(
                DateTimes.Length,
                occurrences.Count,
                "There should be exactly " + DateTimes.Length +
                " occurrences; there were " + occurrences.Count);
        }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:34,代码来源:Recurrence.cs


示例17: RECURPARSE5

        public void RECURPARSE5()
        {
            iCalendar iCal = new iCalendar();

            Event evt = iCal.Create<Event>();
            evt.Summary = "Test event";
            evt.Start = new Date_Time(2006, 1, 1, 9, 0, 0);
            evt.Duration = new TimeSpan(1, 0, 0);
            evt.AddRecurrence(new Recur("Every 10 minutes until 1/1/2006 9:50"));

            List<Occurrence> occurrences = evt.GetOccurrences(
                new Date_Time(2006, 1, 1), 
                new Date_Time(2006, 1, 31));

            Date_Time[] DateTimes = new Date_Time[]
            {
                new Date_Time(2006, 1, 1, 9, 0, 0),
                new Date_Time(2006, 1, 1, 9, 10, 0),
                new Date_Time(2006, 1, 1, 9, 20, 0),
                new Date_Time(2006, 1, 1, 9, 30, 0),
                new Date_Time(2006, 1, 1, 9, 40, 0),
                new Date_Time(2006, 1, 1, 9, 50, 0)
            };

            for (int i = 0; i < DateTimes.Length; i++)
                Assert.AreEqual(DateTimes[i], occurrences[i].Period.StartTime, "Event should occur on " + DateTimes[i]);

            Assert.AreEqual(
                DateTimes.Length,
                occurrences.Count,
                "There should be exactly " + DateTimes.Length +
                " occurrences; there were " + occurrences.Count);
        }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:33,代码来源:Recurrence.cs


示例18: RECURPARSE1

        public void RECURPARSE1()
        {
            iCalendar iCal = new iCalendar();

            Event evt = iCal.Create<Event>();
            evt.Summary = "Test event";
            evt.Start = new Date_Time(2006, 10, 1, 9, 0, 0);
            evt.Duration = new TimeSpan(1, 0, 0);
            evt.AddRecurrence(new Recur("Every 3rd month on the last tuesday and wednesday"));

            List<Occurrence> occurrences = evt.GetOccurrences(
                new Date_Time(2006, 10, 1), 
                new Date_Time(2007, 4, 30));

            Date_Time[] DateTimes = new Date_Time[]
            {
                new Date_Time(2006, 10, 1, 9, 0, 0),
                new Date_Time(2006, 10, 25, 9, 0, 0),
                new Date_Time(2006, 10, 31, 9, 0, 0),
                new Date_Time(2007, 1, 30, 9, 0, 0),
                new Date_Time(2007, 1, 31, 9, 0, 0),
                new Date_Time(2007, 4, 24, 9, 0, 0),
                new Date_Time(2007, 4, 25, 9, 0, 0)
            };

            for (int i = 0; i < DateTimes.Length; i++)
                Assert.AreEqual(DateTimes[i], occurrences[i].Period.StartTime, "Event should occur on " + DateTimes[i]);

            Assert.AreEqual(
                DateTimes.Length,
                occurrences.Count,
                "There should be exactly " + DateTimes.Length +
                " occurrences; there were " + occurrences.Count);
        }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:34,代码来源:Recurrence.cs


示例19: RRULE43

        public void RRULE43()
        {
            iCalendar iCal = new iCalendar();

            DDay.iCal.Components.TimeZone tz = iCal.Create<DDay.iCal.Components.TimeZone>();
            
            tz.TZID = "US-Eastern";
            tz.Last_Modified = new DateTime(1987, 1, 1, 0, 0, 0, DateTimeKind.Utc);

            DDay.iCal.Components.TimeZone.TimeZoneInfo standard = new DDay.iCal.Components.TimeZone.TimeZoneInfo(DDay.iCal.Components.TimeZone.STANDARD, tz);
            standard.Start = new DateTime(1967, 10, 29, 2, 0, 0, DateTimeKind.Utc);            
            standard.AddRecurrence(new Recur("FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10"));
            standard.TZOffsetFrom = new UTC_Offset("-0400");
            standard.TZOffsetTo = new UTC_Offset("-0500");
            standard.TimeZoneName = "EST";            

            DDay.iCal.Components.TimeZone.TimeZoneInfo daylight = new DDay.iCal.Components.TimeZone.TimeZoneInfo(DDay.iCal.Components.TimeZone.DAYLIGHT, tz);
            daylight.Start = new DateTime(1987, 4, 5, 2, 0, 0, DateTimeKind.Utc);
            daylight.AddRecurrence(new Recur("FREQ=YEARLY;BYDAY=1SU;BYMONTH=4"));
            daylight.TZOffsetFrom = new UTC_Offset("-0500");
            daylight.TZOffsetTo = new UTC_Offset("-0400");
            daylight.TimeZoneName = "EDT";

            Event evt = iCal.Create<Event>();
            evt.Summary = "Test event";
            evt.Start = new Date_Time(2007, 1, 24, 8, 0, 0, tzid, iCal);
            evt.Duration = TimeSpan.FromHours(1);
            evt.End = new Date_Time(2007, 1, 24, 9, 0, 0, tzid, iCal);
            Recur recur = new Recur("FREQ=MONTHLY;INTERVAL=2;BYDAY=4WE");
            evt.AddRecurrence(recur);

            List<Occurrence> occurrences = evt.GetOccurrences(
                new DateTime(2007, 1, 24), 
                new DateTime(2007, 12, 31));

            Date_Time[] DateTimes = new Date_Time[]
            {                
                new Date_Time(2007, 1, 24, 8, 0, 0, tzid, iCal),
                new Date_Time(2007, 3, 28, 8, 0, 0, tzid, iCal),
                new Date_Time(2007, 5, 23, 8, 0, 0, tzid, iCal),
                new Date_Time(2007, 7, 25, 8, 0, 0, tzid, iCal),
                new Date_Time(2007, 9, 26, 8, 0, 0, tzid, iCal),
                new Date_Time(2007, 11, 28, 8, 0, 0, tzid, iCal)
            };
            
            for (int i = 0; i < DateTimes.Length; i++)
                Assert.AreEqual(DateTimes[i], occurrences[i].Period.StartTime, "Event should occur on " + DateTimes[i]);

            Assert.AreEqual(
                DateTimes.Length,
                occurrences.Count,                
                "There should be exactly " + DateTimes.Length +
                " occurrences; there were " + occurrences.Count);
        }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:54,代码来源:Recurrence.cs


示例20: Create

 static public Todo Create(iCalendar iCal)
 {
     Todo t = iCal.Create<Todo>();
     return t;
 }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:5,代码来源:Todo.cs



注:本文中的iCalendar类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# iPow类代码示例发布时间:2022-05-24
下一篇:
C# iCalObject类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap