本文整理汇总了C#中IWidget.GetHandle方法的典型用法代码示例。如果您正苦于以下问题:C# IWidget.GetHandle方法的具体用法?C# IWidget.GetHandle怎么用?C# IWidget.GetHandle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWidget
的用法示例。
在下文中一共展示了IWidget.GetHandle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetProperty
/**
* Handles the property setting for a widget. If the widget is not yet created, the
* set operation goes into the operation queue.
* @param widget The widget that recieved a set property syscall.
* @param propertyName The name of the property to be set.
* @param propertyValue The value of the property to be set.
*/
public void SetProperty(IWidget widget, string propertyName, string propertyValue)
{
if (widget is WidgetBaseMock)
{
// we check to see if the property is valid
Type widgetType = mRuntime.GetModule<NativeUIModule>().GetWidgetType(widget.GetHandle());
CheckPropertyValidity(widgetType, propertyName, propertyValue);
WidgetOperation setOperation = WidgetOperation.CreateSetOperation(propertyName, propertyValue);
widget.AddOperation(setOperation);
}
else
{
widget.SetProperty(propertyName, propertyValue);
}
}
示例2: GetProperty
/**
* Handles the property getting for a widget. If the widget is not yet created, we return
* the last valid set for that property. If there is no valid set, we wait for the widget creation
* and then we return the value of the property.
* @param widget The widget that recieved a get property syscall.
* @param propertyName The name of the property for which a value is needed.
*/
public String GetProperty(IWidget widget, string propertyName)
{
String propertyValue = null;
if (widget is WidgetBaseMock)
{
propertyValue = widget.GetLastValidSet(propertyName);
if (propertyValue == null)
{
widget = mRuntime.GetModule<NativeUIModule>().GetWidgetSync(widget.GetHandle());
propertyValue = widget.GetProperty(propertyName);
}
}
else
{
propertyValue = widget.GetProperty(propertyName);
}
return propertyValue;
}
示例3: RemoveChild
/**
* Handles the remove child. If the parent is not yet created, the remove operation goes into the operation
* queue. If the parent exists but the child hasn't been created, we wait for the child creation and then
* remove it from the parent.
* @param child The child widget.
*/
public void RemoveChild(IWidget child)
{
IWidget parent = child.GetParent();
if (parent is WidgetBaseMock)
{
WidgetOperation removeChildOperation = WidgetOperation.CreateRemoveOperation(child.GetHandle());
parent.AddOperation(removeChildOperation);
}
else
{
if (child is WidgetBaseMock)
{
child = mRuntime.GetModule<NativeUIModule>().GetWidgetSync(child.GetHandle());
}
MoSync.Util.RunActionOnMainThread(() =>
{
child.RemoveFromParent();
}, true);
}
}
示例4: InsertChild
/**
* Handles the insert child. If the parent is not yet created, the insert operation goes into the operation
* queue. If the parent exists but the child hasn't been created, we wait for the child creation and then
* insert it into the parent.
* @param parent The parent widget.
* @param child The child widget.
*/
public void InsertChild(IWidget parent, IWidget child, int index)
{
if (parent is WidgetBaseMock)
{
WidgetOperation insertChildOperation = WidgetOperation.CreateInsertOperation(child.GetHandle(), index);
parent.AddOperation(insertChildOperation);
}
else
{
if (child is WidgetBaseMock)
{
child = mRuntime.GetModule<NativeUIModule>().GetWidgetSync(child.GetHandle());
}
MoSync.Util.RunActionOnMainThread(() =>
{
child.SetParent(parent);
parent.InsertChild(child, index);
}, true);
}
}