예제 #1
0
        public static void Main(string[] args)
        {
            AppNameVer = Assembly.GetExecutingAssembly().GetName().Name + " " +
                         Assembly.GetExecutingAssembly().GetName().Version.ToString(3);

            // check for help request
            if (new List <string>(args).Contains("--help"))
            {
                Console.WriteLine(GetHelpMsg());
                return;
            }

            retStr = GlobalObj.Initialize(args);

            if (retStr != "")
            {
                // error detected
                Console.WriteLine("ERROR: " + retStr);
                return;
            }


            // console application required
            ConsoleManager.StartApp();
        }
예제 #2
0
 /// <summary>
 /// Disconnect sim card from reader
 /// </summary>
 private void SimDisconnect()
 {
     GlobalObj.CloseConnection();
     UpdateSimControls(false);
     mainwindow_Ui.LstSimContacts.Clear();
     MainClass.QtWait();
 }
예제 #3
0
        public static void Main(string[] args)
        {
            AppNameVer = Assembly.GetExecutingAssembly().GetName().Name + " " +
                         Assembly.GetExecutingAssembly().GetName().Version.ToString(3);

            // check for help request
            if (new List <string>(args).Contains("--help"))
            {
                Console.WriteLine(GetHelpMsg());
                return;
            }


            // Init resource class manager
            Q_INIT_RESOURCE("ResManager");


            // Create new Qyoto Application
            new QApplication(args);


            retStr = GlobalObj.Initialize(args);

            // check for problems detected
            if (retStr != "")
            {
                // check for problem type
                if (!retStr.Contains("SCARD_"))
                {
                    // error detected (not scard problem)
                    ShowMessage(new QWidget(), "ERROR", retStr, MessageType.Error);
                    QApplication.Quit();
                    return;
                }
                else
                {
                    // warning (scard problem, can use serial reader)
                    ShowMessage(new QWidget(), "WARNING", retStr, MessageType.Warning);
                }
            }

            // Create new Qyoto Desktop Object
            QDesktopWidget qdw = new QDesktopWidget();

            // Create MainWindow class manager
            MainWindowClass mwc = new MainWindowClass();

            int wWidth  = Convert.ToInt32(mwc.Width() / 2);
            int wHeight = Convert.ToInt32(mwc.Height() / 2);
            int dWidth  = Convert.ToInt32(qdw.Width() / 2);
            int dHeight = Convert.ToInt32(qdw.Height() / 2);

            mwc.Move(dWidth - wWidth, dHeight - wHeight - 20);

            mwc.Show();


            // Run Qyoto Application
            QApplication.Exec();
        }
예제 #4
0
        //初始化核心数据,加载“UI窗体路径”到集合中。
        public void Awake()
        {
            //字段初始化
            _DicALLUIForms         = new Dictionary <string, BaseUIForm>();
            _DicCurrentShowUIForms = new Dictionary <string, BaseUIForm>();
            _StaCurrentUIForms     = new Stack <BaseUIForm>();
            //初始化加载(根UI窗体)Canvas预设
            InitRootCanvasLoading();
            //得到UI根节点、全屏节点、固定节点、弹出节点
            _TraCanvasTransfrom = GameObject.FindGameObjectWithTag(SysDefine.SYS_TAG_CANVAS).transform;
            _TraNormal          = UnityHelper.FindTheChildNode(_TraCanvasTransfrom.gameObject, SysDefine.SYS_NORMAL_NODE);
            _TraFixed           = UnityHelper.FindTheChildNode(_TraCanvasTransfrom.gameObject, SysDefine.SYS_FIXED_NODE);
            _TraPopUp           = UnityHelper.FindTheChildNode(_TraCanvasTransfrom.gameObject, SysDefine.SYS_POPUP_NODE);
            _TraUIScripts       = UnityHelper.FindTheChildNode(_TraCanvasTransfrom.gameObject, SysDefine.SYS_SCRIPTMANAGER_NODE);
            GuideMask           = UnityHelper.FindTheChildNode(_TraCanvasTransfrom.gameObject, SysDefine.GUIDE_MASK);
            var ca = UnityHelper.FindTheChildNode(_TraCanvasTransfrom.gameObject, "UICamera");

            GlobalObj.InitUiCamera(ca.GetComponent <Camera>());
            GlobalObj.InitCanvas(_TraCanvasTransfrom);
            GlobalObj.InitGuideMask(GuideMask);
            //把本脚本作为“根UI窗体”的子节点。
            this.gameObject.transform.SetParent(_TraUIScripts, false);
            //"根UI窗体"在场景转换的时候,不允许销毁
            DontDestroyOnLoad(_TraCanvasTransfrom);
        }
