void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.PrintersGrid = ((System.Windows.Controls.Grid)(target)); return; case 2: this.Printer1 = ((dotNetWPF_03_6274_2436.PrinterUserControl)(target)); return; case 3: this.Printer2 = ((dotNetWPF_03_6274_2436.PrinterUserControl)(target)); return; case 4: this.Printer3 = ((dotNetWPF_03_6274_2436.PrinterUserControl)(target)); return; case 5: this.PrintButton = ((System.Windows.Controls.Button)(target)); #line 25 "..\..\MainWindow.xaml" this.PrintButton.Click += new System.Windows.RoutedEventHandler(this.PrintButton_Click); #line default #line hidden return; } this._contentLoaded = true; }
public void CurrentPrinter_PagesEmpty(object sender, PrintEventArgs e) { MessageBox.Show(e.MessageEvent, "Critical Error from : " + CurrentPrinter.PrinterName, MessageBoxButton.OK, MessageBoxImage.Error); CurrentPrinter.AddPages(); Queue.Enqueue(CurrentPrinter); CurrentPrinter = Queue.Dequeue(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.userControl = ((dotNetWPF_03_6274_2436.PrinterUserControl)(target)); return; case 2: this.InkLabel = ((System.Windows.Controls.Label)(target)); return; case 3: this.PageLabel = ((System.Windows.Controls.Label)(target)); return; case 4: this.InkCountProgressBar = ((System.Windows.Controls.ProgressBar)(target)); #line 31 "..\..\PrinterUserControl.xaml" this.InkCountProgressBar.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.InkCountProgressBar_ValueChanged); #line default #line hidden return; case 5: this.PageCountSlider = ((System.Windows.Controls.Slider)(target)); #line 34 "..\..\PrinterUserControl.xaml" this.PageCountSlider.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.PageCountSlider_ValueChanged); #line default #line hidden return; case 6: this.PrinterNameLabel = ((System.Windows.Controls.Label)(target)); #line 38 "..\..\PrinterUserControl.xaml" this.PrinterNameLabel.MouseEnter += new System.Windows.Input.MouseEventHandler(this.PrinterNameLabel_MouseEnter); #line default #line hidden #line 39 "..\..\PrinterUserControl.xaml" this.PrinterNameLabel.MouseLeave += new System.Windows.Input.MouseEventHandler(this.PrinterNameLabel_MouseLeave); #line default #line hidden return; } this._contentLoaded = true; }
public void InitializeQueue() { Queue = new Queue <PrinterUserControl>(); foreach (Control p in PrintersGrid.Children) { if (p is PrinterUserControl) { var printer = p as PrinterUserControl; Queue.Enqueue(printer); } } CurrentPrinter = Queue.Dequeue(); }
public void CurrentPrinter_InkEmpty(object sender, PrintEventArgs e) { if (e.CriticalEvent) { MessageBox.Show(e.MessageEvent, "Critical Error from : " + CurrentPrinter.PrinterName, MessageBoxButton.OK, MessageBoxImage.Error); CurrentPrinter.AddInk(); Queue.Enqueue(CurrentPrinter); CurrentPrinter = Queue.Dequeue(); } else { MessageBox.Show(e.MessageEvent, "Warning from : " + CurrentPrinter.PrinterName, MessageBoxButton.OK, MessageBoxImage.Warning); } }