Example #1
0
        /// <summary>
        /// Handles a changed stylesheet in the data model.
        /// </summary>
        /// <param name="sender">The object that originated the event.</param>
        /// <param name="stylesheetRowChangeEvent">The event argument.</param>
        private void StylesheetChangedEvent(object sender, ClientMarketData.StylesheetRowChangeEvent stylesheetRowChangeEvent)
        {
            // This will make it easier to operate on the changed record.
            ClientMarketData.StylesheetRow stylesheetRow = stylesheetRowChangeEvent.Row;

            // Reopen the document if the style sheet has changed.
            if (this.IsOpen && stylesheetRow.StylesheetId == this.stylesheetId)
            {
                DrawDocument();
            }
        }
Example #2
0
        /// <summary>
        /// Handles a changed stylesheet in the data model.
        /// </summary>
        /// <param name="sender">The object that originated the event.</param>
        /// <param name="stylesheetRowChangeEvent">The event argument.</param>
        private void ChangeStylesheetRow(object sender, ClientMarketData.StylesheetRowChangeEvent stylesheetRowChangeEvent)
        {
            // The only changes that impact the viewer are committed records.
            if (stylesheetRowChangeEvent.Action == DataRowAction.Commit)
            {
                // This will make it easier to operate on the changed record.
                ClientMarketData.StylesheetRow stylesheetRow = stylesheetRowChangeEvent.Row;

                // Reload the stylesheet if the modified stylesheet is the one currently used by this viewer.
                if (stylesheetRow.StylesheetId == this.stylesheetId)
                {
                    // This will read the stylesheet out of the changed record and into the viewers internal data structures.
                    XmlDocument   xslStylesheet = new XmlDocument();
                    StringReader  stringReader  = new StringReader(stylesheetRow.Text);
                    XmlTextReader xmlTextReader = new XmlTextReader(stringReader);
                    xslStylesheet.Load(xmlTextReader);
                    this.XslStylesheet = xslStylesheet;

                    // This indicates that the list of fragments is invalid and the entire document should be redrawn.
                    this.fragmentList.IsValid = false;
                }
            }
        }
Example #3
0
 /// <summary>
 /// Handles the changing of an execution record.
 /// </summary>
 /// <param name="sender">Object that generated the event.</param>
 /// <param name="e">The event argument.</param>
 public void StylesheetRowChangeEvent(object sender, ClientMarketData.StylesheetRowChangeEvent executionRowChangeEvent)
 {
 }