예제 #1
0
        private void Button1_Click(object sender, System.EventArgs e)
        {
            //System.Net.IPAddress CurrentIP = System.Net.Dns.Resolve(Environment.MachineName).AddressList[0];
            String sSafeLocalHost = System.Net.Dns.Resolve(Environment.MachineName).HostName;
            OSystem = new OCL.Oyster(sSafeLocalHost,13075);

            try
            {
                LU = OSystem.Login(tbLoginId.Text,tbPassword.Text);
            }
            catch(Exception Err)
            {
                Msg.Value = Err.Message;
            }
            tbPassword.Text = "";
            if(LU == null)
            {
                Msg.Value = "Invalid LoginId or Password";
            }
            else
            {
                Session["Oyster"] = OSystem;
                Session["User"] = LU;
                Response.Redirect("frmMain.aspx",true);
            }
        }
예제 #2
0
 public frmFindSource(ref OCL.Oyster OSystem, ref OCL.User AccessingUser,bool EditingSystem)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     this.OSystem = OSystem;
     this.AccessingUser = AccessingUser;
     this.EditingSystem = EditingSystem;
 }
예제 #3
0
        public frmFindSource(ArrayList ExcludingSources,ref OCL.Oyster OSystem, ref OCL.User AccessingUser)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.OSystem = OSystem;
            this.AccessingUser = AccessingUser;
            this.ExcludingSources = ExcludingSources;
        }
예제 #4
0
 public OCLWriter2(string ApplicationName, string ApplicationVersion, int UserId,ref OCL.Oyster OSystem)
 {
     this.ApplicationName = ApplicationName;
     this.UserId = UserId;
     this.OSystem = OSystem;
     OSVersion = System.Environment.OSVersion.ToString();
     MachineName = System.Environment.MachineName;
     MachineIPAddress = System.Net.Dns.Resolve(Environment.MachineName).AddressList[0].ToString();
     UserName = System.Environment.UserDomainName + "\\" + System.Environment.UserName;
     this.ApplicationVersion = ApplicationVersion;
 }
예제 #5
0
        public frmFindControl(ArrayList ExcludingControls,OCL.Scene CurrentScene,ref OCL.Oyster OSystem, ref OCL.User AccessingUser)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.OSystem = OSystem;
            this.AccessingUser = AccessingUser;
            this.ExcludingControls = ExcludingControls;
            this.CurrentScene = CurrentScene;
        }
예제 #6
0
        public frmUserPermissions(ref OCL.User AccessingUser,ref OCL.Oyster OSystem)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.AccessingUser = AccessingUser;
            this.OSystem = OSystem;

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
예제 #7
0
        public frmFindGroup(ref OCL.User LUser, ref OCL.Oyster OSystem, OCL.Group SelectedGroup)
        {
            this.LUser = LUser;
            this.OSystem = OSystem;
            this.SelectedGroup = SelectedGroup;
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
예제 #8
0
        public frmCreateScene(ref OCL.Oyster OSystem, ref OCL.User AccessingUser,OCL.Scene CurrentScene)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            this.OSystem = OSystem;
            this.AccessingUser = AccessingUser;
            this.CurrentScene = CurrentScene;

            this.Text = CarverLab.Utility.AppInfo.Title + ": Edit Scene Dialog: Editing " + CurrentScene.Description;
        }
예제 #9
0
        public frmScenePermissions(ref OCL.Oyster OSystem, ref OCL.User AccessingUser,OCL.Group G,OCL.Scene S)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            this.OSystem = OSystem;
            this.AccessingUser = AccessingUser;

            this.CurrentScene = S;
            this.CurrentGroup = G;

            this.Text = G.Description + "'s " + S.Description + " Permissions";
            this.groupBox1.Text = "Modify User's access to " + S.Description + " in group " +
            G.Description;
            this.gbScenes.Text = "Current permissions for " + S.Description;
        }
예제 #10
0
파일: frmMain.cs 프로젝트: CarverLab/Oyster
        private void frmMain_Load(object sender, System.EventArgs e)
        {
            string ErrorString = "";
            CarverLab.SharedForms.Oyster.frmOptions PO = new CarverLab.SharedForms.Oyster.frmOptions();

            if(!PO.CurrentPlayerOptions.HasBeenSaved)
            {
                if(PO.ShowDialog() != DialogResult.OK)
                {
                    Application.Exit();
                    return;
                }
            }

            TryItAgain:{}
            ErrorString = "";

            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;
                    }
                }
            }

            CarverLab.SharedForms.Oyster.frmLogin fL = new CarverLab.SharedForms.Oyster.frmLogin(ref OSystem);

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

            LUser = fL.LoginUser;
            fL.Dispose();

            tbVolume.Value = 50;
            axWindowsMediaPlayer1.settings.volume = tbVolume.Value;
            txtSearchCriteria.Text = "";
            lblPlayerStatus.Text = "";
            rangeBarBookmark.TotalMaximum = 100;
            rangeBarBookmark.TotalMinimum = 0;
            rangeBarBookmark.RangeMaximum = 100;
            rangeBarBookmark.RangeMinimum = 0;

            axWindowsMediaPlayer1.Buffering += new AxWMPLib._WMPOCXEvents_BufferingEventHandler(axWindowsMediaPlayer1_Buffering);
            axWindowsMediaPlayer1.ErrorEvent += new EventHandler(axWindowsMediaPlayer1_ErrorEvent);
            axWindowsMediaPlayer1.MediaChange += new AxWMPLib._WMPOCXEvents_MediaChangeEventHandler(axWindowsMediaPlayer1_MediaChange);
            axWindowsMediaPlayer1.OpenPlaylistSwitch += new AxWMPLib._WMPOCXEvents_OpenPlaylistSwitchEventHandler(axWindowsMediaPlayer1_OpenPlaylistSwitch);
            axWindowsMediaPlayer1.OpenStateChange += new AxWMPLib._WMPOCXEvents_OpenStateChangeEventHandler(axWindowsMediaPlayer1_OpenStateChange);
            axWindowsMediaPlayer1.PlayStateChange += new AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler(axWindowsMediaPlayer1_PlayStateChange);
            axWindowsMediaPlayer1.StatusChange += new EventHandler(axWindowsMediaPlayer1_StatusChange);
            axWindowsMediaPlayer1.CurrentItemChange += new AxWMPLib._WMPOCXEvents_CurrentItemChangeEventHandler(axWindowsMediaPlayer1_CurrentItemChange);
        }
