public void BarcodeDelete(PrintObject_Base barcode_Base) { //if(PrintObject_List.Contains(barcode_Base)) //{ // PrintObject_List.Remove(barcode_Base); //} PrintObject_List.RemoveAt(barcode_Base.Index); }
private void SetPrintObjectData(params string[] args) { if (args.Count() > PrintObject_List.Count) { throw new Exception("Data number is too big"); } for (int i = 0; i < args.Count(); i++) { PrintObject_Base p = PrintObject_List[i]; p.Data = args[i]; } }
private DrawingVisual CreateObjectDrawingVisual(PrintObject_Base Barcode_Base) { DrawingVisual drawingVisual = new DrawingVisual(); // Retrieve the DrawingContext in order to create new drawing content. DrawingContext drawingContext = drawingVisual.RenderOpen(); // Create a rectangle and draw it in the DrawingContext. BitmapImage imageSource = ConvertBitmap(Barcode_Base.Paint()); drawingContext.DrawImage(imageSource, new Rect(Barcode_Base.Location, new System.Windows.Size(imageSource.Width, imageSource.Height))); // Persist the drawing content. drawingContext.Close(); return(drawingVisual); }
private void SetPrintObjectData(Dictionary <string, string> PrintInfo) { for (int i = 0; i < PrintObject_List.Count; i++) { PrintObject_Base p = PrintObject_List[i]; if (p.Name != null) { if (PrintInfo.Keys.Contains(p.Name)) { p.Data = PrintInfo[p.Name]; } } } }
private SizeF GetTotalSize() { float tmpwidth = 0; float tmpheight = 0; for (int i = 0; i < PrintObject_List.Count; i++) { PrintObject_Base p = PrintObject_List[i]; if (p.Location.X + p.ImagepixelSize.Width > tmpwidth) { tmpwidth = (float)p.Location.X + (float)p.ImagepixelSize.Width; } if (p.Location.Y + p.ImagepixelSize.Height > tmpheight) { tmpheight = (float)p.Location.Y + (float)p.ImagepixelSize.Height; } } return(new SizeF(tmpwidth + 1, tmpheight + 1)); }
private void ButtonDelete_Click(object sender, RoutedEventArgs e) { Labels.BarcodeDelete(printObject_Base); printObject_Base = null; MypropertyGrid.SelectedObject = null; }
/// <summary> /// Action when MouseHit event occur /// </summary> /// <param name="b"> /// recive PrintObject binding to propertygrid /// </param> private void MouseHit(PrintObject_Base b) { printObject_Base = b; MypropertyGrid.SelectedObject = printObject_Base; }