private static TwoLevelMenu GetMenu() { TwoLevelMenu twoLevelMenu = new TwoLevelMenu(); TopMenuItem targetApplicationsMenu = new TopMenuItem(eImageType.Application, "Target Applications", ConsoleKey.T, "Target Applications AID", "Name & Platforms of the Applications which been tested in current Solution"); targetApplicationsMenu.Add(eImageType.Application, "", GetTargetApplicationsPage, ConsoleKey.T, "", "AID"); twoLevelMenu.Add(targetApplicationsMenu); TopMenuItem agentsMenu = new TopMenuItem(eImageType.Agent, "Agents", ConsoleKey.A, "Agents AID", "Agents are the drivers which communicates with the tested application"); agentsMenu.Add(eImageType.Agent, "", AgentsList, ConsoleKey.A, "", "AID"); twoLevelMenu.Add(agentsMenu); TopMenuItem reportsMenu = new TopMenuItem(eImageType.Report, "Reports", ConsoleKey.R, "Reports_AID", "Reports Templates and Configurations"); reportsMenu.Add(eImageType.Report, "Reports Templates", ReportsList, ConsoleKey.R, "Reports Templates are used to define the HTML report content and design", "Reports AID"); reportsMenu.Add(eImageType.Config, "General Reports Configurations", ReportsConfig, ConsoleKey.R, "Global Reports Configurations", "Reports Config AID"); reportsMenu.Add(eImageType.Config, "Execution Logger Configurations", ExecutionLoggerConfig, ConsoleKey.R, "Execution Logger Configurations", "Execution Logger Config AID"); twoLevelMenu.Add(reportsMenu); TopMenuItem tagsMenu = new TopMenuItem(eImageType.Tag, "Tags", ConsoleKey.T, "Tags AID", "List of Tags to be used for marking any of the Solution items with"); tagsMenu.Add(eImageType.Tag, "", GetTagsPage, ConsoleKey.T, "", "AID"); twoLevelMenu.Add(tagsMenu); return(twoLevelMenu); }
private static TwoLevelMenu GetMenu() { TwoLevelMenu twoLevelMenu = new TwoLevelMenu(); TopMenuItem ApplicationModelsMenu = new TopMenuItem("Application Models", ConsoleKey.A, "Application Models AID"); ApplicationModelsMenu.Add("API Models", APIModels, ConsoleKey.L, "Applications Web Service Requests Templates Repository", "AID"); //TODO: bind visible to Beta feature or use WorkSpace.Instance.BetaFeatures.PropertyChanged // meanwhile show/hide per current status if (WorkSpace.Instance.BetaFeatures.ShowPOMInResourcesTab) { ApplicationModelsMenu.Add("POM Models", POMModels, ConsoleKey.P, "Page Object Modeling", "AID"); } ApplicationModelsMenu.Add("Models Global Parameters", ModelsGlobalParameters, ConsoleKey.G, "Add or Edit Models Global Parameters", "AID"); twoLevelMenu.Add(ApplicationModelsMenu); // TODO: use visible show/hide instead of not adding if (App.UserProfile.UserTypeHelper.IsSupportAutomate) { TopMenuItem DataSourceMenu = new TopMenuItem("Data Sources", ConsoleKey.D, "Data Sources AID"); DataSourceMenu.Add("List", DataSources, ConsoleKey.D, "Add and Edit data source", "AID"); twoLevelMenu.Add(DataSourceMenu); } TopMenuItem DocumentsMenu = new TopMenuItem("Documents", ConsoleKey.D, "Documents AID"); DocumentsMenu.Add("List", Documents, ConsoleKey.L, "Solution documents like: text, excel, js scripts and any type of file", "AID"); twoLevelMenu.Add(DocumentsMenu); return(twoLevelMenu); }
private static TwoLevelMenu GetMenu() { TwoLevelMenu twoLevelMenu = new TwoLevelMenu(); TopMenuItem SharedRepositoryMenu = new TopMenuItem(eImageType.SharedRepositoryItem, "Shared Repository", ConsoleKey.S, "Shared Repository AID", "Flow Elements which can be shared between multiple " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlows)); SharedRepositoryMenu.Add(eImageType.ActivitiesGroup, GingerCore.GingerDicser.GetTermResValue(GingerCore.eTermResKey.ActivitiesGroups), SharedActivitiesGroups, ConsoleKey.S, GingerCore.GingerDicser.GetTermResValue(GingerCore.eTermResKey.ActivitiesGroups, "Shared "), "AID"); SharedRepositoryMenu.Add(eImageType.Activity, GingerCore.GingerDicser.GetTermResValue(GingerCore.eTermResKey.Activities), SharedActivities, ConsoleKey.S, GingerCore.GingerDicser.GetTermResValue(GingerCore.eTermResKey.Activities, "Shared "), "AID"); SharedRepositoryMenu.Add(eImageType.Action, "Actions", SharedActions, ConsoleKey.S, "Shared Actions", "AID"); SharedRepositoryMenu.Add(eImageType.Variable, GingerCore.GingerDicser.GetTermResValue(GingerCore.eTermResKey.Variables), SharedVariables, ConsoleKey.S, GingerCore.GingerDicser.GetTermResValue(GingerCore.eTermResKey.Variables, "Shared "), "AID"); twoLevelMenu.Add(SharedRepositoryMenu); TopMenuItem ApplicationModelsMenu = new TopMenuItem(eImageType.ApplicationModel, "Applications Models", ConsoleKey.A, "Application Models AID", "Applications Layers Templates"); ApplicationModelsMenu.Add(eImageType.APIModel, "API Models", APIModels, ConsoleKey.A, "API Templates Repository", "AID"); //TODO: bind visible to Beta feature or use WorkSpace.Instance.BetaFeatures.PropertyChanged // meanwhile show/hide per current status if (WorkSpace.Instance.BetaFeatures.ShowPOMInResourcesTab) { ApplicationModelsMenu.Add(eImageType.ApplicationPOMModel, "Page Objects Models", POMModels, ConsoleKey.P, "Page UI elemetns Modeling", "AID"); } ApplicationModelsMenu.Add(eImageType.Parameter, "Models Global Parameters", ModelsGlobalParameters, ConsoleKey.P, "Add or Edit Models Global Parameters", "AID"); twoLevelMenu.Add(ApplicationModelsMenu); TopMenuItem environemntsMenu = new TopMenuItem(eImageType.Environment, "Environments", ConsoleKey.E, "Environemnts_AID", "Environments are been used for storing environment level parameters and DB/Unix connections details"); environemntsMenu.Add(eImageType.Environment, "Environments", GetEnvsPage, ConsoleKey.E, "Environments are been used for storing environment level parameters and DB / Unix connections details", "Envs List"); twoLevelMenu.Add(environemntsMenu); TopMenuItem GlobalVariabelsMenu = new TopMenuItem(eImageType.Variable, GingerDicser.GetTermResValue(eTermResKey.Variables, "Global "), ConsoleKey.G, "Global Variables AID", GingerDicser.GetTermResValue(eTermResKey.Variables, suffixString: " which can be used cross " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlows))); GlobalVariabelsMenu.Add(eImageType.Variable, "", GetGlobalVariabelsPage, ConsoleKey.G, "", "AID"); twoLevelMenu.Add(GlobalVariabelsMenu); TopMenuItem DataSourceMenu = new TopMenuItem(eImageType.DataSource, "Data Sources", ConsoleKey.D, "Data Sources AID", "Add and Edit Data Sources"); DataSourceMenu.Add(eImageType.DataSource, "", DataSources, ConsoleKey.D, "", "AID"); twoLevelMenu.Add(DataSourceMenu); TopMenuItem DocumentsMenu = new TopMenuItem(eImageType.File, "Documents", ConsoleKey.D, "Documents AID", "Solution documents like: text, excel, js scripts and any type of file"); DocumentsMenu.Add(eImageType.File, "", Documents, ConsoleKey.D, "", "AID"); twoLevelMenu.Add(DocumentsMenu); TopMenuItem PluginsMenu = new TopMenuItem(eImageType.PluginPackage, "Plugins", ConsoleKey.P, "Plugins AID", "Ginger extention Add-ons"); PluginsMenu.Add(eImageType.PluginPackage, "", PluginsList, ConsoleKey.P, "", "AID"); twoLevelMenu.Add(PluginsMenu); return(twoLevelMenu); }
/// <summary> /// Loads the config file. /// </summary> private void LoadConfigFile() { var file = string.Format("{0}\\{1}", Application.StartupPath, this._configFile); var xml = new XmlDocument(); xml.Load(file); var nodeList = xml.ChildNodes; if (nodeList.Count < 2) { throw new Exception(string.Format("MenuFile is invalid format. [ File Name: {0}]", this._configFile)); } this._rootItem = new TopMenuItem(nodeList[1]); }
private static TwoLevelMenu GetMenu() { TwoLevelMenu twoLevelMenu = new TwoLevelMenu(); TopMenuItem SharedRepositoryMenu = new TopMenuItem(eImageType.SharedRepositoryItem, "Shared Repository", ConsoleKey.S, "Shared Repository AID", "Flow Elements which can be shared between multiple " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlows)); SharedRepositoryMenu.Add(eImageType.ActivitiesGroup, GingerCore.GingerDicser.GetTermResValue(GingerCore.eTermResKey.ActivitiesGroups), SharedActivitiesGroups, ConsoleKey.S, GingerCore.GingerDicser.GetTermResValue(GingerCore.eTermResKey.ActivitiesGroups, "Shared "), "AID"); SharedRepositoryMenu.Add(eImageType.Activity, GingerCore.GingerDicser.GetTermResValue(GingerCore.eTermResKey.Activities), SharedActivities, ConsoleKey.S, GingerCore.GingerDicser.GetTermResValue(GingerCore.eTermResKey.Activities, "Shared "), "AID"); SharedRepositoryMenu.Add(eImageType.Action, "Actions", SharedActions, ConsoleKey.S, "Shared Actions", "AID"); SharedRepositoryMenu.Add(eImageType.Variable, GingerCore.GingerDicser.GetTermResValue(GingerCore.eTermResKey.Variables), SharedVariables, ConsoleKey.S, GingerCore.GingerDicser.GetTermResValue(GingerCore.eTermResKey.Variables, "Shared "), "AID"); twoLevelMenu.Add(SharedRepositoryMenu); TopMenuItem ApplicationModelsMenu = new TopMenuItem(eImageType.ApplicationModel, "Applications Models", ConsoleKey.A, "Application Models AID", "Applications Layers Templates"); ApplicationModelsMenu.Add(eImageType.APIModel, "API Models", APIModels, ConsoleKey.A, "API Templates Repository", "AID"); ApplicationModelsMenu.Add(eImageType.ApplicationPOMModel, "Page Objects Models", POMModels, ConsoleKey.P, "Page UI Elements Repository", "POM Menu AID"); ApplicationModelsMenu.Add(eImageType.Parameter, "Models Global Parameters", ModelsGlobalParameters, ConsoleKey.P, "Add or Edit Models Global Parameters", "AID"); twoLevelMenu.Add(ApplicationModelsMenu); TopMenuItem environemntsMenu = new TopMenuItem(eImageType.Environment, "Environments", ConsoleKey.E, "Environemnts_AID", "Environments are been used for storing environment level parameters and DB/Unix connections details"); environemntsMenu.Add(eImageType.Environment, "Environments", GetEnvsPage, ConsoleKey.E, "Environments are been used for storing environment level parameters and DB / Unix connections details", "Envs List"); twoLevelMenu.Add(environemntsMenu); TopMenuItem GlobalVariabelsMenu = new TopMenuItem(eImageType.Variable, GingerDicser.GetTermResValue(eTermResKey.Variables, "Global "), ConsoleKey.G, "Global Variables AID", GingerDicser.GetTermResValue(eTermResKey.Variables, suffixString: " which can be used cross " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlows))); GlobalVariabelsMenu.Add(eImageType.Variable, "", GetGlobalVariabelsPage, ConsoleKey.G, "", "AID"); twoLevelMenu.Add(GlobalVariabelsMenu); TopMenuItem DataSourceMenu = new TopMenuItem(eImageType.DataSource, "Data Sources", ConsoleKey.D, "Data Sources AID", "Add and Edit Data Sources"); DataSourceMenu.Add(eImageType.DataSource, "", DataSources, ConsoleKey.D, "", "AID"); twoLevelMenu.Add(DataSourceMenu); TopMenuItem DocumentsMenu = new TopMenuItem(eImageType.File, "Documents", ConsoleKey.D, "Documents AID", "Solution documents like: text, excel, js scripts and any type of file"); DocumentsMenu.Add(eImageType.File, "", Documents, ConsoleKey.D, "", "AID"); twoLevelMenu.Add(DocumentsMenu); TopMenuItem PluginsMenu = new TopMenuItem(eImageType.PluginPackage, "Plugins", ConsoleKey.P, "Plugins AID", "Ginger extension Add-ons"); PluginsMenu.Add(eImageType.PluginPackage, "Installed", PluginsList, ConsoleKey.P, "Plugins which are installed in the solution", "AID"); PluginsMenu.Add(eImageType.Download, "Download Plugins", OnlinePlugins, ConsoleKey.O, "Online plugins which can be downloaded", "Online Plugins"); //PluginsMenu.Add(eImageType.PluginPackage, "Local", LocalPlugins, ConsoleKey.L, "Local plugins which are already downloaded on the user machine", "Online Plugins"); twoLevelMenu.Add(PluginsMenu); return(twoLevelMenu); }
private void UpdateMainFrame() { ListViewItem mainListItem = (ListViewItem)xMainNavigationListView.SelectedItem; ObservableList <ListViewItem> subItems; // we cahce the sub items in the Tag if (mainListItem.Tag == null) { TopMenuItem topMenuItem = (from x in mTwoLevelMenu.MenuList where x.Name == mainListItem.Content.ToString() select x).SingleOrDefault(); subItems = LoadSubNavigationList(topMenuItem); mainListItem.Tag = subItems; } else { subItems = (ObservableList <ListViewItem>)mainListItem.Tag; } xSubNavigationListView.Items.Clear(); foreach (ListViewItem lvi in subItems) { lvi.Style = (Style)TryFindResource("$ListViewItemStyle"); xSubNavigationListView.Items.Add(lvi); } // get the user back to the same sub item he had before or select the first item if (subItems.CurrentItem == null) { // first time click auto select first sub menu item subItems.CurrentItem = subItems[0]; } // Get the user back to the last sub item he had xSubNavigationListView.SelectedItem = subItems.CurrentItem; // if we have one sub item no need to show sub menu if (xSubNavigationListView.Items.Count > 1) { xSubNavigationListView.Visibility = Visibility.Visible; } else { xSubNavigationListView.Visibility = Visibility.Collapsed; } }
private void GetNote(TreeNode node, TopMenuItem item) { if (item == null) { return; } if (item.Childs.Count == 0) { return; } foreach (var child in item.Childs) { var childNode = new TreeNode(child.Name); childNode.Name = child.Key; GetNote(childNode, child); node.Nodes.Add(childNode); } }
private ObservableList <ListViewItem> LoadSubNavigationList(TopMenuItem topMenuItem) { ObservableList <ListViewItem> list = new ObservableList <ListViewItem>(); foreach (SubMenuItem subMenuItem in topMenuItem.SubItems) { ListViewItem listViewItem = new ListViewItem(); listViewItem.Content = subMenuItem.Name; listViewItem.Tag = subMenuItem; listViewItem.Style = (Style)TryFindResource("$ListViewItemStyle"); listViewItem.FontSize = 11; listViewItem.ToolTip = subMenuItem.ToolTip; listViewItem.SetValue(AutomationProperties.AutomationIdProperty, subMenuItem.AutomationID); list.Add(listViewItem); //TODO: enable visible //Add , Visibility = Visibility.Visible } return(list); }
private static TwoLevelMenu GetMenu() { TwoLevelMenu twoLevelMenuGet = new TwoLevelMenu(); TopMenuItem runSetMenu = new TopMenuItem(eImageType.RunSet, GingerCore.GingerDicser.GetTermResValue(GingerCore.eTermResKey.RunSets), ConsoleKey.R, "Run Set AID", GingerCore.GingerDicser.GetTermResValue(GingerCore.eTermResKey.RunSet, "Create, Design and Execute ")); runSetMenu.Add(eImageType.RunSet, "", GetRunSetPage, ConsoleKey.R, "", "AID"); twoLevelMenuGet.Add(runSetMenu); TopMenuItem executionsHistoryMenu = new TopMenuItem(eImageType.History, "Executions History", ConsoleKey.E, "Executions History AID", "View executions history of all Run Sets"); executionsHistoryMenu.Add(eImageType.History, "", GetExecutionsHistoryPage, ConsoleKey.E, "", "AID"); twoLevelMenuGet.Add(executionsHistoryMenu); TopMenuItem gingerGridMenu = new TopMenuItem(eImageType.Table, "Services Grid", ConsoleKey.G, "Ginger Grid AID", "Grid showing all connected plugins services nodes"); gingerGridMenu.Add(eImageType.List, "", GetGingerGridPage, ConsoleKey.G, "", "AID"); twoLevelMenuGet.Add(gingerGridMenu); return(twoLevelMenuGet); }
public void OnAdd(object sender, EventArgs e) { if (Page.IsValid) { using (DBDataContext db = new DBDataContext()) { var topmenu = new TopMenuItem() { Content = "", AlternateText = "", PageId = null, Title = txtNewMenu.Text.Trim(), }; db.TopMenuItem.InsertOnSubmit(topmenu); db.SubmitChanges(); topmenu.Order = topmenu.id; db.SubmitChanges(); lblMessage.Text = string.Format("Добавлен новый пункт меню '{0}'", txtNewMenu.Text.Trim()); } InitLists(); } }
private static TwoLevelMenu GetMenu() { TwoLevelMenu twoLevelMenu = new TwoLevelMenu(); TopMenuItem environemntsMenu = new TopMenuItem("Environments", ConsoleKey.E, "Environemnts_AID"); environemntsMenu.Add("Environments List", EnvsList, ConsoleKey.L, "Manage Environments", "Envs List"); environemntsMenu.Add("Compare", EnvsCompare, ConsoleKey.C, "Compare Environments", "compare Envs AID"); twoLevelMenu.Add(environemntsMenu); TopMenuItem agentsMenu = new TopMenuItem("Agents", ConsoleKey.A, "Agents AID"); agentsMenu.Add("List", AgentsList, ConsoleKey.L, "", "AgentsList"); twoLevelMenu.Add(agentsMenu); TopMenuItem reportsMenu = new TopMenuItem("Reports", ConsoleKey.R, "Reports_AID"); reportsMenu.Add("Reports Templates", ReportsList, ConsoleKey.L, "Report Templates", "Reports AID"); reportsMenu.Add("General Configurations", ReportsConfig, ConsoleKey.C, "Configuration", "Reports Config AID"); // reportsMenu.Add("Templates", ReportsTemplates, ConsoleKey.T, "Edit and Create report templates", "AID"); twoLevelMenu.Add(reportsMenu); return(twoLevelMenu); }
public void SaveItem(dtoTopMenuItem dto, List <dtoTranslation> translations, List <int> selectedTypes) { if (UserContext.isAnonymous) { View.DisplaySessionTimeout(rootObject.EditMenuBar(View.IdMenubar, Service.GetMenubarType(View.IdMenubar))); } else { TopMenuItem item = Service.SaveItem(dto, translations, selectedTypes); if (item != null) { View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), new dtoItem() { Id = item.Id, Type = MenuItemType.TopItemMenu }); } //View.ChangeTreeItemName(dto, dto.Name, item.DisplayOrder); else { //View.LoadTopMenuItem(Service.GetDtoTopMenuItem(dto.Id), Service.GetDtoTranslations(dto.Id), Service.GetItemProfilesAssignments(dto.Id)); View.SaveError(); } } }
public void AddItem(long idOwner, MenuItemType itemOwner, MenuItemType itemToCreate) { if (UserContext.isAnonymous) { View.DisplaySessionTimeout(rootObject.EditMenuBar(View.IdMenubar, Service.GetMenubarType(View.IdMenubar))); } else { MenuBarType menubarType = Service.GetMenubarType(View.IdMenubar); Boolean loadProfileTypes = (menubarType == MenuBarType.Portal || menubarType == MenuBarType.PortalAdministration); switch (itemOwner) { case MenuItemType.Menubar: TopMenuItem item = Service.AddItemToMenubar(idOwner); if (item != null) { View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), new dtoItem() { Id = idOwner, Type = itemOwner }); View.LoadMenuBarInfo(Service.GetDtoMenubar(View.IdMenubar)); //if (loadProfileTypes) // View.LoadTopMenuItem(Service.GetDtoTopMenuItem(item.Id) , Service.GetDtoTranslations(item.Id), Service.GetItemProfilesAssignments(item.Id)); //else // View.LoadTopMenuItem(Service.GetDtoTopMenuItem(item.Id), Service.GetDtoTranslations(item.Id)); } break; case MenuItemType.TopItemMenu: ItemColumn column = Service.AddItemToTopItem(idOwner); if (column != null) { View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), new dtoItem() { Id = idOwner, Type = itemOwner }); SelectItem(new dtoItem() { Id = idOwner, Type = itemOwner }); //View.LoadColumnItem(Service.GetDtoColumn(column.Id)); } break; case MenuItemType.ItemColumn: MenuItem subColumnItem = Service.AddToColumn(idOwner, itemToCreate); if (subColumnItem != null) { //dtoMenuItem dto = Service.GetDtoMenuItem(subColumnItem.Id); View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), new dtoItem() { Id = idOwner, Type = itemOwner }); //if (itemToCreate == MenuItemType.Separator) // View.LoadSeparatorItem(dto); //else if (loadProfileTypes) // View.LoadMenuItem(dto, Service.GetDtoTranslations(subColumnItem.Id), Service.GetItemProfilesAssignments(subColumnItem.Id), Service.GetItemAvailableProfileTypes(subColumnItem), Service.GetMenuItemAvailableTypes(subColumnItem)); //else // View.LoadMenuItem(dto, Service.GetDtoTranslations(subColumnItem.Id), Service.GetMenuItemAvailableTypes(subColumnItem)); SelectItem(new dtoItem() { Id = idOwner, Type = itemOwner }); } break; case MenuItemType.Link: case MenuItemType.Text: if (!(itemToCreate == MenuItemType.IconManage || itemToCreate == MenuItemType.IconNewItem || itemToCreate == MenuItemType.IconStatistic)) { View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), new dtoItem() { Id = idOwner, Type = itemOwner }); break; } goto case MenuItemType.TextContainer; case MenuItemType.TextContainer: case MenuItemType.LinkContainer: MenuItem subItem = Service.AddToItem(idOwner, itemToCreate); if (subItem != null) { View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), new dtoItem() { Id = idOwner, Type = itemOwner }); SelectItem(new dtoItem() { Id = idOwner, Type = itemOwner }); //if (itemToCreate == MenuItemType.Separator) // View.LoadSeparatorItem(Service.GetDtoMenuItem(subItem.Id)); //else if (loadProfileTypes) // View.LoadMenuItem(Service.GetDtoMenuItem(subItem.Id), Service.GetDtoTranslations(subItem.Id), Service.GetItemProfilesAssignments(subItem.Id), Service.GetItemAvailableProfileTypes(subItem), Service.GetMenuItemAvailableTypes(subItem)); //else // View.LoadMenuItem(Service.GetDtoMenuItem(subItem.Id), Service.GetDtoTranslations(subItem.Id), Service.GetMenuItemAvailableTypes(subItem)); } break; default: View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), new dtoItem() { Id = idOwner, Type = itemOwner }); break; } } }
/// <summary> /// Bindings the menu item. /// </summary> /// <param name="cntrl">The CNTRL.</param> /// <param name="item">The item.</param> public void BindingMenuItem(Control cntrl, TopMenuItem item) { }