Exemple #1
0
        private void buttonOpenFile_Click(object sender, EventArgs e)
        {
            this.strError = string.Empty;
            string errorMessage = string.Empty;

            if (MessageBox.Show("Group Schedule Processing must be disabled to open the raw schedule file to avoid file lock conflicts.\r\n\r\nWhile working with the file you MUST keep the header row unchanged or the file will be rejected.  You MUST not populate the SendStatus column or the record will not be processed.\r\n\r\nOnce additions to the file are complete, open the Edit Group Schedule screen re-enable the process and click on Validate & Save button.\r\n\r\nDo you want to proceed?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
            {
                try
                {
                    AppRegistry.SaveValue(AppRegistry.GetRootKey(ref errorMessage), "EnableGroupScheduleProcessing", false, ref errorMessage, false, RegistryValueKind.Unknown);
                    if (errorMessage != string.Empty)
                    {
                        this.strError = this.strError + "Disable Group Schedule Processing save error: " + errorMessage;
                    }
                    else
                    {
                        this.appManager.m_bEnableGroupScheduleProcessing = false;
                    }
                }
                catch (Exception exception)
                {
                    this.strError = this.strError + "Disable Group Schedule Processing save error: " + exception.Message;
                }
                if (this.strError.Length == 0)
                {
                    base.Close();
                    Process.Start(this.appManager.m_strCSVScheduleFilePath);
                }
                else
                {
                    this.appManager.ShowBalloon("Exception opening raw file: " + this.strError, 5);
                }
            }
        }
Exemple #2
0
        private void checkBoxEnableGroupSchedule_CheckedChanged(object sender, EventArgs e)
        {
            this.strError = string.Empty;
            string errorMessage = string.Empty;

            if (this.appManager.m_bEnableGroupScheduleProcessing != this.checkBoxEnableGroupSchedule.Checked)
            {
                try
                {
                    AppRegistry.SaveValue(AppRegistry.GetRootKey(ref errorMessage), "EnableGroupScheduleProcessing", this.checkBoxEnableGroupSchedule.Checked, ref errorMessage, false, RegistryValueKind.Unknown);
                    if (errorMessage != string.Empty)
                    {
                        this.strError = this.strError + errorMessage;
                    }
                    else
                    {
                        this.appManager.m_bEnableGroupScheduleProcessing = this.checkBoxEnableGroupSchedule.Checked;
                        this.bRefreshMessageForm = true;
                    }
                }
                catch (Exception exception)
                {
                    this.strError = this.strError + exception.Message;
                }
                if (this.strError.Length == 0)
                {
                    this.appManager.ShowBalloon("Setting saved.", 5);
                }
                else
                {
                    this.appManager.ShowBalloon("checkBoxEnableGroupSchedule_CheckedChanged error: " + this.strError, 5);
                }
            }
        }
Exemple #3
0
        private void fmEditGroups_Load(object sender, EventArgs e)
        {
            this.Text = this.appManager.m_strApplicationName + " Edit Groups " + this.appManager.FormatPhone(this.appManager.m_strUserName);
            base.Icon = this.appManager.iTextApp;
            int         num     = 0;
            int         num2    = 0;
            RegistryKey rootKey = AppRegistry.GetRootKey(ref this.strError);

            AppRegistry.GetValue(rootKey, "local_FormEditGroupsWidth", ref num, ref this.strError);
            AppRegistry.GetValue(rootKey, "local_FormEditGroupsHeight", ref num2, ref this.strError);
            if (num2 != 0)
            {
                base.Height = num2;
            }
            if (num != 0)
            {
                base.Width = num;
            }
            this.textBoxGroupTag.Text              = "";
            this.comboBoxContactList.ValueMember   = "id";
            this.comboBoxContactList.DisplayMember = "contact";
            this.comboBoxContactList_Load(string.Empty);
            this.comboBoxGroups_Load(string.Empty);
            this.listBoxSelectedContacts.DrawMode      = DrawMode.OwnerDrawVariable;
            this.listBoxSelectedContacts.MeasureItem  += new MeasureItemEventHandler(this.listBoxSelectedContacts_MeasureItem);
            this.listBoxSelectedContacts.DrawItem     += new DrawItemEventHandler(this.listBoxSelectedContacts_DrawItem);
            this.listBoxSelectedContacts.ValueMember   = "id";
            this.listBoxSelectedContacts.DisplayMember = "contact";
            if (!this.appManager.m_bAllowDelete)
            {
                this.buttonDelete.Visible = false;
            }
        }
        private void buttonSave_Click(object sender, EventArgs e)
        {
            bool        flag         = true;
            string      errorMessage = string.Empty;
            RegistryKey rootKey      = AppRegistry.GetRootKey(ref errorMessage);

            try
            {
                AppRegistry.SaveValue(rootKey, "EnableKeywordProcessing", this.checkBoxEnableKeywordProcessing.Checked, ref errorMessage, false, RegistryValueKind.Unknown);
                if (errorMessage != string.Empty)
                {
                    this.strError = this.strError + "Enable Keyword Processing save error: " + errorMessage;
                    flag          = false;
                }
                else
                {
                    this.appManager.m_bEnableKeywordProcessing = this.checkBoxEnableKeywordProcessing.Checked;
                    this.bRefreshMessageForm = true;
                }
            }
            catch (Exception exception)
            {
                this.strError = this.strError + "Enable Keyword Processing save error: " + exception.Message;
                flag          = false;
            }
            try
            {
                AppRegistry.SaveValue(rootKey, "NotifyKeywordProcessing", this.checkBoxNotifyKeywordProcessing.Checked, ref errorMessage, false, RegistryValueKind.Unknown);
                if (errorMessage != string.Empty)
                {
                    this.strError = this.strError + "Notify Keyword Processing save error: " + errorMessage;
                    flag          = false;
                }
                else
                {
                    this.appManager.m_bNotifyKeywordProcessing = this.checkBoxNotifyKeywordProcessing.Checked;
                }
            }
            catch (Exception exception2)
            {
                this.strError = this.strError + "Notify Keyword Processing save error: " + exception2.Message;
                flag          = false;
            }
            if (flag)
            {
                base.Close();
                if ((this.appManager.formMessages != null) && this.bRefreshMessageForm)
                {
                    this.appManager.formMessages.Close();
                    this.appManager.ShowMessages();
                }
                this.appManager.ShowBalloon("Your settings have been saved.", 5);
            }
            else
            {
                this.appManager.ShowBalloon("Exception saving keyword auto response settings: " + this.strError, 5);
            }
        }
        private void fmEditAccounts_Load(object sender, EventArgs e)
        {
            this.Text = this.appManager.m_strApplicationName + " Edit Accounts";
            base.Icon = this.appManager.iTextApp;
            int         num     = 0;
            int         num2    = 0;
            RegistryKey rootKey = AppRegistry.GetRootKey(ref this.strError);

            AppRegistry.GetValue(rootKey, "local_FormEditAccountsWidth", ref num, ref this.strError);
            AppRegistry.GetValue(rootKey, "local_FormEditAccountsHeight", ref num2, ref this.strError);
            if (num2 != 0)
            {
                base.Height = num2;
            }
            if (num != 0)
            {
                base.Width = num;
            }
            this.comboBoxAccountList.ValueMember   = "phoneNumber";
            this.comboBoxAccountList.DisplayMember = "display";
            this.comboBoxAccountList_Load(string.Empty);
            this.LoadCountryDDL();
            this.comboBoxCountry.SelectedValue = "USA";
            if (this.bNewAccount)
            {
                this.textBoxPhoneNumber.Enabled = true;
                this.textBoxPhoneNumber.Focus();
            }
            else
            {
                try
                {
                    this.DisplayAccount();
                    this.textBoxPassword.Focus();
                }
                catch (Exception exception)
                {
                    this.strError = "Error getting current contact information: " + exception.Message;
                }
            }
            if (!string.IsNullOrEmpty(this.strError))
            {
                this.appManager.ShowBalloon(this.strError, 5);
                this.strError = string.Empty;
            }
            if (this.appManager.m_bValidateMobileNumbers && this.bNewAccount)
            {
                this.textBoxPhoneNumber.Mask = "(000) 000-0000";
            }
            else
            {
                this.textBoxPhoneNumber.Mask = null;
            }
        }
 private void fmEditAccounts_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         RegistryKey rootKey = AppRegistry.GetRootKey(ref this.strError);
         AppRegistry.SaveValue(rootKey, "local_FormEditAccountsWidth", base.Width, ref this.strError, false, RegistryValueKind.Unknown);
         AppRegistry.SaveValue(rootKey, "local_FormEditAccountsHeight", base.Height, ref this.strError, false, RegistryValueKind.Unknown);
     }
     catch
     {
     }
 }
 private void fmAccountDashboard_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         RegistryKey expr_0B = AppRegistry.GetRootKey(ref this.strError);
         AppRegistry.SaveValue(expr_0B, "local_FormAccountDashboardWidth", base.Width, ref this.strError, false, RegistryValueKind.Unknown);
         AppRegistry.SaveValue(expr_0B, "local_FormAccountDashboardHeight", base.Height, ref this.strError, false, RegistryValueKind.Unknown);
     }
     catch
     {
     }
 }
