Пример #1
0
 public MainWindow()
 {
     InitializeComponent();
     StartBtn.IsEnabled     = false;
     Question1Tab.IsEnabled = false;
     Question2Tab.IsEnabled = false;
     Question3Tab.IsEnabled = false;
     FinishTab.IsEnabled    = false;
     launchAPI = new xAPILaunch.LaunchAPI();
     ready     = true;
     string[] args = Environment.GetCommandLineArgs();
     if (!IsUserAdministrator())
     {
         installHandlerBtn.IsEnabled = false;
         removeHandlerBtn.IsEnabled  = false;
     }
     try
     {
         var url   = new Uri(args[1]);
         var query = url.Query;
         NameValueCollection queryValues = HttpUtility.ParseQueryString(query);
         LaunchTokenTxt.Text  = queryValues["xAPILaunchKey"];
         LaunchServerTxt.Text = queryValues["xAPILaunchService"];
         if (LaunchServerTxt.Text != null && LaunchServerTxt.Text.Length > 0 && LaunchTokenTxt.Text != null && LaunchTokenTxt.Text.Length > 0)
         {
             StartBtn_Click(null, null);
         }
     }
     catch (Exception e)
     {
     }
 }
Пример #2
0
        public MainWindow()
        {
            InitializeComponent();
            StartBtn.IsEnabled = false;
            Question1Tab.IsEnabled = false;
            Question2Tab.IsEnabled = false;
            Question3Tab.IsEnabled = false;
            FinishTab.IsEnabled = false;
            launchAPI = new xAPILaunch.LaunchAPI();
            ready = true;
            string[] args = Environment.GetCommandLineArgs();
            if (!IsUserAdministrator())
            {
                installHandlerBtn.IsEnabled = false;
                removeHandlerBtn.IsEnabled = false;
            }
            try
            {

                var url = new Uri(args[1]);
                var query = url.Query;
                NameValueCollection queryValues = HttpUtility.ParseQueryString(query);
                LaunchTokenTxt.Text = queryValues["xAPILaunchKey"];
                LaunchServerTxt.Text = queryValues["xAPILaunchService"];
                if (LaunchServerTxt.Text != null && LaunchServerTxt.Text.Length > 0 && LaunchTokenTxt.Text != null && LaunchTokenTxt.Text.Length > 0)
                {
                    StartBtn_Click(null, null);
                }
            }
            catch (Exception e)
            {

            }


        }