コード例 #1
0
ファイル: QuoteViewer.cs プロジェクト: DonaldAirey/quasar
        /// <summary>
        /// Creates the DOM and Refreshes the spreadsheet control in the background.
        /// </summary>
        /// <remarks>
        /// This thread is responsible for recreating the Document Object Model for the blotter and translating
        /// that DOM into a format compatible with the spreadsheet viewer.  It will call the foreground when the
        /// DOM is complete to either update the entire document, if the structure has changed, or only update
        /// the changed cells, when only the data has changed.
        /// </remarks>
        private void DrawFragmentCommand(object parameter)
        {
            // Extract the list of fragments from the thread parameters.
            FragmentList fragmentList = (FragmentList)parameter;

#if DEBUGXML
            // This will create an XML Document containing only the records and fields that have changed since the viewer was
            // last updated.
            XmlDocument stagedOrderFragment = new MatchHistoryDocument(fragmentList);

            // Make sure that writing the debug file doesn't interrupt the session.
            try
            {
                // During debugging, it's very useful to have a copy of the DOM on the disk.
                stagedOrderFragment.Save("stagedOrderFragment.xml");
            }
            catch (Exception exception)
            {
                // Write the error and stack trace out to the event log.
                EventLog.Error("{0}, {1}", exception.Message, exception.StackTrace);
            }

            // This will write the changes to the viewer by passing it through the stylesheet.
            this.XmlDocument = stagedOrderFragment;
#else
            // This will write the changes to the viewer by passing it through the stylesheet.
            //this.XmlDocument = new MatchHistoryDocument(fragmentList);
            this.XmlDocument = new QuoteDocument(fragmentList);
#endif
        }
コード例 #2
0
ファイル: QuoteViewer.cs プロジェクト: DonaldAirey/quasar
        /// <summary>
        /// Creates the DOM and Refreshes the spreadsheet control in the background.
        /// </summary>
        /// <remarks>
        /// This thread is responsible for recreating the Document Object Model for the blotter and translating
        /// that DOM into a format compatible with the spreadsheet viewer.  It will call the foreground when the
        /// DOM is complete to either update the entire document, if the structure has changed, or only update
        /// the changed cells, when only the data has changed.
        /// </remarks>
        protected override void DrawDocumentCommand(object parameter)
        {
            // Extract the document from the thread parameters.
            Blotter blotter = null;

            if (parameter is Blotter)
            {
                blotter = (Blotter)parameter;
            }

            if (parameter is BlotterMatchDetail)
            {
                blotter = ((BlotterMatchDetail)parameter).Blotter;
            }

#if DEBUGXML
            // Create the blotter document.
            MatchHistoryDocument matchDocument = new MatchHistoryDocument(blotter.BlotterId);

            // Make sure that writing the debug file doesn't interrupt the session.
            try
            {
                // During debugging, it's very useful to have a copy of the DOM on the disk.
                matchDocument.Save("matchHistoryDOM.xml");
            }
            catch (Exception exception)
            {
                // Write the error and stack trace out to the debug listener
                EventLog.Error("{0}, {1}", exception.Message, exception.StackTrace);
            }

            // This will display the
            this.XmlDocument = matchDocument;
#else
            // This will display the quote viewer
            this.XmlDocument = new QuoteDocument(Convert.ToInt32(this.Tag));
#endif
        }