Ejemplo n.º 1
0
        /// <summary>
        /// Shows a form for the user to select/change settings through a GUI. All interactive
        /// GUI operations MUST happen within this function scope.
        /// </summary>
        /// <param name="preConfig">Result of PreConfig</param>
        /// <param name="previousConfig">Previous configuration to initialize the GUI.</param>
        /// <returns>Null if operation is cancelled by the user. Otherwise returns with a new
        /// configuration object.</returns>
        public IInterpreterConfiguration DoGUIConfiguration(
            IInterpreterPreConfiguration preConfig,
            IInterpreterConfiguration previousConfig)
        {
            #pragma warning disable 0219
            DialogResult ok = DialogResult.Cancel;
            #pragma warning restore 0219

            var settings = previousConfig as CyPhy2RF_Settings;

            if (settings == null)
            {
                settings = new CyPhy2RF_Settings();
            }

            //using (MainForm mf = new MainForm(settings, (preConfig as CyPhy2RF_v2PreConfiguration).ProjectDirectory))
            //{
            // show main form
            //    ok = mf.ShowDialog();
            //}

            //if (ok == DialogResult.OK)
            {
                return(settings);
            }

            //return null;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Shows a form for the user to select/change settings through a GUI. All interactive 
        /// GUI operations MUST happen within this function scope.
        /// </summary>
        /// <param name="preConfig">Result of PreConfig</param>
        /// <param name="previousConfig">Previous configuration to initialize the GUI.</param>
        /// <returns>Null if operation is cancelled by the user. Otherwise returns with a new
        /// configuration object.</returns>
        public IInterpreterConfiguration DoGUIConfiguration(
            IInterpreterPreConfiguration preConfig,
            IInterpreterConfiguration previousConfig)
        {
            #pragma warning disable 0219
            DialogResult ok = DialogResult.Cancel;
            #pragma warning restore 0219
            
            var settings = previousConfig as CyPhy2RF_Settings;

            if (settings == null)
            {
                settings = new CyPhy2RF_Settings();
            }

            //using (MainForm mf = new MainForm(settings, (preConfig as CyPhy2RF_v2PreConfiguration).ProjectDirectory))
            //{
            // show main form
            //    ok = mf.ShowDialog();
            //}

            //if (ok == DialogResult.OK)
            {
                return settings;
            }

            //return null;
        }