Пример #1
0
        public void Init()
        {
            string configstring = WatcherEngine.Configuration.GetConfigItem(watchercheck, "Filter", "True");

            if (configstring == "True")
            {
                enablefiltercheckBox.CheckState = CheckState.Checked;
            }
            else
            {
                enablefiltercheckBox.CheckState = CheckState.Unchecked;
            }
            configstring = WatcherEngine.Configuration.GetConfigItem(watchercheck, "CookieList");
            if (!String.IsNullOrEmpty(configstring))
            {
                char[] splitter = new char[1];
                splitter[0] = ',';
                string[] errorlist = configstring.Split(splitter);
                this.cookiechecklistBox.BeginUpdate();
                for (int i = 0; i < errorlist.Length; i++)
                {
                    //Items are stored encoded
                    ListViewItem message = new ListViewItem(Watcher.Utility.Base64Decode(errorlist[i]));
                    this.cookiechecklistBox.Items.Add(message);
                    this.cookiechecklistBox.Text = "";
                }
            }
            watchercheck.UpdateWordList();
            configstring = WatcherEngine.Configuration.GetConfigItem(watchercheck, "CookieFilterType", "Inclusive Filter");
            if (configstring == "Inclusive Filter")
            {
                this.filtertypecomboBox.SelectedItem = configstring;
                this.lblCookies.Text = "Cookies to analyze:";
            }
            else
            {
                this.filtertypecomboBox.SelectedItem = configstring;
                this.lblCookies.Text = "Cookies to ignore:";
            }
        }
Пример #2
0
        private void addbutton_Click(object sender, EventArgs e)
        {
            string stringcheckMessageText = this.stringcheckentrytextBox.Text.Trim();

            if (stringcheckMessageText.Length <= 0)
            {
                return;
            }

            ListViewItem message = new ListViewItem(stringcheckMessageText);

            this.stringchecklistBox.BeginUpdate();

            // skip duplicates
            if (!this.stringchecklistBox.Items.Contains(message))
            {
                this.stringchecklistBox.Items.Add(message);
                this.stringchecklistBox.Text = "";
            }
            else
            {
                MessageBox.Show("\"" + stringcheckMessageText + "\" is already in the word list", "Error");
            }

            this.stringchecklistBox.EndUpdate();

            List <string> tempstring = new List <string>();

            foreach (ListViewItem item in this.stringchecklistBox.Items)
            {
                tempstring.Add(Watcher.Utility.Base64Encode(item.Text));
            }
            WatcherEngine.Configuration.SetConfigItem(watchercheck, "stringcheckList", (String)String.Join(",", tempstring.ToArray()));

            this.stringcheckentrytextBox.Text = "";
            watchercheck.UpdateWordList();
        }