示例#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);
        }
示例#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;
        }
示例#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);
        }
示例#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);
        }
示例#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));
        }
示例#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);
        }
示例#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);
 }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#11
0
 internal NdapiModule(string name, ObjectType type, NdapiObject parent = null) : base(name, type, parent)
 {
     NdapiContext.AddModule(this);
 }
示例#12
0
 internal NdapiObjectList(NdapiObject ndapiObject, int property)
 {
     _ndapiObject = ndapiObject;
     _property    = property;
 }
示例#13
0
文件: Font.cs 项目: nickers/ndapi
        /// <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);
        }
示例#14
0
文件: Font.cs 项目: nickers/ndapi
 /// <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);
 }
示例#15
0
文件: Font.cs 项目: nickers/ndapi
        /// <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);
        }