Changeset 33031
- Timestamp:
- 05/02/09 22:56:11 (4 years ago)
- Location:
- lang/csharp/soyText/soyText
- Files:
-
- 4 modified
-
Form1.cs (modified) (5 diffs)
-
KeywordCondition.cs (modified) (1 diff)
-
PythonEngine.cs (modified) (3 diffs)
-
soyText.suo (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
lang/csharp/soyText/soyText/Form1.cs
r33003 r33031 18 18 { 19 19 Workspace workspace; 20 Document curDoc; 20 Document _curDoc; 21 public Document curDoc 22 { 23 get { return _curDoc; } 24 set { open(value); } 25 } 21 26 static int inst = 0; 22 27 public static Form1 defaultInstance; … … 67 72 } 68 73 TerminableThread searchThread = new TerminableThread(); 74 TerminableThread lineSearchThread = new TerminableThread(); 69 75 DocumentSercher documentSearcher; 70 76 public void refreshList(String kw) … … 126 132 private void open(Document newDoc) 127 133 { 128 curDoc = null;134 _curDoc = null; 129 135 content.Text = newDoc.content; 130 curDoc = newDoc;136 _curDoc = newDoc; 131 137 //curDocLastUpdate = curDoc.lastUpdate; 132 138 //command.Text = newDoc.lastUpdate+""; 133 139 if (command.Text != "") 134 140 { 135 if (autoSresMove && splitContainerSres.SplitterDistance < 64) 136 { 137 splitContainerSres.SplitterDistance = 64; 138 } 139 var sc = SearchCondition.fromExpression(command.Text); 140 sresListBox.Items.Clear(); 141 foreach (var l in curDoc.lines) 142 { 143 if (sc.matches(l)) 144 { 145 sresListBox.Items.Add(l); 146 } 147 } 141 lineSearchThread.exec(delegate(TerminableThread t) 142 { 143 if (autoSresMove && splitContainerSres.SplitterDistance < 64) 144 { 145 syncUI(delegate() 146 { 147 splitContainerSres.SplitterDistance = 64; 148 }); 149 } 150 var sc = SearchCondition.fromExpression(command.Text); 151 syncUI(delegate() { sresListBox.Items.Clear(); }); 152 foreach (var l in curDoc.lines) 153 { 154 var l2 = l; 155 if (sc.matches(l)) 156 { 157 syncUI(delegate() { sresListBox.Items.Add(l2); }); 158 } 159 } 160 }); 148 161 } 149 162 } … … 213 226 workspace.indexer.make(oldActive); 214 227 }).Start();*/ 228 } 229 if (e.KeyCode.Equals(Keys.F9)) 230 { 215 231 var p = new PythonEngine(); 216 var res = p.evaluate( curDoc.handle + "", curDoc.parsed.cdr);217 Debug.print(res);232 var res = p.evaluate(this , curDoc.parsed.cdr); 233 //Debug.print(res); 218 234 Text = res; 219 }220 if (e.KeyCode.Equals(Keys.F9))221 {222 searchThread.exec(delegate(TerminableThread t) {223 statusText = "NEXT!!";224 Thread.Sleep(1000);225 });226 235 /* 227 236 tth.exec(delegate(TerminableThread t) … … 260 269 var f = new Form1(workspace); 261 270 f.Visible = true; 271 } 272 public void newWindow() 273 { 274 var f = new Form1(workspace); 275 f.Visible = true; 276 262 277 } 263 278 -
lang/csharp/soyText/soyText/KeywordCondition.cs
r32912 r33031 11 11 public KeywordCondition(String w) 12 12 { 13 word = w ;13 word = w.ToLower(); 14 14 } 15 15 public override bool matches(Document d) 16 16 { 17 return d.content. IndexOf(word) >= 0;17 return d.content.ToLower().IndexOf(word) >= 0; 18 18 } 19 19 public override bool matches(DocumentLine line) 20 20 { 21 return line.content. IndexOf(word) >= 0;21 return line.content.ToLower().IndexOf(word) >= 0; 22 22 } 23 23 public override string ToString() -
lang/csharp/soyText/soyText/PythonEngine.cs
r33003 r33031 7 7 using Microsoft.Scripting; 8 8 using Microsoft.Scripting.Hosting; 9 using System.Windows.Forms; 9 10 10 11 namespace SoyText … … 31 32 scope.SetVariable("x", x); 32 33 scope.SetVariable("button", button); 34 /*var d=Delegate.CreateDelegate(; 35 d.Method=delegate(string s) 36 { 37 MessageBox.Show(s); 38 }); 39 scope.("alert",);*/ 33 40 34 41 try … … 39 46 catch (Exception ex) 40 47 { 48 MessageBox.Show(ex.ToString()); 41 49 return "Error executing code: " + ex.ToString(); 42 50 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)