コード例 #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;
            }


            // 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();
        }
コード例 #2
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();
        }
コード例 #3
0
ファイル: MainClass.cs プロジェクト: diana-vamp/monosim
        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();
        }
コード例 #4
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();
        }