/// <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."); } }
/// <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) { }
/// <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); }
/// <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) { }
/// <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) { }
/// <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) { }
/// <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) { }
/// <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) { }