Exemple #8
0
        private void btnUserLogin_Click(object sender, EventArgs e)
        {
            string errorMessage = string.Empty;

            this.btnUserLogin.Enabled = false;
            if ((this.txtUserName.Text.Length == 0) || (this.txtPassword.Text.Length == 0))
            {
                this.btnUserLogin.Enabled = true;
            }
            else
            {
                this.txtUserName.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;
                string      text     = this.txtUserName.Text;
                string      password = this.txtPassword.Text;
                RegistryKey rootKey  = AppRegistry.GetRootKey(ref errorMessage);
                try
                {
                    AppRegistry.SaveUserName(rootKey, text, ref errorMessage);
                    if (errorMessage != string.Empty)
                    {
                        this.strError = this.strError + "\nUserName save error: " + errorMessage;
                    }
                    AppRegistry.SavePassword(rootKey, password, ref errorMessage);
                    if (errorMessage != string.Empty)
                    {
                        this.strError = this.strError + "\nPassword save error: " + errorMessage;
                    }
                    AppRegistry.SaveValue(rootKey, "local_IsLoggedOut", false, ref errorMessage, false, RegistryValueKind.Unknown);
                    if (errorMessage != string.Empty)
                    {
                        this.strError = this.strError + "\nIsLoggedOut save error: " + errorMessage;
                    }
                    AppRegistry.SaveValue(rootKey, "local_SaveLogIn", this.ckbSaveLogIn.Checked, ref errorMessage, false, RegistryValueKind.Unknown);
                    if (errorMessage != string.Empty)
                    {
                        this.strError = this.strError + "\nSaveLogIn save error: " + errorMessage;
                    }
                    AppRegistry.SaveValue(rootKey, "local_CountryCode", this.comboBoxCountry.SelectedValue, ref errorMessage, false, RegistryValueKind.Unknown);
                    if (errorMessage != string.Empty)
                    {
                        this.strError = this.strError + "\nSaveCountryCode save error: " + errorMessage;
                    }
                }
                catch (Exception exception)
                {
                    this.appManager.ShowBalloon("Exception with the login information: " + exception.Message + "\nError details: " + this.strError, 5);
                }
                base.Close();
                this.appManager.LogIn(true, null, null, null, null);
            }
        }
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            this.textBoxPhoneNumber.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;
            string strPhoneDigits = this.appManager.FormatContactAddress(this.textBoxPhoneNumber.Text, true, false);

            this.buttonDelete.Enabled = false;
            try
            {
                string[] textArray1 = new string[] { "Delete account ", this.textBoxAccountTitle.Text, " ", this.textBoxPhoneNumber.Text, "?" };
                if (MessageBox.Show(string.Concat(textArray1), "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                {
                    if (this.appManager.m_bAccountDashboardLoading)
                    {
                        MessageBox.Show("The Dashboard is currently refreshing accounts, please wait until complete to delete account.", this.appManager.m_strApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                        this.buttonDelete.Enabled = true;
                        return;
                    }
                    AppRegistry.GetRootKey(ref this.strError).DeleteSubKeyTree(strPhoneDigits);
                }
                else
                {
                    this.buttonDelete.Enabled = true;
                    return;
                }
            }
            catch (Exception exception)
            {
                this.strError = "Error deleting records: " + exception.Message;
            }
            if (!string.IsNullOrEmpty(this.strError))
            {
                this.appManager.ShowBalloon(this.strError, 5);
                this.strError           = string.Empty;
                this.buttonSave.Enabled = true;
            }
            else
            {
                string text = string.Empty;
                text = "Account deleted";
                this.appManager.ShowBalloon(text, 5);
                this.appManager.m_lsAccountItems = (from val in this.appManager.m_lsAccountItems
                                                    where val.number != strPhoneDigits
                                                    select val).ToList <AccountItem>();
            }
            this.buttonDelete.Enabled = true;
            this.ResetDisplay();
        }
Exemple #10
0
 private void GroupSchedule_Load(object sender, EventArgs e)
 {
     try
     {
         this.Text = this.appManager.m_strApplicationName + " Group Schedule";
         base.Icon = this.appManager.iTextApp;
         int         num     = 0;
         int         num2    = 0;
         RegistryKey rootKey = AppRegistry.GetRootKey(ref this.strError);
         AppRegistry.GetValue(rootKey, "local_FormGroupScheduleWidth", ref num, ref this.strError);
         AppRegistry.GetValue(rootKey, "local_FormGroupScheduleHeight", ref num2, ref this.strError);
         if (num2 != 0)
         {
             base.Height = num2;
         }
         if (num != 0)
         {
             base.Width = num;
         }
         this.labelProcessing.BackColor = ColorTranslator.FromHtml("#93FF14");
         this.labelProcessing.Visible   = false;
         this.dataGridViewGroupScheduleFile.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
         this.dataGridViewGroupScheduleFile.DefaultCellStyle.SelectionBackColor = ColorTranslator.FromHtml("#E8FFCC");
         this.dataGridViewGroupScheduleFile.DefaultCellStyle.SelectionForeColor = System.Drawing.Color.Black;
         if (this.appManager.m_bGroupScheduleProcessing)
         {
             this.labelProcessing.Visible = true;
             this.buttonOpenFile.Enabled  = false;
             this.buttonSave.Enabled      = false;
         }
         else
         {
             this.labelProcessing.Visible = false;
             this.buttonOpenFile.Enabled  = true;
             this.buttonSave.Enabled      = true;
         }
         if (this.appManager.m_bEnableGroupScheduleProcessing)
         {
             this.checkBoxEnableGroupSchedule.Checked = true;
         }
         this.dataGridViewGroupScheduleFile_Load();
     }
     catch (Exception exception)
     {
         this.appManager.ShowBalloon("Exception creating Group Schedule form: " + exception.Message, 5);
     }
 }
Exemple #11
0
        private void openDashboardWithUnreadReminderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string errorMessage = string.Empty;

            try
            {
                AppRegistry.SaveValue(AppRegistry.GetRootKey(ref errorMessage), "PopDashboardWindow", this.openDashboardWithUnreadReminderToolStripMenuItem.Checked, ref errorMessage, false, RegistryValueKind.Unknown);
                if (errorMessage != string.Empty)
                {
                    errorMessage = "Open dashboard with unread reminder save error: " + errorMessage;
                    this.appManager.ShowBalloon(errorMessage, 5);
                }
                else
                {
                    this.appManager.m_bPopDashboardWindow = this.openDashboardWithUnreadReminderToolStripMenuItem.Checked;
                }
            }
            catch (Exception exception)
            {
                errorMessage = "Open dashboard with unread reminder save error: " + exception.Message;
                this.appManager.ShowBalloon(errorMessage, 10);
            }
        }