예제 #11
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            if(!this.IsPostBack)
            {
                Users = new ArrayList();
                //O = new OCL.Oyster("OME-Prototype",13075);
                //OCL.User LU = O.GetUserByCardNumber("YeahBaby!");
                O = (OCL.Oyster)Session["Oyster"];
                LU = (OCL.User)Session["User"];

                OCL.Users OUsers = O.AllVisibleUsers(LU);

                foreach(OCL.User U in OUsers)
                {
                    Users.Add(U);
                }
                ListBox1.DataSource = Users;
                ListBox1.DataTextField = "Description";
                ListBox1.DataValueField = "Id";
                ListBox1.DataBind();
            }
        }
예제 #12
0
        private void ListBox1_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if(ListBox1.SelectedItem.Value == "")
            {
                Button2.Enabled = false;
                return;
            }

            int UserId = Convert.ToInt32(ListBox1.SelectedItem.Value);
            O = (OCL.Oyster)Session["Oyster"];
            LU = (OCL.User)Session["User"];
            OCL.User U = O.GetUserById(UserId);

            tbFirstName.Text = U.FirstName;
            tbMiddleName.Text = U.MiddleName;
            tbLastName.Text = U.LastName;
            tbLoginId.Text = U.LoginName;
            tbPassword.Text = "***********************";
            cb.Checked = U.CanRecord;
            Session["SelectedUser"] = U;
            Button2.Enabled = true;
            //			OCL.Group DefaultGroup = (OCL.Group)O.GetUnassignedObject(OCL.OysterUnassignedObjects.Group);
            //			if(LU.CanEditAllUsers)
            //			{
            //				btnUserPermissions.Enabled = true;
            //			}
            //			else
            //			{
            //				OCL.Permission P = DefaultGroup.GetObjectPermission(LU,LU,U);
            //				if(P != null)
            //				{
            //					btnUserPermissions.Enabled = P.CanEdit;
            //				}
            //				else
            //				{
            //					btnUserPermissions.Enabled = false;
            //				}
            //			}
        }
예제 #13
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:");
        }