예제 #5
0
        private bool addSceneDirectory()
        {
            GxTreeNode selectedNode = (GxTreeNode)tvwSceneList.SelectedNode;

            if (selectedNode == null)
            {
                return(false);
            }

            if (selectedNode == null)
            {
                Logger.Error("parentNode null.");
                return(false);
            }

            if (selectedNode.getGxNodeType() != GXNodeType.GX_NODE_TYPE_DIRECTORY &&
                selectedNode.getGxNodeType() != GXNodeType.GX_NODE_TYPE_PROJECT)
            {
                Logger.Error("invalid node type.");
                return(false);
            }

            GxProject project = GlobalObj.getOpenningProject();

            project.createNewDirectory(selectedNode);

            return(true);
        }
예제 #6
0
 /// <summary>
 /// Disconnect sim card from reader
 /// </summary>
 private void SimDisconnect()
 {
     GlobalObj.CloseConnection();
     UpdateSimControls(false);
     lstSimContacts.Clear();
     MainClass.GtkWait();
 }
예제 #7
0
        /// <summary>
        /// Perform sim card connection and contacts read.
        /// </summary>
        private void SimConnect()
        {
            MainClass.QtWait();

            if (GlobalObj.IsPowered)
            {
                // Disconnect card if needed
                GlobalObj.CloseConnection();
            }

            // Connect to smartcard
            retStr = GlobalObj.AnswerToReset(ref ATR);

            // check for error
            if (retStr != "")
            {
                // error on answer to reset
                log.Error("MainWindowClass::SimConnect: " + retStr);
                MainClass.ShowMessage(this, "ERROR", retStr, MainClass.MessageType.Error);
                return;
            }

            // read sim contacts and fill list
            retStr = GlobalObjUI.SelectSimContactsList();

            // check for error
            if (retStr != "")
            {
                if (retStr == GlobalObjUI.LMan.GetString("needpindisable"))
                {
                    // Pin1 enabled
                    MainClass.ShowMessage(this, "ERROR", retStr, MainClass.MessageType.Error);
                    EnableSimPinControl();
                    return;
                }
                else
                {
                    // error on reading contacts list
                    GlobalObj.CloseConnection();
                    MainClass.ShowMessage(this, "ERROR", retStr, MainClass.MessageType.Error);
                    return;
                }
            }

            ScanSimBefore();
            mainwindow_Ui.LstSimContacts.Clear();

            // Reset status values
            GlobalObjUI.SimADNStatus   = 1;
            GlobalObjUI.SimADNPosition = 0;
            GlobalObjUI.SimADNError    = "";

            // Start thread for reading process
            isEnd     = false;
            isReading = true;
            simThread = new System.Threading.Thread(new
                                                    System.Threading.ThreadStart(GlobalObjUI.ReadSimContactsList));
            simThread.Start();
        }
        public void ActionCancel(object sender, EventArgs args)
        {
            GlobalObj.CloseConnection();

            MainWindow.Destroy();
            MainWindow.Dispose();
            Application.Quit();
        }
예제 #9
0
 /// <summary>
 /// Update selected reader
 /// </summary>
 private void UpdateSelectedReader(string reader)
 {
     GlobalObj.CloseConnection();
     GlobalObj.SelectedReader = reader;
     StatusBar.Push(1, GlobalObj.LMan.GetString("selreader") + ": " + reader);
     TxtATR.Text  = "";
     TxtResp.Text = "";
     TxtCmd.Text  = "";
 }
