本文整理汇总了C#中IWidget.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IWidget.GetType方法的具体用法?C# IWidget.GetType怎么用?C# IWidget.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWidget
的用法示例。
在下文中一共展示了IWidget.GetType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: JuiceWidgetState
public JuiceWidgetState(IWidget widget)
{
Widget = widget;
foreach(EventDescriptor widgetEvent in TypeDescriptor.GetEvents(Widget.GetType()).OfType<EventDescriptor>()) {
WidgetEventAttribute attribute = widgetEvent.Attributes.OfType<WidgetEventAttribute>().SingleOrDefault();
if(attribute != null && attribute.DataChangedHandler == true) {
_dataChangedEvent = new WidgetEvent(attribute.Name);
break;
}
}
_cssManager = new CssManager(widget as Control);
}
示例2: GetWidgetInfo
public static WidgetInfo GetWidgetInfo(IWidget widget)
{
if (null == widget)
{
throw new ArgumentNullException(nameof(widget));
}
var attribute = Attribute.GetCustomAttribute(widget.GetType(), typeof (WidgetAttribute)) as WidgetAttribute;
return new WidgetInfo
{
Author = (null != attribute && null != attribute.Author) ? attribute.Author : String.Empty,
Site = (null != attribute && null != attribute.Site) ? attribute.Site : String.Empty,
Order = (null != attribute && attribute.Order > 0) ? attribute.Order : Int32.MaxValue
};
}
示例3: WidgetNode
public WidgetNode(IWidget widget)
: this()
{
Id = widget.GetType().GetHashCode().ToString();
Name = widget.Name;
}
示例4: GetDescriptor
private WidgetDescriptor GetDescriptor(IWidget widget)
{
return WidgetManager.Descriptors.Single(x => x.WidgetType == widget.GetType());
}