Exemplo n.º 1
0
        private void miConfiguration_Click(object sender, System.EventArgs e)
        {
            frmPlayerOptions PO = new frmPlayerOptions();
            string sAddress = PO.CurrentPlayerOptions.DefaultOysterAddress;
            int iCPort = PO.CurrentPlayerOptions.DefaultOysterConnectionPort;
            int iFPort = PO.CurrentPlayerOptions.DefaultOysterFilePort;

            if(PO.ShowDialog()== DialogResult.OK)
            {
                if((sAddress.ToLower() != PO.CurrentPlayerOptions.DefaultOysterAddress.ToLower())||
                    (iCPort != PO.CurrentPlayerOptions.DefaultOysterConnectionPort)||
                    (iFPort != PO.CurrentPlayerOptions.DefaultOysterFilePort))
                {
                    PO.Dispose();
                    this.Visible = false;
                    InitializePlayer();
                    this.Visible = true;
                }
                else
                {
                    PO.Dispose();
                }
            }
            else
            {
                PO.Dispose();
            }
        }
Exemplo n.º 2
0
        private void ReloadDefaults()
        {
            frmPlayerOptions PO = new frmPlayerOptions();

            bool SetDateTime = true;
            switch(PO.CurrentPlayerOptions.DefaultSearchType)
            {
                case OCL.OysterRecordingSessionSearchType.Title:
                    rbTitle.Checked = true;
                    pnlDateSearch.Visible = false;
                    break;
                case OCL.OysterRecordingSessionSearchType.People:
                    rbPeople.Checked = true;
                    pnlDateSearch.Visible = false;
                    break;
                case OCL.OysterRecordingSessionSearchType.Notes:
                    rbNotes.Checked = true;
                    pnlDateSearch.Visible = false;
                    break;
                case OCL.OysterRecordingSessionSearchType.Date:
                    rbDate.Checked = true;
                    pnlDateSearch.Visible = true;
                    SetDateTime = false;
                    break;
            }
            if(SetDateTime)
            {
                DateTime Tomorrow = DateTime.Now.AddDays(1);
                DateTime Yesterday = DateTime.Now.AddDays(-1);

                dtpStartTime.Value = DateTime.Parse(Yesterday.Month + "/" + Yesterday.Day + "/" + Yesterday.Year);
                dtpStopTime.Value = DateTime.Parse(Tomorrow.Month + "/" + Tomorrow.Day + "/" + Tomorrow.Year);
            }
            else
            {
                dtpStartTime.Value = DateTime.Parse(PO.CurrentPlayerOptions.DefaultBeginDate);
                dtpStopTime.Value = DateTime.Parse(PO.CurrentPlayerOptions.DefaultEndDate);
            }
        }
Exemplo n.º 3
0
        private void InitializePlayer()
        {
            string ErrorString = "";
            //bool bTryAgain = false;
            //			string Server = "o-prototype";
            //			int iPort = 13075;
            frmPlayerOptions PO = new frmPlayerOptions();

            if(!PO.CurrentPlayerOptions.HasBeenSaved)
            {
                if(PO.ShowDialog() != DialogResult.OK)
                {
                    Application.Exit();
                    return;
                }
            }
            //goto SkipAll;
            TryItAgain:{}
            ErrorString = "";
            //bTryAgain = false;
            try
            {
                OSystem = new OCL.Oyster(PO.CurrentPlayerOptions.DefaultOysterAddress,PO.CurrentPlayerOptions.DefaultOysterConnectionPort);
            }
            catch(Exception Err)
            {
                ErrorString = Err.Message;
                if(MessageBox.Show("Do you wish to open Player Configuration?","Unable to communicate with Oyster Server",MessageBoxButtons.RetryCancel)== DialogResult.Cancel)
                {
                    Application.Exit();
                    return;
                }
                else
                {
                    if(PO.ShowDialog() == DialogResult.OK)
                    {
                        goto TryItAgain;
                    }
                    else
                    {
                        Application.Exit();
                        return;
                    }
                }
            }

            frmLogin fL = new frmLogin(ref OSystem);

            if(fL.ShowDialog(this)!= DialogResult.OK)
            {
                Application.Exit();
                return;
            }

            LUser = fL.LoginUser;
            fL.Dispose();
            //SkipAll:{}
            PO.Dispose();
            frmSO = new frmSearchOptions();
            //			OCL.RecordingSessions ARS = LUser.AllVisibleRecordingSessions(LUser);
            //			foreach(OCL.RecordingSession RS in ARS)
            //			{
            //				ListViewItem LVI = lvSearchResults.Items.Add(RS.Description);
            //				LVI.SubItems.Add(RS.CreatedDate.ToString());
            //				OCL.User Owner = OSystem.GetUserById(RS.OwnerID);
            //				LVI.SubItems.Add(Owner.Description);
            //				LVI.SubItems.Add(RS.IsPresentation.ToString());
            //				LVI.SubItems.Add(RS.CurrentRecordings(LUser).Count.ToString());
            //				LVI.Tag = RS;
            //			}

            //			dtpStartTime.Value = DateTime.Parse(DateTime.Now.Month + "/" + (DateTime.Now.Day - 1) + "/" + DateTime.Now.Year);
            //			dtpStopTime.Value = DateTime.Parse(DateTime.Now.Month + "/" + (DateTime.Now.Day + 1) + "/" + DateTime.Now.Year);

            radioButton2_CheckedChanged(rbStoredMedia,EventArgs.Empty);
        }