예제 #14
0
        private void StopRecording(bool StopEncoder)
        {
            int iCodeSection = 0;

            if(StopEncoder)
            {

                mLogger.WriteLog("Stopping encode...");

                frmRecordOptions frm = new frmRecordOptions();
                frmStatusWindow StatusWindow = null;
                if(!bConnectionError)
                {
                    StatusWindow = new frmStatusWindow("Desktop Recorder: Stopping session","Please wait...");
                }
                else
                {
                    StatusWindow = new frmStatusWindow("Connection with server has been lost.","Stopping session please wait...");
                }
                string sRawFileName = "";
                string sRName = "";

                bDontClick = true;
                if(!StatusWindow.IsDisposed)
                {
                    StatusWindow.Owner = this;
                    StatusWindow.Show();
                }
                clock.StopTimer();
                clock.DigitalDisplayColor = SriClocks.DigitalColor.RedColor;
                try
                {
                    Application.DoEvents();
                    string[] sCamFiles = new string[1];
                    int NumCams = 0;

            //					bool bScreenRecorded = false;
            //					bool bCamerasRecorded = false;
                    //Stop Presentation Capture
                    System.Threading.Thread T = new System.Threading.Thread(new System.Threading.ThreadStart(StopScreenCapture));
                    iCodeSection = 1; //Stopping Screen Capture
                    if (m_ScreenIsCaptured)
                    {
                        mLogger.WriteLog("... Sending Screen Capture Stop Command");

                        sRawFileName = m_sScreenRecordingName;
                        sRName = sRawFileName + ".wmv";
                        //bScreenRecorded = true;
                        //System.Diagnostics.Debug.Assert(m_encoder != null,"m_encoder is null when stopping a recording.");
                        T.Start();
                        //m_encoder.Execute(ScreenEncoder.Command.StopRecording,null);
                    }

                    // Stop All Cameras
                    //Stopping Cameras: Code = 2 for camera1 and Code = 3 for camera2;
                    if(m_oec != null)
                    {

                        mLogger.WriteLog("Stopping Camera(s)...");
                        iCodeSection++; //Incrents to 2 for camera1 and 3 for camera2
                        sCamFiles = new string[m_oec.GetLength(0)];
                        NumCams = m_oec.GetLength(0);
                        for (int i = 0; i < NumCams; i++)
                        {
                            if(m_oec[i].IsConnected)
                            {
                                mLogger.WriteLog("... Sending stop command to ''Camera'' m_oec[ " + i + "]");
                                m_oec[i].FilePath = "*";	// set back to default
                                m_oec[i].StopRecording();
                            }
                            m_oec[i].Close();
                            m_oec[i] = null;
                        }
                        m_oec = null;
                        mLogger.WriteLog("... done stopping cameras");
                        //bCamerasRecorded = true;
                    }

                    //OCL.Oyster oyster = new OCL.Oyster();
                    OCL.Oyster oyster = new OCL.Oyster(frm.CurrentRecordOptions.DefaultOysterAddress,frm.CurrentRecordOptions.DefaultOysterConnectionPort);
                    #region Moved Code To StartRecording()
            //					iCodeSection = 10; // Section 10 means creating recording entrees in database.

            //					OCL.User me = oyster.GetUserById(m_me.ID);
            //
            //					int iVSS = 0, iSE = 0;
            //					bool bIsPresentation = false;
            //					System.DateTime dtmRecording = System.DateTime.Now;
            //
            //					OCL.VideoStorageServer vss = (OCL.VideoStorageServer)oyster.GetUnassignedObject(OCL.OysterUnassignedObjects.VideoStorageServer);
            //					OCL.Scene sce = (OCL.Scene)oyster.GetUnassignedObject(OCL.OysterUnassignedObjects.Scene);
            //					OCL.Source src = (OCL.Source)oyster.GetUnassignedObject(OCL.OysterUnassignedObjects.Source);
            //					iVSS = vss.ID;
            //					TimeSpan tsTotalTime = dtmRecording - StartRecordingTime;
            //					double TotalTime = tsTotalTime.TotalSeconds;
            //
            //					//				foreach (OCL.VideoStorageServer vss in oyster.VIDEOSTORAGESERVERS)
            //					//				{
            //					//					if (vss.ControlAddress != "Not Assigned")
            //					//					{
            //					//						iVSS = vss.ID;
            //					//						break;
            //					//					}
            //					//				}
            //
            //					iSE = src.ID;
            //					// get the StreamingEncoder for Not Assigned
            //					//				foreach (OCL.Source se in oyster.SOURCES)
            //					//				{
            //					//					if (se.ControlAddress == "Not Assigned")
            //					//					{
            //					//						iSE = se.ID;
            //					//					}
            //					//				}
            //
            //					if (m_sRecordingSessionId != null)
            //					{
            //						m_sRecordingSessionName = dtmRecording.ToString("MM/dd/yyyy hh:mm tt");
            //					}
            //					else
            //					{
            //						m_sRecordingSessionName = DateTime.Now.ToString("MM/dd/yyyy hh:mm tt");
            //					}
            //
            //					if ((m_sScreenRecordingName != null)&&(bCamerasRecorded))
            //					{
            //						bIsPresentation = true;
            //					}
            //
            //					OCL.RecordingSession RS = me.CreateASession(m_sRecordingSessionName,bIsPresentation);
            //
            //					/* Added a check to see if m_oec is not null.
            //					 * m_oec will be null if only capturing the desktop */
            //
            //					if(NumCams > 0)
            //					{
            //						for (int i = 0; i < NumCams; i++)
            //						{
            //							bool bIsPrimaryCamera;
            //
            //							if (i == System.Convert.ToInt32(frm.CurrentRecordOptions.CameraPrimary))
            //								bIsPrimaryCamera = true;
            //							else
            //								bIsPrimaryCamera = false;
            //							if (m_sScreenRecordingName != null)
            //								bIsPresentation = true;
            //							else
            //								bIsPresentation = false;
            //							sCamFiles[i] = m_sCameraRecordingName[i] + ".wmv";
            //							OCL.Recording CR = RS.CreateRecording(m_sCameraRecordingName[i] + ".wmv",
            //								"Camera " + (i+1),me,sce,src,false,bIsPrimaryCamera);
            //							CR.UpdateFileSizeOnDisk();
            //							CR.Update(TotalTime.ToString());
            //						}
            //					}
            //					if (m_sScreenRecordingName != null)
            //					{
            //						frmRecordOptions RO = new frmRecordOptions();
            //						string sFileLocation = RO.CurrentRecordOptions.WMVDirectory + @"\" + sRName;
            //						RO.Dispose();
            //						System.IO.FileInfo FID = new System.IO.FileInfo(sFileLocation);
            //						m_DesktopRecordingSize = FID.Length;
            //						OCL.Recording DR = RS.CreateRecording(sRName,"Presentation",
            //							me,sce,src,true,false);
            //						DR.Update(m_DesktopRecordingSize);
            //						DR.Update(TotalTime.ToString());
            //						Reset();
            //						DataRow R = null;
            //						string SourceFile = frm.CurrentRecordOptions.WMVDirectory + @"\" + sRName;
            //						try
            //						{
            //							R = dsFileTransfer.Tables["File"].NewRow();
            //							R["ObjectID"] = DR.ID;
            //							R["OysterObjectTypeID"]= 2; //Recording Type
            //							R["RecordingSessionID"] = DR.SessionID;
            //							R["UserID"] = m_me.ID;
            //							R["UserDescription"]= m_me.Description;
            //							R["VideoStorageServerID"]= vss.ID;
            //							R["OysterServerAddress"] = RO.CurrentRecordOptions.DefaultOysterAddress;
            //							R["SourceFile"] = frm.CurrentRecordOptions.WMVDirectory + @"\" + sRName;
            //							R["DestinationFileName"] = sRName;
            //							R["DeleteAfterTransfer"] = true;
            //							dsFileTransfer.Tables["File"].Rows.Add(R);
            //							dsFileTransfer.Tables["File"].AcceptChanges();
            //							dsFileTransfer.WriteXml(frm.CurrentRecordOptions.WMVDirectory + @"\" + sRawFileName + ".xml");
            //						}
            //						catch(Exception Err)
            //						{
            //							MessageBox.Show(Err.Message,"Programmer Error during writing xml");
            //						}
                    #endregion
                    if(m_ScreenIsCaptured)
                    {
                        mLogger.WriteLog("... Preparing to upload screen capture to Server");

                        iCodeSection = 20; //Uploading DesktopRecording
                        if(!StatusWindow.IsDisposed)
                        {
                            StatusWindow.MsgTitle = "Desktop Recording: Uploading desktop capture to Oyster System";
                            StatusWindow.MsgBody = "Please wait...";
                            StatusWindow.Refresh();
                            Application.DoEvents();
                        }

                        DateTime dtStartingUploadTime = DateTime.Now;
                        int iUploadRetryCount = 0;
                        int iUploadRetryMax = 20;
                        int iUploadRetryInterval = 1; // seconds
                        T.Join();

                        if(bConnectionError)
                        {
                            if(!StatusWindow.IsDisposed)
                            {
                                StatusWindow.Hide();
                            }
                            if(MessageBox.Show("Do you wish to try and upload the presentation to server the at this time?","A connection error was detected!",MessageBoxButtons.YesNo,MessageBoxIcon.Warning)== DialogResult.No)
                            {
                                mLogger.WriteLog("User chose not to upload presentation due to detected connection error.");
                                if(!StatusWindow.IsDisposed)
                                {
                                    StatusWindow.Show();
                                }
                                goto SkippedUpload;
                            }
                        }
                        mLogger.WriteLog("... uploading to server");
                        clock.StopTimer();
                    TryUploadAgain:{};
                        TimeSpan tsElapsedUploadTime = DateTime.Now.Subtract(dtStartingUploadTime);

                        if(!StatusWindow.IsDisposed)
                        {
                            StatusWindow.Show();
                            StatusWindow.MsgBody = "Please wait... Elapsed Time (" + System.Convert.ToInt32(tsElapsedUploadTime.TotalSeconds) + " secs)";
                            StatusWindow.Refresh();
                        }
                        Application.DoEvents();
                        try
                        {
                            Application.DoEvents();
                            string[] supload = new string[1];
                            supload[0] = frm.CurrentRecordOptions.WMVDirectory + @"\" + sRName;

                            if(!oyster.UploadFileToOysterServer(supload[0]))
                            {
                                mLogger.WriteLog("... Upload returned false... forcing exception err for retry attempt.");
                                throw new Exception("Upload returned false... forcing exception err for retry attempt.");
                            }
                            mLogger.WriteLog("... updating xml file with status of Uploaded");
                            dsFileTransfer.Tables["File"].Rows[0]["StatusMessage"]= "Uploaded";
                            dsFileTransfer.Tables["File"].AcceptChanges();
                            dsFileTransfer.WriteXml(frm.CurrentRecordOptions.WMVDirectory + @"\" + sRawFileName + ".xml");
                        }
                        catch(Exception Err)
                        {
                            string PeekErr = Err.Message;
                            mLogger.WriteLog("... upload failed.. Retry count is " + iUploadRetryCount + " of " + iUploadRetryMax);
                            mLogger.WriteLog("... failed Error Message was " + Err.Message);
                            if (++iUploadRetryCount < iUploadRetryMax)
                            {

                                System.Threading.Thread.Sleep(iUploadRetryInterval * 1000);
                                goto TryUploadAgain;
                            }
                            if(!StatusWindow.IsDisposed)
                            {
                                StatusWindow.Hide();
                            }
                            if(MessageBox.Show("Do you wish to try again?","Presentation upload failed",MessageBoxButtons.RetryCancel)== DialogResult.Retry)
                            {
                                iUploadRetryCount = 0;
                                goto TryUploadAgain;
                            }
                            MessageBox.Show("Error detected during file upload. Please contact your Administrator for assistance.","Serious error detected.");
                            dsFileTransfer.Tables["File"].Rows[0]["StatusMessage"]= "Upload Failed with Error Message: " + Err.Message;
                            dsFileTransfer.Tables["File"].AcceptChanges();
                            dsFileTransfer.WriteXml(frm.CurrentRecordOptions.WMVDirectory + @"\" + sRawFileName + ".xml");
                            goto SkippedUpload;
                        }
                        SkippedUpload:{}
                    }
                    else
                    {
                        if(bConnectionError)
                        {
                            if(!StatusWindow.IsDisposed)
                            {
                                StatusWindow.Hide();
                            }
                            MessageBox.Show("Please check connection status and press OK to update Server with final session metadata.","A connection error was detected!");
                            if(!StatusWindow.IsDisposed)
                            {
                                StatusWindow.Show();
                            }
                        }
                    }

            //					bDontClick = false;
            //					StatusWindow.Hide();
            //					StatusWindow.Dispose();
                }
                catch(Exception BigBadError)
                {
                    mLogger.WriteLog("... Oyster Fault Code: " + iCodeSection);
                    mLogger.WriteLog("... Error Message was " + BigBadError.Message);

                    MessageBox.Show(BigBadError.Message,"Oyster Fault Code: " + iCodeSection);
                }
                finally
                {

                    /// Update All Database Entries
                    if(!StatusWindow.IsDisposed)
                    {
                        StatusWindow.MsgBody = "Making final changes in database...";
                        StatusWindow.Refresh();
                    }
                    mLogger.WriteLog("... Updating database with IsReady status entries and file size info");
                    for(int a=0; a < CurrentRecordings.GetLength(0);a++)
                    {

                        int RetryAttempts = 3;
                        int WaitInterval = 1;
                    RetryUpdate:{}
                        try
                        {
                            //CurrentRecordings[a].UpdateFileSizeOnDisk();
                            CurrentRecordings[a].Update(true);
                            System.Threading.Thread.Sleep(1000);
                        }
                        catch(Exception Err)
                        {
                            mLogger.WriteLog("... update entry failed with Error Message: " + Err.Message);

                            System.Threading.Thread.Sleep(WaitInterval * 250);
                            RetryAttempts--;

                            if(RetryAttempts > 0)
                            {
                                goto RetryUpdate;
                            }
                            else
                            {
                                mLogger.WriteLog("... retry attempts timed out...[" + a.ToString() + "] writing failure to xml file");
                            }
                        }
                    }
                    mLogger.WriteLog("... Resetting all variables");
                    bDontClick = false;
                    if(!StatusWindow.IsDisposed)
                    {
                        StatusWindow.Hide();
                        StatusWindow.Dispose();
                    }
                    Reset();
                    bDontClick = false;
                    this.TopMost = true;
                    m_ScreenIsCaptured = false;
                    m_CameraIsCaptured = false;
                    dsFileTransfer.Tables["File"].Rows.Clear();
                    //To do create a SQL Active X that will update PlayLength on Recording update.
                }
            }

            bDontClick = false;
            Reset();
            this.TopMost = true;
        }
예제 #15
0
        private void frmFindSession_Load(object sender, System.EventArgs e)
        {
            this.Text =  CarverLabUtility.AppInfo.Title + " - " + this.Tag.ToString();
            sLocalDrive = GetDiscLocation();
            lblRecordingIdentifier.Text = "No Angles";
            TryAgain:{}

            string Server = System.Net.Dns.Resolve(Environment.MachineName).HostName;
            //int iPort = 13075;

            try
            {
                //				OSystem = new OCL.Oyster();
                OysterDataBaseService.RemoteFunctions AlternateRF = new OysterDataBaseService.RemoteFunctions();
                OSystem = new OCL.Oyster(AlternateRF);
            }
            catch(Exception Err)
            {
                string PeekError = Err.Message;
                if(MessageBox.Show("Do you wish to try again?","Unable to communicate with Oyster Server: " + Server,MessageBoxButtons.RetryCancel)== DialogResult.Cancel)
                {
                    Application.Exit();
                    return;
                }
                else
                    goto TryAgain;
            }
            try
            {
                LUser = OSystem.Login("splat","splat");
                int iError = 0;
                if(LUser == null)
                    /*Generate An Error*/ iError = Convert.ToInt32("HereComesAnError",10);

                if(iError == 0)
                    iError = 0;

            }
            catch(Exception Err)
            {

                string PeekError = Err.Message;
                MessageBox.Show("Unknown error occurred. Closing Application","Unknown Error");
                Application.Exit();
                return;
            }

            //			PreviewPlayer.IsUMPlayer = false;
            PreviewPlayer.CurrentPlayerType = OysterPlaybackControls.PlayerType.WindowMediaPlayer;
            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;
            }
            sLocalDrive = GetDiscLocation();
            frmSO = new frmSearchOptions();
        }
예제 #16
0
        private void LogOffUser()
        {
            string speek = "";
            LUser = null;
            OSystem = null;
            //TabRecordings_Click(TabRecordings,new System.EventArgs());
            ShowButtons(NoButtons);
            DisplayMode(false);
            UP.Size = new System.Drawing.Size(600,388);
            UP.Stop();
            UP.Visible = false;
            lblMediaTitle.Tag = null;
            lblMediaTitle.Visible = false;
            lblPlayTime.Visible = false;
            PlayerButtons(false);

            UPCamera.Stop();
            UP2.Stop();
            UP2.Visible = false;
            pnlLogin.Visible = true;
            pnlLogin.BringToFront();
            listView1.Items.Clear();

            try
            {
                ShowViewerControls(false);
                //				MP.Visible = false;
                //				MP.Hide();
            }
            catch(Exception Err)
            {
                speek = Err.Message;
            }
            try
            {
                UP.Stop();

            }
            catch(Exception Err)
            {
                speek = Err.Message;
            }
        }
예제 #17
0
        void StartRecording()
        {
            frmRecordOptions frm = new frmRecordOptions();

            if(!System.IO.Directory.Exists(frm.CurrentRecordOptions.WMVDirectory))
            {
                try
                {
                    System.IO.Directory.CreateDirectory(frm.CurrentRecordOptions.WMVDirectory);
                }
                catch(Exception Err)
                {
                    MessageBox.Show("Error details:" + Err.Message,"Temporary storage directory does not exist. Creation attempt failed.",MessageBoxButtons.OK,MessageBoxIcon.Error);
                    return;
                }
            }
            frmStatusWindow StatusWindow = new frmStatusWindow("Desktop Recorder: Preparing Session Capture","Please wait...");

            bDontClick = true;
            StatusWindow.Owner = this;
            StatusWindow.Show();
            bool bRecordCamera = true, bRecordScreen = true; // bError = false;
            int NumCams = 0;
            string sErrorBody = "";
            string sErrorCaption = "";

            //btnStartStop.Text = "Preparing...";

            //btnStartStop.Update();
            Application.DoEvents();

            //			clock.DigitalDisplayColor = SriClocks.DigitalColor.GreenColor;
            //			clock.ClockDisplayType = SriClocks.ClockType.StopWatch;
            //			clock.Reset();
            //			btnStartStop.Text = "STOP";

            // startup the oyster encoder

            RecordOptions ro = frm.CurrentRecordOptions;
            bool bIsSession = false;

            System.Diagnostics.Debug.Assert(m_oec == null,"OEC should be null when starting a recording.");
            #region SCREEN SELECTION

            object oparams = null;
            ScreenEncoder.CapturePerformance cp = ScreenEncoder.CapturePerformance.VeryLow;
            ScreenEncoder.CaptureType ct = ScreenEncoder.CaptureType.FullScreen;
            switch (frm.CurrentRecordOptions.RecordType)
            {
                case RecordOptions.ScreenRecordType.ScreenRecordNone:
                    bRecordScreen = false;
                    break;
                case RecordOptions.ScreenRecordType.ScreenRecordFullScreen:

                    //					oparams = "N/A";
                    /*Changed By Kevin Gray 5-6-05 due to errors in typecasting "N/A" to an object[]*/
                    oparams = new object[1];
                    cp = frm.CurrentRecordOptions.ScreenCapturePerformance;
                    ct = ScreenEncoder.CaptureType.FullScreen;
                    bRecordScreen = true;
                    break;
                case RecordOptions.ScreenRecordType.ScreenRecordWindow:
                    CarverLab.Utility.Win32Wrapper w32 = new CarverLab.Utility.Win32Wrapper();
                    CarverLab.Utility.Window CapWin = w32[frm.CurrentRecordOptions.WindowTitleToRecord];

                    cp = frm.CurrentRecordOptions.ScreenCapturePerformance;
                    if (frm.CurrentRecordOptions.WindowTitleToRecord == string.Empty ||
                        CapWin == null)
                    {
                        if (System.Windows.Forms.MessageBox.Show(this,"Could not find the specified window entitled: " + frm.CurrentRecordOptions.WindowTitleToRecord + ". Continue and record the full screen instead?",
                            "Record the Entire Screen?",System.Windows.Forms.MessageBoxButtons.YesNo,
                            System.Windows.Forms.MessageBoxIcon.Question,System.Windows.Forms.MessageBoxDefaultButton.Button1)
                            == System.Windows.Forms.DialogResult.Yes)
                        {
                            ct = ScreenEncoder.CaptureType.FullScreen;
                            oparams = "N/A";
                        }
                        else
                        {
                            if(bRecordCamera)
                            {

                                if (System.Windows.Forms.MessageBox.Show(this,"Would you like to continue recording camera(s)?",
                                    "Record Cameras without Screen Capture?",System.Windows.Forms.MessageBoxButtons.YesNo,
                                    System.Windows.Forms.MessageBoxIcon.Question,System.Windows.Forms.MessageBoxDefaultButton.Button1)
                                    != System.Windows.Forms.DialogResult.Yes)
                                {
                                    bRecordScreen = false;
                                }
                            }
                        }
                    }
                    else
                    {
                        System.Diagnostics.Debug.Assert(CapWin != null,"CapWin should not be null!");
                        ct = ScreenEncoder.CaptureType.WindowByHandle;
                        oparams = CapWin;
                    }
                    break;
                default:
                    System.Diagnostics.Debug.Assert(false,"Invalid recording type selected for screen recording.");
                    break;
            }

            #endregion

            #region SET UP FOR SCREEN RECORD

            if (bRecordScreen)
            {
                if (!m_encoder.Execute(ScreenEncoder.Command.SetupEncoder,cp,ct,oparams))
                {
                    sErrorBody = "Could not start the screen recording process. This is a serious error. Contact your system administrator.";
                    sErrorCaption = "Screen Recording Failure...";
                    goto Label_Screen_Error;
                }
                Application.DoEvents();
                System.Threading.Thread.Sleep(1500);
                Application.DoEvents();
            }
            #endregion

            #region CAMERA SELECTION

            switch (ro.SelectedCamera)
            {
                case RecordOptions.CameraSelection.CameraNone:
                    bRecordCamera = false;
                    NumCams = 0;
                    break;
                case RecordOptions.CameraSelection.CameraOne:
                    NumCams = 1;

                    m_sCameraRecordingName = new string[1];
                    m_oec = new OysterEncoderController.Control[1];
                    m_oec[0] = new OysterEncoderController.Control(ro.DefaultOysterDeviceAddress,OysterEncoderController.Control.CameraDefaultPort(1),ref mLogger);

                    if (!m_oec[0].Open())
                    {
                        sErrorBody = "Could not start the camera one recording process. Camera may be in use or this could be a serious error. Contact your system administrator.";
                        sErrorCaption = "Camera Recording Failure...";
                        //bRecordCamera = false;
                        //bError = true;
                        //Reset();
                        goto Label_Camera_Error;
                    }
                    break;
                case RecordOptions.CameraSelection.CameraTwo:
                    NumCams = 1;
                    m_sCameraRecordingName = new string[1];
                    m_oec = new OysterEncoderController.Control[1];
                    m_oec[0] = new OysterEncoderController.Control(ro.DefaultOysterDeviceAddress,OysterEncoderController.Control.CameraDefaultPort(2),ref mLogger);
                    if (!m_oec[0].Open())
                    {
                        sErrorBody = "Could not start the camera two recording process. Camera may be in use or this could be a serious error. Contact your system administrator.";
                        sErrorCaption = "Camera Recording Failure...";
                        goto Label_Camera_Error;
                    }
                    break;
                case RecordOptions.CameraSelection.CameraOneAndTwo:
                    NumCams = 2;
                    bIsSession = true;
                    m_sCameraRecordingName = new string[2];
                    m_oec = new OysterEncoderController.Control[2];
                    m_oec[0] = new OysterEncoderController.Control(ro.DefaultOysterDeviceAddress,OysterEncoderController.Control.CameraDefaultPort(1),ref mLogger);
                    if (!m_oec[0].Open())
                    {
                        sErrorBody = "Could not start the camera one recording process. Camera may be in use or this could be a serious error. Contact your system administrator.";
                        sErrorCaption = "Camera Recording Failure...";
                        goto Label_Camera_Error;
                    }
                    m_oec[1] = new OysterEncoderController.Control(ro.DefaultOysterDeviceAddress,OysterEncoderController.Control.CameraDefaultPort(2),ref mLogger);
                    if (!m_oec[1].Open())
                    {
                        sErrorBody = "Could not start the camera two recording process. Camera may be in use or this could be a serious error. Contact your system administrator.";
                        sErrorCaption = "Camera Recording Failure...";
                        goto Label_Camera_Error;
                    }
                    break;
                default:
                    System.Diagnostics.Debug.Assert(false,"Invalid SelectedCamera enum");

                    sErrorBody = "A programmer error detected.  Please try reselected the desired camera in the options menu. If problem persist please contact your Administrator.";
                    sErrorCaption = "Programmer Error: Invalid SelectedCamera enum";
                    //bRecordCamera = false;
                    //bError = true;
                    goto Label_Camera_Error;
            }

            #endregion

            #region Require Oyster Objects
            //OCL.Oyster oyster = new OCL.Oyster();
            OCL.Oyster oyster = new OCL.Oyster(frm.CurrentRecordOptions.DefaultOysterAddress,frm.CurrentRecordOptions.DefaultOysterConnectionPort);
            OCL.User me = oyster.GetUserById(m_me.ID);
            OCL.VideoStorageServer vss;// = (OCL.VideoStorageServer)oyster.GetUnassignedObject(OCL.OysterUnassignedObjects.VideoStorageServer);

            OCL.Scene sce;// = (OCL.Scene)oyster.GetUnassignedObject(OCL.OysterUnassignedObjects.Scene);
            OCL.Source src = null;// = (OCL.Source)oyster.GetUnassignedObject(OCL.OysterUnassignedObjects.Source);
            foreach (OCL.Source srcx in oyster.AllVisibleSources(me))
            {
                string shostname = System.Net.Dns.GetHostByAddress(System.Net.IPAddress.Parse(frm.CurrentRecordOptions.DefaultOysterDeviceAddress)).HostName;
                //strip off domain info
                if (shostname.IndexOf(".") != -1)
                {
                    shostname = shostname.Substring(0,shostname.IndexOf("."));
                }
                if (srcx.ControlAddress.ToLower() == shostname.ToLower() ||
                    srcx.ControlAddress.ToLower() == frm.CurrentRecordOptions.DefaultOysterDeviceAddress.ToLower())
                {
                    src = srcx;
                    break;
                }
            }
            if (src == null)
            {

                sErrorBody = "The data for the Oyster Device that was selected for this recording is not configured correctly. Contact the system administrator.";
                sErrorCaption = "Camera Recording Failure";
                //bRecordCamera = false;
                //bError = true;
                goto Label_Camera_Error;
            }
            sce = src.CurrentScene;
            vss = sce.AssignedVideoStorageServer;
            #endregion

            #region START RECORDING

            if (bRecordScreen)
            {
                if (bRecordCamera)
                {
                    bIsSession = true;
                }
                m_sScreenRecordingName = System.Guid.NewGuid().ToString();
                Application.DoEvents();
                System.Threading.Thread T = new System.Threading.Thread(new System.Threading.ThreadStart(StartScreenCapture));
                T.Start();
                //m_encoder.Execute(ScreenEncoder.Command.StartRecording,m_sScreenRecordingName);

            }

            if (bRecordCamera)
            {
                for (int i = 0; i < m_oec.GetLength(0); i++)
                {
                    m_sCameraRecordingName[i] = System.Guid.NewGuid().ToString();
                    m_oec[i].FilePath = vss.OysterRootDirectory;
                    if (m_oec[i].LastError.Length > 0)
                    {
                        sErrorBody = m_oec[i].LastError;
                        sErrorCaption = "Recording Startup Error...";
                        goto Label_Camera_Error;
                    }
                    m_oec[i].StartRecording(m_sCameraRecordingName[i]);
                    m_oec[i].OnConnectionError +=new OysterEncoderController.Control.OnConnectionErrorHandler(frmDisplay_OnConnectionError);

                }
            }
            #endregion

            if (bIsSession)
            {
                m_sRecordingSessionId = System.Guid.NewGuid().ToString();
            }
            else
                m_sRecordingSessionId = null;

            #region Create Database Entries

            bool bIsPresentation = false;
            if(bRecordScreen && bRecordCamera)
            {
                bIsPresentation = true;
            }
            int NumRecordings = NumCams;
            if(bRecordScreen)
                NumRecordings++;

            CurrentRecordingSession = me.CreateASession(DateTime.Now.ToString(),bIsPresentation);
            CurrentRecordings = new OCL.Recording[NumRecordings];
            int iRecIndex = 0;

            /// Create Camera Recording Entries
            if(bRecordCamera)
            {
                for (int i = 0; i < NumCams; i++)
                {
                    bool bIsPrimaryCamera;

                    if (i == System.Convert.ToInt32(frm.CurrentRecordOptions.CameraPrimary))
                        bIsPrimaryCamera = true;
                    else
                        bIsPrimaryCamera = false;

                    CurrentRecordings[iRecIndex] = CurrentRecordingSession.CreateRecording(m_sCameraRecordingName[i] + ".wmv",
                        "Camera " + (i+1),me,sce,src,false,bIsPrimaryCamera);
                    //CurrentRecordings[iRecIndex].UpdateFileSizeOnDisk();
                    //CurrentRecordings[iRecIndex].Update(TotalTime.ToString());
                    iRecIndex++;
                }
            }
            /// Create Desktop Recording Entry
            if(bRecordScreen)
            {

                string sRawFileName = m_sScreenRecordingName;
                string sRName = sRawFileName + ".wmv";

                string sFileLocation = frm.CurrentRecordOptions.WMVDirectory + @"\" + sRName;

                System.IO.FileInfo FID = new System.IO.FileInfo(sFileLocation);
                m_DesktopRecordingSize = FID.Length;
                CurrentRecordings[iRecIndex] = CurrentRecordingSession.CreateRecording(sRName,"Presentation",
                    me,sce,src,true,false);
                //CurrentRecordings[iRecIndex].Update(m_DesktopRecordingSize);
                //CurrentRecordings[iRecIndex].Update(TotalTime.ToString());
                DataRow R = null;
                string SourceFile = frm.CurrentRecordOptions.WMVDirectory + @"\" + sRName;
                try
                {
                    R = dsFileTransfer.Tables["File"].NewRow();
                    R["ObjectID"] = CurrentRecordings[iRecIndex].ID;
                    R["OysterObjectTypeID"]= 2; //Recording Type
                    R["RecordingSessionID"] = CurrentRecordings[iRecIndex].SessionID;
                    R["UserID"] = m_me.ID;
                    R["UserDescription"]= m_me.Description;
                    R["VideoStorageServerID"]= vss.ID;
                    R["OysterServerAddress"] = frm.CurrentRecordOptions.DefaultOysterAddress;
                    R["SourceFile"] = frm.CurrentRecordOptions.WMVDirectory + @"\" + sRName;
                    R["DestinationFileName"] = sRName;
                    R["DeleteAfterTransfer"] = true;
                    dsFileTransfer.Tables["File"].Rows.Add(R);
                    dsFileTransfer.Tables["File"].AcceptChanges();
                    dsFileTransfer.WriteXml(frm.CurrentRecordOptions.WMVDirectory + @"\" + sRawFileName + ".xml");
                }
                catch(Exception Err)
                {
                    MessageBox.Show(Err.Message,"Programmer Error during writing xml");
                }
            }
            #endregion

            clock.DigitalDisplayColor = SriClocks.DigitalColor.GreenColor;
            clock.ClockDisplayType = SriClocks.ClockType.StopWatch;
            clock.Reset();
            btnStartStop.Text = "STOP";
            btnStartStop.Enabled = true;
            clock.StartTimer();
            StartRecordingTime = DateTime.Now;
            m_bRecording = true;
            m_ScreenIsCaptured = bRecordScreen;
            m_CameraIsCaptured = bRecordCamera;
            this.TopMost = false;
            bDontClick = false;
            StatusWindow.Hide();
            StatusWindow.Dispose();
            return;

            Label_Camera_Error:
            {
                bDontClick = false;
                StatusWindow.Hide();
                StatusWindow.Dispose();
                System.Windows.Forms.MessageBox.Show(this,sErrorBody,
                    sErrorCaption,System.Windows.Forms.MessageBoxButtons.OK,
                    System.Windows.Forms.MessageBoxIcon.Error);
                if(m_oec != null)
                {
                    for(int i=0; i< m_oec.Length;i++)
                    {
                        m_oec[i] = null;
                    }
                    m_oec = null;
                }
                Reset();
                m_CameraIsCaptured = false;
                m_ScreenIsCaptured = false;
                this.TopMost = true;
                return;
            }
            Label_Screen_Error:
            {
                bDontClick = false;
                StatusWindow.Hide();
                StatusWindow.Dispose();
                System.Windows.Forms.MessageBox.Show(this,sErrorBody,
                    sErrorCaption,System.Windows.Forms.MessageBoxButtons.OK,
                    System.Windows.Forms.MessageBoxIcon.Error);
                if(m_oec != null)
                {
                    for(int i=0; i< m_oec.Length;i++)
                    {
                        m_oec[i].StopRecording();
                        m_oec[i].Close();
                        m_oec[i] = null;
                    }
                    m_oec = null;
                }
                m_CameraIsCaptured = false;
                m_ScreenIsCaptured = false;
                Reset();
                this.TopMost = true;
                return;
            }
        }
예제 #18
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            if(!this.IsPostBack)
            {

                O = (OCL.Oyster)Session["Oyster"];
                LU = (OCL.User)Session["User"];
                string IPAddress = "";
                string SNMask = "";
                string GateWay = "";
                bool IsDHCP = false;
                GetNetStats(out IPAddress,out SNMask,out GateWay,out IsDHCP);

                tbIPAddress.Text = FormatIPAddress(IPAddress);
                tbSubNetMask.Text = FormatIPAddress(SNMask);
                tbGateWay.Text = FormatIPAddress(GateWay);

                if(IsDHCP)
                {
                    rbDHCP.Items[0].Selected = true;
                    rbDHCP.Items[1].Selected = false;
                }
                else
                {
                    rbDHCP.Items[0].Selected = false;
                    rbDHCP.Items[1].Selected = true;
                }

            }
        }
예제 #19
0
파일: frmMain.cs 프로젝트: CarverLab/Oyster
        private void frmMain_Load(object sender, System.EventArgs e)
        {
            this.Text = CarverLab.Utility.AppInfo.Title;
            string ErrorString = "";
            CarverLab.SharedForms.Oyster.frmOptions PO = new CarverLab.SharedForms.Oyster.frmOptions();

            if(!PO.CurrentPlayerOptions.HasBeenSaved)
            {
                if(PO.ShowDialog() != DialogResult.OK)
                {
                    Application.Exit();
                    return;
                }
            }

            TryItAgain:{}
            ErrorString = "";

            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 System 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;
                    }
                }
            }
            CarverLab.SharedForms.Oyster.frmLogin fL = new CarverLab.SharedForms.Oyster.frmLogin(ref OSystem);

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

            LUser = fL.LoginUser;
            fL.Dispose();

            /// Initialize Main Page
            tbSearchUsers.Text = "";

            OCL.Group DefaultGroup = (OCL.Group)OSystem.GetUnassignedObject(OCL.OysterUnassignedObjects.Group);
            btnTabUserNew.Enabled = DefaultGroup.CanAddUsers(LUser);
        }
