예제 #1
0
        /// <summary>
        /// Load the module into memory.
        /// </summary>
        /// <param name="filename">Module location (.fmb, .olb, .mmb or .pll file)</param>
        /// <returns>Loaded module reference.</returns>
        public static NdapiModule Open(string filename)
        {
            var extension = Path.GetExtension(filename).ToUpperInvariant();

            switch (extension)
            {
            case ".FMB":
                return(FormModule.Open(filename));

            case ".OLB":
                return(ObjectLibrary.Open(filename));

            case ".MMB":
                return(MenuModule.Open(filename));

            case ".PLL":
                return(LibraryModule.Open(filename));

            default:
                throw new NdapiException($"The file {filename} does not have a valid extension.");
            }
        }
예제 #2
0
파일: Menu.cs 프로젝트: nickers/ndapi
 /// <summary>
 /// Creates a new menu.
 /// </summary>
 /// <param name="module">Menu owner.</param>
 /// <param name="name">Menu name</param>
 public Menu(MenuModule module, string name) : base(name, ObjectType.Menu, module)
 {
 }
예제 #3
0
        /// <summary>
        /// Creates an attached library in the specified module.
        /// </summary>
        /// <param name="module">Form module to attach the library.</param>
        /// <param name="location">Library location.</param>
        public AttachedLibrary(MenuModule module, string location)
        {
            var status = NativeMethods.d2falbat_Attach(NdapiContext.GetContext(), module._handle, out _handle, location);

            Ensure.Success(status);
        }
예제 #4
0
 /// <summary>
 /// Creates a property class.
 /// </summary>
 /// <param name="module">Property class owner.</param>
 /// <param name="name">Property class name.</param>
 public PropertyClass(MenuModule module, string name) : base(name, ObjectType.PropertyClass, module)
 {
 }
예제 #5
0
 /// <summary>
 /// Creates a program unit.
 /// </summary>
 /// <param name="module">Program unit owner.</param>
 /// <param name="name">Program unit name.</param>
 public ProgramUnit(MenuModule module, string name) : base(name, ObjectType.ProgramUnit, module)
 {
 }
예제 #6
0
 /// <summary>
 /// Creates a visual attribute.
 /// </summary>
 /// <param name="menu">Visual attribute owner.</param>
 /// <param name="name">Visual attribute name.</param>
 public VisualAttribute(MenuModule menu, string name) : base(name, ObjectType.VisualAttribute, menu)
 {
 }
예제 #7
0
 /// <summary>
 /// Creates a object group.
 /// </summary>
 /// <param name="module">Object group owner.</param>
 /// <param name="name">Object group name.</param>
 public ObjectGroup(MenuModule module, string name) : base(name, ObjectType.ObjectGroup, module)
 {
 }
예제 #8
0
 /// <summary>
 /// Creates a new menu parameter.
 /// </summary>
 /// <param name="module">Parameter owner.</param>
 /// <param name="name">Parameter name.</param>
 public MenuParameter(MenuModule module, string name) : base(name, ObjectType.MenuParameter, module)
 {
 }