Beispiel #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            List <CameraInfo> cams = Framework.Environment.CameraList;

            if (!string.IsNullOrEmpty(m_ViewModel.CameraId) && cams.Find(item => item.FullName == m_ViewModel.CameraId) == null)
            {
                cams.Add(new CameraInfo()
                {
                    FullName = m_ViewModel.CameraId, ID = m_ViewModel.CameraId
                });
                Framework.Environment.CameraList = cams;
            }
            List <FilePathInfo> files = Framework.Environment.FilePathList;

            if (!string.IsNullOrEmpty(m_ViewModel.Path) && files.Find(item => item.FullName == m_ViewModel.Path) == null)
            {
                files.Add(new FilePathInfo()
                {
                    FullName = m_ViewModel.Path, ID = m_ViewModel.Path
                });
                Framework.Environment.FilePathList = files;
            }
            if (m_ViewModel.Commit())
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                this.DialogResult = DialogResult.None;
            }
        }