public String GetLastValidSet(String property) { String res = null; WidgetOperation[] operations = mOperationQueue.ToArray(); // get the last valid set for (int i = operations.Length - 1; i >= 0; i--) { WidgetOperation operation = operations[i]; if (operation.Type == WidgetOperation.OperationType.SET && operation.Property.Equals(property)) { res = operation.Value; break; } } return(res); }
/** * Adds an operation to the operation queue. * @param op The operation to be added. */ public void AddOperation(WidgetOperation op) { MoSync.Util.RunActionOnMainThread(() => { // we need to check if the widget was already created or not when the AddOperation is called // if so, we'll run the operation on the widget instead of inserting it into the queue IWidget widget = mRuntime.GetModule <NativeUIModule>().GetWidget(this.GetHandle()); int handle = this.GetHandle(); if (widget is WidgetBaseMock) { (widget as WidgetBaseMock).OperationQueue.Enqueue(op); } else { // we need to check if the widget we got from the runtime can be cast to WidgetBaseWindowsPhone if (typeof(WidgetBaseWindowsPhone).IsAssignableFrom(widget.GetType())) { (widget as WidgetBaseWindowsPhone).RunOperation(op); } } }, true); }
/** * Runs a WidgetOperation on the current widget. * @param operation The widget operation (could be a ADD, INSERT, REMOVE, SET or GET) that * needs to be applied on the current widget. */ public void RunOperation(WidgetOperation op) { // nothing to do here since this method should be overriden by the subclasses that // have a view on which to run the operation }
/** * Adds an operation to the operation queue. * @param op The operation to be added. */ public void AddOperation(WidgetOperation op) { MoSync.Util.RunActionOnMainThread(() => { // we need to check if the widget was already created or not when the AddOperation is called // if so, we'll run the operation on the widget instead of inserting it into the queue IWidget widget = mRuntime.GetModule<NativeUIModule>().GetWidget(this.GetHandle()); int handle = this.GetHandle(); if (widget is WidgetBaseMock) { (widget as WidgetBaseMock).OperationQueue.Enqueue(op); } else { // we need to check if the widget we got from the runtime can be cast to WidgetBaseWindowsPhone if (typeof(WidgetBaseWindowsPhone).IsAssignableFrom(widget.GetType())) { (widget as WidgetBaseWindowsPhone).RunOperation(op); } } }, true); }
public static WidgetOperation CreateSetOperation(string propertyName, string propertyValue) { WidgetOperation op = new WidgetOperation(OperationType.SET, propertyName, propertyValue, -1, -1); return op; }
public static WidgetOperation CreateRemoveOperation(int handle) { WidgetOperation op = new WidgetOperation(OperationType.REMOVE, "", "", handle, -1); return op; }
public static WidgetOperation CreateInsertOperation(int handle, int index) { WidgetOperation op = new WidgetOperation(OperationType.REMOVE, "", "", handle, index); return op; }
/** * Adds an operation to the operation queue. * @param op The operation to be added. */ public void AddOperation(WidgetOperation op) { mOperationQueue.Enqueue(op); }
public static WidgetOperation CreateAddOperation(int handle) { WidgetOperation op = new WidgetOperation(OperationType.ADD, "", "", handle, -1); return op; }
static public WidgetOperation CreateRemoveOperation(int handle) { WidgetOperation op = new WidgetOperation(OperationType.REMOVE, "", "", handle, -1); return(op); }
static public WidgetOperation CreateInsertOperation(int handle, int index) { WidgetOperation op = new WidgetOperation(OperationType.REMOVE, "", "", handle, index); return(op); }
static public WidgetOperation CreateAddOperation(int handle) { WidgetOperation op = new WidgetOperation(OperationType.ADD, "", "", handle, -1); return(op); }
static public WidgetOperation CreateGetOperation(string propertyName) { WidgetOperation op = new WidgetOperation(OperationType.GET, propertyName, "", -1, -1); return(op); }
static public WidgetOperation CreateSetOperation(string propertyName, string propertyValue) { WidgetOperation op = new WidgetOperation(OperationType.SET, propertyName, propertyValue, -1, -1); return(op); }
public static WidgetOperation CreateGetOperation(string propertyName) { WidgetOperation op = new WidgetOperation(OperationType.GET, propertyName, "", -1, -1); return op; }