コード例 #1
0
ファイル: ClientThread.cs プロジェクト: rhomobile/rhodes
        private void processMessage(rho.protocol.client.IClientMethod clientMethod)
        {
            try
            {
                lock(g_syncObject)
                {
                    rho.protocol.server.IMethodHodler selectHolder = null;

                    if (clientMethod.PrinterID.Length == 0)
                    {
                        PrinterZebraSingleton singleton = PrinterManager.Instance.getPrinterSingleton();

                        selectHolder = m_factorySingleton.convert(clientMethod);

                        if (selectHolder != null)
                        {
                            rho.MethodRunnable<PrinterZebraSingleton> c = new rho.MethodRunnable<PrinterZebraSingleton>(selectHolder);
                            c.runInObject(singleton);
                        }
                    }
                    else
                    {
                        PrinterZebra printer = PrinterManager.Instance.getPrinterByID(clientMethod.PrinterID);

                        printer.applicationForm = m_applicationForm;

                        selectHolder = m_factory.convert(clientMethod);

                        if (selectHolder != null)
                        {
                            rho.MethodRunnable<PrinterZebra> c = new rho.MethodRunnable<PrinterZebra>(selectHolder);
                            c.runInObject(printer);
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                Logger.Write("Catch main extension: " + ex.Message);
            }

            processEndofAnswer();
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: rhomobile/rhodes
        public PrinterStatus getPrinterStatus(rho.PrinterZebraImpl.PrinterZebra.EPrinterConnectionType connType, string address, Int32 port)
        {
            Logger.Write("MainWindow.getPrinterStatus call, address=" + address + " port=" + port.ToString());

            PrinterStatus          status = null;
            ZebraPrinterConnection connection = null;
            ZebraPrinter           printer = null;

            if (connType == rho.PrinterZebraImpl.PrinterZebra.EPrinterConnectionType.eTCP)
            {
                connection = new TcpPrinterConnection(address, port);
            }
            else if (connType == rho.PrinterZebraImpl.PrinterZebra.EPrinterConnectionType.eBluetooth)
            {
                connection = new BluetoothPrinterConnection(address);
            }
            else if (connType == rho.PrinterZebraImpl.PrinterZebra.EPrinterConnectionType.eUSB)
            {
                connection = new UsbPrinterConnection(address);
            }
            else
            {
                Logger.Write("MainWindow.getPrinterStatus undifined connection type");
                return null;
            }
            
            connection.Open();

            if (connection.IsConnected())
            {
                printer = ZebraPrinterFactory.GetInstance(PrinterLanguage.ZPL, connection);

                status = printer.GetCurrentStatus();
            }

            connection.Close();

            Logger.Write("MainWindow.getPrinterStatus call finished");

            return status;
        }
コード例 #3
0
ファイル: ServerCommands.cs プロジェクト: rhomobile/rhodes
 public void executeCommand(rho.server.IClientsManager manager)
 {
     manager.unregisterClient(rhoString);
 }
コード例 #4
0
 get => new Vector2(rho, AxonModel.CalculatePhi(phi0, rho, b, c));