예제 #20
0
파일: frmMain.cs 프로젝트: CarverLab/Oyster
        private void frmMain_Load(object sender, System.EventArgs e)
        {
            string ErrorString = "";
            CarverLab.SharedForms.Oyster.frmOptions PO = new CarverLab.SharedForms.Oyster.frmOptions();

            if(!PO.CurrentPlayerOptions.HasBeenSaved)
            {
                if(PO.ShowDialog() != DialogResult.OK)
                {
                    Application.Exit();
                    return;
                }
            }

            TryItAgain:{}
            ErrorString = "";

            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;
                    }
                }
            }
            CarverLab.SharedForms.Oyster.frmLogin fL = new CarverLab.SharedForms.Oyster.frmLogin(ref OSystem);

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

            LUser = fL.LoginUser;
            fL.Dispose();

            /// Initialize Main Page
            this.Text = "Oyster Content Author";
            tbSessionName.Text = DateTime.Now.ToString();
            tbContentGroup.Text = "None";
            tbContentGroup.Tag = null;
            tbContentOwner.Text = LUser.Description;
            tbContentOwner.Tag = LUser;
        }
예제 #21
0
파일: Form1.cs 프로젝트: CarverLab/Oyster
        private void CardReaderEvent(string CardNumber)
        {
            if(LUser == null)
            {
                try
                {
                    OSystem = new OCL.Oyster();
                    LUser = OSystem.GetUserByCardNumberRaw(CardNumber);

                    if(LUser == null) return;
                    InitializeUserData();
                }
                catch(Exception Err)
                {
                    MessageBox.Show(Err.Message,"Error detected");
                    return;
                }
            }
            else
            {
                LogOffUser();
            }
        }
