コード例 #1
0
ファイル: Program.cs プロジェクト: woltere/toopher-rdp
        static int Main(String[] args)
        {
            ToopherSettings settings = new ToopherSettings ();
            if(!settings.IsConfigured) {
                MessageBox.Show ("Toopher CredentialProvider has not been configured.  Toopher Authentication is not currently active.  Please contact your administrator.");
                return AuthenticationJob.SUCCESS;
            }

            string userName = string.Empty;
            if(args.Length > 0) {
                userName = args[0];
            } else {
                userName = WinApiMethods.getTerminalInfoString (WinApiMethods.WTS_INFO_CLASS.WTSUserName);
            }

            if(string.IsNullOrEmpty (userName)) {
                return AuthenticationJob.SUCCESS;
            }

            AuthenticationJob job = new AuthenticationJob (userName, WinApiMethods.buildTerminalIdentifier(), start:false );

            Application.EnableVisualStyles ();
            Application.SetCompatibleTextRenderingDefault (false);
            AuthenticationStatusUI form = new AuthenticationStatusUI (job);
            Application.Run (form);
            int result = job.GetAuthenticationResult();
            return result;
        }
コード例 #2
0
        public AuthenticationStatusUI(AuthenticationJob theJob)
        {
            this.job = theJob;
            settings = new ToopherSettings ();

            debugMode = settings.DebugMode;

            InitializeComponent ();

            debugTextBox.Visible = debugMode;

            job.InfoStatus += updateTitle;
            job.DebugStatus += updateStatus;
            job.Done += jobDone;
            job.PromptUser += promptUser;

            inputPanel.Visible = false;
            if(!job.IsRunning) {
                job.Start ();
            }
            doLayout ();
        }