Changeset 34415
- Timestamp:
- 07/13/09 20:30:25 (4 years ago)
- Location:
- lang/csharp/soyText/soyText
- Files:
-
- 18 modified
-
DThread.cs (modified) (2 diffs)
-
Debug.cs (modified) (1 diff)
-
DocumentSet.cs (modified) (3 diffs)
-
EditorTab.cs (modified) (12 diffs)
-
ExecForm.Designer.cs (modified) (1 diff)
-
ExecForm.cs (modified) (1 diff)
-
Form2.Designer.cs (modified) (4 diffs)
-
Form2.cs (modified) (4 diffs)
-
ImportDialog.cs (modified) (1 diff)
-
ListSyncer.cs (modified) (2 diffs)
-
Program.cs (modified) (1 diff)
-
TerminableThread.cs (modified) (2 diffs)
-
bin/Debug/soyText.application (modified) (1 diff)
-
bin/Debug/soyText.exe (modified) (previous)
-
bin/Debug/soyText.exe.manifest (modified) (2 diffs)
-
bin/Debug/soyText.pdb (modified) (previous)
-
bin/Debug/soyText.vshost.application (modified) (1 diff)
-
soyText.suo (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
lang/csharp/soyText/soyText/DThread.cs
r33756 r34415 10 10 { 11 11 Thread th; 12 public DThread(string name,ThreadStart t)12 /*public DThread(string name,ThreadStart t) 13 13 { 14 14 th = new Thread(delegate() { … … 16 16 }); 17 17 th.Name = name; 18 } 18 }*/ 19 19 public void Start() 20 20 { -
lang/csharp/soyText/soyText/Debug.cs
r34144 r34415 41 41 public static void syslog(string msg) 42 42 { 43 if (syslogF == null)43 /*if (syslogF == null) 44 44 { 45 45 syslogF = Mkdir.openStream("sys.log", true); 46 } 47 46 }*/ 47 System.Diagnostics.Debug.Print(msg); 48 48 } 49 49 } -
lang/csharp/soyText/soyText/DocumentSet.cs
r34144 r34415 13 13 public class DocumentSet 14 14 { 15 internal ListSyncerSet listSyncerSet = new ListSyncerSet(); 15 16 internal SearchLogSet searchLogSet; 16 17 public int maxHandle = -1; … … 62 63 return (d == 0 ? 0 : (d < 0 ? 1 : -1)); 63 64 } 65 static int count = 0; 64 66 public DocumentList getRecents() 65 67 { 68 Debug.syslog("Getrecent called " + (++count) + "times"); 66 69 if (cache != null) return cache.getRecents(); 67 70 Debug.print("文書一覧取得中..."); … … 171 174 if (cache == null) return; 172 175 cache.update(document); 176 listSyncerSet.notifyAll(document); 173 177 } 174 178 } -
lang/csharp/soyText/soyText/EditorTab.cs
r34185 r34415 18 18 public Workspace workspace; 19 19 public Form2 parentForm; 20 public static EditorTab active ;20 public static EditorTab active=null; 21 21 Document _curDoc; 22 22 public Document curDoc … … 32 32 public void onLoad(object sender, EventArgs e) 33 33 { 34 if (searchOnLoad) initList(); 35 ActiveControl = command; 36 } 37 public void initList() 38 { 39 if (listInited) return; 40 documentSet.getRecents(); 34 /*if (searchOnLoad) initList(); 35 ActiveControl = command;*/ 36 } 37 public void reload() 38 { 39 if (!listInited) 40 { 41 listInited = true; 42 documentSet.getRecents(); 43 } 41 44 if (condition != "") 42 45 { … … 48 51 refreshList(null); 49 52 } 50 listInited = true;51 53 } 52 54 /*public String statusText … … 59 61 bool searchOnLoad; 60 62 bool listInited = false; 61 63 ListSyncer listSyncer; 62 64 public EditorTab(Form2 parent,string condition, bool searchOnLoad) 63 65 { … … 74 76 inst++; 75 77 defaultInstance = this; 78 listSyncer = documentSet.listSyncerSet.add(docListBox, condition); 76 79 } 77 80 … … 95 98 public void refreshList() 96 99 { 100 /*if (searchThread.running) 101 { 102 Debug.syslog("Already running.... stop"); 103 104 return; 105 }*/ 97 106 refreshList(condition); 98 107 } … … 104 113 } 105 114 static bool firstTab=true; 115 106 116 public void refreshList(string kw) 107 117 { … … 120 130 } 121 131 condition = newCond; 132 listSyncer.condExpr=condition; 122 133 if (titleChanged != null) titleChanged(kw); 123 134 if (documentSearcher != null) documentSearcher.terminate(); 124 /*Document searchLog=null; 125 if (kw != null && kw != "") 126 { 127 searchLog = documentSet.searchLogSet.addOrGet(kw); 128 searchLog.parsed["closed"] = "false"; 129 searchLog.save(); 130 }*/ 135 131 136 var ft = firstTab; 132 137 firstTab = false; 133 138 searchThread.exec(delegate(TerminableThread t) 134 139 { 140 Debug.syslog("Start search kw="+kw); 135 141 var cnt = 0; 136 syncUI(delegate()142 /*syncUI(delegate() 137 143 { 138 144 docListBox.Items.Clear(); 139 }); 145 });*/ 146 listSyncer.openSyncSession(); 140 147 documentSearcher = documentSet.createDocumentSearcher(kw,true); 141 148 142 149 foreach (var d2 in documentSearcher.search()) 143 //delegate(Document d)144 150 { 145 151 var d = d2; … … 148 154 if (documentSet.searchLogSet.add(d)) 149 155 { 150 //Debug.alert(d.parsed["condition"] + " - " + d.parsed["closed"]+" - "+(d.parsed["closed"] != "false"));156 Debug.syslog("newtab - " + d.parsed["condition"]+" ft = "+ft+" closed ="+d.parsed["closed"]); 151 157 if (ft && d.parsed["closed"] != "true") 152 158 { 159 153 160 syncUI(delegate() 154 161 { … … 160 167 { 161 168 cnt++; 162 syncUI(delegate() { docListBox.Items.Add(d); }); 169 listSyncer.add(d); 170 //syncUI(delegate() { docListBox.Items.Add(d); }); 163 171 } 164 //return FoundHandlerAction.Accept;165 172 } 166 173 else 167 174 { 168 175 break; 169 //return FoundHandlerAction.End;170 176 } 171 } //);172 //documentSearcher.search2();177 } 178 listSyncer.closeSyncSession(); 173 179 Debug.print("完了"); 174 180 }); 175 181 } 176 /* public void syncUI(SyncUIAction u)177 {178 uiActionQueue.Enqueue(u);179 }*/180 182 public void newDocument() 181 183 { … … 383 385 internal void activate() 384 386 { 387 if (active == this) return; 385 388 active = this; 389 390 //if (searchOnLoad) 391 reload(); 392 ActiveControl = command; 393 //refreshList(); 386 394 } 387 395 … … 390 398 if (curDoc == null) newDocument(); 391 399 } 400 392 401 } 393 402 } -
lang/csharp/soyText/soyText/ExecForm.Designer.cs
r34279 r34415 88 88 this.lowerTable.RowCount = 1; 89 89 this.lowerTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 90 this.lowerTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 1 07F));90 this.lowerTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 187F)); 91 91 this.lowerTable.Size = new System.Drawing.Size(413, 187); 92 92 this.lowerTable.TabIndex = 2; -
lang/csharp/soyText/soyText/ExecForm.cs
r34279 r34415 21 21 internal void exec(Document document) 22 22 { 23 new DThread("Exec "+document.fileName,delegate()23 new Thread(/*"Exec "+document.fileName,*/delegate() 24 24 { 25 25 var d = new DocExecutor(document, null, delegate(string o) -
lang/csharp/soyText/soyText/Form2.Designer.cs
r34038 r34415 46 46 this.実行RToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 47 47 this.外部プログラムを実行RToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 48 this.tESTToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 48 49 this.timer1 = new System.Windows.Forms.Timer(this.components); 49 50 this.tabMenu = new System.Windows.Forms.ContextMenuStrip(this.components); 50 51 this.閉じるCToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 51 52 this.tabControl1 = new SoyText.TabControl2(); 52 this.tESTToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();53 53 this.menuStrip1.SuspendLayout(); 54 54 this.tabMenu.SuspendLayout(); … … 178 178 this.外部プログラムを実行RToolStripMenuItem.Click += new System.EventHandler(this.外部プログラムを実行RToolStripMenuItem_Click); 179 179 // 180 // tESTToolStripMenuItem 181 // 182 this.tESTToolStripMenuItem.Name = "tESTToolStripMenuItem"; 183 this.tESTToolStripMenuItem.Size = new System.Drawing.Size(206, 22); 184 this.tESTToolStripMenuItem.Text = "TEST"; 185 this.tESTToolStripMenuItem.Click += new System.EventHandler(this.tESTToolStripMenuItem_Click); 186 // 180 187 // timer1 181 188 // … … 209 216 this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); 210 217 // 211 // tESTToolStripMenuItem212 //213 this.tESTToolStripMenuItem.Name = "tESTToolStripMenuItem";214 this.tESTToolStripMenuItem.Size = new System.Drawing.Size(206, 22);215 this.tESTToolStripMenuItem.Text = "TEST";216 this.tESTToolStripMenuItem.Click += new System.EventHandler(this.tESTToolStripMenuItem_Click);217 //218 218 // Form2 219 219 // … … 227 227 this.Text = "Form2"; 228 228 this.ResizeBegin += new System.EventHandler(this.Form2_ResizeBegin); 229 this.Activated += new System.EventHandler(this.Form2_Activated); 229 230 this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Form2_FormClosed); 230 231 this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form2_MouseDown); -
lang/csharp/soyText/soyText/Form2.cs
r34185 r34415 128 128 curTab.activate(); 129 129 Text = curTab.Text; 130 curTab.initList();130 //curTab.initList(); 131 131 } 132 132 } … … 167 167 private void Form2_ResizeBegin(object sender, EventArgs e) 168 168 { 169 if (curTab == null) return; 169 170 curTab.ResizeBegin(sender, e); 170 171 } … … 172 173 private void Form2_ResizeEnd(object sender, EventArgs e) 173 174 { 175 if (curTab == null) return; 174 176 curTab.ResizeEnd(sender, e); 175 177 } … … 216 218 } 217 219 220 private void Form2_Activated(object sender, EventArgs e) 221 { 222 if (curTab!=null) curTab.activate(); 223 } 224 218 225 } 219 226 } -
lang/csharp/soyText/soyText/ImportDialog.cs
r33756 r34415 28 28 { 29 29 var i = new DocumentImporter(path.Text,workspace.documentSet); 30 new DThread("imp",delegate()30 new Thread(delegate() 31 31 { 32 32 i.traverse(); -
lang/csharp/soyText/soyText/ListSyncer.cs
r34296 r34415 10 10 { 11 11 static HashSet<ListSyncer> s=new HashSet<ListSyncer>(); 12 static ListSyncer add(ListBox list, SearchConditioncond)12 public ListSyncer add(ListBox list, string cond) 13 13 { 14 14 var res = new ListSyncer(list, cond); … … 16 16 return res; 17 17 } 18 public void remove(ListSyncer listsyncer) 19 { 20 s.Remove(listsyncer); 21 } 22 23 internal void notifyAll(Document document) 24 { 25 /* foreach (var sy in s) 26 { 27 sy.update(document); 28 }*/ 29 } 18 30 } 19 31 internal class ListSyncer 20 32 { 21 33 ListBox list; 34 string _condExpr; 35 public string condExpr 36 { 37 set 38 { 39 if (_condExpr == value) return; 40 _condExpr = value; 41 cond = SearchCondition.fromExpression(value); 42 list.Items.Clear(); 43 } 44 } 22 45 SearchCondition cond; 23 public ListSyncer(ListBox list, SearchCondition cond)46 public ListSyncer(ListBox list, string condExpr) 24 47 { 25 48 this.list = list; 26 this.cond = cond;49 this.condExpr = condExpr; 27 50 } 28 public bool add(Document d) { 51 52 public bool update(Document d) 53 { 54 if (list.Items.Contains(d)) return removeUnlessMatch(d); 55 else return addIfMatch(d); 56 } 57 bool addIfMatch(Document d) { 29 58 if (cond.matches(d)) 30 59 { 31 list.Items.Add(d);60 add(d); 32 61 return true; 33 62 } 34 63 return false; 35 64 } 36 public bool remove(Document d)65 public void add(Document d) 37 66 { 38 if (list.Items.Contains(d))67 SyncUI.exe(delegate() 39 68 { 40 list.Items.Remove(d); 69 if (isFirstSession) 70 { 71 list.Items.Add(d); 72 return; 73 } 74 if (list.Items.Contains(d)) return; 75 if (list.Items.Count >= 1) 76 { 77 list.Items.Insert(0, d); 78 } 79 else 80 { 81 list.Items.Add(d); 82 } 83 }); 84 85 } 86 bool removeUnlessMatch(Document d) 87 { 88 if (!cond.matches(d)) 89 { 90 SyncUI.exe(delegate() 91 { 92 if (!list.Items.Contains(d)) return; 93 list.Items.Remove(d); 94 }); 41 95 return true; 42 96 } 43 97 return false; 44 98 } 99 bool isFirstSession; 100 public void openSyncSession() 101 { 102 isFirstSession = list.Items.Count == 0; 103 System.Diagnostics.Debug.Print("ISF "+cond+" : "+isFirstSession); 104 } 105 public void closeSyncSession() 106 { 107 removeAllUnmatch(); 108 } 109 private void removeAllUnmatch() 110 { 111 var ls = new object[list.Items.Count]; 112 list.Items.CopyTo(ls,0); 113 foreach (object e in ls) 114 { 115 if (e is Document) 116 { 117 var d = (Document)e; 118 if (!cond.matches(d)) 119 { 120 SyncUI.exe(delegate() 121 { 122 list.Items.Remove(d); 123 }); 124 } 125 } 126 } 127 } 45 128 } 46 129 } -
lang/csharp/soyText/soyText/Program.cs
r33756 r34415 16 16 Application.EnableVisualStyles(); 17 17 Application.SetCompatibleTextRenderingDefault(false); 18 Debug.Try("Main", delegate()19 { 18 /*Debug.Try("Main", delegate() 19 {*/ 20 20 Application.Run(new WorkspaceSelector()); 21 });21 //}); 22 22 } 23 23 } -
lang/csharp/soyText/soyText/TerminableThread.cs
r33756 r34415 41 41 else _running = true; 42 42 } 43 if (r!=null) new DThread(name,r).Start();43 if (r!=null) new Thread(r).Start(); 44 44 } 45 45 } … … 71 71 } 72 72 } 73 if (r) new DThread(name,d).Start();73 if (r) new Thread(d).Start(); 74 74 } 75 75 } -
lang/csharp/soyText/soyText/bin/Debug/soyText.application
r34279 r34415 12 12 </dsig:Transforms> 13 13 <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 14 <dsig:DigestValue> zUdISs7VamOXM/l91giRXwP07rk=</dsig:DigestValue>14 <dsig:DigestValue>2V7AMEy6UTkeQ7vRbogHsGWi13w=</dsig:DigestValue> 15 15 </hash> 16 16 </dependentAssembly> -
lang/csharp/soyText/soyText/bin/Debug/soyText.exe.manifest
r34279 r34415 113 113 </dependency> 114 114 <dependency> 115 <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="soyText.exe" size="8 2944">115 <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="soyText.exe" size="84480"> 116 116 <assemblyIdentity name="soyText" version="1.0.0.0" language="neutral" processorArchitecture="msil" /> 117 117 <hash> … … 120 120 </dsig:Transforms> 121 121 <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 122 <dsig:DigestValue> CBgmbBvumgAZxMXXzPeQPl0CgPk=</dsig:DigestValue>122 <dsig:DigestValue>9VkzjS3QpI2zx/U6AIMTvmxrXhc=</dsig:DigestValue> 123 123 </hash> 124 124 </dependentAssembly> -
lang/csharp/soyText/soyText/bin/Debug/soyText.vshost.application
r34279 r34415 12 12 </dsig:Transforms> 13 13 <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 14 <dsig:DigestValue> zUdISs7VamOXM/l91giRXwP07rk=</dsig:DigestValue>14 <dsig:DigestValue>2V7AMEy6UTkeQ7vRbogHsGWi13w=</dsig:DigestValue> 15 15 </hash> 16 16 </dependentAssembly>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)