Пример #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;
            }

            // 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();
        }