Exemplo n.º 1
0
        private void CbxProfilesSelectedIndexChanged(object sender, System.EventArgs e)
        {
            //Load login settings based on what profile is selected
            prefs.LoadSettings(cbxProfiles.Text, "LoginSettings");

            settings = prefs.settings;

            if (!settings.ContainsKey("Error"))
            {
                IDictionaryEnumerator myEnum = settings.GetEnumerator();
                while (myEnum.MoveNext())
                {
                    if (myEnum.Key.ToString() == "SaveLoginInfo")
                    {
                        chkSaveLogin.Checked = setSaveLogin = true;
                    }
                    else if (myEnum.Key.ToString() == "FirstName")
                    {
                        txtFirstName.Text = setFirstName = myEnum.Value.ToString();
                    }
                    else if (myEnum.Key.ToString() == "LastName")
                    {
                        txtLastName.Text = setLastName = myEnum.Value.ToString();
                    }
                    else if (myEnum.Key.ToString() == "LoginLocation")
                    {
                        cbxLocation.Text = setLLocation = myEnum.Value.ToString();
                    }
                }
            }
            else
            {
                IDictionaryEnumerator myEnum = settings.GetEnumerator();
                while (myEnum.MoveNext())
                {
                    if (myEnum.Key.ToString() == "Error")
                    {
                        rtbStatus.Text = "Error loading settings: " + myEnum.Value.ToString();
                    }
                }
            }
            settings.Clear();
            prefs.settings.Clear();
        }
Exemplo n.º 2
0
        public void LoadSettings(string parentnode)
        {
            //Our local load settings, used when we start up the
            //chat/main form.
            prefs.LoadSettings(netcom.LoginOptions.FirstName + "_" + netcom.LoginOptions.LastName, parentnode);

            settings = prefs.settings;

            if (!settings.ContainsKey("Error"))
            {
                IDictionaryEnumerator myEnum = settings.GetEnumerator();
                while (myEnum.MoveNext())
                {
                    if (parentnode == "ChatSettings")
                    {
                        if (myEnum.Key.ToString() == "UseFullName")
                        {
                            if (myEnum.Value.ToString() == "true")
                            {
                                prefs.setUseFullName = true;
                            }
                            else
                            {
                                prefs.setUseFullName = false;
                            }
                        }
                        else if (myEnum.Key.ToString() == "ListUserName")
                        {
                            if (myEnum.Value.ToString() == "true")
                            {
                                prefs.setListUserName = true;
                            }
                            else
                            {
                                prefs.setListUserName = false;
                                UpdateUserList(netcom.LoginOptions.FullName, null, false);
                                UpdateUserList("You", null, false);
                            }
                        }
                    }
                    else if (parentnode == "TimestampSettings")
                    {
                        if (myEnum.Key.ToString() == "ShowIMTimestamps")
                        {
                            if (myEnum.Value.ToString() == "true")
                            {
                                prefs.setIMTimestamps = true;
                            }
                            else
                            {
                                prefs.setIMTimestamps = false;
                            }
                        }
                        else if (myEnum.Key.ToString() == "ShowChatTimestamps")
                        {
                            if (myEnum.Value.ToString() == "true")
                            {
                                prefs.setChatTimestamps = true;
                            }
                            else
                            {
                                prefs.setChatTimestamps = false;
                            }
                        }
                        else if (myEnum.Key.ToString() == "IMTimeZone")
                        {
                            prefs.setIMTimeZ = myEnum.Value.ToString();
                        }
                        else if (myEnum.Key.ToString() == "ChatTimeZone")
                        {
                            prefs.setChatTimeZ = myEnum.Value.ToString();
                        }
                        else if (myEnum.Key.ToString() == "IMStampFormat")
                        {
                            prefs.setIMStampFormat = myEnum.Value.ToString();
                        }
                        else if (myEnum.Key.ToString() == "ChatStampFormat")
                        {
                            prefs.setChatStampFormat = myEnum.Value.ToString();
                        }
                        else if (myEnum.Key.ToString() == "SyncStampSettings")
                        {
                            if (myEnum.Value.ToString() == "true")
                            {
                                prefs.setSyncTimestamps = true;
                            }
                            else
                            {
                                prefs.setSyncTimestamps = false;
                            }
                        }
                    }
                }
            }
            else
            {
                IDictionaryEnumerator myEnum = settings.GetEnumerator();
                while (myEnum.MoveNext())
                {
                    if (myEnum.Key.ToString() == "Error")
                    {
                        //rtbStatus.Text = "Error loading settings: "+myEnum.Value.ToString();
                    }
                }
            }
            settings.Clear();
            prefs.settings.Clear();
        }
