示例#1
0
        public void Initialize(Object passedObj)
        {
            MainPanelParameter parameters = passedObj as MainPanelParameter;

            caseObj   = parameters.caseObject;
            sysConfig = parameters.SysConfig;
            sysMgr    = parameters.SysMgr;

            m_UserControlDisplay = new UserControl1(caseObj, sysConfig);
        }
示例#2
0
        public void Initialize(Object passedObj)
        {
            MainPanelParameter parameters = passedObj as MainPanelParameter;

            caseObj   = parameters.caseObject;
            sysConfig = parameters.SysConfig;
            sysMgr    = parameters.SysMgr;

            m_UserControlDisplay = new UserControl1(parameters.printerObjects, parameters.MainFrameworkWindow);
        }
示例#3
0
        public new void Show()
        {
            base.Show();

            MainPanelParameter Parameter         = new MainPanelParameter(null, m_SysConfig, m_SysMgr, m_DisplayedCases.GetPrinterObjects(), FrameWorkWindow);
            MainPanelInstance  mainPanelInstance = m_MainPanelPluginManager.GetCasesMainPanelInstance(Parameter);

            if (mainPanelInstance != null)
            {
                mainPanelInstance.Instance.SetOpenAndCloseCaseCallback(CasesOpenCase, DefaultCloseCase);
                MainPanelStackPanel.Children.Add(mainPanelInstance.Instance.UserControlDisplay);
            }

            if (m_DualViewWindow != null)
            {
                m_DualViewWindow.Show();
                m_DualViewWindow.WindowState = WindowState.Maximized;
            }
        }
        public MainPanelInstances GetInstances(MainPanelParameter parameters)
        {
            MainPanelInstances instances = new MainPanelInstances();

            foreach (string fileName in base.m_PluginAssemblies)
            {
                Assembly filterAssembly = Assembly.LoadFrom(fileName);

                foreach (Type assemblyType in filterAssembly.GetTypes())
                {
                    Type typeInterface = assemblyType.GetInterface("IMainPanel", true);

                    if (assemblyType.IsPublic && !assemblyType.IsAbstract && typeInterface != null && !assemblyType.FullName.Contains("Cases"))
                    {
                        MainPanelInstance newMainPanel = new MainPanelInstance();

                        newMainPanel.Instance = Activator.CreateInstance(assemblyType) as IMainPanel;

                        try
                        {
                            newMainPanel.Instance.Initialize(parameters);
                            instances.Add(newMainPanel);
                        }
                        catch (Exception ex)
                        {
                            //TODO: Log a message here since the instance couldn't be made
                        }

                        newMainPanel = null;
                    }

                    typeInterface = null;
                }

                filterAssembly = null;
            }

            return(instances);
        }
        public MainPanelInstance GetCasesMainPanelInstance(MainPanelParameter parameters)
        {
            foreach (string fileName in base.m_PluginAssemblies)
            {
                Assembly filterAssembly = Assembly.LoadFrom(fileName);

                foreach (Type assemblyType in filterAssembly.GetTypes())
                {
                    Type typeInterface = assemblyType.GetInterface("IMainPanel", true);

                    if (assemblyType.IsPublic && !assemblyType.IsAbstract && typeInterface != null)
                    {
                        MainPanelInstance newMainPanel = new MainPanelInstance();

                        newMainPanel.Instance = Activator.CreateInstance(assemblyType) as IMainPanel;

                        if (newMainPanel.Instance.Name.Contains("Cases"))
                        {
                            try
                            {
                                newMainPanel.Instance.Initialize(parameters);
                                return(newMainPanel);
                            }
                            catch (System.Windows.Markup.XamlParseException exp)
                            {
                                return(newMainPanel);
                            }
                            catch (Exception ex)
                            {
                                //TODO: Log a message here since the instance couldn't be made
                                return(null);
                            }
                        }
                    }
                }
            }

            return(null);
        }
示例#6
0
        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);
                }
            }
        }
示例#7
0
        public void Initialize(Object passedObj)
        {
            MainPanelParameter parameters = passedObj as MainPanelParameter;

            m_UserControlDisplay = new UserControl1(parameters.SysMgr, parameters.SysConfig, parameters.caseObject, (Framework)parameters.MainFrameworkWindow);
        }