Beispiel #1
0
        public FormMain(ClassLogger Logger)
        {
            InitializeComponent();
            _formConfig = new ClassFormConfig(this);
            LoadCertificate(textBoxAuthCertificate.Text);

            this.Text = Application.ProductName + " v" + Application.ProductVersion;
            _logger   = Logger;
            _logger.DebugLog(this.Text);

            // Hook up the cert callback.
            ServicePointManager.ServerCertificateValidationCallback = ValidateCertificate;

            GetUserSMTPAddress();
            UpdateTextBoxState();
            UpdateHTTPHeaderControls();
            UpdateHTTPCookieControls();
            xmlEditorResponse.XmlValidationComplete += xmlEditorResponse_XmlValidationComplete;
            _logger.DebugLog("Initialisation complete");

            /*
             * if (System.Diagnostics.Debugger.IsAttached)
             * {
             *  FormUserControlTest oForm = new FormUserControlTest();
             *  oForm.Show(this);
             * }
             */
        }
Beispiel #2
0
        public FormMain(bool DebugLogging)
        {
            InitializeComponent();

            // Add our form configuration helper
            _formConfig = new ConfigurationManager.ClassFormConfig(this, true);
            _formConfig.AddControlTypeRecurseExclusion("SOAPe.XmlEditor");
            _formConfig.ExcludedControls.Add(groupBoxResponse);
            _formConfig.ExcludedControls.Add(xmlEditorResponse);
            _formConfig.ExcludedControls.Add(textBoxHTTPHeaderName);
            _formConfig.ExcludedControls.Add(textBoxHTTPHeaderValue);
            ClassFormConfig.ApplyConfiguration();

            // Configure log file
            if (String.IsNullOrEmpty(textBoxLogFolder.Text))
            {
                textBoxLogFolder.Text = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
            }
            if (String.IsNullOrEmpty(textBoxLogFileName.Text))
            {
                textBoxLogFileName.Text = "SOAPe.log";
            }
            _logger = new ClassLogger(LogFileName(), DebugLogging);

            LoadCertificate(textBoxAuthCertificate.Text);

            this.Text = Application.ProductName + " v" + Application.ProductVersion;
            _logger.DebugLog(this.Text);

            // Hook up the cert callback.
            ServicePointManager.ServerCertificateValidationCallback = ValidateCertificate;

            GetUserSMTPAddress();
            UpdateAuthUI();
            UpdateHTTPHeaderControls();
            UpdateHTTPCookieControls();
            xmlEditorResponse.XmlValidationComplete += xmlEditorResponse_XmlValidationComplete;

            try
            {
                if (!NativeMethods.IsProcessElevated())
                {
                    // The HTTP listener requires elevation, check if we have this  hTTPListenerToolStripMenuItem
                    hTTPListenerToolStripMenuItem.Image = NativeMethods.GetStockIcon(NativeMethods.SHSTOCKICONID.SIID_SHIELD, NativeMethods.SHGSI.SHGSI_ICON).ToBitmap();
                }
            }
            catch { }

            /*
             * if (System.Diagnostics.Debugger.IsAttached)
             * {
             *  FormUserControlTest oForm = new FormUserControlTest();
             *  oForm.Show(this);
             * }
             */
            _logger.DebugLog("Initialisation complete");

            this.Shown += FormMain_Shown;
        }