예제 #1
0
    // .. FUNCTIONS

    public static void Main(
        string[] argument_table
        )
    {
        DymoLabel
            label;
        string
            label_directory;

        label_directory = System.Reflection.Assembly.GetEntryAssembly().Location;

        label_directory = label_directory.Substring(0, label_directory.LastIndexOf("\\")).Replace("\\", "/") + "/Labels/";

        label = new DymoLabel();

        if (MENU_HANDLER.FindValue("Type", argument_table, out string[] type_table) && MENU_HANDLER.FindValue("Data", argument_table, out string[] data_table))
        private void PrintHotKey(object sender, KeyEventArgs e)
        {
            int  copies = 1;
            bool barcodeOrGraphsquality = false;

            if (e.Key == System.Windows.Input.Key.P)
            {
                count = 0;
                if (mem_str != "N/A")
                {
                    count++;
                }
                if (hdd_str != "N/A")
                {
                    count++;
                }
                if (ssd_str != "N/A")
                {
                    count++;
                }
                if (special_str != "N/A")
                {
                    count++;
                }
            }

            dymoSDKLabel = new DymoLabel();

            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "DYMO files |*.label;*.dymo|All files|*.*";
            if (openFileDialog.ShowDialog() == true)
            {
                FileName = openFileDialog.FileName;
                Console.WriteLine(FileName);
                //C:\Users\Jinxiao Yu\Desktop\Label\3 lines.dymo
                //Load label from file path
                dymoSDKLabel.LoadLabelFromFilePath(FileName);
                //Get object names list
                LabelObjects        = dymoSDKLabel.GetLabelObjects().ToList();
                SelectedLabelObject = LabelObjects[0];
                ObjectValue         = "Test";
                dymoSDKLabel.UpdateLabelObject(SelectedLabelObject, ObjectValue);
                Console.WriteLine("Update Finish!");
                DymoPrinter.Instance.PrintLabel(dymoSDKLabel, SelectedPrinter.Name, copies, barcodeGraphsQuality: barcodeOrGraphsquality);
            }
        }