Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        /// <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);
        }
Ejemplo n.º 4
0
        /// <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);
        }
Ejemplo n.º 5
0
        /// <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));
        }
Ejemplo n.º 6
0
        /// <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);
        }
Ejemplo n.º 7
0
 /// <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);
 }
Ejemplo n.º 8
0
        /// <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);
        }
Ejemplo n.º 9
0
        /// <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);
        }
Ejemplo n.º 10
0
        /// <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);
        }
Ejemplo n.º 11
0
 internal NdapiModule(string name, ObjectType type, NdapiObject parent = null) : base(name, type, parent)
 {
     NdapiContext.AddModule(this);
 }
Ejemplo n.º 12
0
 internal NdapiObjectList(NdapiObject ndapiObject, int property)
 {
     _ndapiObject = ndapiObject;
     _property    = property;
 }
Ejemplo n.º 13
0
        /// <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);
        }
Ejemplo n.º 14
0
 /// <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);
 }
Ejemplo n.º 15
0
        /// <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);
        }