Пример #1
0
        private void tmrGeneral_Tick(object sender, System.EventArgs e)
        {
            tmrGeneral.Enabled = false;
            frmRecordOptions frm = new frmRecordOptions();

            if (!frm.CurrentRecordOptions.HasBeenSaved)
            {
                if (frm.ShowDialog(this) != System.Windows.Forms.DialogResult.OK)
                {
                    DialogResult = System.Windows.Forms.DialogResult.Cancel;
                    //this.Close();
                    return;
                }
            }
            TryOysterAgain:{}
            this.Update();
            Application.DoEvents();
            try
            {
                this.Text = "Connecting to Oyster...";
                m_oyster = new OCL.Oyster(frm.CurrentRecordOptions.DefaultOysterAddress,OCL.Oyster.DefaultOysterNetworkPort);
            }
            catch(Exception Err)
            {
                this.Text = "Unable to connect to Oyster";
                if(Err.Message == "Unable to connect to Oyster Server")
                {
                    if(System.Windows.Forms.MessageBox.Show("Try Again?","Could not connect to Oyster Server",MessageBoxButtons.RetryCancel)== DialogResult.Retry)
                    {
                        goto TryOysterAgain;
                    }
                    this.DialogResult = System.Windows.Forms.DialogResult.Abort;
                    //this.Close();
                    return;
                }
            }
            if (m_oyster == null)
            {
                this.Text = "Unable to connect to Oyster";

                if(System.Windows.Forms.MessageBox.Show("Try Again?","Could not connect to Oyster Server",MessageBoxButtons.RetryCancel)== DialogResult.Retry)
                {
                    goto TryOysterAgain;
                }
                DialogResult = System.Windows.Forms.DialogResult.Abort;
                //this.Close();
                return;
            }
            this.Text = "Login to Oyster System";
            this.Enabled = true;
            this.txtUserName.Focus();
        }
Пример #2
0
        private void btnStartStop_Click(object sender, System.EventArgs e)
        {
            if(bDontClick)
                return;

            if (m_bRecording)
            {
                System.Diagnostics.Debug.Assert(m_encoder != null,"m_encoder is null when stopping a recording.");
                StopRecording(true);
                m_encoder.Execute(ScreenEncoder.Command.ExitEncoder,null);
                m_encoder = null;
            }
            else
            {
                bool bRecord = true;
                frmRecordOptions frm = new frmRecordOptions();

                if (!frm.CurrentRecordOptions.HasBeenSaved)
                {
                    if (frm.ShowDialog() != System.Windows.Forms.DialogResult.OK)
                    {
                        bRecord = false;
                    }
                }

                if (bRecord)
                {

                    System.Diagnostics.Debug.Assert(m_encoder == null,"m_encoder is not null when starting a recording.");
                    m_encoder = new ScreenEncoder(frm.CurrentRecordOptions.ProfileDirectory,frm.CurrentRecordOptions.WMVDirectory);
                    //						if (frm.CurrentRecordOptions.SecondsToCountdown != 0)
                    //						{
                    //							clock.CountDownTime = frm.CurrentRecordOptions.SecondsToCountdown * 1000;
                    //							clock.ClockDisplayType = SriClocks.ClockType.CountDown;
                    //							clock.DigitalDisplayColor = SriClocks.DigitalColor.WhiteColor;
                    //							if (frm.CurrentRecordOptions.MinutesToRecord != 0)
                    //							{
                    //								m_iCountdownMinutes = frm.CurrentRecordOptions.MinutesToRecord;
                    //							}
                    //							btnStartStop.Text = "STOP";
                    //							clock.StartTimer();
                    //							m_bWaitingForCountdown = true;
                    //						}
                    //						else
                    //{
                    if (m_me.CanRecord)
                    {
                        StartRecording();
                    }
                    else
                    {
                        System.Windows.Forms.MessageBox.Show(this,
                            "The currently logged in user is not authorized to create recordings.",
                            "Unauthorized User",
                            System.Windows.Forms.MessageBoxButtons.OK,
                            System.Windows.Forms.MessageBoxIcon.Exclamation);
                    }
                    //}
                    //}
                }
            }
        }
Пример #3
0
        private void mitmOptions_Click(object sender, System.EventArgs e)
        {
            frmRecordOptions frm = new frmRecordOptions();

            if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {	// TODO: Save the options in CURRENT_USER
            }
        }
Пример #4
0
        private void tmrGeneral_Tick(object sender, System.EventArgs e)
        {
            tmrGeneral.Enabled = false;
            ShowHide();
            frmRecordOptions frmOps = new frmRecordOptions();

            if (!frmOps.CurrentRecordOptions.HasBeenSaved)
            {
                if (frmOps.ShowDialog() != System.Windows.Forms.DialogResult.OK)
                {
                    Application.Exit();
                    return;
                }
            }
            mLogger.WriteLog("Displaying Login screen...");
            OCL.Oyster oyster = new OCL.Oyster(frmOps.CurrentRecordOptions.DefaultOysterAddress,frmOps.CurrentRecordOptions.DefaultOysterConnectionPort);
            frmLogin frm = new frmLogin(ref oyster);

            if (frm.ShowDialog(this) != System.Windows.Forms.DialogResult.OK)
            {
                //m_bExitWithoutAsking = true;
                Application.Exit(); //this.Close();
                return;
            }
            m_me = frm.LoginUser;
            this.TopMost = true;
            frmIV = new frmInvisible(this);
            frmIV.Show();
            frmIV.Hide();
        }