public void ChangeModule(E_Module moduleType) { switch (moduleType) { case E_Module.e_FF_Module: Data_PageSource = new Uri("pack://application:,,,/View/FF/FF.xaml", UriKind.Absolute); break; case E_Module.e_HART_Module: Data_PageSource = new Uri("pack://application:,,,/View/HART/HART.xaml", UriKind.Absolute); break; case E_Module.e_PA_Module: Data_PageSource = new Uri("pack://application:,,,/View/PA/PA.xaml", UriKind.Absolute); break; default: break; } if (ModuleSelect != null) { //To do:此处释放资源存在问题 ModuleSelect.Close(); } }
void On_ModuleChanged_Receiver(E_Module message) { //TO DO:目前这里动态加载有问题,无法动态切换 switch (message) { case E_Module.e_FF_Module: Data_PageSource = new Uri("pack://application:,,,/View/FF/FF.xaml", UriKind.Absolute); break; case E_Module.e_HART_Module: Data_PageSource = new Uri("pack://application:,,,/View/HART/HART.xaml", UriKind.Absolute); break; case E_Module.e_PA_Module: Data_PageSource = new Uri("pack://application:,,,/View/PA/PA.xaml", UriKind.Absolute); break; default: break; } if (ModuleSelect != null) { //To do:此处释放资源存在问题 ModuleSelect.Close(); } }
/// <summary> /// Adds a module to a page. /// </summary> /// <param name="moduleName">The name that will be given to the module. Entering "" as a name will not fill in the module title field.</param> /// <param name="moduleType">The type of module that will be added. Ex. HTML, Links, Dashboard etc.</param> public void AddModuleToPage(string moduleName, string moduleType) { ModuleSelect.Select(moduleType); if (!moduleName.Equals("")) { ModuleTitleField.Value = moduleName; } AddModuleLink.ClickNoWait(); }
/// <summary> /// Adds a module to a page and inserts it above or below another module. /// </summary> /// <param name="moduleName">The name that will be given to the module. Entering "" as a name will not fill in the module title field.</param> /// <param name="moduleType">The type of module that will be added. Ex. HTML, Links, Dashboard etc.</param> /// <param name="insert">How the module shoudl be inserted. "Above" or "Below".</param> /// <param name="otherModule">The module that the new module will be inserted relative to.</param> public void AddModuleToPageInsert(string moduleName, string moduleType, string insert, string otherModule) { ModuleSelect.Select(moduleName); if (!moduleName.Equals("")) { ModuleTitleField.Value = moduleName; } ModuleInsertSelect.Select(insert); if (insert.ToLower().Equals("above") || insert.ToLower().Equals("below")) { InsertRelativeSelectList.Select(otherModule); } AddModuleLink.Click(); }
/// <summary> /// Adds a module to a page and adds content to the module. /// </summary> /// <param name="moduleName">The name that will be given to the module. Entering "" as a name will not fill in the module title field.</param> /// <param name="moduleType">The type of module that will be added. Ex. HTML, Links, Dashboard etc.</param> /// <param name="content">The content that will be added to the module.</param> /// <param name="moduleIndex">The index for the module on the page. Ex. if the module will be the first one on the page the index should be 0.</param> public void AddHTMLModuleToPageWithContent(string moduleName, string moduleType, string content, int moduleIndex) { ModuleSelect.Select(moduleType); if (!moduleName.Equals("")) { ModuleTitleField.Value = moduleName; } AddModuleLink.Click(); System.Threading.Thread.Sleep(2000); var htmlModule = new HTMLModule(this); htmlModule.AddContentToModule(content, moduleIndex); }
public void clearSavedUserInfo() { string moduleName = CollectionManager.moduleCollection[ModuleSelect.currentModuleID].getName(); File.Delete(Application.persistentDataPath + "/UserRecords/Module" + ModuleSelect.currentModuleID + ".json"); ModuleInfo newMod = new ModuleInfo(ModuleSelect.currentModuleID, moduleName, 0, 0, 0, 0, 0, 0); CollectionManager.moduleCollection.Remove(ModuleSelect.currentModuleID); CollectionManager.moduleCollection.Add(ModuleSelect.currentModuleID, newMod); string moduleJson = newMod.createJson(); newMod.saveJson(); ModuleSelect.setSelectedModule(ModuleSelect.currentModuleID); }
public void pickModule(int moduleID) { ModuleSelect.setSelectedModule(moduleID); }