예제 #10
0
 /// <summary>
 /// Update selected reader
 /// </summary>
 private void UpdateSelectedReader(string reader)
 {
     GlobalObj.CloseConnection();
     GlobalObj.SelectedReader = reader;
     mainwindow_Ui.statusbar.ShowMessage(GlobalObj.LMan.GetString("selreader") + ": " + reader);
     mainwindow_Ui.TxtATR.Text  = "";
     mainwindow_Ui.TxtResp.Text = "";
     mainwindow_Ui.TxtCmd.Text  = "";
 }
예제 #11
0
 private void Update()
 {
     //Call Input On Screen
     if (Input.GetKeyDown(KeyCode.LeftShift) || Input.GetKeyDown(KeyCode.C))
     {
         GlobalObj.SetActive(true);
     }
     SwitchSytem();
 }
예제 #12
0
 void Start()
 {
     GlobalObj.Init();
     GuideManager.instance.Init();
     ModelMgr.InitCfg();
     MarketUIFrom.InitCfg();
     MarketUI2From.InitCfg();
     UiModelView.instance.Init();
     //加载登陆窗体
     UIManager.GetInstance().ShowUIForms(ProConst.LOGON_FROMS);
 }
예제 #13
0
        public static void Main(string[] args)
        {
            AppNameVer = Assembly.GetExecutingAssembly().GetName().Name + " " +
                         Assembly.GetExecutingAssembly().GetName().Version.ToString();

            // check for help request
            if (new List <string>(args).Contains("--help"))
            {
                Console.WriteLine(GetHelpMsg());
                return;
            }

            Application.Init();

            retStr = GlobalObj.Initialize(args);

            // check for problems detected
            if (retStr != "")
            {
                // check for problem type
                if (!retStr.Contains("SCARD_"))
                {
                    // error detected (not scard problem)
                    ShowMessage(null, "ERROR", retStr, MessageType.Error);
                    return;
                }
                else
                {
                    // warning (scard problem, can use serial reader)
                    ShowMessage(null, "WARNING", retStr, MessageType.Warning);
                }
            }

            try
            {
                // try to set language
                GlobalObjUI.SetLanguage("monosim-gtk");
            }
            catch (Exception Ex)
            {
                // error detected
                log.Error("GlobalObjUI::SetLanguage: " + Ex.Message + "\r\n" + Ex.StackTrace);
                ShowMessage(null, "LANGUAGE SET ERROR", Ex.Message, MessageType.Error);
                return;
            }


            // create new Gtk Gui for application and show it
            MainWindowClass mwc = new MainWindowClass();

            mwc.Show();
            Application.Run();
        }
