Пример #1
0
        void printButton_Click(object sender, EventArgs e)
        {
            if (labelText.Text.Length <= 0)
            {
                return;
            }

            GenericLabel lbl = GenericLabel.GetGenericLabel();

            lbl.SetLabelValues(labelText.Text);

            ZPLLabel zplLabel = ZPLLabel.GetLabelByName("CHARTER_UNIVERSAL");

            zplLabel.SetLabelValues(lbl.LabelValues);


            //DellAslLpnLabel label = DellAslLpnLabel.GetDellAslLpnLabel();
            //label.SetLabelValues("ASL5815204","D5551");

            //ZPLLabel zplLabel = ZPLLabel.GetLabelByName("DELL_ASL_LPN");
            //zplLabel.SetLabelValues(label.LabelValues);

            for (int i = 1; i <= labelCount.Value; i++)
            {
                zplLabel.Print();
            }
        }
Пример #2
0
        public string SearchForReference(GenericLabel search)
        {
            StringBuilder returned = new StringBuilder(String.Empty);
            var funcRefsNew = SearchFileForVarReference(search.Value, SearchOptions.InFunctions);
            var offRefsNew = SearchFileForVarReference(search.Value, SearchOptions.InFile);
            string functionUsedMessage = "{0} was used near these labels:{1}";
            string offsetUsedMessage = "{0} was used at these offsets:{1}";

            #region Var Refs in Functions

            if (funcRefsNew.Count == 0)
            {
                returned.AppendFormat("{0} is not referred to in any of the defined functions.{1}", search.Name, Environment.NewLine);
            }
            else
            {
                returned.AppendFormat(functionUsedMessage, search.Name, Environment.NewLine);
                foreach (KeyValuePair<string, VarRefType> kvp in funcRefsNew)
                {
                    returned.AppendFormat("{0} ({1}){2}", kvp.Key, kvp.Value.ToString("G"), Environment.NewLine);
                }
            }

            #endregion Var Refs in Functions

            #region Var Refs out of functions

            if (offRefsNew.Count == 0)
            {
                returned.AppendFormat("{0} could not be found at any offset.{1}", search.Name, Environment.NewLine);
            }
            else
            {
                returned.AppendFormat(offsetUsedMessage, search.Name, Environment.NewLine);
                foreach (KeyValuePair<string, VarRefType> kvp in offRefsNew)
                {
                    returned.AppendFormat("{0} ({1}){2}", kvp.Key, kvp.Value.ToString("G"), Environment.NewLine);
                }
            }

            #endregion Var Refs out of functions

            return returned.ToString();
        }
Пример #3
0
 public async Task<string> SearchForReferenceAsync(GenericLabel search)
 {
     Task<string> task = new Task<string>(() => SearchForReference(search));
     task.Start();
     return await task;
 }