示例#1
0
 public CS_RecordSession()
 {
     Name        = "New session";
     SessionDate = DateTime.Now;
     Comment     = "";
     UserInfos   = new CS_RecordUserInfoCollection();
 }
示例#2
0
        private void Export_UserInfo()
        {
            Dlg_SaveFile.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\CANStream\\Record User Information";

            if (Dlg_SaveFile.ShowDialog().Equals(DialogResult.OK))
            {
                CS_RecordUserInfoCollection oInfoCollection = new CS_RecordUserInfoCollection();

                foreach (DataGridViewRow oRow in Grid_UserInfos.Rows)
                {
                    if (!(oRow.Cells[0].Value == null))
                    {
                        CS_RecordUserInfo sInfo = new CS_RecordUserInfo();
                        sInfo.Title = oRow.Cells[0].Value.ToString();

                        if (!(oRow.Cells[1].Value == null))
                        {
                            sInfo.Value = oRow.Cells[1].Value.ToString();
                        }

                        oInfoCollection.Informations.Add(sInfo);
                    }
                }

                oInfoCollection.Write_UserInfoCollection(Dlg_SaveFile.FileName);
            }
        }
示例#3
0
        private void Import_UserInfo()
        {
            Dlg_OpenFile.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\CANStream\\Record User Information";

            if (Dlg_OpenFile.ShowDialog().Equals(DialogResult.OK))
            {
                CS_RecordUserInfoCollection oInfoCollection = new CS_RecordUserInfoCollection();

                if (oInfoCollection.Load_UserInfoCollection(Dlg_OpenFile.FileName))
                {
                    Grid_UserInfos.Rows.Clear();

                    foreach (CS_RecordUserInfo sInfo in oInfoCollection.Informations)
                    {
                        Grid_UserInfos.Rows.Add();
                        DataGridViewRow oRow = Grid_UserInfos.Rows[Grid_UserInfos.Rows.Count - 2];
                        oRow.Cells[0].Value = sInfo.Title;
                        oRow.Cells[1].Value = sInfo.Value;
                    }
                }
                else
                {
                    MessageBox.Show("User information file reading error !", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
        }
示例#4
0
        public Ctrl_RecordUserInformations()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            UserInformations   = new CS_RecordUserInfoCollection();
            oUserInfoClipBoard = null;
        }
示例#5
0
        public CS_RecordEvent()
        {
            Name         = "New event";
            StartingDate = DateTime.Now;
            Comment      = "";
            Sessions     = new List <CS_RecordSession>();
            UserInfos    = new CS_RecordUserInfoCollection();

            //Creation of the first session of the event
            CS_RecordSession oSession = new CS_RecordSession();

            Sessions.Add(oSession);
            CurrentSession = Sessions[0];
        }
示例#6
0
        private void Paste_UserInfo()
        {
            if (!(oUserInfoClipBoard == null))
            {
                foreach (CS_RecordUserInfo sInfo in oUserInfoClipBoard.Informations)
                {
                    Grid_UserInfos.Rows.Add();

                    DataGridViewRow oRow = Grid_UserInfos.Rows[Grid_UserInfos.Rows.Count - 2];
                    oRow.Cells[0].Value = sInfo.Title;
                    oRow.Cells[1].Value = sInfo.Value;
                }

                oUserInfoClipBoard = null;
            }
        }
示例#7
0
        /// <summary>
        /// Set the user inforamtions collection to be  hosted by the control
        /// </summary>
        /// <param name="oInformations">User inforamtions collection to be  hosted by the control</param>
        public void Set_UserInformations(CS_RecordUserInfoCollection oInformations)
        {
            Grid_UserInfos.Rows.Clear();

            if (!(oInformations == null))
            {
                UserInformations = oInformations;

                foreach (CS_RecordUserInfo sInfo in UserInformations.Informations)
                {
                    if (!(sInfo.Title.Equals("")))
                    {
                        Grid_UserInfos.Rows.Add();
                        DataGridViewRow oRow = Grid_UserInfos.Rows[Grid_UserInfos.Rows.Count - 2];

                        oRow.Cells[0].Value = sInfo.Title;
                        oRow.Cells[1].Value = sInfo.Value;
                    }
                }
            }
        }
示例#8
0
        /// <summary>
        /// Return the user inforamtions collection hosted by the control
        /// </summary>
        /// <returns>User inforamtions collection hosted by the control</returns>
        public CS_RecordUserInfoCollection Get_UserInformations()
        {
            UserInformations = new CS_RecordUserInfoCollection();

            foreach (DataGridViewRow oRow in Grid_UserInfos.Rows)
            {
                if (!(oRow.Cells[0].Value == null))
                {
                    CS_RecordUserInfo sInfo = new CS_RecordUserInfo();
                    sInfo.Title = oRow.Cells[0].Value.ToString();

                    if (!(oRow.Cells[1].Value == null))
                    {
                        sInfo.Value = oRow.Cells[1].Value.ToString();
                    }

                    UserInformations.Informations.Add(sInfo);
                }
            }

            return(UserInformations);
        }
示例#9
0
        private void Copy_UserInfo()
        {
            if (!(Grid_UserInfos.SelectedCells == null))
            {
                oUserInfoClipBoard = new CS_RecordUserInfoCollection();

                foreach (DataGridViewRow oRow in Grid_UserInfos.SelectedRows)
                {
                    if (!(oRow.Cells[0].Value == null))
                    {
                        CS_RecordUserInfo sInfo = new CS_RecordUserInfo();
                        sInfo.Title = oRow.Cells[0].Value.ToString();

                        if (!(oRow.Cells[1].Value == null))
                        {
                            sInfo.Value = oRow.Cells[1].Value.ToString();
                        }

                        oUserInfoClipBoard.Informations.Add(sInfo);
                    }
                }
            }
        }