public void RefObjectReference() { tlog.Debug(tag, $"RefObjectReference START"); using (View view = new View() { Size = new Size(20, 30) }) { var testingTarget = new RefObject(view.SwigCPtr.Handle, false); Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <RefObject>(testingTarget, "Should return RefObject instance."); try { testingTarget.Reference(); tlog.Debug(tag, "ReferenceCount : " + testingTarget.ReferenceCount()); testingTarget.Unreference(); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception : Failed!"); } testingTarget.Dispose(); } tlog.Debug(tag, $"RefObjectReference END (OK)"); }
private void ButtonSave_Click(object sender, RoutedEventArgs e) { if (RefObject.Save()) { LoadObjectById(RefObject.ID); } }
public void ObjectCreatedSignalEmit() { tlog.Debug(tag, $"ObjectCreatedSignalEmit START"); var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id; var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId; tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}"); using (View view = new View()) { var testingTarget = new ObjectCreatedSignal(); Assert.IsNotNull(testingTarget, "Should be not null!"); Assert.IsInstanceOf <ObjectCreatedSignal>(testingTarget, "Should be an Instance of ObjectCreatedSignal!"); try { using (RefObject obj = new RefObject(view.SwigCPtr.Handle, false)) { testingTarget.Emit(view); } } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception: Failed!"); } testingTarget.Dispose(); } tlog.Debug(tag, $"ObjectCreatedSignalEmit END (OK)"); }
public bool TryGetPreviousLocation( RefObject <LTouchLocation> aPreviousLocation) { if (aPreviousLocation.argvalue == null) { aPreviousLocation.argvalue = new LTouchLocation(); } if (previousState == LTouchLocationState.Invalid) { aPreviousLocation.argvalue.id = -1; aPreviousLocation.argvalue.state = LTouchLocationState.Invalid; aPreviousLocation.argvalue.position = Vector2f.ZERO(); aPreviousLocation.argvalue.previousState = LTouchLocationState.Invalid; aPreviousLocation.argvalue.previousPosition = Vector2f.ZERO(); aPreviousLocation.argvalue.pressure = 0.0f; aPreviousLocation.argvalue.previousPressure = 0.0f; return(false); } else { aPreviousLocation.argvalue.id = this.id; aPreviousLocation.argvalue.state = this.previousState; aPreviousLocation.argvalue.position = this.previousPosition.Cpy(); aPreviousLocation.argvalue.previousState = LTouchLocationState.Invalid; aPreviousLocation.argvalue.previousPosition = Vector2f.ZERO(); aPreviousLocation.argvalue.pressure = this.previousPressure; aPreviousLocation.argvalue.previousPressure = 0.0f; return(true); } }
public void Emit(RefObject arg) { Interop.ObjectDestroyedSignal.ObjectDestroyedSignal_Emit(swigCPtr, RefObject.getCPtr(arg)); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } }
protected override bool RenderSubtree() { if (!base.RenderSubtree()) { return(false); } var context = Node.FindNearestContext <IDrawableRenderContext>().Value; if (context == null) { return(false); } // create drawable var drawable = (Drawable = UseRef <T>()).Current; bool drawableCreated; if (drawable == null) { drawable = Drawable.Current = CreateDrawable(); drawableCreated = true; } else { drawableCreated = false; } drawable.Name = Key.ToString(); // add styling and events ApplyStyles(drawable); ApplyEvents(drawable); // render drawable var explicitDepth = UseRef(drawableCreated && drawable.Depth != 0).Current; context.Render(drawable, explicitDepth); // invoke ref callback if (drawableCreated) { Ref?.Invoke(drawable); } // schedule expiry on unmount UseEffect(() => () => { drawable.Expire(); Ref?.Invoke(null); }, null); return(true); }
public static RefObject GetRefObjectFromPtr(global::System.IntPtr cPtr) { RefObject ret = new RefObject(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
internal RefObject GetObjectPtr() { global::System.IntPtr cPtr = NDalicPINVOKE.BaseHandle_GetObjectPtr(swigCPtr); RefObject ret = (cPtr == global::System.IntPtr.Zero) ? null : new RefObject(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) { throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
private void ButtonSetTextToClipboard_Click(object sender, RoutedEventArgs e) { if (RefObject != null) { string textToClipboard = RefObject.GetTextToClipboard(); if (!string.IsNullOrWhiteSpace(textToClipboard)) { ActionClipboard.SetTextToClipboard(textToClipboard, true, "Вызов метода помещен в буфер обмена."); } } ; }
public static RefObject[] testReturnArray() { var result = new RefObject[3]; for (int i = 0; i < 3; i++) { var obj = new RefObject(); obj.x = i; obj.y = i; obj.Name = "ArrayList"; result[i] = obj; } return(result); }
public static Dictionary <int, RefObject> testReturnDic() { var result = new Dictionary <int, RefObject>(); for (int i = 0; i < 3; i++) { var obj = new RefObject(); obj.x = i; obj.y = i; obj.Name = "Dictionary"; result.Add(i, obj); } return(result); }
public static HashSet <RefObject> testReturnHashSet() { var result = new HashSet <RefObject>(); for (int i = 0; i < 3; i++) { var obj = new RefObject(); obj.x = i; obj.y = i; obj.Name = "HashSet"; result.Add(obj); } return(result); }
public static List <RefObject> testReturnList() { var result = new List <RefObject>(3); for (int i = 0; i < 3; i++) { var obj = new RefObject(); obj.x = i; obj.y = i; obj.Name = "List"; result.Add(obj); } return(result); }
public static void Test() { RefObject baseRef = ClassBase.GetRefObject(); Console.WriteLine(baseRef.ToString()); RefObject?baseRefNullable = ClassBase.GetRefObject(0); Console.WriteLine(baseRefNullable?.ToString()); RefObject?midRef = ClassMid.GetRefObject(0); Console.WriteLine(midRef.ToString()); }
public int FindIndexById(int id, RefObject <LTouchLocation> touchLocation) { for (int i = 0; i < this.Size(); i++) { LTouchLocation location = this.Get(i); if (location.GetId() == id) { touchLocation.argvalue = this.Get(i); return(i); } } touchLocation.argvalue = new LTouchLocation(); return(-1); }
public void RefObjectConstructor() { tlog.Debug(tag, $"RefObjectConstructor START"); using (View view = new View() { Size = new Size(20, 30) }) { var testingTarget = new RefObject(view.SwigCPtr.Handle, false); Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <RefObject>(testingTarget, "Should return RefObject instance."); testingTarget.Dispose(); } tlog.Debug(tag, $"RefObjectConstructor END (OK)"); }
public void ObjectRegistryObjectDestroyedEventArgs() { tlog.Debug(tag, $"ObjectRegistryObjectDestroyedEventArgs START"); var testingTarget = new Tizen.NUI.ObjectRegistry.ObjectDestroyedEventArgs(); Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <Tizen.NUI.ObjectRegistry.ObjectDestroyedEventArgs>(testingTarget, "Should return ObjectDestroyedEventArgs instance."); using (View view = new View()) { RefObject obj = RefObject.GetRefObjectFromPtr(view.SwigCPtr.Handle); testingTarget.RefObject = obj; tlog.Debug(tag, "RefObject : " + testingTarget.RefObject); } tlog.Debug(tag, $"ObjectRegistryObjectDestroyedEventArgs END (OK)"); }
internal static RuntimeDefinedParameter FieldsToReturn(InfoBloxObjectsEnum objectType, IEnumerable <string> parameterSets, bool required = false) { IEnumerable <string> FieldsToReturn = objectType.GetObjectType().GetTypeInfo().GetProperties().Where(x => !x.IsAttributeDefined <NotReadableAttribute>() && x.Name != "_ref").Select(x => x.Name); FieldsToReturn = RefObject.RemoveRefProperty(FieldsToReturn); List <string> Temp = FieldsToReturn.ToList(); Temp.AddRange(new string[] { "ALL", "BASIC" }); FieldsToReturn = Temp; RuntimeDefinedParameter Param = new RuntimeDefinedParameter() { Name = "FieldsToReturn", ParameterType = typeof(string[]) }; if (parameterSets != null && parameterSets.Any()) { foreach (string Set in parameterSets) { Param.Attributes.Add(new ParameterAttribute() { ParameterSetName = Set, Mandatory = required, HelpMessage = "Specify the fields to return." }); } } else { Param.Attributes.Add(new ParameterAttribute() { Mandatory = required, HelpMessage = "Specify the fields to return." }); } Param.Attributes.Add(new ValidateSetAttribute(FieldsToReturn.ToArray())); return(Param); }
public bool tryGetPreviousLocation( RefObject<LTouchLocation> aPreviousLocation) { if (aPreviousLocation.argvalue == null) { aPreviousLocation.argvalue = new LTouchLocation(); } if (previousState == LTouchLocationState.Invalid) { aPreviousLocation.argvalue.id = -1; aPreviousLocation.argvalue.state = LTouchLocationState.Invalid; aPreviousLocation.argvalue.position = Vector2f.ZERO(); aPreviousLocation.argvalue.previousState = LTouchLocationState.Invalid; aPreviousLocation.argvalue.previousPosition = Vector2f.ZERO(); aPreviousLocation.argvalue.pressure = 0.0f; aPreviousLocation.argvalue.previousPressure = 0.0f; return false; } else { aPreviousLocation.argvalue.id = this.id; aPreviousLocation.argvalue.state = this.previousState; aPreviousLocation.argvalue.position = this.previousPosition.Cpy(); aPreviousLocation.argvalue.previousState = LTouchLocationState.Invalid; aPreviousLocation.argvalue.previousPosition = Vector2f.ZERO(); aPreviousLocation.argvalue.pressure = this.previousPressure; aPreviousLocation.argvalue.previousPressure = 0.0f; return true; } }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RefObject obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }
void Effect([Ref] RefObject <int> count) => Assert.That(count.Current, Is.EqualTo(7));