示例#1
0
        internal ViewOpenDialog(string strConfigDir)
        {
            InitializeComponent();
            this.Icon      = new System.Drawing.Icon(@"app.ico");
            m_strConfigDir = strConfigDir;

            m_fEditControl = null;
            try
            {
                if (File.Exists(Path.Combine(strConfigDir, "viewhistory.cfg")))
                {
                    m_fEditControl = FEditControl.DeSerialize(Path.Combine(strConfigDir, "viewhistory.cfg"));
                }
            }
            catch
            {
            }
            if (m_fEditControl == null)
            {
                m_fEditControl              = new Geosoft.OpenGX.UtilityForms.FEditControl();
                m_fEditControl.BrowseQuery  = "Open Dapple View";
                m_fEditControl.FileOpenSave = Geosoft.OpenGX.UtilityForms.FileOpenSaveEnum.Open;
                m_fEditControl.FilterIndex  = 1;
                m_fEditControl.Filters      = "Dapple View files (*.dapple)|*.dapple";
            }

            m_fEditControl.Anchor            = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            m_fEditControl.AutoSizeMode      = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            m_fEditControl.Font              = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            m_fEditControl.Location          = new System.Drawing.Point(68, 456);
            m_fEditControl.MaximumSize       = new System.Drawing.Size(400, 21);
            m_fEditControl.MinimumSize       = new System.Drawing.Size(50, 21);
            m_fEditControl.Name              = "fEditControl";
            m_fEditControl.Size              = new System.Drawing.Size(180, 21);
            m_fEditControl.TabIndex          = 8;
            m_fEditControl.MaxHistory        = 10;
            m_fEditControl.Required          = true;
            m_fEditControl.FEditTextChanged += new Geosoft.OpenGX.UtilityForms.FEditControl.FEditTextChangedEventHandler(FEditTextChanged);
            this.Controls.Add(m_fEditControl);

            string strPath = "";

            m_fEditControl.GetFilePath(ref strPath);
            if (strPath.Length > 0)
            {
                ValidateView(strPath);
            }
        }
示例#2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            string strError = "";

            if (m_fEditControl.bIsValid(ref strError))
            {
                m_fEditControl.GetFilePath(ref m_strOutputPath);
                m_strNotes = this.c_tbNotes.Text;
                if (m_fOpenEditControl != null)
                {
                    m_fOpenEditControl.InitialDirectory = m_fEditControl.InitialDirectory;
                    m_fOpenEditControl.FileName         = m_fEditControl.FileName;
                    m_fOpenEditControl.Serialize(Path.Combine(m_strConfigDir, "viewhistory.cfg"));
                }
                this.DialogResult = DialogResult.OK;
                Close();
            }
            else
            {
                this.DialogResult = DialogResult.None;
            }
        }