public MyPreferences(LangCodeEnum lang, ProjectEnum proj, string customproj,
                             Font textFont, bool lowPriority, bool flash, bool beep, bool minimize,
                             bool saveArticleList, decimal timeOut, bool autoSaveEditBox,
                             string autoSaveEditBoxFile, decimal autoSaveEditBoxPeriod, bool suppressUsingAWB)
        {
            InitializeComponent();

            foreach (LangCodeEnum l in Enum.GetValues(typeof(LangCodeEnum)))
            {
                cmboLang.Items.Add(l.ToString().ToLower());
            }

            foreach (ProjectEnum l in Enum.GetValues(typeof(ProjectEnum)))
            {
                cmboProject.Items.Add(l);
            }

            cmboLang.SelectedItem    = lang.ToString().ToLower();
            cmboProject.SelectedItem = proj;

            cmboCustomProject.Items.Clear();
            foreach (string s in Properties.Settings.Default.CustomWikis.Split('|'))
            {
                if (!cmboCustomProject.Items.Contains(s))
                {
                    cmboCustomProject.Items.Add(s);
                }
            }

            cmboCustomProject.Text = customproj;

            TextBoxFont         = textFont;
            LowThreadPriority   = lowPriority;
            PerfFlash           = flash;
            PerfBeep            = beep;
            PerfMinimize        = minimize;
            PerfSaveArticleList = saveArticleList;
            PerfTimeOutLimit    = timeOut;

            PerfAutoSaveEditBoxEnabled = autoSaveEditBox;
            PerfAutoSaveEditBoxFile    = autoSaveEditBoxFile;
            PerfAutoSaveEditBoxPeriod  = autoSaveEditBoxPeriod;

            chkSupressAWB.Enabled = (cmboProject.Text == "custom" || cmboProject.Text == "wikia");
            if (chkSupressAWB.Enabled)
            {
                chkSupressAWB.Checked = suppressUsingAWB;
            }
            else
            {
                chkSupressAWB.Checked = false;
            }

            cmboProject_SelectedIndexChanged(null, null);

            chkAlwaysConfirmExit.Checked = Properties.Settings.Default.DontAskForTerminate;
            PrivacyCheckBox.Checked      = !Properties.Settings.Default.Privacy;
        }
        public MyPreferences(LangCodeEnum lang, ProjectEnum proj, string customproj,
            Font textFont, bool lowPriority, bool flash, bool beep, bool minimize,
            bool saveArticleList, decimal timeOut, bool autoSaveEditBox,
            string autoSaveEditBoxFile, decimal autoSaveEditBoxPeriod, bool suppressUsingAWB,
            bool addUsingAWBOnArticleAction, bool ignoreNoBots, bool falsePositives, 
            bool showTimer)
        {
            InitializeComponent();

            foreach (LangCodeEnum l in Enum.GetValues(typeof(LangCodeEnum)))
                cmboLang.Items.Add(l.ToString().ToLower());

            foreach (ProjectEnum l in Enum.GetValues(typeof(ProjectEnum)))
                cmboProject.Items.Add(l);

            cmboLang.SelectedItem = lang.ToString().ToLower();
            cmboProject.SelectedItem = proj;

            cmboCustomProject.Items.Clear();
            foreach (string s in Properties.Settings.Default.CustomWikis.Split('|'))
            {
                if (!cmboCustomProject.Items.Contains(s))
                    cmboCustomProject.Items.Add(s);
            }

            cmboCustomProject.Text = customproj;

            TextBoxFont = textFont;
            LowThreadPriority = lowPriority;
            PrefFlash = flash;
            PrefBeep = beep;
            PrefMinimize = minimize;
            PrefSaveArticleList = saveArticleList;
            PrefTimeOutLimit = timeOut;

            PrefAutoSaveEditBoxEnabled = autoSaveEditBox;
            PrefAutoSaveEditBoxFile = autoSaveEditBoxFile;
            PrefAutoSaveEditBoxPeriod = autoSaveEditBoxPeriod;
            PrefIgnoreNoBots = ignoreNoBots;
            PrefFalsePositives = falsePositives;
            PrefShowTimer = showTimer;
            PrefAddUsingAWBOnArticleAction = addUsingAWBOnArticleAction;

            chkSupressAWB.Enabled = (cmboProject.Text == "custom" || cmboProject.Text == "wikia");
            if (chkSupressAWB.Enabled)
                PrefSuppressUsingAWB = suppressUsingAWB;
            else
                PrefSuppressUsingAWB = false;

            cmboProject_SelectedIndexChanged(null, null);

            chkAlwaysConfirmExit.Checked = Properties.Settings.Default.AskForTerminate;
            chkPrivacy.Checked = !Properties.Settings.Default.Privacy;
        }