Exemple #12
0
 private void fmAccountDashboard_Load(object sender, EventArgs e)
 {
     try
     {
         int         num     = 0;
         int         num2    = 0;
         RegistryKey rootKey = AppRegistry.GetRootKey(ref this.strError);
         AppRegistry.GetValue(rootKey, "local_FormAccountDashboardWidth", ref num, ref this.strError);
         AppRegistry.GetValue(rootKey, "local_FormAccountDashboardHeight", ref num2, ref this.strError);
         if (num2 != 0)
         {
             base.Height = num2;
         }
         if (num != 0)
         {
             base.Width = num;
         }
         this.versionToolStripMenuItem.Text = this.appManager.m_AssemblyVersion + " (Update)";
         if (this.appManager.m_bIsBranded)
         {
             this.versionToolStripMenuItem.Text    = this.appManager.m_AssemblyVersion;
             this.versionToolStripMenuItem.Enabled = false;
             this.tryBETAToolStripMenuItem.Visible = false;
         }
         this.Text = this.appManager.m_strApplicationName + " Account Dashboard";
         base.Icon = this.appManager.iTextApp;
         this.LoadGridViewAccounts();
     }
     catch (Exception exception)
     {
         this.strError = "Unexpected application error while loading Account Dashboard window: " + exception.Message;
     }
     if (this.strError.Length > 0)
     {
         this.appManager.ShowBalloon(this.strError, 5);
     }
 }
 private void buttonSave_Click(object sender, EventArgs e)
 {
     if (this.appManager.m_bAccountDashboardLoading)
     {
         MessageBox.Show("The Dashboard is currently refreshing accounts, please wait until complete to save account.", this.appManager.m_strApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
     else
     {
         this.textBoxPhoneNumber.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;
         if (this.textBoxPhoneNumber.Text.Length != 0)
         {
             try
             {
                 this.buttonSave.Enabled = false;
                 if (this.bNewAccount)
                 {
                     if (!this.appManager.IsDigitsOnly(this.textBoxPhoneNumber.Text))
                     {
                         this.strError = "Phone number must be numeric digits...";
                         this.textBoxPhoneNumber.Select();
                     }
                     if (!this.appManager.IsValidMobileNumber(this.appManager.FormatContactAddress(this.textBoxPhoneNumber.Text, true, false)))
                     {
                         this.strError = "Phone number is not a valid number of digits...";
                         this.textBoxPhoneNumber.Select();
                     }
                     if (this.appManager.GetAccountItem(this.textBoxPhoneNumber.Text).number != null)
                     {
                         this.strError = "Phone number is already saved, please select from the dropdown and update...";
                         this.comboBoxAccountList.Focus();
                     }
                     if (this.textBoxPassword.Text.Length == 0)
                     {
                         this.strError = "Please enter a password...";
                         this.textBoxPassword.Select();
                     }
                     if (this.comboBoxCountry.SelectedValue.ToString() == "")
                     {
                         this.strError = "Please select a country code...";
                         this.comboBoxCountry.Focus();
                     }
                 }
                 if (string.IsNullOrEmpty(this.strError))
                 {
                     bool   flag    = false;
                     bool   flag2   = false;
                     string session = string.Empty;
                     this.appManager.ShowBalloon("Please wait, account information is being verified...", 5);
                     string strPhoneDigits = this.appManager.FormatContactAddress(this.textBoxPhoneNumber.Text, true, false);
                     if (this.appManager.m_textService == null)
                     {
                         this.appManager.m_textService = new TextService();
                     }
                     try
                     {
                         if (AppRegistry.AuthorizeUser(strPhoneDigits, ref this.strError))
                         {
                             flag = this.appManager.m_textService.AccountLogIn(strPhoneDigits, this.textBoxPassword.Text, this.comboBoxCountry.SelectedValue.ToString(), ref session);
                         }
                     }
                     catch
                     {
                         flag2 = true;
                     }
                     if (flag2)
                     {
                         this.strError = "Exception connecting to Text Service\n\nPlease check your internet connection...";
                     }
                     else if (!flag)
                     {
                         this.strError = "Account Failed Authentication.\n\nPlease check your log in information and selected country...";
                     }
                     else
                     {
                         RegistryKey key = AppRegistry.GetSubKey(AppRegistry.GetRootKey(ref this.strError), strPhoneDigits, true, ref this.strError);
                         if (this.strError == string.Empty)
                         {
                             AppRegistry.SaveUserName(key, strPhoneDigits, ref this.strError);
                             AppRegistry.SavePassword(key, this.textBoxPassword.Text, ref this.strError);
                             AppRegistry.SaveValue(key, "CountryCode", this.comboBoxCountry.SelectedValue.ToString(), ref this.strError, false, RegistryValueKind.Unknown);
                             AppRegistry.SaveValue(key, "Title", this.textBoxAccountTitle.Text, ref this.strError, false, RegistryValueKind.Unknown);
                             AppRegistry.SaveValue(key, "Session", session, ref this.strError, false, RegistryValueKind.Unknown);
                         }
                         if (this.strError == string.Empty)
                         {
                             this.appManager.m_lsAccountItems = (from val in this.appManager.m_lsAccountItems
                                                                 where val.number != strPhoneDigits
                                                                 select val).ToList <AccountItem>();
                             AccountItem item = new AccountItem {
                                 countryCode       = this.comboBoxCountry.SelectedValue.ToString(),
                                 number            = strPhoneDigits,
                                 password          = this.textBoxPassword.Text,
                                 title             = this.textBoxAccountTitle.Text,
                                 session           = session,
                                 unReadMessageList = new List <TextMessage>(),
                                 connectionStatus  = "Connected"
                             };
                             this.appManager.m_lsAccountItems.Add(item);
                         }
                     }
                 }
             }
             catch (Exception exception)
             {
                 this.strError = "Error saving account: " + exception.Message;
             }
             if (!string.IsNullOrEmpty(this.strError))
             {
                 MessageBox.Show(this.strError, this.appManager.m_strApplicationName + " Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 this.strError           = string.Empty;
                 this.buttonSave.Enabled = true;
             }
             else
             {
                 this.appManager.ShowBalloon("Account has been verified and saved.", 5);
                 this.ResetDisplay();
             }
             this.buttonSave.Enabled = true;
         }
     }
 }
Exemple #14
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            bool        flag         = true;
            string      errorMessage = string.Empty;
            RegistryKey rootKey      = AppRegistry.GetRootKey(ref errorMessage);

            try
            {
                AppRegistry.SaveValue(rootKey, "NotificationSound", this.comboBoxNotificationSound.SelectedValue.ToString(), ref errorMessage, false, RegistryValueKind.Unknown);
                if (errorMessage != string.Empty)
                {
                    this.strError = this.strError + "Notification sound save error: " + errorMessage;
                    flag          = false;
                }
                else
                {
                    this.appManager.m_strNotificationSound = this.comboBoxNotificationSound.SelectedValue.ToString();
                    if (this.appManager.m_strNotificationSound == "None")
                    {
                        this.appManager.m_bPlaySound = false;
                    }
                    else
                    {
                        this.appManager.m_bPlaySound = true;
                    }
                }
            }
            catch (Exception exception)
            {
                this.strError = this.strError + "Notification sound save error: " + exception.Message;
                flag          = false;
            }
            try
            {
                AppRegistry.SaveValue(rootKey, "NotificationInterval", Convert.ToInt32(this.comboBoxNotificationReminder.SelectedValue), ref errorMessage, false, RegistryValueKind.Unknown);
                if (errorMessage != string.Empty)
                {
                    this.strError = this.strError + "Notificaiton reminder save error: " + errorMessage;
                    flag          = false;
                }
                else
                {
                    this.appManager.m_nNotificationInterval = Convert.ToInt32(this.comboBoxNotificationReminder.SelectedValue);
                    this.appManager.m_dtNextNotification    = DateTime.Now.AddMinutes((double)this.appManager.m_nNotificationInterval);
                }
            }
            catch (Exception exception2)
            {
                this.strError = this.strError + "Notificaiton reminder save error: " + exception2.Message;
                flag          = false;
            }
            try
            {
                AppRegistry.SaveValue(rootKey, "FontSize", Convert.ToInt32(this.comboBoxFontSize.SelectedValue), ref errorMessage, false, RegistryValueKind.Unknown);
                if (errorMessage != string.Empty)
                {
                    this.strError = this.strError + "Font size save error: " + errorMessage;
                    flag          = false;
                }
                else
                {
                    this.appManager.m_nFontSize = Convert.ToInt32(this.comboBoxFontSize.SelectedValue);
                    this.appManager.m_fontSize  = new Font("Arial", (float)this.appManager.m_nFontSize);
                    this.bRefreshMessageForm    = true;
                }
            }
            catch (Exception exception3)
            {
                this.strError = this.strError + "Font size save error: " + exception3.Message;
                flag          = false;
            }
            try
            {
                AppRegistry.SaveValue(rootKey, "FontSizeDT", Convert.ToInt32(this.comboBoxFontSizeDT.SelectedValue), ref errorMessage, false, RegistryValueKind.Unknown);
                if (errorMessage != string.Empty)
                {
                    this.strError = this.strError + "Font size Date/Time save error: " + errorMessage;
                    flag          = false;
                }
                else
                {
                    this.appManager.m_nFontSizeDT = Convert.ToInt32(this.comboBoxFontSizeDT.SelectedValue);
                    this.appManager.m_fontSizeDT  = new Font("Arial", (float)this.appManager.m_nFontSizeDT);
                    this.bRefreshMessageForm      = true;
                }
            }
            catch (Exception exception4)
            {
                this.strError = this.strError + "Font size Date/Time save error: " + exception4.Message;
                flag          = false;
            }
            try
            {
                AppRegistry.SaveValue(rootKey, "LastMessageStatusLimit", Convert.ToInt32(this.comboBoxLastMessageStatus.SelectedValue), ref errorMessage, false, RegistryValueKind.Unknown);
                if (errorMessage != string.Empty)
                {
                    this.strError = this.strError + "Last message status save error: " + errorMessage;
                    flag          = false;
                }
                else if (this.appManager.m_nLastMessageStatusLimit != Convert.ToInt32(this.comboBoxLastMessageStatus.SelectedValue))
                {
                    this.appManager.m_nLastMessageStatusLimit = Convert.ToInt32(this.comboBoxLastMessageStatus.SelectedValue);
                    this.bRefreshMessageForm = true;
                    if (this.appManager.m_nLastMessageStatusLimit == 0)
                    {
                        this.appManager.m_lsConversationMetaData.Clear();
                    }
                    else
                    {
                        this.appManager.LoadConversations(true);
                    }
                }
            }
            catch (Exception exception5)
            {
                this.strError = this.strError + "Last message status save error: " + exception5.Message;
                flag          = false;
            }
            try
            {
                AppRegistry.SaveValue(rootKey, "UnreadMessageLimit", Convert.ToInt32(this.comboBoxUnreadMessageLimit.SelectedValue), ref errorMessage, false, RegistryValueKind.Unknown);
                if (errorMessage != string.Empty)
                {
                    this.strError = this.strError + "UnreadyMessage Count limit save error: " + errorMessage;
                    flag          = false;
                }
                else if (this.appManager.m_nUnreadMessageLimit != Convert.ToInt32(this.comboBoxUnreadMessageLimit.SelectedValue))
                {
                    this.appManager.m_nUnreadMessageLimit = Convert.ToInt32(this.comboBoxUnreadMessageLimit.SelectedValue);
                }
            }
            catch (Exception exception6)
            {
                this.strError = this.strError + "Unread Message Count limit save error: " + exception6.Message;
                flag          = false;
            }
            try
            {
                AppRegistry.SaveValue(rootKey, "EnableSignature", this.checkBoxEnableSignature.Checked, ref errorMessage, false, RegistryValueKind.Unknown);
                AppRegistry.SaveValue(rootKey, "Signature", this.textBoxSignature.Text, ref errorMessage, false, RegistryValueKind.Unknown);
                if (errorMessage != string.Empty)
                {
                    this.strError = this.strError + "Enable Signature save error: " + errorMessage;
                    flag          = false;
                }
                else
                {
                    this.appManager.m_bEnableSignature = this.checkBoxEnableSignature.Checked;
                    this.appManager.m_strSignature     = this.textBoxSignature.Text;
                    this.bRefreshMessageForm           = true;
                }
            }
            catch (Exception exception7)
            {
                this.strError = this.strError + "Enable Signature save error: " + exception7.Message;
                flag          = false;
            }
            try
            {
                AppRegistry.SaveValue(rootKey, "local_AccountDashboardRefreshInterval", Convert.ToInt32(this.comboBoxDashboardRefreshInterval.SelectedValue), ref errorMessage, false, RegistryValueKind.Unknown);
                if (errorMessage != string.Empty)
                {
                    this.strError = this.strError + "Dashboard refresh interval save error: " + errorMessage;
                    flag          = false;
                }
                else if (this.appManager.m_nAccountDashboardRefreshInterval != Convert.ToInt32(this.comboBoxDashboardRefreshInterval.SelectedValue))
                {
                    this.appManager.m_nAccountDashboardRefreshInterval = Convert.ToInt32(this.comboBoxDashboardRefreshInterval.SelectedValue);
                    this.appManager.StartMonitorAccountDashboardTimer();
                }
            }
            catch (Exception exception8)
            {
                this.strError = this.strError + "Dashboard refresh interval save error: " + exception8.Message;
                flag          = false;
            }
            try
            {
                AppRegistry.SaveValue(rootKey, "local_DashboardNotificationSound", this.comboBoxDashboardNotificationSound.SelectedValue.ToString(), ref errorMessage, false, RegistryValueKind.Unknown);
                if (errorMessage != string.Empty)
                {
                    this.strError = this.strError + "Dashboard notification sound save error: " + errorMessage;
                    flag          = false;
                }
                else
                {
                    this.appManager.m_strDashboardNotificationSound = this.comboBoxDashboardNotificationSound.SelectedValue.ToString();
                    if (this.appManager.m_strDashboardNotificationSound == "None")
                    {
                        this.appManager.m_bPlayDashboardSound = false;
                    }
                    else
                    {
                        this.appManager.m_bPlayDashboardSound = true;
                    }
                }
            }
            catch (Exception exception9)
            {
                this.strError = this.strError + "Dashboard notification sound save error: " + exception9.Message;
                flag          = false;
            }
            try
            {
                AppRegistry.SaveValue(rootKey, "local_DisableDashboardSettingChangeNotifications", this.checkBoxDisableDashboardSettingChangeNotifications.Checked, ref this.strError, false, RegistryValueKind.Unknown);
                if (errorMessage != string.Empty)
                {
                    this.strError = this.strError + "Dashboard Settign Change Notification save error: " + errorMessage;
                    flag          = false;
                }
                else
                {
                    this.appManager.m_bDisableDashboardSettingChangeNotifications = this.checkBoxDisableDashboardSettingChangeNotifications.Checked;
                }
            }
            catch (Exception exception10)
            {
                this.strError = this.strError + "Dashboard Settign Change Notification save error: " + exception10.Message;
                flag          = false;
            }
            if (this.appManager.m_bDashboardMode != this.checkBoxEnableDashboard.Checked)
            {
                this.changeEnableDashbaordMode = MessageBox.Show("You must exit and re-open the " + this.appManager.m_strApplicationName + " application for the change to Dashboard mode to take effect.  Would you like to exit " + this.appManager.m_strApplicationName + " now?", "Multiple Account Mode Change", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
                if (this.changeEnableDashbaordMode == DialogResult.Yes)
                {
                    try
                    {
                        AppRegistry.SaveValue(rootKey, "local_DashboardMode", this.checkBoxEnableDashboard.Checked, ref errorMessage, false, RegistryValueKind.Unknown);
                        if (errorMessage != string.Empty)
                        {
                            this.strError = this.strError + "Enable Dashboard save error: " + errorMessage;
                            flag          = false;
                        }
                        else
                        {
                            AppRegistry.SaveUserName(rootKey, "", ref errorMessage);
                            if (errorMessage != string.Empty)
                            {
                                this.strError = this.strError + "\nUserName Save Error: " + errorMessage;
                            }
                            AppRegistry.SavePassword(rootKey, "", ref errorMessage);
                            if (errorMessage != string.Empty)
                            {
                                this.strError = this.strError + "\nPassword Save Error: " + errorMessage;
                            }
                        }
                    }
                    catch (Exception exception11)
                    {
                        this.strError = this.strError + "Enable Dashboard save error: " + exception11.Message;
                        flag          = false;
                    }
                }
            }
            if (flag)
            {
                if (this.changeEnableDashbaordMode == DialogResult.Yes)
                {
                    Application.Exit();
                }
                else if (this.changeEnableDashbaordMode == DialogResult.No)
                {
                    this.checkBoxEnableDashboard.Checked = this.appManager.m_bDashboardMode;
                }
                else
                {
                    base.Close();
                    if ((this.appManager.formMessages != null) && this.bRefreshMessageForm)
                    {
                        this.appManager.formMessages.Close();
                        this.appManager.ShowMessages();
                    }
                    this.appManager.ShowBalloon("Your settings have been saved.", 5);
                }
            }
            else
            {
                this.appManager.ShowBalloon("Exception saving settings: " + this.strError, 5);
            }
        }
Exemple #15
0
        private void fmEditContact_Load(object sender, EventArgs e)
        {
            this.Text = this.appManager.m_strApplicationName + " Edit Contacts " + this.appManager.FormatPhone(this.appManager.m_strUserName);
            base.Icon = this.appManager.iTextApp;
            int         num     = 0;
            int         num2    = 0;
            RegistryKey rootKey = AppRegistry.GetRootKey(ref this.strError);

            AppRegistry.GetValue(rootKey, "local_FormEditContactWidth", ref num, ref this.strError);
            AppRegistry.GetValue(rootKey, "local_FormEditContactHeight", ref num2, ref this.strError);
            if (num2 != 0)
            {
                base.Height = num2;
            }
            if (num != 0)
            {
                base.Width = num;
            }
            if (!this.appManager.m_bAllowDelete)
            {
                this.buttonDelete.Visible = false;
            }
            if (!this.appManager.m_bAllowBlock)
            {
                this.buttonBlock.Visible = false;
            }
            this.comboBoxContactList.ValueMember   = "id";
            this.comboBoxContactList.DisplayMember = "contact";
            this.comboBoxContactList_Load(string.Empty);
            this.comboBoxGroups_Load(string.Empty);
            this.listBoxSelectedGroups.DrawMode     = DrawMode.OwnerDrawVariable;
            this.listBoxSelectedGroups.MeasureItem += new MeasureItemEventHandler(this.listBoxSelectedGroups_MeasureItem);
            this.listBoxSelectedGroups.DrawItem    += new DrawItemEventHandler(this.listBoxSelectedGroups_DrawItem);
            if (this.bNewContact)
            {
                this.textBoxPhoneNumber.Enabled = true;
                this.textBoxPhoneNumber.Select();
            }
            else
            {
                try
                {
                    this.DisplayContact();
                    this.textBoxFirstName.Select();
                }
                catch (Exception exception)
                {
                    this.strError = "Error getting current contact information: " + exception.Message;
                }
            }
            if (!string.IsNullOrEmpty(this.strError))
            {
                this.appManager.ShowBalloon(this.strError, 5);
                this.strError = string.Empty;
            }
            if (this.appManager.m_bValidateMobileNumbers && this.bNewContact)
            {
                this.textBoxPhoneNumber.Mask = "(000) 000-0000";
            }
            else
            {
                this.textBoxPhoneNumber.Mask = null;
            }
        }