コード例 #1
0
        public static byte[] CreateData(Emulation emulation, PeripheralChannel channel)
        {
            ICommandBuilder builder = StarIoExt.CreateCommandBuilder(emulation);

            builder.BeginDocument();

            builder.AppendPeripheral(channel);

            builder.EndDocument();

            return(builder.Commands);
        }
コード例 #2
0
        private void OpenCashDrawer()
        {
            lock (lockObject)
            {
                PeripheralChannel channel = SharedInformationManager.PeripheralChannel;
                bool checkCondition       = SharedInformationManager.CheckCondition;

                Emulation emulation = SharedInformationManager.GetSelectedEmulation();
                byte[]    commands  = CashDrawerFunctions.CreateData(emulation, channel);

                if (checkCondition)
                {
                    Communication.SendCommandsWithProgressBar(commands, port);
                }
                else
                {
                    Communication.SendCommandsDoNotCheckConditionWithProgressBar(commands, port);
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// Sample : Opening cash drawer.
        /// </summary>
        public static void OpenCashDrawer(PeripheralChannel channel, bool checkCondition)
        {
            // Your printer emulation.
            Emulation emulation = SharedInformationManager.SelectedEmulation;

            // Create open cash darawer commands.
            byte[] commands = CashDrawerFunctions.CreateData(emulation, channel);

            // Your printer PortName and PortSettings.
            string portName     = SharedInformationManager.SelectedPortName;
            string portSettings = SharedInformationManager.SelectedPortSettings;

            if (checkCondition)
            {
                // Sending commands to printer sample is "Communication.SendCommands(byte[] commands, string portName, string portSettings, int timeout)".
                Communication.SendCommandsWithProgressBar(commands, portName, portSettings, 30000);
            }
            else
            {
                // Sending commands to printer sample (do not check condition) is "Communication.SendCommandsDoNotCheckCondition(byte[] commands, string portName, string portSettings, int timeout)".
                Communication.SendCommandsDoNotCheckConditionWithProgressBar(commands, portName, portSettings, 30000);
            }
        }