Exemplo n.º 1
0
        public QuoteViewer()
        {
            // IDs of the security for data and stylesheet for style
            this.Tag          = Int32.MinValue;
            this.stylesheetId = Int32.MinValue;

            InitializeComponent();

            // This collects the changes to the data model and is used to generate incremental changes to the displayed document.
            this.fragmentList = new FragmentList();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Handles the event that is generated when all the data model changes have been incorporated.
 /// </summary>
 /// <param name="sender">Object that generated the event.</param>
 /// <param name="e">This aregument isn't used.</param>
 protected void EndMerge(object sender, EventArgs e)
 {
     // When all the fragments have been collected they are sent to be drawn in another thread.  Note that a clean, empty
     // fragment list is created each time the data model is changed.  This prevents the data model event handlers from
     // corrupting the list of fragments before they can be drawn.
     if (this.fragmentList.IsValid)
     {
         if (this.fragmentList.Count != 0)
         {
             ThreadPool.QueueUserWorkItem(new WaitCallback(DrawFragmentCommand), this.fragmentList);
             this.fragmentList = new FragmentList();
         }
     }
     else
     {
         DrawDocument();
         this.fragmentList.Clear();
     }
 }