<pre> public void PrintLabelAction() { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "DYMO files |*.label;*.dymo|All files|*.*"; if (openFileDialog.ShowDialog() == true) { var FileName = openFileDialog.FileName; // DymoSDK.App.Init(); //Load label from file path dymoSDKLabel.LoadLabelFromFilePath(FileName); //Get image preview of the label dymoSDKLabel.GetPreviewLabel(); //Load image preview in the control var ImageSourcePreview = LoadImage(dymoSDKLabel.Preview); //Get object names list var LabelObjects = dymoSDKLabel.GetLabelObjects().ToList(); int u = 1; } int copies = 1; // var SelectedPrinter = DymoPrinter.Instance.GetPrinters(); //DymoPrinter SelectedPrinter; var SelectedPrinter = DymoPrinter.Instance.GetPrinters(); var name = SelectedPrinter.ToString(); if (SelectedPrinter != null) { //Send to print // int SelectedRoll; System.String SelectedRoll = ""; if (name.Contains("Twin Turbo")) { //var TwinTurboRolls = new List<string>() { "Auto", "Left", "Right" }; int rollSel = SelectedRoll == "Auto" ? 0 : SelectedRoll == "Left" ? 1 : 2; //DA MODIFICARE DymoPrinter.Instance.PrintLabel(dymoSDKLabel, name, copies, rollSelected: rollSel); } else DymoPrinter.Instance.PrintLabel(dymoSDKLabel, name, copies); //If the label contains counter objects //Update counter object and preview to show the incresead value of the counter var LabelObjects = dymoSDKLabel.GetLabelObjects().ToList(); var counterObjs = LabelObjects.Where(w => w.Type == DymoSDK.Interfaces.TypeObject.CounterObject).ToList(); // if (counterObjs.Count > 0) { foreach (var obj in counterObjs) dymoSDKLabel.UpdateLabelObject(obj, copies.ToString()); UpdatePreviewAction(); } } } /// <summary> /// Update the object value using the object name selected /// </summary> private void UpdateValueAction() { DymoSDK.Interfaces.ILabelObject SelectedLabelObject; string ObjectValue = ""; SelectedLabelObject = DymoLabel.Instance.GetLabelObject(ObjectValue); //var SelectedObjectLabel; //string ObjectValue; //if (SelectedLabelObject.GetHashCode != null) { //Update label object value dymoSDKLabel.UpdateLabelObject(SelectedLabelObject, ObjectValue); UpdatePreviewAction(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)