public void Remove(string caseName) { DisplayedCase displayedCase = this.Find(caseName); if (displayedCase != null) { this.Remove(displayedCase); } }
public new void RemoveAt(int index) { DisplayedCase displayCase = this.List[index] as DisplayedCase; if (displayCase != null) { displayCase.Dispose(); } this.List.RemoveAt(index); }
public PrinterObjects GetPrinterObjects() { PrinterObjects printerObjects = null; DisplayedCase displayCase = GetPrimaryCase(); if (displayCase != null) { printerObjects = displayCase.PrinterObjects; } return(printerObjects); }
public DisplayedCase GetPrimaryCase() { DisplayedCase toReturn = null; foreach (DisplayedCase displayCase in this.List) { if (displayCase.IsPrimaryCase == true) { toReturn = displayCase; break; } } return(toReturn); }
public DisplayedCase Find(string caseName) { DisplayedCase toReturn = null; foreach (DisplayedCase displayCase in this.List) { if (string.Equals(displayCase.CaseID, caseName)) { toReturn = displayCase; break; } } return(toReturn); }
public DisplayedCase GetLiveCase() { DisplayedCase toReturn = null; foreach (DisplayedCase displayCase in this.List) { if (displayCase.IsCaseEditable == true) { toReturn = displayCase; break; } } return(toReturn); }
public void Remove(DisplayedCase caseToRemove) { caseToRemove.Dispose(); this.List.Remove(caseToRemove); }
public void Add(DisplayedCase caseToAdd) { this.List.Add(caseToAdd); }
private void AutoSelectPendingCaseThreadMethod() { Exception Exp = null; while (true) { try { m_GetAvailablePendingCaseEvent.WaitOne(6000); if (!m_LiveCaseDisplayed) { //wait some time to clear the screen before displaying the next case information. Thread.Sleep(100); DisplayedCase displayCase = null; MainPanelStackPanel.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate { displayCase = new DisplayedCase(String.Empty, true); })); if (displayCase != null) { DisplayCase(String.Empty, displayCase); } } } catch (ThreadAbortException) { return; } catch (Exception exp) { if (exp.Message == ErrorMessages.NO_LIVE_CASE || exp.Message == ErrorMessages.NO_LIVE_SOURCES || exp.Message == ErrorMessages.SOURCE_NOT_AVAILABLE) m_SysMgr.WaitForAvailableCase(5000); else { Thread.Sleep(3000); } m_GetAvailablePendingCaseEvent.Set(); } } }
private void CasesOpenCase(String SourceAlias, String CaseID, Boolean CompareCase) { try { if (!String.IsNullOrWhiteSpace(SourceAlias) && !m_DisplayedCases.Contains(CaseID)) { CompareCaseChecked = CompareCase; if (!IsComparing) { CleanUpCases(CaseUpdateEnum.CloseCase); } DisplayedCase displayCase = new DisplayedCase(CaseID, !CompareCase); DisplayCase(SourceAlias, displayCase); } else if (m_DisplayedCases.Contains(CaseID)) { throw new Exception(L3.Cargo.Common.Resources.SelectedCaseIsAlreadyBeingDisplayed); } } catch (Exception ex) { //TODO: Log error Message Here throw ex; } }
private void ConstructLayout(DisplayedCase displayCase) { Boolean DualViewAvailable = (m_DualViewWindow != null && m_DualViewWindow.IsWindowAvailable && (m_DisplayedCases.Count == 0) && !IsComparing); Boolean MoveDualViewTabItems = ((m_DisplayedCases.Count == 1) && IsComparing); if (!StatusList.ContainsKey(displayCase.CaseID)) StatusList.Add(displayCase.CaseID, displayCase.StatusBarItems); StatusBar.Items.Clear(); foreach (StatusBarItem statusBarItem in displayCase.StatusBarItems) { if (!StatusBar.Items.Contains(statusBarItem)) { StatusBar.Items.Add(statusBarItem); } } if (MoveDualViewTabItems) { DisplayedCase primaryCase = m_DisplayedCases.GetPrimaryCase(); if (primaryCase != null) { MoveTabItems(m_DualViewWindow.PrimaryTabControl, primaryCase.PanelLayout.MainTabControl); } } if (DualViewAvailable) { MoveTabItems(displayCase.SecTabControl, m_DualViewWindow.PrimaryTabControl); } else { MoveTabItems(displayCase.SecTabControl, displayCase.PanelLayout.MainTabControl); } displayCase.CaseTabItem = new TabItem(); displayCase.CaseTabItem.Header = displayCase.CaseID; displayCase.CaseTabItem.Style = (Style)FindResource("TabItemTemplate"); displayCase.CaseTabItem.Content = displayCase.PanelLayout; displayCase.CaseTabItem.AddHandler(CloseTabItemButton.ClickEvent, new RoutedEventHandler(this.CloseCase)); if (IsComparing) { if (m_DualViewWindow != null && m_DualViewWindow.IsWindowAvailable) { displayCase.Parent = m_DualViewWindow.PrimaryTabControl; m_DualViewWindow.PrimaryTabControl.MouseEnter += new MouseEventHandler(PrimaryTabControl_MouseEnter); } else { displayCase.Parent = CompareTabControl; CompareTabControl.MouseEnter += new MouseEventHandler(PrimaryTabControl_MouseEnter); CompareTabControl.SelectionChanged += new SelectionChangedEventHandler(CompareTabControl_SelectionChanged); } displayCase.CaseTabItem.Visibility = Visibility.Visible; } else { displayCase.Parent = PrimaryTabControl; PrimaryTabControl.MouseEnter += new MouseEventHandler(PrimaryTabControl_MouseEnter); } displayCase.Parent.Items.Add(displayCase.CaseTabItem); displayCase.Parent.SelectedItem = displayCase.CaseTabItem; if (displayCase.Parent == PrimaryTabControl) m_LiveCaseDisplayed = true; }
private void DisplayCase(String sourceAlias, DisplayedCase displayCase) { try { CaseObject caseObj = null; if (m_AutoSelectCaseEnabled && !m_SysConfig.GetDefaultConfig().SelectedArchiveDuringAutoSelect) { m_SysMgr.AutoSelectCase(out caseObj); if (caseObj != null) { displayCase.CaseID = caseObj.CaseId; displayCase.IsCTICase = (caseObj.caseType == Cargo.Common.CaseType.CTICase) ? true : false; displayCase.IsFTICase = (caseObj.caseType == Cargo.Common.CaseType.FTICase) ? true : false; } } else if (!String.IsNullOrWhiteSpace(sourceAlias) && !String.IsNullOrWhiteSpace(displayCase.CaseID)) { m_SysMgr.GetCase(sourceAlias, displayCase.CaseID, out caseObj, displayCase.IsCaseEditable); displayCase.IsCTICase = (caseObj.caseType == Cargo.Common.CaseType.CTICase) ? true : false; displayCase.IsFTICase = (caseObj.caseType == Cargo.Common.CaseType.FTICase) ? true : false; } if (caseObj != null) { MainPanelStackPanel.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate { try { displayCase.IsCaseEditable = caseObj.IsCaseEditable; ContentParameter parameters = new ContentParameter(caseObj, m_SysConfig.GetConfig(caseObj.SourceAlias)); displayCase.ContentInstances = m_ContentPluginManager.GetInstances(parameters); ConstructLayout(displayCase); m_DisplayedCases.Add(displayCase); if (displayCase.IsPrimaryCase) { DisplayedCase dispalyedCase = m_DisplayedCases.Find(displayCase.CaseID); MainPanelParameter Parameters = new MainPanelParameter(caseObj, m_SysConfig, m_SysMgr, m_DisplayedCases.GetPrinterObjects(), FrameWorkWindow); dispalyedCase.mainPanelInstances = m_MainPanelPluginManager.GetInstances(Parameters); MainPanelInstance DecisionPlugin = null; foreach (MainPanelInstance mainPanelInst in dispalyedCase.mainPanelInstances) { if (mainPanelInst.Instance.Name.Contains("Decision")) DecisionPlugin = mainPanelInst; else MainPanelStackPanel.Children.Add(mainPanelInst.Instance.UserControlDisplay); if (mainPanelInst.Instance.Name.Contains("ClearCase")) { mainPanelInst.Instance.SetOpenAndCloseCaseCallback(DefaultOpenCase, ClearScreenCloseCase); } else if (mainPanelInst.Instance.Name.Contains("Decision")) { mainPanelInst.Instance.SetOpenAndCloseCaseCallback(DefaultOpenCase, DecisionCloseCase); } } if (DecisionPlugin != null) MainPanelStackPanel.Children.Add(DecisionPlugin.Instance.UserControlDisplay); caseObj.AnalysisStartTime = DateTime.Now; } NotifyPropertyChanged("IsCompareAvailable"); } catch (Exception ex) { MessageBox.Show(ex.Message); } })); } } catch (Exception ex) { if (m_SysConfig.GetDefaultConfig().AutoSelectPendingCasesEnabled) { throw; } else { MessageBox.Show(ex.Message); } } }