예제 #14
0
        /// <summary>
        /// 粘贴
        /// </summary>
        /// <param name="opType"></param>
        private void moveNode(GxTreeNode srcNode, GxTreeNode dstNode)
        {
            GxTreeNode movedNode = GlobalObj.getOpenningProject().moveNode(srcNode, dstNode);

            if (movedNode != null)
            {
                tvwSceneList.SelectedNode = movedNode;
            }
            else
            {
                //MessageBox.Show("移动节点失败!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
예제 #15
0
        //================================================================
        //  ● 外部调用方法
        //================================================================

        /// <summary>
        /// 关闭当前工程
        /// </summary>
        public void closeCurrentProject()
        {
            //卸载工程
            GxProject project = GlobalObj.getOpenningProject();

            project.unload();
            Logger.Debug("Unloaded openning project.");

            //清除节点数据
            _projectNode = null;
            tvwSceneList.Nodes.Clear();
            Logger.Debug("Cleared all project nodes.");
        }
예제 #16
0
 public void showMsg(String text, GlobalObj.ErrorLevels el)
 {
     switch (el)
     {
         case GlobalObj.ErrorLevels.Critical:
             MessageBox.Show(text);
             break;
         case GlobalObj.ErrorLevels.Info:
             errorLabel.Visible = true;
             errorLabel.Text = text;
             break;
     }
 }
예제 #17
0
    void Start()
    {
#if UNITY_ANDROID
        //安卓平台关闭log,减少消耗
        //Debug.unityLogger.logEnabled = false;
#endif

        GlobalObj.Init();
        ResMgr.instance.Init();
        //GuideManager.instance.Init();
        //UiModelView.instance.Init();
        UIManager.GetInstance().ShowUIForms(ProConst.LOGON_FROMS);
    }
예제 #18
0
        /// <summary>
        /// 加载工程
        /// </summary>
        /// <param name="filename"></param>
        /// <returns></returns>
        public bool loadProject(string filename)
        {
            Logger.Debug("Loading Project, Path = " + filename);

            if (File.Exists(filename) == false)
            {
                Logger.Error("Failed to load project : file not found.");
                MessageBox.Show(string.Format("{0}\n\n工程文件不存在或文件路径错误。", filename), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            //关闭当前已打开的工程
            GxProject project = GlobalObj.getOpenningProject();

            if (project.isLoaded() == true)
            {
                closeCurrentProject();
            }

            //取得传入文件的全路径
            //filename = Path.GetFullPath(filename);

            //加载工程文件
            if (project.load(filename) == false)
            {
                Logger.Error("load project [" + filename + "] failed.");
                return(false);
            }
            Logger.Debug("Project is loaded.");

            //加载场景树
            GxTreeNode projectNode = new GxTreeNode();

            projectNode.setGxNodeType(GXNodeType.GX_NODE_TYPE_PROJECT);
            projectNode.Text               = string.Format("{0} [已加载]", GxEnvManager.getEnv(GxEnvVarType.GXENV_PROJECT_NAME));
            projectNode.Tag                = project;
            projectNode.ImageIndex         = 0;
            projectNode.SelectedImageIndex = 0;
            _projectNode = projectNode;

            string sceneDirPath = GxEnvManager.getEnv(GxEnvVarType.GXENV_PROJECT_SCENE_DIR);
            //traversalSceneList(sceneDirPath, projectNode);

            GxTreeNode projectTreeNode = project.getProjectNode();

            tvwSceneList.Nodes.Add(projectTreeNode);

            tvwSceneList.ExpandAll();

            return(true);
        }
예제 #19
0
        public frmGenexMainForm()
        {
            InitializeComponent();

            //初始化全局对象
            GlobalObj.init();
            Logger.Debug("Init global obj OK.");

            //初始化新建文件管理器
            _newFileGuider = new frmNewFileGuider();

            //初始化场景管理器
            _frmDockSceneManager = new frmDockSceneManager();
        }
예제 #20
0
        /// <summary>
        /// Update serial port settings
        /// </summary>
        private void UpdateSettings()
        {
            SerialSettings.PortSpeedReset = int.Parse(CmbPortSpeedReset.ActiveText);
            SerialSettings.PortSpeed      = int.Parse(CmbPortSpeed.ActiveText);
            SerialSettings.DataBits       = int.Parse(CmbDataBits.ActiveText);
            SerialSettings.StopBits       = int.Parse(CmbStopBits.ActiveText);
            SerialSettings.Parity         = CmbParity.ActiveText;


            if (CmbConvention.ActiveText == "Direct")
            {
                SerialSettings.IsDirectConvention = true;
            }
            else
            {
                SerialSettings.IsDirectConvention = false;
            }

            GlobalObj.WriteSettings();
        }
예제 #21
0
    private void Start()
    {
        GlobalObj = GameObject.Find("ProgramingUI");
        ObjString = GameObject.Find("StringInput");
        ObjInt    = GameObject.Find("IntInput");

        ObjString.SetActive(true);
        ObjInt.SetActive(false);

        if (GlobalObj != null)
        {
            GlobalObj.SetActive(false);
        }

        ObjManager = GameObject.Find("Manager");
        if (ObjManager != null)
        {
            manager = ObjManager.GetComponent <_GameManager>();
        }
    }
예제 #22
0
        /// <summary>
        /// Update serial port settings
        /// </summary>
        private void UpdateSettings()
        {
            SerialSettings.PortSpeedReset = int.Parse(settingsdialog_UI.CmbPortSpeedReset.CurrentText);
            SerialSettings.PortSpeed      = int.Parse(settingsdialog_UI.CmbPortSpeed.CurrentText);
            SerialSettings.DataBits       = int.Parse(settingsdialog_UI.CmbDataBits.CurrentText);
            SerialSettings.StopBits       = int.Parse(settingsdialog_UI.CmbStopBits.CurrentText);
            SerialSettings.Parity         = settingsdialog_UI.CmbParity.CurrentText;


            if (settingsdialog_UI.CmbConvention.CurrentText == "Direct")
            {
                SerialSettings.IsDirectConvention = true;
            }
            else
            {
                SerialSettings.IsDirectConvention = false;
            }

            GlobalObj.WriteSettings();
        }
예제 #23
0
        /// <summary>
        /// Perform Power On
        /// </summary>
        private void GetATR()
        {
            mainwindow_Ui.TxtATR.Text  = "";
            mainwindow_Ui.TxtResp.Text = "";
            mainwindow_Ui.TxtCmd.Text  = "";
            MainClass.QtWait();

            // Connect to smartcard
            retStr = GlobalObj.AnswerToReset(ref ATR);

            if (retStr != "")
            {
                // error on answer to reset
                log.Error(retStr);
                MainClass.ShowMessage(this, "ERROR", retStr, MainClass.MessageType.Error);
                return;
            }

            mainwindow_Ui.TxtATR.Text = ATR;
        }
예제 #24
0
        public static void Main(string[] args)
        {
            AppNameVer = Assembly.GetExecutingAssembly().GetName().Name + " " +
                         Assembly.GetExecutingAssembly().GetName().Version.ToString(3);

            // check for help request
            if (new List <string>(args).Contains("--help"))
            {
                Console.WriteLine(GetHelpMsg());
                return;
            }

            Application.Init();

            retStr = GlobalObj.Initialize(args);

            // check for problems detected
            if (retStr != "")
            {
                // check for problem type
                if (!retStr.Contains("SCARD_"))
                {
                    // error detected (not scard problem)
                    ShowMessage("ERROR", retStr, MessageType.Error);
                    return;
                }
                else
                {
                    // warning (scard problem, can use serial reader)
                    ShowMessage("WARNING", retStr, MessageType.Warning);
                }
            }

            // create new Gtk Gui for application and show it
            MainWindowClass mwc = new MainWindowClass();

            mwc.Show();
            Application.Run();
        }
예제 #25
0
        /// <summary>
        /// Exchange data with smartcard and check response with expected data,
        /// you can use '?' digit to skip check in a specific position.
        /// </summary>
        private static string SendReceiveAdv(string command,
                                             ref string response,
                                             string expResponse,
                                             ref bool isVerified)
        {
            isVerified = false;
            response   = "";

            // exchange data
            retStr = GlobalObj.SendReceive(command, ref response);

            if (retStr != "")
            {
                // error detected
                return(retStr);
            }

            if (response.Length != expResponse.Length)
            {
                // two length are differents
                return("");
            }

            // loop for each digits
            for (int p = 0; p < response.Length; p++)
            {
                if ((expResponse.Substring(p, 1) != "?") &&
                    (expResponse.Substring(p, 1) != response.Substring(p, 1)))
                {
                    // data returned is different from expected
                    return("");
                }
            }

            isVerified = true;
            return("");
        }
예제 #26
0
        /// <summary>
        /// Perform exchange data with card
        /// </summary>
        private void ExchangeData()
        {
            if (!GlobalObj.IsPowered)
            {
                MainClass.ShowMessage(this, "WARNING", GlobalObj.LMan.GetString("noinitreader"), MainClass.MessageType.Warning);
                return;
            }

            command = mainwindow_Ui.TxtCmd.Text;
            mainwindow_Ui.TxtResp.Text = "";
            mainwindow_Ui.TxtResp.Show();
            MainClass.QtWait();

            retStr = GlobalObj.SendReceive(command, ref response);

            if (retStr != "")
            {
                log.Error(retStr);
                MainClass.ShowMessage(this, "ERROR", retStr, MainClass.MessageType.Error);
                return;
            }

            mainwindow_Ui.TxtResp.Text = response;
        }
예제 #27
0
 public void showMsg(String msg, GlobalObj.ErrorLevels levels)
 {
     showMsg(msg, levels, MessageBoxButtons.OK);
 }
예제 #28
0
        /// <summary>
        /// Console Application
        /// </summary>
        public static void StartApp()
        {
            // create readers list
            List <string> allreaders = new List <string>();

            // loop for each managed readers type
            foreach (IReader rdr in GlobalObj.ReaderManager.Values)
            {
                allreaders.AddRange(rdr.Readers);
            }


            // display available readers
            Console.WriteLine("\r\n" + GlobalObj.LMan.GetString("readerslist") + ":");
            for (int n = 0; n < allreaders.Count; n++)
            {
                Console.WriteLine(n.ToString().PadLeft(3) + ". " + allreaders[n]);
            }
            Console.WriteLine("\r\n" + GlobalObj.LMan.GetString("readersel"));
            Console.Write("> ");
            command = Console.ReadLine();

            if (command == "EXIT")
            {
                // exit from application
                return;
            }

            try
            {
                // set reader to use
                GlobalObj.SelectedReader = allreaders[int.Parse(command)];
            }
            catch (Exception Ex)
            {
                // error detected
                log.Error("ConsoleManager::StartApp: " + Ex.Message);
                return;
            }


            // Connect to smartcard
            ret = GlobalObj.AnswerToReset(ref ATR);

            if (ret != "")
            {
                // error on answer to reset
                log.Error("ConsoleManager::StartApp: " + ret);
                Console.WriteLine(ret);
                return;
            }

            Console.WriteLine("\r\nAnswer To Reset: " + ATR + "\r\n");

            while (1 == 1)
            {
                Console.WriteLine(GlobalObj.LMan.GetString("cmdtosend"));
                Console.Write("> ");
                command = Console.ReadLine();

                if (command == "EXIT")
                {
                    // exit from loop and from application
                    GlobalObj.CloseConnection();
                    break;
                }

                ret = GlobalObj.SendReceive(command, ref response);
                if (ret != "")
                {
                    // error on send command
                    log.Error("ConsoleManager::StartApp: " + ret);
                    Console.WriteLine("< " + ret);
                }
                else
                {
                    // response returned
                    Console.WriteLine("< " + response + "\r\n");
                }
            }
        }
예제 #29
0
 /// <summary>
 /// Perform change of selected reader
 /// </summary>
 private void UpdateSelectedReader(string newSelReader)
 {
     GlobalObj.CloseConnection();
     GlobalObj.SelectedReader = newSelReader;
     StatusBar.Push(1, GlobalObj.LMan.GetString("selreader") + ": " + newSelReader);
 }
예제 #30
0
        /// <summary>
        /// Update Gtk objects properties
        /// </summary>
        private void UpdateGraphicObjects()
        {
            // Set dialog icon
            MainWindow.Icon = Gdk.Pixbuf.LoadFromResource("comex_256.png");

            // Set tool tip text for toolbutton
            TbOpen.TooltipText = GlobalObj.LMan.GetString("openact");
            TbOpen.Label       = GlobalObj.LMan.GetString("openlbl");

            TbClose.Label = GlobalObj.LMan.GetString("closelbl");

            TbSettings.Label       = GlobalObj.LMan.GetString("settingslbl");
            TbSettings.TooltipText = GlobalObj.LMan.GetString("settingsmenulbl");

            TbAbout.TooltipText = GlobalObj.LMan.GetString("infoact");
            TbAbout.Label       = GlobalObj.LMan.GetString("infolbl");

            TbExit.TooltipText = GlobalObj.LMan.GetString("exitact");
            TbExit.Label       = GlobalObj.LMan.GetString("exitlbl");

            TbATR.TooltipText = GlobalObj.LMan.GetString("atract");
            TbATR.Label       = GlobalObj.LMan.GetString("atrlbl");

            // Set labels
            ((Label)MenuFileItem.Child).TextWithMnemonic     = GlobalObj.LMan.GetString("filemenulbl");
            ((Label)MenuFileOpen.Child).TextWithMnemonic     = GlobalObj.LMan.GetString("openmenulbl");
            ((Label)MenuFileClose.Child).TextWithMnemonic    = GlobalObj.LMan.GetString("closemenulbl");
            ((Label)MenuFileSettings.Child).TextWithMnemonic = GlobalObj.LMan.GetString("settingsmenulbl");
            ((Label)MenuFileExit.Child).TextWithMnemonic     = GlobalObj.LMan.GetString("exitmenulbl");
            ((Label)MenuReaderItem.Child).TextWithMnemonic   = GlobalObj.LMan.GetString("readermenulbl");
            ((Label)MenuAboutItem.Child).TextWithMnemonic    = GlobalObj.LMan.GetString("helpmenulbl");
            ((Label)MenuAboutInfo.Child).TextWithMnemonic    = GlobalObj.LMan.GetString("infomenulbl");

            LblATR.Markup      = "<b>" + GlobalObj.LMan.GetString("atrframelbl") + "</b>";
            LblCommand.Text    = GlobalObj.LMan.GetString("cmdlbl");
            LblResponse.Text   = GlobalObj.LMan.GetString("resplbl");
            LblSend.Text       = GlobalObj.LMan.GetString("sendlbl");
            LblExchange.Markup = "<b>" + GlobalObj.LMan.GetString("cardframelbl") + "</b>";
            LblFile.Markup     = "<b>" + GlobalObj.LMan.GetString("commandfilelbl") + "</b>";

            Gdk.Color color = new Gdk.Color();
            Gdk.Color.Parse("#0000FF", ref color);
            TxtATR.ModifyText(StateType.Normal, color);
            Gdk.Color.Parse("#0000FF", ref color);
            TxtResp.ModifyText(StateType.Normal, color);

            Gdk.Color.Parse("#1F6D20", ref color);
            TxtCmd.ModifyText(StateType.Normal, color);

            // TreeView (List)
            LstCommands.Selection.Mode = SelectionMode.Single;
            CellRendererText rendererText = new CellRendererText();

            TreeViewColumn column = new TreeViewColumn();

            column.Title     = "Commands";
            column.Resizable = true;
            column.PackStart(rendererText, true);
            column.AddAttribute(rendererText, "text", 0);

            LstCommands.RulesHint = true;
            LstCommands.AppendColumn(column);

            if (GlobalObj.IsWindows())
            {
                LstCommands.ModifyFont(FontDescription.FromString("Courier New Normal 10"));
            }
            else
            {
                LstCommands.ModifyFont(FontDescription.FromString("Fixed Normal 10"));
            }


            // update gui menu
            Gtk.RadioMenuItem rmi;
            // loop for all readers
            List <string> allReaders = new List <string>();

            // loop for each managed readers type
            foreach (IReader rdr in GlobalObj.ReaderManager.Values)
            {
                allReaders.AddRange(rdr.Readers);
            }


            for (int n = 0; n < allReaders.Count; n++)
            {
                // set first as selected
                if (n == 0)
                {
                    rmi = new Gtk.RadioMenuItem(allReaders[n]);
                    GlobalObj.SelectedReader = allReaders[n];
                    StatusBar.Push(1, GlobalObj.LMan.GetString("selreader") + ": " + allReaders[n]);
                }
                else
                {
                    // added others
                    rmi = new Gtk.RadioMenuItem((RadioMenuItem)MenuReader.Children[0], allReaders[n]);
                }

                rmi.ButtonReleaseEvent += ActionChangeReader;
                MenuReader.Add(rmi);
            }

            MenuReader.ShowAll();
        }
예제 #31
0
 public void showMsg(String msg,  GlobalObj.ErrorLevels levels, MessageBoxButtons buttons = MessageBoxButtons.OK, String title="")
 {
     if (title!="")
        {
         if (levels == GlobalObj.ErrorLevels.Info)
             title = "Уведомление";
         else if (levels == GlobalObj.ErrorLevels.Critical)
             title = "Ошибка";
         else
             throw new NotImplementedException("showMsg courier не предвиденный ErrorLevel");
        }
     notifyValue = MessageBox.Show(msg, title, buttons);
 }
예제 #32
0
        /// <summary>
        /// Update graphic objects with language file values
        /// </summary>
        private void UpdateGraphicObjects()
        {
            // Main Window Title
            this.WindowTitle = MainClass.AppNameVer + " [" + GlobalObj.AppNameVer + "]";

            // Update menu and toolbar
            mainwindow_Ui.menu_File.Title      = GlobalObj.LMan.GetString("filemenulbl").Replace("_", "&");
            mainwindow_Ui.action_Open.Text     = GlobalObj.LMan.GetString("openmenulbl").Replace("_", "&");
            mainwindow_Ui.action_Open.IconText = GlobalObj.LMan.GetString("openlbl");

            mainwindow_Ui.action_Close.Text     = GlobalObj.LMan.GetString("closemenulbl").Replace("_", "&");
            mainwindow_Ui.action_Close.IconText = GlobalObj.LMan.GetString("closelbl");

            mainwindow_Ui.action_SerialSettings.Text     = GlobalObj.LMan.GetString("settingsmenulbl");
            mainwindow_Ui.action_SerialSettings.IconText = GlobalObj.LMan.GetString("settingslbl");

            mainwindow_Ui.action_Exit.Text     = GlobalObj.LMan.GetString("exitmenulbl").Replace("_", "&");
            mainwindow_Ui.action_Exit.IconText = GlobalObj.LMan.GetString("exitlbl");

            mainwindow_Ui.menu_Reader.Title    = GlobalObj.LMan.GetString("readermenulbl").Replace("_", "&");
            mainwindow_Ui.menu_About.Title     = GlobalObj.LMan.GetString("helpmenulbl").Replace("_", "&");
            mainwindow_Ui.action_Info.Text     = GlobalObj.LMan.GetString("infomenulbl").Replace("_", "&");
            mainwindow_Ui.action_Info.IconText = GlobalObj.LMan.GetString("infolbl");

            mainwindow_Ui.action_ATR.IconText = GlobalObj.LMan.GetString("atrlbl");

            mainwindow_Ui.FrameATR.Title      = GlobalObj.LMan.GetString("atrframelbl");
            mainwindow_Ui.FrameFile.Title     = GlobalObj.LMan.GetString("commandfilelbl");
            mainwindow_Ui.FrameExchange.Title = GlobalObj.LMan.GetString("cardframelbl");

            mainwindow_Ui.LblCommand.Text  = GlobalObj.LMan.GetString("cmdlbl");
            mainwindow_Ui.LblResponse.Text = GlobalObj.LMan.GetString("resplbl");
            mainwindow_Ui.BtnSend.Text     = GlobalObj.LMan.GetString("sendlbl");


            // Update font for command list
            if (GlobalObj.IsWindows())
            {
                mainwindow_Ui.LstCommands.Font = new QFont("Courier New", 10);
            }
            else
            {
                mainwindow_Ui.LstCommands.Font = new QFont("Fixed", 10);
            }


            // loop for each managed readers type
            foreach (IReader rdr in GlobalObj.ReaderManager.Values)
            {
                allReaders.AddRange(rdr.Readers);
            }

            // Update readers list on gui
            QAction      action_Reader;
            QActionGroup readersGrp = new QActionGroup(this);

            for (int r = 0; r < allReaders.Count; r++)
            {
                action_Reader            = new QAction(allReaders[r], mainwindow_Ui.menu_Reader);
                action_Reader.ObjectName = "action_Reader_" + r.ToString();
                action_Reader.SetVisible(true);
                action_Reader.IconVisibleInMenu = false;
                action_Reader.Checkable         = true;
                action_Reader.SetActionGroup(readersGrp);

                if (r == 0)
                {
                    action_Reader.SetChecked(true);
                }
                else
                {
                    action_Reader.SetChecked(false);
                }
                mainwindow_Ui.menu_Reader.AddAction(action_Reader);

                Connect(action_Reader, SIGNAL("activated()"), this, SLOT("ActionChangeReader()"));
            }

            // check for available readers
            if (allReaders.Count > 0)
            {
                // select first reader
                GlobalObj.SelectedReader = allReaders[0];
            }


            // LANGUAGE STATUS TIP
            // mainwindow_Ui.action_Open.StatusTip = "";  // status bar desc

            // LANGUAGE TOOL TIP
            // mainwindow_Ui.action_Open.ToolTip = ""; // tool tip text
        }
예제 #33
0
 public void showMsg(String msg, GlobalObj.ErrorLevels el)
 {
     switch (el)
     {
         case GlobalObj.ErrorLevels.Critical:
             MessageBox.Show(msg);
             break;
         case GlobalObj.ErrorLevels.Info:
             toolStripStatusLabel1.Text = msg;
             toolStripStatusLabel1.Visible = true;
             break;
     }
 }
예제 #34
0
 void Awake()
 {
     Instance = this;
 }