Exemplo n.º 3
0
        private void LoadSettings(string parentnode)
        {
            prefs.LoadSettings(user, parentnode);

            settings = prefs.settings;

            if (!settings.ContainsKey("Error"))
            {
                IDictionaryEnumerator myEnum = settings.GetEnumerator();
                while (myEnum.MoveNext())
                {
                    if (parentnode == "ChatSettings")
                    {
                        if (myEnum.Key.ToString() == "UseFullName")
                        {
                            if (myEnum.Value.ToString() == "true")
                            {
                                chkYouName.Checked = prefs.setUseFullName = true;
                            }
                            else
                            {
                                chkYouName.Checked = prefs.setUseFullName = false;
                            }
                        }
                        else if (myEnum.Key.ToString() == "ListUserName")
                        {
                            if (myEnum.Value.ToString() == "true")
                            {
                                chkListUserName.Checked = prefs.setListUserName = true;
                            }
                            else
                            {
                                chkListUserName.Checked = prefs.setListUserName = false;
                            }
                        }
                    }
                    else if (parentnode == "TimestampSettings")
                    {
                        if (myEnum.Key.ToString() == "ShowIMTimestamps")
                        {
                            if (myEnum.Value.ToString() == "true")
                            {
                                chkIMTimestamps.Checked = prefs.setIMTimestamps = true;
                            }
                            else
                            {
                                chkIMTimestamps.Checked = prefs.setIMTimestamps = false;
                            }
                        }
                        else if (myEnum.Key.ToString() == "ShowChatTimestamps")
                        {
                            if (myEnum.Value.ToString() == "true")
                            {
                                chkChatTimestamps.Checked = prefs.setChatTimestamps = true;
                            }
                            else
                            {
                                chkChatTimestamps.Checked = prefs.setChatTimestamps = false;
                            }
                        }
                        else if (myEnum.Key.ToString() == "IMTimeZone")
                        {
                            numIMTimeZ.Text = prefs.setIMTimeZ = myEnum.Value.ToString();
                        }
                        else if (myEnum.Key.ToString() == "ChatTimeZone")
                        {
                            numChatTimeZ.Text = prefs.setChatTimeZ = myEnum.Value.ToString();
                        }
                        else if (myEnum.Key.ToString() == "IMStampFormat")
                        {
                            txtIMStampFormat.Text = prefs.setIMStampFormat = myEnum.Value.ToString();
                        }
                        else if (myEnum.Key.ToString() == "ChatStampFormat")
                        {
                            txtChatStampFormat.Text = prefs.setChatStampFormat = myEnum.Value.ToString();
                        }
                        else if (myEnum.Key.ToString() == "SyncStampSettings")
                        {
                            if (myEnum.Value.ToString() == "true")
                            {
                                chkSyncStamps.Checked = prefs.setSyncTimestamps = true;
                            }
                            else
                            {
                                chkSyncStamps.Checked = prefs.setSyncTimestamps = false;
                            }
                        }
                    }
                }
            }
            else
            {
                IDictionaryEnumerator myEnum = settings.GetEnumerator();
                while (myEnum.MoveNext())
                {
                    if (myEnum.Key.ToString() == "Error")
                    {
                        //rtbStatus.Text = "Error loading settings: "+myEnum.Value.ToString();
                    }
                }
            }
            settings.Clear();
            prefs.settings.Clear();
        }