Beispiel #1
0
        void loadSettings()
        {
            _mysettings                = _mysettings.load();
            txtDomain.Text             = _mysettings.ExchangeDomainname;
            txtUser.Text               = _mysettings.ExchangeUsername;
            txtExchangeServiceURL.Text = _mysettings.ExchangeServiceURL;
            chkUseWebProxy.Checked     = _mysettings.UseWebProxy;
            txtWebProxy.Text           = _mysettings.ExchangeWebProxy;
            numProxyPort.Value         = _mysettings.EchangeWebProxyPort;

            chkEnableLogging.Checked = _mysettings.UseLogging;

            txtDatabaseFile.Text = _mysettings.SQLiteDataBaseFilename;
        }
Beispiel #2
0
        public MainForm()
        {
            InitializeComponent();
            #if !DEBUG
            mnuAdmin.Visible = false;
            #endif
OpenDB:
            //load settings
            _mysettings = new MySettings();
            _mysettings = _mysettings.load();

            string appPath = utils.helpers.getAppPath();

            _licenseMail = new LicenseMail();
            //subscribe to new license mails
            _licenseMail.StateChanged += on_new_licensemail;

            addLog("Please select Exchange-Connect to start test");
            string dbFile = _mysettings.SQLiteDataBaseFilename;

            if (!dbFile.Contains('\\'))
            {  //build full file name
                dbFile = utils.helpers.getAppPath() + dbFile;
            }
            _licenseDataBase = new LicenseDataBase(ref this.dataGridView1, dbFile);

            if (_licenseDataBase.bIsValidDB == false)
            {
                MessageBox.Show("Error accessing or creating database file: " + dbFile, "Fatal ERROR");
                SettingsForm dlg = new SettingsForm();
                if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    goto OpenDB;    //try again
                }
                else
                {
                    MessageBox.Show("Cannot run without valid database path and file name", "Exchange License Mail Grabber");
                    exitApp();
                }
            }
            else
            {
                _licenseDataBase.StateChanged += new StateChangedEventHandler(_licenseDataBase_StateChanged);
                loadData();
            }

            readDGVlayout();
        }
Beispiel #3
0
        public MainForm()
        {
            InitializeComponent();
            #if !DEBUG
            mnuAdmin.Visible = false;
            #endif
            OpenDB:
            //load settings
            _mysettings = new MySettings();
            _mysettings = _mysettings.load();

            string appPath = utils.helpers.getAppPath();

            _licenseMail = new LicenseMail();
            //subscribe to new license mails
            _licenseMail.StateChanged += on_new_licensemail;

            addLog("Please select Exchange-Connect to start test");
            string dbFile = _mysettings.SQLiteDataBaseFilename;

            if (!dbFile.Contains('\\'))
            {  //build full file name
                dbFile = utils.helpers.getAppPath() + dbFile;
            }
            _licenseDataBase = new LicenseDataBase(ref this.dataGridView1, dbFile);

            if (_licenseDataBase.bIsValidDB == false)
            {
                MessageBox.Show("Error accessing or creating database file: " + dbFile, "Fatal ERROR");
                SettingsForm dlg = new SettingsForm();
                if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    goto OpenDB;    //try again
                }
                else
                {
                    MessageBox.Show("Cannot run without valid database path and file name", "Exchange License Mail Grabber");
                    exitApp();
                }
            }
            else
            {
                _licenseDataBase.StateChanged += new StateChangedEventHandler(_licenseDataBase_StateChanged);
                loadData();
            }

            readDGVlayout();
        }
Beispiel #4
0
        private void mnuConnect_Click(object sender, EventArgs e)
        {
            _mysettings = _mysettings.load();
            _userData   = new utils.UserData(_mysettings.ExchangeDomainname, _mysettings.ExchangeUsername, "", _mysettings.UseWebProxy);
            Helpers.GetLogonData dlg = new Helpers.GetLogonData(ref _userData);
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                _ews = new ews(ref _licenseMail);
                _ews.StateChanged += new StateChangedEventHandler(_ews_stateChanged1);
                _ews.start();

                if (_ews.logon(_userData.sDomain, _userData.sUser, _userData.sPassword,
                               _mysettings.UseWebProxy,
                               _mysettings.ExchangeWebProxy,
                               _mysettings.EchangeWebProxyPort))
                {// "Global", "E841719", ""))
                    Cursor.Current = Cursors.WaitCursor;
                    Application.DoEvents();
                    _ews.getMailsAsync();
                }
            }
            mnuConnect.Enabled    = false;
            mnuDisconnect.Enabled = true;
        }