本文整理汇总了C#中Gtk.Widget.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Widget.GetType方法的具体用法?C# Widget.GetType怎么用?C# Widget.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Widget
的用法示例。
在下文中一共展示了Widget.GetType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OneWidgetDialog
public OneWidgetDialog(Widget widget)
{
this.Build ();
var att = widget.GetType ().GetCustomAttributes (typeof(WidgetWindowAttribute), false);
if (att.Length > 0)
this.SetDefaultSize ((att [0] as WidgetWindowAttribute).DefaultWidth,
(att [0] as WidgetWindowAttribute).DefaultHeight);
widget.Show ();
VBox.Add (widget);
att = widget.GetType ().GetCustomAttributes (typeof(DisplayNameAttribute), true);
if (att.Length > 0)
Title = (att [0] as DisplayNameAttribute).DisplayName;
tdiTab = widget as ITdiTab;
if(tdiTab != null)
{
if(!String.IsNullOrWhiteSpace (tdiTab.TabName))
Title = tdiTab.TabName;
tdiTab.TabParent = this;
tdiTab.TabNameChanged += TdiTab_TabNameChanged;
tdiTab.CloseTab += TdiTab_CloseTab;
}
this.ReshowWithInitialSize ();
}
示例2: Main
//.........这里部分代码省略.........
if (vo.UnicharProp != UNICHAR_VAL)
MPError ("unichar method->prop", UNICHAR_VAL, vo.Unichar, vo.UnicharProp);
vo.Enum = ENUM_VAL;
if (vo.EnumProp != ENUM_VAL)
MPError ("enum method->prop", ENUM_VAL, vo.Enum, vo.EnumProp);
vo.Flags = FLAGS_VAL;
if (vo.FlagsProp != (FLAGS_VAL))
MPError ("flags method->prop", FLAGS_VAL, vo.Flags, vo.FlagsProp);
vo.Float = FLOAT_VAL;
if (vo.FloatProp != FLOAT_VAL)
MPError ("float method->prop", FLOAT_VAL, vo.Float, vo.FloatProp);
vo.Double = DOUBLE_VAL;
if (vo.DoubleProp != DOUBLE_VAL)
MPError ("double method->prop", DOUBLE_VAL, vo.Double, vo.DoubleProp);
vo.String = STRING_VAL;
if (vo.StringProp != STRING_VAL)
MPError ("string method->prop", STRING_VAL, vo.String, vo.StringProp);
vo.Boxed = BOXED_VAL;
if (vo.BoxedProp != BOXED_VAL)
MPError ("boxed method->prop", BOXED_VAL, vo.Boxed, vo.BoxedProp);
vo.Pointer = POINTER_VAL;
if (vo.PointerProp != POINTER_VAL)
MPError ("pointer method->prop", POINTER_VAL, vo.Pointer, vo.PointerProp);
vo.Object = OBJECT_VAL;
if (vo.ObjectProp != OBJECT_VAL) {
MPError ("object method->prop", OBJECT_VAL.GetType().Name + " " + OBJECT_VAL.GetHashCode (),
vo.Object == null ? "null" : vo.Object.GetType().Name + " " + vo.Object.GetHashCode (),
vo.ObjectProp == null ? "null" : vo.ObjectProp.GetType().Name + " " + vo.ObjectProp.GetHashCode ());
}
// Part 3: property->unmanaged->method round trip
vo = new Valobj ();
vo.BooleanProp = BOOL_VAL;
if (vo.Boolean != BOOL_VAL)
MPError ("boolean prop->method", BOOL_VAL, vo.Boolean, vo.BooleanProp);
vo.IntProp = INT_VAL;
if (vo.Int != INT_VAL)
MPError ("int prop->method", INT_VAL, vo.Int, vo.IntProp);
vo.UintProp = UINT_VAL;
if (vo.Uint != UINT_VAL)
MPError ("uint prop->method", UINT_VAL, vo.Uint, vo.UintProp);
vo.Int64Prop = INT64_VAL;
if (vo.Int64 != INT64_VAL)
MPError ("int64 prop->method", INT64_VAL, vo.Int64, vo.Int64Prop);
vo.Uint64Prop = UINT64_VAL;
if (vo.Uint64 != UINT64_VAL)
MPError ("uint64 prop->method", UINT64_VAL, vo.Uint64, vo.Uint64Prop);
vo.UnicharProp = UNICHAR_VAL;
if (vo.Unichar != UNICHAR_VAL)
MPError ("unichar prop->method", UNICHAR_VAL, vo.Unichar, vo.UnicharProp);
示例3: IsSkipedType
static bool IsSkipedType(Widget w, Type[] skipTypes)
{
return skipTypes.Count (t => w.GetType ().IsSubclassOf (t)) > 0;
}
示例4: SwitchPage
private void SwitchPage(Widget newPage)
{
Logger.DebugFormat("Switching to page {0}", newPage.GetType().Name);
var viewBase = newPage as ViewBase;
foreach (var view in MainUiContainer.Children.OfType<ViewBase>())
view.Deactivated();
if (MainUiContainer.Child != null)
MainUiContainer.Remove(MainUiContainer.Child);
MainUiContainer.Add(newPage);
newPage.ShowAll();
if(ButtonsUiContainer.Child!=null)
ButtonsUiContainer.Remove(ButtonsUiContainer.Child);
if (viewBase != null)
{
ButtonsUiContainer.Add(viewBase.DetachableViewControlsContainer);
viewBase.Activated();
}
TouchMPCGtk.Settings.Default.LastPage = newPage.GetType().Name;
TouchMPCGtk.Settings.Default.Save();
}
示例5: ProbeAdjustable
private void ProbeAdjustable (Widget widget)
{
Type type = widget.GetType ();
PropertyInfo hadj_prop = type.GetProperty ("Hadjustment");
PropertyInfo vadj_prop = type.GetProperty ("Vadjustment");
if (hadj_prop == null || vadj_prop == null) {
return;
}
object hadj_value = hadj_prop.GetValue (widget, null);
object vadj_value = vadj_prop.GetValue (widget, null);
if (hadj_value == null || vadj_value == null
|| hadj_value.GetType () != typeof (Adjustment)
|| vadj_value.GetType () != typeof (Adjustment)) {
return;
}
Hadjustment = (Adjustment)hadj_value;
Vadjustment = (Adjustment)vadj_value;
}