Page ITreeViewItem.EditPage(Amdocs.Ginger.Common.Context mContext) { if (mActivitiesRepositoryPage == null) { mActivitiesRepositoryPage = new ActivitiesRepositoryPage(mActivitiesFolder, null); } return(mActivitiesRepositoryPage); }
Page ITreeViewItem.EditPage() { if (mActivitiesRepositoryPage == null) { mActivitiesRepositoryPage = new ActivitiesRepositoryPage(mActivitiesFolder); } return(mActivitiesRepositoryPage); }
public bool Load(string FileName) { featureFileName = FileName; GherkinTextEditor.SetContentEditorTitleLabel(Path.GetFileName(FileName) + " , Target " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlow) + ": N/A", (Style)TryFindResource("@ucGridTitleLightStyle")); GherkinDcoumentEditor g = new GherkinDcoumentEditor(); g.OptimizedSteps = mOptimizedSteps; g.OptimizedTags = mTags; GherkinTextEditor.Init(FileName, g, true); mSolTags.ClearAll(); foreach (GherkinTag tag in mTags) { Guid guid = GetTagInSolution(tag.Name); if (guid != Guid.Empty) { mSolTags.Add(guid); } } string externalID = FileName.Replace(WorkSpace.Instance.Solution.Folder, "~"); mBizFlow = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <BusinessFlow>().Where(x => x.Source == BusinessFlow.eSource.Gherkin && (x.ExternalID == externalID || x.ExternalID == FileName)).SingleOrDefault(); ARP = new ActivitiesRepositoryPage(WorkSpace.Instance.SolutionRepository.GetRepositoryItemRootFolder <Activity>(), new Context() { BusinessFlow = mBizFlow }, mSolTags, ArrowButtonHandler); //ARP.xActivitiesRepositoryListView.EnableTagsPanel = false; SharedActivitiesFrame.Content = ARP; BFName = FileName.Replace(WorkSpace.Instance.Solution.Folder, ""); //to prevent creating a folder rather than putting them on BF level. if (BFName.Contains("Business Flows")) { BFName = BFName.Replace("Business Flows", ""); } if (BFName.EndsWith(".feature")) { BFName = Path.GetFileName(FileName).Replace(".feature", ""); } // search if we have the BF defined already, so search in BF will work if (mBizFlow != null) { BFName = mBizFlow.FileName; isBFexists = true; UpdateBFButton.Content = "Update " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlow); GherkinTextEditor.SetContentEditorTitleLabel(Path.GetFileName(FileName) + " , Target " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlow) + ": " + mBizFlow.ContainingFolder + "\\" + mBizFlow.Name, (Style)TryFindResource("@ucGridTitleLightStyle")); } else { isBFexists = false; UpdateBFButton.Content = "Create " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlow); } SavePrompt(); return(Optimize()); }
public bool Load(string FileName) { GherkinTextEditor.ContentEditorTitleLabel.Content = Path.GetFileName(FileName); GherkinTextEditor.ContentEditorTitleLabel.Style = (Style)TryFindResource("@ucGridTitleLightStyle"); GherkinDcoumentEditor g = new GherkinDcoumentEditor(); g.OptimizedSteps = mOptimizedSteps; g.OptimizedTags = mTags; GherkinTextEditor.Init(FileName, g, true); mSolTags.ClearAll(); foreach (GherkinTag tag in mTags) { Guid guid = GetTagInSolution(tag.Name); if (guid != Guid.Empty) { mSolTags.Add(guid); } } ARP = new ActivitiesRepositoryPage(WorkSpace.Instance.SolutionRepository.GetRepositoryItemRootFolder <Activity>(), null, mSolTags, ArrowButtonHandler); ARP.xActivitiesRepositoryGrid.EnableTagsPanel = false; SharedActivitiesFrame.Content = ARP; BFName = FileName.Replace(App.UserProfile.Solution.Folder, ""); //to prevent creating a folder rather than putting them on BF level. if (BFName.Contains("Business Flows")) { BFName = BFName.Replace("Business Flows", ""); } BFName = BFName.Replace(@"Documents\Features\", ""); BFName = BFName.Replace(".feature", ""); BFName = folder + BFName + ".Ginger.BusinessFlow.xml"; // search if we have the BF defined already, so search in BF will work mBizFlow = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <BusinessFlow>().Where(x => x.Name == BFName).SingleOrDefault(); if (File.Exists(BFName)) { isBFexists = true; UpdateBFButton.Content = "Update " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlow); } else { isBFexists = false; UpdateBFButton.Content = "Create " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlow); } SavePrompt(); return(Optimize()); }
private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { if (xTabRepository.SelectedItem != null) { foreach (TabItem tab in xTabRepository.Items) { foreach (object ctrl in ((StackPanel)(tab.Header)).Children) { if (ctrl.GetType() == typeof(TextBlock)) { if (xTabRepository.SelectedItem == tab) { ((TextBlock)ctrl).Foreground = (SolidColorBrush)FindResource("$SelectionColor_Pink"); } else { ((TextBlock)ctrl).Foreground = (SolidColorBrush)FindResource("$Color_DarkBlue"); } ((TextBlock)ctrl).FontWeight = FontWeights.Bold; } } } } } catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, "Error in Action Edit Page tabs style", ex); } // We do load on demand if (xTabRepository.SelectedItem == xTabActivitiesGroups) { if (((string)xTabActivitiesGroups.Tag) != "Done") { ActivitiesGroupsRepoPage = new ActivitiesGroupsRepositoryPage(WorkSpace.Instance.SolutionRepository.GetRepositoryItemRootFolder <ActivitiesGroup>(), mContext); xFrameActivitiesGroups.Content = ActivitiesGroupsRepoPage; // Mark that this tab is loaded with info xTabActivitiesGroups.Tag = "Done"; } } if (xTabRepository.SelectedItem == xTabActivities) { if (((string)xTabActivities.Tag) != "Done") { ActivitiesRepoPage = new ActivitiesRepositoryPage(WorkSpace.Instance.SolutionRepository.GetRepositoryItemRootFolder <Activity>(), mContext); xFrameActivities.Content = ActivitiesRepoPage; // Mark that this tab is loaded with info xTabActivities.Tag = "Done"; } } if (xTabRepository.SelectedItem == xTabActions) { if (((string)xTabActions.Tag) != "Done") { ActionsRepoPage = new ActionsRepositoryPage(WorkSpace.Instance.SolutionRepository.GetRepositoryItemRootFolder <Act>(), mContext); xFrameActions.Content = ActionsRepoPage; // Mark that this tab is loaded with info xTabActions.Tag = "Done"; } } }
private void BtnAdd_Click(object sender, RoutedEventArgs e) { ActivitiesRepositoryPage ActivitiesRepoPage = new ActivitiesRepositoryPage(WorkSpace.Instance.SolutionRepository.GetRepositoryItemRootFolder <Activity>(), null, null, GroupActivitiesHandler, ActivitiesRepositoryPage.ePageViewMode.Selection); ActivitiesRepoPage.ShowAsWindow(Window.GetWindow(this)); }