当前位置: 首页>>代码示例>>C#>>正文


C# iCalObject.GetType方法代码示例

本文整理汇总了C#中iCalObject.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# iCalObject.GetType方法的具体用法?C# iCalObject.GetType怎么用?C# iCalObject.GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iCalObject的用法示例。


在下文中一共展示了iCalObject.GetType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddChild

 /// <summary>
 /// Adds an <see cref="iCalObject"/>-based component to the
 /// appropriate collection.  Currently, the TimeZone component
 /// supports the following components:
 ///     <list type="bullet">
 ///         <item>Standard</item>
 ///         <item>Daylight</item>
 ///     </list>
 /// </summary>
 /// <param name="child"></param>
 public override void AddChild(iCalObject child)
 {
     Type type = child.GetType();
     switch (type.Name)
     {
         case "Standard": TimeZoneInfos.Add(child); StandardTimes.Add(child); break;
         case "Daylight": TimeZoneInfos.Add(child); DaylightTimes.Add(child); break;
         default: break;
     }
 }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:20,代码来源:TimeZone.cs

示例2: AddChild

 /// <summary>
 /// Adds an <see cref="iCalObject"/>-based component to the
 /// appropriate collection.  Currently, the iCalendar component
 /// supports the following components:
 ///     <list>
 ///         <item>Event</item>
 ///         <item>FreeBusy</item>
 ///         <item>Journal</item>
 ///         <item>TimeZone</item>
 ///         <item>Todo</item>
 ///     </list>
 /// </summary>
 /// <param name="child"></param>
 public override void AddChild(iCalObject child)
 {
     Type type = child.GetType();
     switch (type.Name)
     {
         case "Event": Events.Add(child); break;
         case "FreeBusy": FreeBusy.Add(child); break;
         case "Journal": Journals.Add(child); break;
         case "TimeZone": TimeZones.Add(child); break;
         case "Todo": Todos.Add(child); break;
         default: break;
     }                
 }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:26,代码来源:iCalendar.cs

示例3: RemoveChild

        /// <summary>
        /// Removes an <see cref="iCalObject"/>-based component from all
        /// of the collections that this object may be contained in within
        /// the iCalendar.
        /// </summary>
        /// <param name="child"></param>
        public override void RemoveChild(iCalObject child)
        {
            base.RemoveChild(child);

            if (child is UniqueComponent)
                UniqueComponents.Remove((UniqueComponent)child);

            Type type = child.GetType();
            if (type == typeof(Event) || type.IsSubclassOf(typeof(Event))) Events.Remove((Event)child);
            else if (type == typeof(FreeBusy) || type.IsSubclassOf(typeof(FreeBusy))) FreeBusy.Remove((FreeBusy)child);
            else if (type == typeof(Journal) || type.IsSubclassOf(typeof(Journal))) Journals.Remove((Journal)child);
            else if (type == typeof(DDay.iCal.Components.TimeZone) || type.IsSubclassOf(typeof(DDay.iCal.Components.TimeZone))) TimeZones.Remove((DDay.iCal.Components.TimeZone)child);
            else if (type == typeof(Todo) || type.IsSubclassOf(typeof(Todo))) Todos.Remove((Todo)child);
        }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:20,代码来源:iCalendar.cs

示例4: AddChild

        /// <summary>
        /// Adds an <see cref="iCalObject"/>-based component to the
        /// appropriate collection.  Currently, the iCalendar component
        /// supports the following components:
        ///     <list type="bullet">        
        ///         <item><see cref="Event"/></item>
        ///         <item><see cref="FreeBusy"/></item>
        ///         <item><see cref="Journal"/></item>
        ///         <item><see cref="DDay.iCal.Components.TimeZone"/></item>
        ///         <item><see cref="Todo"/></item>
        ///     </list>
        /// </summary>
        /// <param name="child"></param>
        public override void AddChild(iCalObject child)
        {
            base.AddChild(child);            
            child.Parent = this;

            Type type = child.GetType();
            switch (type.Name)
            {
                case "Event": Events.Add((Event)child); break;
                case "FreeBusy": FreeBusy.Add((FreeBusy)child); break;
                case "Journal": Journals.Add((Journal)child); break;
                case "TimeZone": TimeZones.Add((DDay.iCal.Components.TimeZone)child); break;
                case "Todo": Todos.Add((Todo)child); break;
                default: break;
            }                
        }
开发者ID:MaitreDede,项目名称:dday-ical,代码行数:29,代码来源:iCalendar.cs


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