コード例 #1
0
ファイル: XRayDisplays.cs プロジェクト: marzlia/CXPortal
        public XRayDisplays(CaseObject caseObj, SysConfiguration SysConfig)
        {
            m_CaseObj            = caseObj;
            m_SysConfig          = SysConfig;
            m_statusBarItems     = new StatusBarItems();
            m_HistogramDisplay   = new HistogramDisplay();
            Displays             = new List <LayoutInfo>();
            FragmentMarkInfoList = new Collection <FragmentObject>();

            m_FragmentDataDisplay = new FragmentDataDisplay(this);

            foreach (DataAttachment attachment in caseObj.attachments.GetUnknownAttachments())
            {
                if (attachment.attachmentId == "FragmentDataTable.csv")
                {
                    byte[] fragmentData = new byte[attachment.attachmentData.Length];
                    attachment.attachmentData.Read(fragmentData, 0, fragmentData.Length);

                    FragmentMarkInfoList = m_FragmentDataDisplay.UpdateDisplay(fragmentData);
                }
            }

            StatusBarItem caseIDStatus = new StatusBarItem();

            caseIDStatus.Content = "Case ID :" + m_CaseObj.CaseId;
            m_statusBarItems.StatusDisplay.Add(caseIDStatus);

            Initialize();
        }
コード例 #2
0
ファイル: XRayDisplays.cs プロジェクト: marzlia/CXPortal
        public void Dispose()
        {
            m_HistogramDisplay.Dispose();

            if (Displays != null)
            {
                foreach (LayoutInfo layoutInfo in Displays)
                {
                    UserControl1 userControl1 = layoutInfo.Display as UserControl1;

                    if (userControl1 != null)
                    {
                        userControl1.Dispose();
                    }
                    else
                    {
                        HistogramDisplay histogramDisplay = layoutInfo.Display as HistogramDisplay;

                        if (histogramDisplay != null)
                        {
                            histogramDisplay.Dispose();
                        }
                    }
                }

                Displays.Clear();
            }

            byte[] filedata = null;
            try
            {
                string tfn = Path.GetTempFileName();
                m_FragmentDataDisplay.SaveReport(tfn);
                if (File.Exists(tfn))
                {
                    string data = File.ReadAllText(tfn);
                    System.Text.ASCIIEncoding en = new System.Text.ASCIIEncoding();
                    filedata = en.GetBytes(data);
                    DataAttachment attachment = new DataAttachment();
                    attachment.attachmentId   = "FragmentDataTable.csv";
                    attachment.attachmentType = AttachmentType.Unknown;
                    attachment.attachmentData = new MemoryStream(filedata, true); //MemoryStream
                    //   MemoryStream ms = new MemoryStream();
                    m_CaseObj.NewAttachments.Add(attachment);
                    File.Delete(tfn); //not working
                }
            }
            catch { }
            m_statusBarItems.StatusDisplay.Clear();
            m_statusBarItems = null;
            m_CaseObj        = null;
        }
コード例 #3
0
ファイル: XRayDisplays.cs プロジェクト: BdGL3/CXPortal
        public XRayDisplays (CaseObject caseObj, SysConfiguration SysConfig)
        {
            m_CaseObj = caseObj;
            m_SysConfig = SysConfig;
            m_statusBarItems = new StatusBarItems();
            m_HistogramDisplay = new HistogramDisplay();
            Displays = new List<LayoutInfo>();
            FragmentMarkInfoList = new Collection<FragmentObject>();

            m_FragmentDataDisplay = new FragmentDataDisplay(this);            

            foreach (DataAttachment attachment in caseObj.attachments.GetUnknownAttachments())
            {                
                if (attachment.attachmentId == "FragmentDataTable.csv")
                {
                    byte[] fragmentData = new byte[attachment.attachmentData.Length];
                    attachment.attachmentData.Read(fragmentData, 0, fragmentData.Length);
                    
                    FragmentMarkInfoList = m_FragmentDataDisplay.UpdateDisplay(fragmentData);
                }
            }

            StatusBarItem caseIDStatus = new StatusBarItem();
            caseIDStatus.Content = "Case ID :" + m_CaseObj.CaseId;
            m_statusBarItems.StatusDisplay.Add(caseIDStatus);

            Initialize();
        }