예제 #22
0
파일: Form1.cs 프로젝트: CarverLab/Oyster
        private void LogOffUser()
        {
            string speek = "";
            LUser = null;
            OSystem = null;
            //TabRecordings_Click(TabRecordings,new System.EventArgs());
            ShowButtons(NoButtons);
            pnlLogin.Visible = true;
            pnlLogin.BringToFront();
            listView1.Items.Clear();

            try
            {
                ShowViewerControls(false);
                //				MP.Visible = false;
                //				MP.Hide();
            }
            catch(Exception Err)
            {
                speek = Err.Message;
            }
            try
            {
                UP.Stop();

            }
            catch(Exception Err)
            {
                speek = Err.Message;
            }
        }
예제 #23
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);
        }
예제 #24
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();
        }
예제 #25
0
        static void RunTest()
        {
            O = new OCL.Oyster();

            //TEST USER FUNCTIONS.
            Msg("Acquiring Super User..");
            SUser = O.GetUserById(23);
            if(SUser == null)
            {
                Msg("Failed to Aquire SuperUser...aborting app");
                System.Threading.Thread.CurrentThread.Abort();
            }
            Msg("Passed");

            Msg("Starting User Functions Test");

            UserTest();

            Msg("Starting Recording Functions Test");
            RecordingTest();
        }