Changeset 860
- Timestamp:
- 10/30/07 03:04:24 (6 years ago)
- Location:
- lang/csharp/IrcSendOnly
- Files:
-
- 5 modified
-
Form1.cs (modified) (13 diffs)
-
Form1.resx (modified) (1 diff)
-
IRCClient.cs (modified) (2 diffs)
-
IRCListener.cs (modified) (1 diff)
-
IrcSend.csproj (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/csharp/IrcSendOnly/Form1.cs
r844 r860 26 26 private System.Windows.Forms.ImageList imageListToggleBtns; 27 27 private int mExpHeight; 28 private System.Windows.Forms.Button buttonClear; 28 29 private int mOriginalWidth; 30 private System.Windows.Forms.CheckBox checkBoxPause; 31 private bool mPauseLog; 32 private System.Windows.Forms.Timer timerLogFlush; 33 34 private ChatLogger mLogger; 29 35 30 36 public IrcSendAppForm() … … 32 38 InitializeComponent(); 33 39 40 } 41 42 private void IrcSendAppForm_Load(object sender, System.EventArgs e) 43 { 34 44 this.Activated += new EventHandler(IrcSendAppForm_Activated); 35 45 this.Deactivate += new EventHandler(IrcSendAppForm_Deactivate); 46 mLogger = new ChatLogger("chatlog.html"); 36 47 37 48 comboBox1.Enabled = false; … … 40 51 mExpHeight = 296; 41 52 mOriginalWidth = 400; 53 mPauseLog = false; 42 54 43 55 // TODO: InitializeComponent �Ăяo���̌��A�R���X�g���N�^ �R�[�h�����Ă��������B … … 48 60 mExpanded = true; 49 61 mLogExpanded = true; 50 hideLogForm(); 51 shrinkForm(); 52 } 62 expandLogForm(); 63 expandForm(); 64 65 timerLogFlush.Start(); 66 67 } 68 53 69 54 70 /// <summary> … … 62 78 mIRC.stop(); 63 79 80 if (mLogger != null) 81 { 82 mLogger.Dispose(); 83 mLogger = null; 84 } 85 64 86 if (components != null) 65 87 components.Dispose(); … … 81 103 } 82 104 105 public void myMessageSent(string aChannel, string aNick, string aMessage) 106 { 107 channelMessageArrived(aChannel, aNick, aMessage); 108 } 109 83 110 public void anyMessageArrived(string aMessage) 84 111 { 112 if (mPauseLog) 113 return; 114 85 115 lock(this.textBoxLog) 86 116 { 87 117 textBoxLog.Text += aMessage+"\r\n"; 88 118 89 if (mLogExpanded && mExpanded) 90 { 91 textBoxLog.SelectionStart = textBoxLog.Text.Length-1; 92 textBoxLog.ScrollToCaret(); 93 } 119 textBoxLog.SelectionStart = textBoxLog.Text.Length-1; 120 textBoxLog.ScrollToCaret(); 94 121 } 95 122 } … … 97 124 public void channelMessageArrived(string aChannel, string aNick, string aMessage) 98 125 { 126 lock(mLogger) 127 { 128 mLogger.addChannelMessage(aChannel, aNick, aMessage); 129 } 130 99 131 lock(Text) 100 132 { … … 117 149 this.textBoxLog = new System.Windows.Forms.TextBox(); 118 150 this.imageListToggleBtns = new System.Windows.Forms.ImageList(this.components); 151 this.buttonClear = new System.Windows.Forms.Button(); 152 this.checkBoxPause = new System.Windows.Forms.CheckBox(); 153 this.timerLogFlush = new System.Windows.Forms.Timer(this.components); 119 154 this.SuspendLayout(); 120 155 // … … 164 199 this.textBoxLog.ReadOnly = true; 165 200 this.textBoxLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; 166 this.textBoxLog.Size = new System.Drawing.Size(392, 2 40);201 this.textBoxLog.Size = new System.Drawing.Size(392, 223); 167 202 this.textBoxLog.TabIndex = 4; 168 203 this.textBoxLog.Text = ""; … … 174 209 this.imageListToggleBtns.TransparentColor = System.Drawing.Color.Transparent; 175 210 // 211 // buttonClear 212 // 213 this.buttonClear.Location = new System.Drawing.Point(3, 249); 214 this.buttonClear.Name = "buttonClear"; 215 this.buttonClear.Size = new System.Drawing.Size(192, 20); 216 this.buttonClear.TabIndex = 5; 217 this.buttonClear.Text = "Clear"; 218 this.buttonClear.Click += new System.EventHandler(this.buttonClear_Click); 219 // 220 // checkBoxPause 221 // 222 this.checkBoxPause.Appearance = System.Windows.Forms.Appearance.Button; 223 this.checkBoxPause.Location = new System.Drawing.Point(199, 249); 224 this.checkBoxPause.Name = "checkBoxPause"; 225 this.checkBoxPause.Size = new System.Drawing.Size(192, 20); 226 this.checkBoxPause.TabIndex = 6; 227 this.checkBoxPause.Text = "Stop"; 228 this.checkBoxPause.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 229 this.checkBoxPause.CheckedChanged += new System.EventHandler(this.checkBoxPause_CheckedChanged); 230 // 231 // timerLogFlush 232 // 233 this.timerLogFlush.Interval = 5000; 234 this.timerLogFlush.Tick += new System.EventHandler(this.timerLogFlush_Tick); 235 // 176 236 // IrcSendAppForm 177 237 // … … 179 239 this.ClientSize = new System.Drawing.Size(394, 270); 180 240 this.ControlBox = false; 241 this.Controls.Add(this.checkBoxPause); 242 this.Controls.Add(this.buttonClear); 181 243 this.Controls.Add(this.textBoxLog); 182 244 this.Controls.Add(this.buttonToggle); … … 189 251 this.Text = "IrcSend"; 190 252 this.TopMost = true; 253 this.Load += new System.EventHandler(this.IrcSendAppForm_Load); 191 254 this.ResumeLayout(false); 192 255 … … 278 341 e.Graphics.DrawImage(buttonToggle.Image, 6, 6); 279 342 } 343 344 private void buttonClear_Click(object sender, System.EventArgs e) 345 { 346 lock(this.textBoxLog) 347 { 348 this.textBoxLog.Text=""; 349 } 350 } 351 352 private void checkBoxPause_CheckedChanged(object sender, System.EventArgs e) 353 { 354 mPauseLog = checkBoxPause.Checked; 355 } 356 357 private void timerLogFlush_Tick(object sender, System.EventArgs e) 358 { 359 360 if (mLogger != null) 361 lock(mLogger){mLogger.flush();} 362 } 363 280 364 } 281 365 } -
lang/csharp/IrcSendOnly/Form1.resx
r844 r860 198 198 </value> 199 199 </data> 200 <data name="buttonClear.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 201 <value>False</value> 202 </data> 203 <data name="buttonClear.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 204 <value>Private</value> 205 </data> 206 <data name="buttonClear.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 207 <value>Private</value> 208 </data> 209 <data name="checkBoxPause.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 210 <value>False</value> 211 </data> 212 <data name="checkBoxPause.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 213 <value>Private</value> 214 </data> 215 <data name="checkBoxPause.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 216 <value>Private</value> 217 </data> 218 <data name="timerLogFlush.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 219 <value>Private</value> 220 </data> 221 <data name="timerLogFlush.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 222 <value>171, 17</value> 223 </data> 224 <data name="timerLogFlush.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 225 <value>Private</value> 226 </data> 200 227 <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 201 228 <value>False</value> 229 </data> 230 <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 231 <value>(Default)</value> 232 </data> 233 <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 234 <value>False</value> 235 </data> 236 <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 237 <value>False</value> 238 </data> 239 <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 240 <value>8, 8</value> 202 241 </data> 203 242 <data name="$this.Name"> 204 243 <value>IrcSendAppForm</value> 205 </data>206 <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">207 <value>(Default)</value>208 </data>209 <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">210 <value>False</value>211 </data>212 <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">213 <value>False</value>214 </data>215 <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">216 <value>8, 8</value>217 244 </data> 218 245 <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> -
lang/csharp/IrcSendOnly/IRCClient.cs
r844 r860 141 141 { 142 142 string readLn; 143 KeepAlive ka = new KeepAlive(mWriter, mServer, 15000);143 KeepAlive ka = new KeepAlive(mWriter, mServer, 20000); 144 144 while(mContinue) 145 145 { … … 174 174 mWriter.WriteLine("PRIVMSG "+chname+" :"+msg); 175 175 mWriter.Flush(); 176 177 if (mListener != null) 178 mListener.myMessageSent(chname, mNick, msg); 176 179 } 177 180 } -
lang/csharp/IrcSendOnly/IRCListener.cs
r844 r860 8 8 void anyMessageArrived(string aMessage); 9 9 void channelMessageArrived(string aChannel, string aNick, string aMessage); 10 void myMessageSent(string aChannel, string aNick, string aMessage); 10 11 } 11 12 } -
lang/csharp/IrcSendOnly/IrcSend.csproj
r831 r860 87 87 <Reference 88 88 Name = "System.XML" 89 AssemblyName = "System.X ML"89 AssemblyName = "System.Xml" 90 90 HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" 91 91 /> … … 100 100 <File 101 101 RelPath = "AssemblyInfo.cs" 102 SubType = "Code" 103 BuildAction = "Compile" 104 /> 105 <File 106 RelPath = "ChatLogger.cs" 102 107 SubType = "Code" 103 108 BuildAction = "Compile"
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)