本文整理汇总了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;
}
}
示例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;
}
}
示例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);
}
示例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;
}
}