public DisplayedCase(string caseId, bool IsPrimaryCase, ContentInstances contentInstances, MainPanelInstances mainPanelInstances) { if (String.IsNullOrWhiteSpace(caseId)) { throw new Exception(ErrorMessages.CASE_ID_INVALID); } m_CaseID = caseId; m_IsPrimaryCase = IsPrimaryCase; m_IsCaseEditable = IsPrimaryCase; m_IsCTICase = false; m_IsFTICase = false; m_IsTIPResultReturned = false; m_ContentInstances = contentInstances; m_MainPanelInstances = mainPanelInstances; m_PanelLayout = new PanelLayout(); m_SecTabControl = new TabControl(); m_StatusBarItems = new List <StatusBarItem>(); m_PrinterObjects = new PrinterObjects(); }
public ContentInstances GetInstances(ContentParameter parameters) { ContentInstances instances = new ContentInstances(); foreach (string fileName in base.m_PluginAssemblies) { Assembly contentAssembly = Assembly.LoadFrom(fileName); foreach (Type assemblyType in contentAssembly.GetTypes()) { Type typeInterface = assemblyType.GetInterface("IContent", true); if (assemblyType.IsPublic && !assemblyType.IsAbstract && typeInterface != null) { ContentInstance newContent = new ContentInstance(); newContent.Instance = Activator.CreateInstance(assemblyType) as IContent; try { newContent.Instance.Initialize(parameters); instances.Add(newContent); } catch (Exception ex) { //TODO: Log a message here since the instance couldn't be made } newContent = null; } typeInterface = null; } contentAssembly = null; } return(instances); }
public DisplayedCase(string caseId, bool IsPrimaryCase, ContentInstances contentInstances, PanelLayout panelLayout, MainPanelInstances mainPanelInstances) { if (String.IsNullOrWhiteSpace(caseId)) { throw new Exception(ErrorMessages.CASE_ID_INVALID); } m_CaseID = caseId; m_IsPrimaryCase = IsPrimaryCase; m_IsCaseEditable = IsPrimaryCase; m_IsCTICase = false; m_IsFTICase = false; m_IsTIPResultReturned = false; m_ContentInstances = contentInstances; m_MainPanelInstances = mainPanelInstances; m_PanelLayout = panelLayout; m_SecTabControl = new TabControl(); m_StatusBarItems = new List<StatusBarItem>(); m_PrinterObjects = new PrinterObjects(); }