예제 #1
0
        public void OnEachLabelPrintComplete(BioSero.ReadyLabel.Label label, Dictionary <string, string> data)
        {
            // this procedure is called after each label is printed

            if (!File.Exists(PrintLogFileName)) // write header if first time
            {
                List <string> headers = new List <string>(data.Keys);
                headers.Insert(0, "Element Count");
                headers.Insert(1, "Print Error");
                headers.Insert(2, "Error Text");
                File.WriteAllText(PrintLogFileName, string.Join(",", headers) + Environment.NewLine);
            }
            string values = label.PrintElements.Count() + "," + label.LabelHasError.ToString() + "," + label.LabelErrorText + ",";

            values += string.Join(",", data.Values);
            File.AppendAllText(PrintLogFileName, values + Environment.NewLine);
        }
예제 #2
0
        //void okButton_Click(object sender, RoutedEventArgs e)
        //{
        //    window.Close();
        //}

        public byte[] ManipulateRawData(BioSero.ReadyLabel.LabelPrinter printer, byte[] rawData, BioSero.ReadyLabel.Label label)
        {
            // This procedure can be used to either manipulate the raw printer data before it is sent to the printer (for instance, special printer control characters could be added),
            // or used to display data for debugging purposes.

            //File.WriteAllBytes(@"c:\output.txt");
            //System.Diagnostics.Process.Start("notepad.exe", @"c:\output.txt")

            return(rawData);

            //Alternatively, data could be converted to a string then displayed in a message box.
            //string text = System.Text.Encoding.Default.GetString(rawData);
            //MessageBox.Show(text);
            //return System.Text.Encoding.Default.GetBytes(text);
        }