/// <summary> /// Checks if an object is considered a smart object. /// </summary> /// <param name="obj">Object to check.</param> /// <returns>The state indicating if it's a smart object or not.</returns> public bool IsSmartclass(NdapiObject obj) { var status = NativeMethods.d2folbis_IsSmartclassed(NdapiContext.GetContext(), _handle, obj._handle); Ensure.BooleanResult(status); return(status == D2fErrorCode.D2FS_YES); }
internal NdapiObject(string name, ObjectType type, NdapiObject parent = null) { var parentHandle = parent?._handle ?? new ObjectSafeHandle(); var status = NativeMethods.d2fobcr_Create(NdapiContext.GetContext(), parentHandle, out _handle, name, (int)type); Ensure.Success(status); _type = type; }
/// <summary> /// Gets the name of the tab that a given object is on. /// </summary> /// <param name="obj">Object in library.</param> /// <returns>Name of tab the object is on.</returns> public string GetObjectTabName(NdapiObject obj) { string tabName; var status = NativeMethods.d2folbot_ObjTabname(NdapiContext.GetContext(), _handle, obj._handle, out tabName); Ensure.Success(status); return(tabName); }
/// <summary> /// Gets the description for an object in the library. /// </summary> /// <param name="obj">Object in library.</param> /// <returns>Description of object.</returns> public string GetObjectDescription(NdapiObject obj) { string description; var status = NativeMethods.d2folbgd_GetDesc(NdapiContext.GetContext(), _handle, obj._handle, out description); Ensure.Success(status); return(description); }
/// <summary> /// Finds an object by name. /// </summary> /// <param name="name">Name of the object.</param> /// <returns>The object that was found. Returns null if the object doesn't exist.</returns> public T Single(string name) { var type = NdapiMetadata.GetObjectTypeFrom <T>(); ObjectSafeHandle handle; var status = NativeMethods.d2fobfo_FindObj(NdapiContext.GetContext(), _ndapiObject._handle, name, type, out handle); if (status == D2fErrorCode.D2FS_OBJNOTFOUND) { return(null); } Ensure.Success(status); return(NdapiObject.Create <T>(handle)); }
/// <summary> /// Change the subclassing parent of an object to the parent object. /// This will cause the property values to be overriden for all properties which are defined on the parent object. /// </summary> /// <param name="parent">Object to subclass.</param> /// <param name="keepPath">Indicates whether the system should refer to the parent object's module by filename or by path+filename. /// The recommended choice is false in most cases.</param> public void Subclass(NdapiObject parent, bool keepPath) { var status = NativeMethods.d2fobsc_SubClass(NdapiContext.GetContext(), _handle, parent._handle, keepPath); Ensure.Success(status); }
/// <summary> /// Change the subclassing parent of an object to the parent object. /// This will cause the property values to be overriden for all properties which are defined on the parent object. /// </summary> /// <param name="parent">Object to subclass.</param> public void Subclass(NdapiObject parent) { Subclass(parent, false); }
/// <summary> /// Sets the description for an object in the library. /// </summary> /// <param name="obj">Object in library.</param> /// <param name="description">Description of object.</param> public void SetObjectDescription(NdapiObject obj, string description) { var status = NativeMethods.d2folbsd_SetDesc(NdapiContext.GetContext(), _handle, obj._handle, description); Ensure.Success(status); }
/// <summary> /// Flag whether an object is considered a smart object or not. /// </summary> /// <param name="obj">Object to check.</param> /// <param name="state">Indicate if it's a smart object or not.</param> public void SetSmartclass(NdapiObject obj, bool state) { var status = NativeMethods.d2folbss_SetSmartclass(NdapiContext.GetContext(), _handle, obj._handle, state); Ensure.Success(status); }
/// <summary> /// Removes the object from the object library. /// </summary> /// <param name="obj">Object to be removed.</param> public void RemoveObject(NdapiObject obj) { var status = NativeMethods.d2folbro_RemoveObj(NdapiContext.GetContext(), _handle, obj._handle); Ensure.Success(status); }
internal NdapiModule(string name, ObjectType type, NdapiObject parent = null) : base(name, type, parent) { NdapiContext.AddModule(this); }
internal NdapiObjectList(NdapiObject ndapiObject, int property) { _ndapiObject = ndapiObject; _property = property; }
/// <summary> /// Extract the font declaration from the specified object. /// </summary> /// <param name="obj">Object.</param> /// <param name="type">Visual attribute type.</param> public void Extract(NdapiObject obj, VisualAttributeType type) { var status = NativeMethods.d2ffntex_Extract(NdapiContext.GetContext(), _handle, obj._handle, type); Ensure.Success(status); }
/// <summary> /// Extracts the font declaration from an object. /// </summary> /// <param name="obj">Object.</param> /// <param name="type">Visual attribute type.</param> public Font(NdapiObject obj, VisualAttributeType type) : this() { Extract(obj, type); }
/// <summary> /// Apply the coordinate declaration to the specified form module. /// </summary> /// <param name="module">Form module to be changed.</param> /// <param name="type">Visual attribute type.</param> public void Apply(NdapiObject module, VisualAttributeType type) { var status = NativeMethods.d2ffntap_Apply(NdapiContext.GetContext(), _handle, module._handle, type); Ensure.Success(status); }