Changeset 19727 for lang/csharp
- Timestamp:
- 09/22/08 17:49:20 (2 months ago)
- Location:
- lang/csharp/MMMMB/MMMMB
- Files:
-
- 3 modified
-
MainForm.cs (modified) (2 diffs)
-
MiniBlogView.Designer.cs (modified) (6 diffs)
-
MiniBlogView.cs (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/csharp/MMMMB/MMMMB/MainForm.cs
r13980 r19727 35 35 // account 36 36 string[] accounts = LoadAccounts(); 37 string[] filters = File.Exists("filters.txt") ? File.ReadAllLines("filters.txt") : new string[]{}; 37 38 foreach (string account in accounts) 38 39 { … … 49 50 view.Logger = logger; 50 51 view.Notify += new MiniBlogView.NotifyEventHandler(view_Notify); 52 view.FilterTemplate = filters; 51 53 view.Reload(); 52 54 -
lang/csharp/MMMMB/MMMMB/MiniBlogView.Designer.cs
r13977 r19727 39 39 this.browserPanel = new System.Windows.Forms.Panel(); 40 40 this.filterPanel = new System.Windows.Forms.Panel(); 41 this.notifyInput = new System.Windows.Forms.TextBox();42 this.allowInput = new System.Windows.Forms.TextBox();43 this.denyInput = new System.Windows.Forms.TextBox();44 41 this.notifyInputLabel = new System.Windows.Forms.Label(); 45 42 this.allowInputLabel = new System.Windows.Forms.Label(); … … 47 44 this.filterCheck = new System.Windows.Forms.CheckBox(); 48 45 this.panel = new System.Windows.Forms.Panel(); 46 this.denyInput = new System.Windows.Forms.ComboBox(); 47 this.allowInput = new System.Windows.Forms.ComboBox(); 48 this.notifyInput = new System.Windows.Forms.ComboBox(); 49 49 this.browserPanel.SuspendLayout(); 50 50 this.filterPanel.SuspendLayout(); … … 148 148 this.filterPanel.TabIndex = 0; 149 149 // 150 // notifyInput151 //152 this.notifyInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)153 | System.Windows.Forms.AnchorStyles.Right)));154 this.notifyInput.Location = new System.Drawing.Point(56, 75);155 this.notifyInput.Name = "notifyInput";156 this.notifyInput.Size = new System.Drawing.Size(318, 19);157 this.notifyInput.TabIndex = 6;158 //159 // allowInput160 //161 this.allowInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)162 | System.Windows.Forms.AnchorStyles.Right)));163 this.allowInput.Location = new System.Drawing.Point(56, 50);164 this.allowInput.Name = "allowInput";165 this.allowInput.Size = new System.Drawing.Size(318, 19);166 this.allowInput.TabIndex = 4;167 this.allowInput.TextChanged += new System.EventHandler(this.filterInput_TextChanged);168 //169 // denyInput170 //171 this.denyInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)172 | System.Windows.Forms.AnchorStyles.Right)));173 this.denyInput.Location = new System.Drawing.Point(56, 25);174 this.denyInput.Name = "denyInput";175 this.denyInput.Size = new System.Drawing.Size(318, 19);176 this.denyInput.TabIndex = 2;177 this.denyInput.TextChanged += new System.EventHandler(this.filterInput_TextChanged);178 //179 150 // notifyInputLabel 180 151 // 181 152 this.notifyInputLabel.AutoSize = true; 182 this.notifyInputLabel.Location = new System.Drawing.Point(3, 78);153 this.notifyInputLabel.Location = new System.Drawing.Point(3, 80); 183 154 this.notifyInputLabel.Name = "notifyInputLabel"; 184 155 this.notifyInputLabel.Size = new System.Drawing.Size(47, 12); … … 189 160 // 190 161 this.allowInputLabel.AutoSize = true; 191 this.allowInputLabel.Location = new System.Drawing.Point(3, 5 3);162 this.allowInputLabel.Location = new System.Drawing.Point(3, 54); 192 163 this.allowInputLabel.Name = "allowInputLabel"; 193 164 this.allowInputLabel.Size = new System.Drawing.Size(47, 12); … … 226 197 this.panel.Size = new System.Drawing.Size(381, 303); 227 198 this.panel.TabIndex = 8; 199 // 200 // denyInput 201 // 202 this.denyInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 203 | System.Windows.Forms.AnchorStyles.Right))); 204 this.denyInput.FormattingEnabled = true; 205 this.denyInput.Location = new System.Drawing.Point(56, 25); 206 this.denyInput.Name = "denyInput"; 207 this.denyInput.Size = new System.Drawing.Size(318, 20); 208 this.denyInput.TabIndex = 2; 209 this.denyInput.TextChanged += new System.EventHandler(this.filterInput_TextChanged); 210 // 211 // allowInput 212 // 213 this.allowInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 214 | System.Windows.Forms.AnchorStyles.Right))); 215 this.allowInput.FormattingEnabled = true; 216 this.allowInput.Location = new System.Drawing.Point(56, 51); 217 this.allowInput.Name = "allowInput"; 218 this.allowInput.Size = new System.Drawing.Size(318, 20); 219 this.allowInput.TabIndex = 4; 220 this.allowInput.TextChanged += new System.EventHandler(this.filterInput_TextChanged); 221 // 222 // notifyInput 223 // 224 this.notifyInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 225 | System.Windows.Forms.AnchorStyles.Right))); 226 this.notifyInput.FormattingEnabled = true; 227 this.notifyInput.Location = new System.Drawing.Point(56, 77); 228 this.notifyInput.Name = "notifyInput"; 229 this.notifyInput.Size = new System.Drawing.Size(318, 20); 230 this.notifyInput.TabIndex = 6; 231 this.notifyInput.TextChanged += new System.EventHandler(this.filterInput_TextChanged); 228 232 // 229 233 // MiniBlogView … … 261 265 private System.Windows.Forms.CheckBox filterCheck; 262 266 private System.Windows.Forms.Panel panel; 263 private System.Windows.Forms.TextBox denyInput;264 267 private System.Windows.Forms.Label denyInputLabel; 265 private System.Windows.Forms.TextBox notifyInput;266 private System.Windows.Forms.TextBox allowInput;267 268 private System.Windows.Forms.Label notifyInputLabel; 268 269 private System.Windows.Forms.Label allowInputLabel; 270 private System.Windows.Forms.ComboBox denyInput; 271 private System.Windows.Forms.ComboBox notifyInput; 272 private System.Windows.Forms.ComboBox allowInput; 269 273 } 270 274 } -
lang/csharp/MMMMB/MMMMB/MiniBlogView.cs
r18564 r19727 91 91 } 92 92 93 public string[] FilterTemplate 94 { 95 set 96 { 97 ComboBox[] combos = { denyInput, allowInput, notifyInput }; 98 foreach (ComboBox combo in combos) 99 { 100 combo.Items.Clear(); 101 combo.Items.Add(""); 102 combo.Items.AddRange(value); 103 } 104 } 105 } 106 93 107 public MiniBlogView() 94 108 { … … 108 122 try 109 123 { 110 Filter notify = Filter.Parse(filterCheck.Checked ? notifyInput.Text: "");124 Filter notify = Filter.Parse(filterCheck.Checked ? InvokeComboText(notifyInput) : ""); 111 125 List<Entry> notifyEntryList = new List<Entry>(); 112 126 int before = entryList.Count; … … 164 178 { 165 179 // filter 166 Filter deny = Filter.Parse(filterCheck.Checked ? denyInput.Text: "");167 Filter allow = Filter.Parse(filterCheck.Checked ? allowInput.Text: "");180 Filter deny = Filter.Parse(filterCheck.Checked ? InvokeComboText(denyInput) : ""); 181 Filter allow = Filter.Parse(filterCheck.Checked ? InvokeComboText(allowInput) : ""); 168 182 StringBuilder sb = new StringBuilder(); 169 183 int count = 0; … … 171 185 { 172 186 Entry e = entryList[i]; 173 bool ok = true; 174 if (0 < allow.Items.Length) ok = allow.IsMatchAny(e); 175 if (0 < deny.Items.Length) ok = !deny.IsMatchAny(e); 176 if (!ok) continue; 187 bool ok_allow = true; 188 bool ok_deny = true; 189 if (0 < allow.Items.Length) ok_allow = allow.IsMatchAny(e); 190 if (0 < deny.Items.Length) ok_deny = !deny.IsMatchAny(e); 191 if (!(ok_allow && ok_deny)) continue; 177 192 if (500 <= count++) break; 178 193 … … 214 229 browser.DocumentText = html; 215 230 } 231 })); 232 } 233 234 private delegate string StringMethodInvoker(); 235 private string InvokeComboText(ComboBox combo) 236 { 237 return (string)this.Invoke(new StringMethodInvoker(delegate() 238 { 239 return combo.Text; 216 240 })); 217 241 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)