protected override void RegisterModules(PaFolder Folder, ArrayList Modules, ArrayList Controls) { InstallerInfo.Log.AddInfo(REGISTER_Controls); ModuleControlController objModuleControls = new ModuleControlController(); ModuleControlInfo objModuleControl; foreach (ModuleControlInfo tempLoopVar_objModuleControl in Controls) { objModuleControl = tempLoopVar_objModuleControl; // Skins Objects have a null ModuleDefID objModuleControl.ModuleDefID = Null.NullInteger; // check if control exists ModuleControlInfo objModuleControl2 = objModuleControls.GetModuleControlByKeyAndSrc(Null.NullInteger, objModuleControl.ControlKey, objModuleControl.ControlSrc); if (objModuleControl2 == null) { // add new control objModuleControls.AddModuleControl(objModuleControl); } else { // update existing control objModuleControl.ModuleControlID = objModuleControl2.ModuleControlID; objModuleControls.UpdateModuleControl(objModuleControl); } } InstallerInfo.Log.EndJob(REGISTER_End); }
/// <summary> /// AddModuleControl adds a new Module Control to the system /// </summary> /// <remarks> /// </remarks> /// <param name="ModuleDefId">The Module Definition Id</param> /// <param name="ControlKey">The key for this control in the Definition</param> /// <param name="ControlTitle">The title of this control</param> /// <param name="ControlSrc">Te source of ths control</param> /// <param name="IconFile">The icon file</param> /// <param name="ControlType">The type of control</param> /// <param name="ViewOrder">The vieworder for this module</param> /// <param name="HelpURL">The Help Url</param> private static void AddModuleControl(int ModuleDefId, string ControlKey, string ControlTitle, string ControlSrc, string IconFile, SecurityAccessLevel ControlType, int ViewOrder, string HelpURL) { ModuleControlController objModuleControls = new ModuleControlController(); // check if module control exists ModuleControlInfo objModuleControl = objModuleControls.GetModuleControlByKeyAndSrc(ModuleDefId, ControlKey, ControlSrc); if (objModuleControl == null) { objModuleControl = new ModuleControlInfo(); objModuleControl.ModuleControlID = Null.NullInteger; objModuleControl.ModuleDefID = ModuleDefId; objModuleControl.ControlKey = ControlKey; objModuleControl.ControlTitle = ControlTitle; objModuleControl.ControlSrc = ControlSrc; objModuleControl.ControlType = ControlType; objModuleControl.ViewOrder = ViewOrder; objModuleControl.IconFile = IconFile; objModuleControl.HelpURL = HelpURL; objModuleControls.AddModuleControl(objModuleControl); } }