Beispiel #3
0
        public MyPreferences(LangCodeEnum lang, ProjectEnum proj, string customproj,
                             Font textFont, bool lowPriority, bool flash, bool beep, bool minimize,
                             bool saveArticleList, decimal timeOut, bool autoSaveEditBox,
                             string autoSaveEditBoxFile, decimal autoSaveEditBoxPeriod, bool suppressUsingAWB,
                             bool addUsingAWBOnArticleAction, bool ignoreNoBots, bool showTimer, bool usePHP5)
        {
            InitializeComponent();

            foreach (ProjectEnum l in Enum.GetValues(typeof(ProjectEnum)))
            {
                cmboProject.Items.Add(l);
            }

            cmboProject.SelectedItem = proj;

            cmboProject_SelectedIndexChanged(null, null);

            cmboLang.SelectedItem = lang.ToString().ToLower();

            cmboCustomProject.Items.Clear();
            foreach (string s in Properties.Settings.Default.CustomWikis.Split('|'))
            {
                if (!cmboCustomProject.Items.Contains(s))
                {
                    cmboCustomProject.Items.Add(s);
                }
            }

            cmboCustomProject.Text = customproj;

            chkPHP5Ext.Checked = usePHP5;

            TextBoxFont         = textFont;
            LowThreadPriority   = lowPriority;
            PrefFlash           = flash;
            PrefBeep            = beep;
            PrefMinimize        = minimize;
            PrefSaveArticleList = saveArticleList;
            PrefTimeOutLimit    = timeOut;

            PrefAutoSaveEditBoxEnabled = autoSaveEditBox;
            PrefAutoSaveEditBoxFile    = autoSaveEditBoxFile;
            PrefAutoSaveEditBoxPeriod  = autoSaveEditBoxPeriod;
            PrefIgnoreNoBots           = ignoreNoBots;
            PrefShowTimer = showTimer;
            PrefAddUsingAWBOnArticleAction = addUsingAWBOnArticleAction;

            chkSupressAWB.Enabled = (cmboProject.Text == "custom" || cmboProject.Text == "wikia");

            PrefSuppressUsingAWB = chkSupressAWB.Enabled && suppressUsingAWB;

            chkAlwaysConfirmExit.Checked = Properties.Settings.Default.AskForTerminate;
            chkPrivacy.Checked           = !Properties.Settings.Default.Privacy;
        }
 /// <summary>
 /// Returns the provided language code as a string
 /// (Underscore as shown in enum, to hyphen representation)
 /// </summary>
 /// <param name="lang">Language Code to convert to string</param>
 /// <returns>String representation of the current language code</returns>
 public static string LangCodeEnumString(LangCodeEnum lang)
 {
     return lang.ToString().Replace('_', '-').ToLower();
 }
 /// <summary>
 /// Returns the provided language code as a string
 /// (Underscore as shown in enum, to hyphen representation)
 /// </summary>
 /// <param name="lang">Language Code to convert to string</param>
 /// <returns>String representation of the current language code</returns>
 public static string LangCodeEnumString(LangCodeEnum lang)
 {
     return(lang.ToString().Replace('_', '-').ToLower());
 }