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

            if(PO.ShowDialog()== DialogResult.OK)
            {
                if((sAddress.ToLower() != PO.CurrentHardCopyOptions.DefaultOysterAddress.ToLower())||
                    (iCPort != PO.CurrentHardCopyOptions.DefaultOysterConnectionPort)||
                    (iFPort != PO.CurrentHardCopyOptions.DefaultOysterFilePort))
                {
                    PO.Dispose();
                    this.Visible = false;
                    InitializeHardCopy();
                    this.Visible = true;
                }
                else
                {
                    PO.Dispose();
                }
            }
            else
            {
                PO.Dispose();
            }
        }
Esempio n. 2
0
        private void InitializeHardCopy()
        {
            string ErrorString = "";
            frmHardCopyOptions PO = new frmHardCopyOptions();

            if(!PO.CurrentHardCopyOptions.HasBeenSaved)
            {
                if(PO.ShowDialog() != DialogResult.OK)
                {
                    Application.Exit();
                    return;
                }
            }
            /// Check Temporary Path Exist

            string UserTemperoraryPath = PO.CurrentHardCopyOptions.DefaultTemporaryDirectory;
                System.IO.DirectoryInfo DI = null;
            miEmptyTempFolder.Enabled = false;
            try
            {
                if(!System.IO.Directory.Exists(UserTemperoraryPath))
                {
                    DI = System.IO.Directory.CreateDirectory(UserTemperoraryPath);
                }
                else
                {
                    DI = new System.IO.DirectoryInfo(UserTemperoraryPath);
                }

                System.IO.FileInfo[] FIS = DI.GetFiles();
                if(FIS.Length > 0)
                {
                    miEmptyTempFolder.Enabled = true;
                }
                System.IO.DirectoryInfo[] DIS = DI.GetDirectories();
                if(DIS.Length > 0)
                {
                    miEmptyTempFolder.Enabled = true;
                }
            }
            catch(Exception Err)
            {
                string perror = Err.Message;
            }
            TryItAgain:{}

            //			string Server = "o-prototype";
            //			int iPort = 13075;

            try
            {
                OSystem = new OCL.Oyster(PO.CurrentHardCopyOptions.DefaultOysterAddress,PO.CurrentHardCopyOptions.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.Me;
            fL.Dispose();

            //			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;
            //			}
            frmSO = new frmSearchOptions();
            PO.Dispose();
            //sLocalDrive = GetRegistryValue(MAJORSECTION,MINORSECTION,MINISECTION,KEYSECTION,"D:");
        }