Changeset 11290 for lang/csharp

Show
Ignore:
Timestamp:
05/09/08 13:50:32 (7 months ago)
Author:
poolmmjp
Message:
  • ウィンドウの位置・サイズを保存するようにした
  • 更新時、データに変化が無い場合は再描画しないようにした
  • タスクトレイにアイコンを表示した
  • フィルタ機能 (拒否、許可、通知) に対応した
Location:
lang/csharp/MMMMB/MMMMB
Files:
3 added
6 modified

Legend:

Unmodified
Added
Removed
  • lang/csharp/MMMMB/MMMMB/MMMMB.csproj

    r10785 r11290  
    7979    </Compile> 
    8080    <Compile Include="MiniBlogs\Twitter.cs" /> 
     81    <Compile Include="Properties\Settings.Designer.cs"> 
     82      <AutoGen>True</AutoGen> 
     83      <DesignTimeSharedInput>True</DesignTimeSharedInput> 
     84      <DependentUpon>Settings.settings</DependentUpon> 
     85    </Compile> 
    8186    <Compile Include="Settings.cs" /> 
    8287    <Compile Include="Template.cs" /> 
    8388  </ItemGroup> 
    8489  <ItemGroup> 
     90    <None Include="app.config" /> 
    8591    <None Include="item.template"> 
    8692      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 
     
    8894    <None Include="main.template"> 
    8995      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 
     96    </None> 
     97    <None Include="Properties\Settings.settings"> 
     98      <Generator>SettingsSingleFileGenerator</Generator> 
     99      <LastGenOutput>Settings.Designer.cs</LastGenOutput> 
    90100    </None> 
    91101    <None Include="Resources\busy.gif" /> 
  • lang/csharp/MMMMB/MMMMB/MainForm.Designer.cs

    r10019 r11290  
    2929        private void InitializeComponent() 
    3030        { 
     31            this.components = new System.ComponentModel.Container(); 
    3132            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); 
    3233            this.tab = new System.Windows.Forms.TabControl(); 
     34            this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components); 
     35            this.notifyMenu = new System.Windows.Forms.ContextMenuStrip(this.components); 
     36            this.openMenu = new System.Windows.Forms.ToolStripMenuItem(); 
     37            this.notifyMenuSeparator = new System.Windows.Forms.ToolStripSeparator(); 
     38            this.exitMenu = new System.Windows.Forms.ToolStripMenuItem(); 
     39            this.notifyMenu.SuspendLayout(); 
    3340            this.SuspendLayout(); 
    3441            //  
     
    4249            this.tab.TabIndex = 0; 
    4350            //  
     51            // notifyIcon 
     52            //  
     53            this.notifyIcon.ContextMenuStrip = this.notifyMenu; 
     54            this.notifyIcon.Visible = true; 
     55            this.notifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon_MouseDoubleClick); 
     56            //  
     57            // notifyMenu 
     58            //  
     59            this.notifyMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 
     60            this.openMenu, 
     61            this.notifyMenuSeparator, 
     62            this.exitMenu}); 
     63            this.notifyMenu.Name = "notifyMenu"; 
     64            this.notifyMenu.Size = new System.Drawing.Size(153, 76); 
     65            //  
     66            // openMenu 
     67            //  
     68            this.openMenu.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Bold); 
     69            this.openMenu.Name = "openMenu"; 
     70            this.openMenu.Size = new System.Drawing.Size(152, 22); 
     71            this.openMenu.Text = "開く(&O)"; 
     72            this.openMenu.Click += new System.EventHandler(this.openMenu_Click); 
     73            //  
     74            // notifyMenuSeparator 
     75            //  
     76            this.notifyMenuSeparator.Name = "notifyMenuSeparator"; 
     77            this.notifyMenuSeparator.Size = new System.Drawing.Size(149, 6); 
     78            //  
     79            // exitMenu 
     80            //  
     81            this.exitMenu.Name = "exitMenu"; 
     82            this.exitMenu.Size = new System.Drawing.Size(152, 22); 
     83            this.exitMenu.Text = "終了(&X)"; 
     84            this.exitMenu.Click += new System.EventHandler(this.exitMenu_Click); 
     85            //  
    4486            // MainForm 
    4587            //  
     
    4991            this.Controls.Add(this.tab); 
    5092            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 
     93            this.Location = new System.Drawing.Point(100, 100); 
    5194            this.Name = "MainForm"; 
    5295            this.Padding = new System.Windows.Forms.Padding(3); 
    5396            this.Text = "MMMMB"; 
     97            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); 
    5498            this.Load += new System.EventHandler(this.MainForm_Load); 
     99            this.notifyMenu.ResumeLayout(false); 
    55100            this.ResumeLayout(false); 
    56101 
     
    60105 
    61106        private System.Windows.Forms.TabControl tab; 
     107        private System.Windows.Forms.NotifyIcon notifyIcon; 
     108        private System.Windows.Forms.ContextMenuStrip notifyMenu; 
     109        private System.Windows.Forms.ToolStripMenuItem openMenu; 
     110        private System.Windows.Forms.ToolStripSeparator notifyMenuSeparator; 
     111        private System.Windows.Forms.ToolStripMenuItem exitMenu; 
    62112    } 
    63113} 
  • lang/csharp/MMMMB/MMMMB/MainForm.cs

    r10019 r11290  
    2121        private void MainForm_Load(object sender, EventArgs e) 
    2222        { 
     23            // bounds 
     24            this.Location = Properties.Settings.Default.MainFormLocation; 
     25            this.Size = Properties.Settings.Default.MainFormClientSize; 
     26 
     27            // notifyIcon 
     28            notifyIcon.Icon = this.Icon; 
     29            notifyIcon.Text = Application.ProductName; 
     30            notifyIcon.Visible = true; 
     31 
     32            // logger 
    2333            ILogger logger = new FileLogger(); 
     34 
     35            // account 
    2436            string[] accounts = LoadAccounts(); 
    2537            foreach (string account in accounts) 
     
    3547                view.Prompt = miniblog.Prompt; 
    3648                view.Logger = logger; 
     49                view.Notify += new MiniBlogView.NotifyEventHandler(view_Notify); 
    3750                view.Reload(); 
    3851 
     
    8194        } 
    8295 
     96        private void view_Notify(IMiniBlog service, Entry[] entries) 
     97        { 
     98            List<String> msg = new List<string>(); 
     99            foreach (Entry e in entries) 
     100            { 
     101                msg.Add(e.Name + ":\n" + e.Content + "\n"); 
     102            } 
     103            notifyIcon.ShowBalloonTip(1000, service.ServiceName + ":" + service.Username, String.Join("\n", msg.ToArray()), ToolTipIcon.Info); 
     104        } 
     105 
    83106        private string[] LoadAccounts() 
    84107        { 
    85108            return File.ReadAllLines("accounts.config.txt"); 
    86109        } 
     110 
     111        private void MainForm_FormClosing(object sender, FormClosingEventArgs e) 
     112        { 
     113            if (this.WindowState == FormWindowState.Normal) 
     114            { 
     115                Properties.Settings.Default.MainFormLocation = this.Bounds.Location; 
     116                Properties.Settings.Default.MainFormClientSize = this.Bounds.Size; 
     117            } 
     118            else 
     119            { 
     120                Properties.Settings.Default.MainFormLocation = this.RestoreBounds.Location; 
     121                Properties.Settings.Default.MainFormClientSize = this.RestoreBounds.Size; 
     122            } 
     123            Properties.Settings.Default.Save(); 
     124        } 
     125 
     126        private void notifyIcon_MouseDoubleClick(object sender, MouseEventArgs e) 
     127        { 
     128            openMenu.PerformClick(); 
     129        } 
     130 
     131        private void openMenu_Click(object sender, EventArgs e) 
     132        { 
     133            this.Activate(); 
     134        } 
     135 
     136        private void exitMenu_Click(object sender, EventArgs e) 
     137        { 
     138            this.Close(); 
     139        } 
    87140    } 
    88141} 
  • lang/csharp/MMMMB/MMMMB/MainForm.resx

    r10019 r11290  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 
    119119  </resheader> 
     120  <metadata name="notifyIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
     121    <value>17, 17</value> 
     122  </metadata> 
     123  <metadata name="notifyMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
     124    <value>119, 17</value> 
     125  </metadata> 
    120126  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
    121127  <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> 
  • lang/csharp/MMMMB/MMMMB/MiniBlogView.Designer.cs

    r10019 r11290  
    3838            this.browser = new System.Windows.Forms.WebBrowser(); 
    3939            this.browserPanel = new System.Windows.Forms.Panel(); 
     40            this.filterPanel = new System.Windows.Forms.Panel(); 
     41            this.panel = new System.Windows.Forms.Panel(); 
     42            this.filterCheck = new System.Windows.Forms.CheckBox(); 
     43            this.denyInputLabel = new System.Windows.Forms.Label(); 
     44            this.denyInput = new System.Windows.Forms.TextBox(); 
     45            this.allowInput = new System.Windows.Forms.TextBox(); 
     46            this.allowInputLabel = new System.Windows.Forms.Label(); 
     47            this.notifyInput = new System.Windows.Forms.TextBox(); 
     48            this.notifyInputLabel = new System.Windows.Forms.Label(); 
    4049            this.browserPanel.SuspendLayout(); 
     50            this.filterPanel.SuspendLayout(); 
     51            this.panel.SuspendLayout(); 
    4152            this.SuspendLayout(); 
    4253            //  
     
    5061            this.contentInput.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; 
    5162            this.contentInput.Size = new System.Drawing.Size(381, 60); 
    52             this.contentInput.TabIndex = 1; 
     63            this.contentInput.TabIndex = 2; 
    5364            this.contentInput.TextChanged += new System.EventHandler(this.contentInput_TextChanged); 
    5465            this.contentInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.contentInput_KeyDown); 
     
    7182            this.reloadButton.Name = "reloadButton"; 
    7283            this.reloadButton.Size = new System.Drawing.Size(60, 23); 
    73             this.reloadButton.TabIndex = 5; 
     84            this.reloadButton.TabIndex = 4; 
    7485            this.reloadButton.Text = "更新(&R)"; 
    7586            this.reloadButton.UseVisualStyleBackColor = true; 
     
    97108            this.lengthLabel.Name = "lengthLabel"; 
    98109            this.lengthLabel.Size = new System.Drawing.Size(87, 12); 
    99             this.lengthLabel.TabIndex = 2; 
     110            this.lengthLabel.TabIndex = 1; 
    100111            this.lengthLabel.Text = "0 文字"; 
    101112            this.lengthLabel.TextAlign = System.Drawing.ContentAlignment.TopRight; 
     
    107118            this.browser.MinimumSize = new System.Drawing.Size(20, 20); 
    108119            this.browser.Name = "browser"; 
    109             this.browser.Size = new System.Drawing.Size(377, 299); 
    110             this.browser.TabIndex = 6; 
     120            this.browser.Size = new System.Drawing.Size(377, 274); 
     121            this.browser.TabIndex = 0; 
    111122            //  
    112123            // browserPanel 
    113124            //  
    114             this.browserPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    115                         | System.Windows.Forms.AnchorStyles.Left) 
    116                         | System.Windows.Forms.AnchorStyles.Right))); 
    117125            this.browserPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; 
    118126            this.browserPanel.Controls.Add(this.browser); 
    119             this.browserPanel.Location = new System.Drawing.Point(0, 104); 
     127            this.browserPanel.Dock = System.Windows.Forms.DockStyle.Fill; 
     128            this.browserPanel.Location = new System.Drawing.Point(0, 25); 
    120129            this.browserPanel.Name = "browserPanel"; 
    121             this.browserPanel.Size = new System.Drawing.Size(381, 303); 
     130            this.browserPanel.Size = new System.Drawing.Size(381, 278); 
    122131            this.browserPanel.TabIndex = 7; 
     132            //  
     133            // filterPanel 
     134            //  
     135            this.filterPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; 
     136            this.filterPanel.Controls.Add(this.notifyInput); 
     137            this.filterPanel.Controls.Add(this.allowInput); 
     138            this.filterPanel.Controls.Add(this.denyInput); 
     139            this.filterPanel.Controls.Add(this.notifyInputLabel); 
     140            this.filterPanel.Controls.Add(this.allowInputLabel); 
     141            this.filterPanel.Controls.Add(this.denyInputLabel); 
     142            this.filterPanel.Controls.Add(this.filterCheck); 
     143            this.filterPanel.Dock = System.Windows.Forms.DockStyle.Top; 
     144            this.filterPanel.Location = new System.Drawing.Point(0, 0); 
     145            this.filterPanel.Name = "filterPanel"; 
     146            this.filterPanel.Size = new System.Drawing.Size(381, 25); 
     147            this.filterPanel.TabIndex = 0; 
     148            //  
     149            // panel 
     150            //  
     151            this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     152                        | System.Windows.Forms.AnchorStyles.Left) 
     153                        | System.Windows.Forms.AnchorStyles.Right))); 
     154            this.panel.Controls.Add(this.browserPanel); 
     155            this.panel.Controls.Add(this.filterPanel); 
     156            this.panel.Location = new System.Drawing.Point(0, 104); 
     157            this.panel.Name = "panel"; 
     158            this.panel.Size = new System.Drawing.Size(381, 303); 
     159            this.panel.TabIndex = 8; 
     160            //  
     161            // filterCheck 
     162            //  
     163            this.filterCheck.AutoSize = true; 
     164            this.filterCheck.Location = new System.Drawing.Point(3, 3); 
     165            this.filterCheck.Name = "filterCheck"; 
     166            this.filterCheck.Size = new System.Drawing.Size(72, 16); 
     167            this.filterCheck.TabIndex = 0; 
     168            this.filterCheck.Text = "フィルタ(&F)"; 
     169            this.filterCheck.UseVisualStyleBackColor = true; 
     170            this.filterCheck.CheckedChanged += new System.EventHandler(this.filterCheck_CheckedChanged); 
     171            //  
     172            // denyInputLabel 
     173            //  
     174            this.denyInputLabel.AutoSize = true; 
     175            this.denyInputLabel.Location = new System.Drawing.Point(3, 28); 
     176            this.denyInputLabel.Name = "denyInputLabel"; 
     177            this.denyInputLabel.Size = new System.Drawing.Size(47, 12); 
     178            this.denyInputLabel.TabIndex = 1; 
     179            this.denyInputLabel.Text = "拒否(&D):"; 
     180            //  
     181            // denyInput 
     182            //  
     183            this.denyInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     184                        | System.Windows.Forms.AnchorStyles.Right))); 
     185            this.denyInput.Location = new System.Drawing.Point(56, 25); 
     186            this.denyInput.Name = "denyInput"; 
     187            this.denyInput.Size = new System.Drawing.Size(318, 19); 
     188            this.denyInput.TabIndex = 2; 
     189            this.denyInput.TextChanged += new System.EventHandler(this.filterInput_TextChanged); 
     190            //  
     191            // allowInput 
     192            //  
     193            this.allowInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     194                        | System.Windows.Forms.AnchorStyles.Right))); 
     195            this.allowInput.Location = new System.Drawing.Point(56, 50); 
     196            this.allowInput.Name = "allowInput"; 
     197            this.allowInput.Size = new System.Drawing.Size(318, 19); 
     198            this.allowInput.TabIndex = 4; 
     199            this.allowInput.TextChanged += new System.EventHandler(this.filterInput_TextChanged); 
     200            //  
     201            // allowInputLabel 
     202            //  
     203            this.allowInputLabel.AutoSize = true; 
     204            this.allowInputLabel.Location = new System.Drawing.Point(3, 53); 
     205            this.allowInputLabel.Name = "allowInputLabel"; 
     206            this.allowInputLabel.Size = new System.Drawing.Size(47, 12); 
     207            this.allowInputLabel.TabIndex = 3; 
     208            this.allowInputLabel.Text = "許可(&A):"; 
     209            //  
     210            // notifyInput 
     211            //  
     212            this.notifyInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     213                        | System.Windows.Forms.AnchorStyles.Right))); 
     214            this.notifyInput.Location = new System.Drawing.Point(56, 75); 
     215            this.notifyInput.Name = "notifyInput"; 
     216            this.notifyInput.Size = new System.Drawing.Size(318, 19); 
     217            this.notifyInput.TabIndex = 6; 
     218            //  
     219            // notifyInputLabel 
     220            //  
     221            this.notifyInputLabel.AutoSize = true; 
     222            this.notifyInputLabel.Location = new System.Drawing.Point(3, 78); 
     223            this.notifyInputLabel.Name = "notifyInputLabel"; 
     224            this.notifyInputLabel.Size = new System.Drawing.Size(47, 12); 
     225            this.notifyInputLabel.TabIndex = 5; 
     226            this.notifyInputLabel.Text = "通知(&N):"; 
    123227            //  
    124228            // MiniBlogView 
     
    126230            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 
    127231            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 
    128             this.Controls.Add(this.browserPanel); 
     232            this.Controls.Add(this.panel); 
    129233            this.Controls.Add(this.reloadButton); 
    130234            this.Controls.Add(this.postButton); 
     
    135239            this.Size = new System.Drawing.Size(381, 407); 
    136240            this.browserPanel.ResumeLayout(false); 
     241            this.filterPanel.ResumeLayout(false); 
     242            this.filterPanel.PerformLayout(); 
     243            this.panel.ResumeLayout(false); 
    137244            this.ResumeLayout(false); 
    138245            this.PerformLayout(); 
     
    150257        private System.Windows.Forms.WebBrowser browser; 
    151258        private System.Windows.Forms.Panel browserPanel; 
     259        private System.Windows.Forms.Panel filterPanel; 
     260        private System.Windows.Forms.CheckBox filterCheck; 
     261        private System.Windows.Forms.Panel panel; 
     262        private System.Windows.Forms.TextBox denyInput; 
     263        private System.Windows.Forms.Label denyInputLabel; 
     264        private System.Windows.Forms.TextBox notifyInput; 
     265        private System.Windows.Forms.TextBox allowInput; 
     266        private System.Windows.Forms.Label notifyInputLabel; 
     267        private System.Windows.Forms.Label allowInputLabel; 
    152268    } 
    153269} 
  • lang/csharp/MMMMB/MMMMB/MiniBlogView.cs

    r11284 r11290  
    66using System.Data; 
    77using System.Text; 
     8using System.Text.RegularExpressions; 
    89using System.Windows.Forms; 
    910using System.Threading; 
     
    1516    public partial class MiniBlogView : UserControl 
    1617    { 
     18        private class Filter 
     19        { 
     20            public static Filter Parse(string source) 
     21            { 
     22                Filter f = new Filter(); 
     23                source = source.Trim(); 
     24                f.Items = (0 < source.Length) ? Regex.Split(source, @" +") : new string[] { }; 
     25                return f; 
     26            } 
     27 
     28            private string[] items; 
     29            public string[] Items 
     30            { 
     31                get { return items; } 
     32                set { items = value; } 
     33            } 
     34 
     35            public bool IsMatchAny(Entry entry) 
     36            { 
     37                foreach (string item in items) 
     38                { 
     39                    if (item.Length == 0) continue; 
     40                    if (entry.Name.ToLower().Contains(item.ToLower()) || entry.Content.ToLower().Contains(item.ToLower())) return true; 
     41                } 
     42                return false; 
     43            } 
     44 
     45            public bool IsMatchAll(Entry entry) 
     46            { 
     47                if (items.Length == 0) return true; 
     48                foreach (string item in items) 
     49                { 
     50                    if (item.Length == 0) continue; 
     51                    if (!entry.Name.ToLower().Contains(item.ToLower()) && !entry.Content.ToLower().Contains(item.ToLower())) return false; 
     52                } 
     53                return true; 
     54            } 
     55        } 
     56 
     57        public delegate void NotifyEventHandler(IMiniBlog service, Entry[] entries); 
     58        public event NotifyEventHandler Notify; 
     59 
    1760        private List<Entry> entryList = new List<Entry>(); 
    1861        private int scrollY = 0; 
     
    5598                try 
    5699                { 
     100                    Filter notify = Filter.Parse(filterCheck.Checked ? notifyInput.Text : ""); 
     101                    List<Entry> notifyEntryList = new List<Entry>(); 
     102                    int before = entryList.Count; 
    57103                    List<Entry> newEntryList = miniBlog.GetLatestEntryList(); 
    58104                    newEntryList.Reverse(); 
     
    70116                        } 
    71117 
    72                         // �V��������烊�X�g�ɒlj� 
    73                         if (isNew) entryList.Insert(0, new_e); 
     118                        // �V���������                        if (isNew) 
     119                        { 
     120                            // ���X�g�ɒlj� 
     121                            entryList.Insert(0, new_e); 
     122                            // �ʒm�Ώ� 
     123                            if (0 < notify.Items.Length && notify.IsMatchAny(new_e)) notifyEntryList.Add(new_e); 
     124                        } 
    74125                    } 
    75  
    76                     StringBuilder items = new StringBuilder(); 
    77                     foreach (Entry e in entryList) 
    78                     { 
    79                         Template item = new Template("item"); 
    80                         item.SetValue("permalink", e.Permalink.ToString()); 
    81                         item.SetValue("image", e.Image.ToString()); 
    82                         item.SetValue("name", e.Name); 
    83                         item.SetValue("content", e.Content); 
    84                         item.SetValue("time", toShortDate(e.Date)); 
    85                         items.Append(item.ToString()); 
    86                     } 
    87                     Template main = new Template("main"); 
    88                     main.SetValue("items", items.ToString()); 
    89                     main.SetValue("scroll", scrollY.ToString()); 
    90                     main.SetValue("servicename", miniBlog.ServiceName); 
    91                     string html = main.ToString(); 
    92  
     126                    if (before == entryList.Count) return;  // �ω��������ꍇ�͔����� 
     127                    // �`��                    string html = GenerateHtml(); 
    93128                    this.Invoke(new MethodInvoker(delegate() 
    94129                    { 
    95130                        browser.DocumentText = html; 
    96131                    })); 
     132 
     133                    // �ʒm 
     134                    if (0 < notifyEntryList.Count) this.Notify(this.miniBlog, notifyEntryList.ToArray()); 
    97135                } 
    98136                catch (Exception ex) 
     
    109147                } 
    110148            }).Start(); 
     149        } 
     150 
     151        private string GenerateHtml() 
     152        { 
     153            // filter 
     154            Filter deny = Filter.Parse(filterCheck.Checked ? denyInput.Text : ""); 
     155            Filter allow = Filter.Parse(filterCheck.Checked ? allowInput.Text : ""); 
     156            StringBuilder sb = new StringBuilder(); 
     157            foreach (Entry e in entryList) 
     158            { 
     159                bool ok = true; 
     160                if(0 < allow.Items.Length) ok = allow.IsMatchAny(e); 
     161                if(0 < deny.Items.Length) ok = !deny.IsMatchAny(e); 
     162                if (!ok) continue; 
     163 
     164                Template item = new Template("item"); 
     165                item.SetValue("permalink", e.Permalink.ToString()); 
     166                item.SetValue("image", e.Image.ToString()); 
     167                item.SetValue("name", e.Name); 
     168                item.SetValue("content", e.Content); 
     169                item.SetValue("time", toShortDate(e.Date)); 
     170                sb.Append(item.ToString()); 
     171            } 
     172            Template main = new Template("main"); 
     173            main.SetValue("items", sb.ToString()); 
     174            main.SetValue("scroll", scrollY.ToString()); 
     175            main.SetValue("servicename", miniBlog.ServiceName); 
     176            return main.ToString(); 
    111177        } 
    112178 
     
    210276            if (e.Modifiers == Keys.Control && e.KeyCode == Keys.A) contentInput.SelectAll(); 
    211277        } 
     278 
     279        private void filterCheck_CheckedChanged(object sender, EventArgs e) 
     280        { 
     281            filterPanel.Height = (filterCheck.Checked) ? 102 : 25; 
     282        } 
     283 
     284        private Thread filterThread; 
     285        private void filterInput_TextChanged(object sender, EventArgs e) 
     286        { 
     287            // 300 �~���b�҂�Ă����B���^��p���� 
     288            // �҂�Ă��Ɏ��̃L�[��������҂�Ă鏈��������Z�����A 
     289            // �҂‚Ƃ��납���蒼���B 
     290 
     291            if (filterThread != null && filterThread.IsAlive) 
     292            { 
     293                filterThread.Abort(); 
     294            } 
     295 
     296            filterThread = new Thread(delegate() 
     297            { 
     298                Thread.Sleep(300); 
     299                try 
     300                { 
     301                    this.Invoke(new MethodInvoker(delegate() 
     302                    { 
     303                        browser.DocumentText = GenerateHtml(); 
     304                    })); 
     305                } 
     306                finally 
     307                { 
     308                } 
     309            }); 
     310            filterThread.Start(); 
     311        } 
    212312    } 
    213313}