Changeset 36733 for lang/csharp
- Timestamp:
- 02/13/10 10:53:32 (3 years ago)
- Location:
- lang/csharp/soyText/soyText
- Files:
-
- 18 modified
-
DocumentList.cs (modified) (2 diffs)
-
DocumentListMap.cs (modified) (4 diffs)
-
DocumentSearcher.cs (modified) (5 diffs)
-
DocumentSet.cs (modified) (4 diffs)
-
EditorTab.cs (modified) (9 diffs)
-
LoggedDocumentSearcher.cs (modified) (3 diffs)
-
SearchLogSet.cs (modified) (4 diffs)
-
bin/Debug/soyText.application (modified) (1 diff)
-
bin/Debug/soyText.exe (modified) (previous)
-
bin/Debug/soyText.exe.manifest (modified) (3 diffs)
-
bin/Debug/soyText.pdb (modified) (previous)
-
bin/Debug/soyText.vshost.application (modified) (1 diff)
-
bin/Release/soyText.application (modified) (2 diffs)
-
bin/Release/soyText.exe (modified) (previous)
-
bin/Release/soyText.exe.manifest (modified) (3 diffs)
-
bin/Release/soyText.pdb (modified) (previous)
-
soyText.ico (modified) (previous)
-
soyText.suo (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
lang/csharp/soyText/soyText/DocumentList.cs
r36658 r36733 3 3 using System.Linq; 4 4 using System.Text; 5 using System.IO; 6 using System.Text.RegularExpressions; 7 5 8 6 namespace SoyText 9 7 { 10 11 class DocumentList12 {13 DocumentSet documentSet;14 IDChain first,last;15 /*List<string> ids = new List<string>();16 public List<string> idList17 {18 get { return ids; }19 }*/20 public DocumentList(DocumentSet d) { documentSet = d; init(); }21 void init()22 {23 scanDir();24 25 }26 public IEnumerable<IDChain> getIDS()27 {28 for (var idc = first; idc != null; idc = idc.next)29 {30 yield return idc;31 }32 }33 private void scanDir()34 {35 36 DocumentState state=DocumentState.active;37 var dir=documentSet.stateDir(state);38 List<IDInfo> infs = new List<IDInfo>();39 foreach (string fileName40 in Mkdir.getFiles(dir))41 {42 var m = Regex.Match(fileName, @"([^/\\]+).txt$");43 if (m.Success)44 {45 var id = m.Groups[1].Value;46 infs.Add(new IDInfo(id,File.GetLastWriteTime(documentSet.getFileName(id,state)).Ticks));47 }48 }49 infs.Sort();50 foreach (var inf in infs) {51 pushID(inf.id);52 //Debug.syslog(inf.id);53 }54 //Debug.syslog(""+ids.Count);55 }56 internal IDChain pushID(string id)57 {58 var idc = new IDChain();59 idc.id = id;60 idc.prev = last;61 if (first == null) first = idc;62 if (last != null)63 {64 last.next = idc;65 }66 last = idc;67 return idc;68 }69 internal IDChain insertIDChain(IDChain idc)70 {71 idc.next = first;72 idc.prev = null;73 if (last == null) last = idc;74 if (first != null)75 {76 first.prev = idc;77 }78 first = idc;79 return idc;80 }81 82 internal IDChain insertID(string id)83 {84 var idc=new IDChain();85 idc.id=id;86 insertIDChain(idc);87 return idc;88 }89 internal IDChain removeIDChain(IDChain idc)90 {91 if (idc.prev != null)92 {93 idc.prev.next = idc.next;94 }95 if (idc.next != null)96 {97 idc.next.prev = idc.prev;98 }99 idc.prev = null;100 idc.next = null;101 return idc;102 }103 class IDInfo : IComparable104 {105 public string id;106 public long lastUpdate;107 public IDInfo(string id, long lastUpdate)108 {109 this.id = id;110 this.lastUpdate = lastUpdate;111 }112 113 #region IComparable メンバ114 115 public int CompareTo(object obj)116 {117 if (obj is IDInfo)118 {119 IDInfo t = (IDInfo)obj;120 if (t.lastUpdate > lastUpdate) return 1;121 if (t.lastUpdate < lastUpdate) return -1;122 }123 return 0;124 }125 126 #endregion127 }128 129 130 131 }132 class IDChain133 {134 public string id;135 public Document document;136 public IDChain prev, next;137 }138 /*139 8 public class DocumentList: SortedList<long,Document> 140 9 { … … 154 23 return true; 155 24 } 156 } */25 } 157 26 } -
lang/csharp/soyText/soyText/DocumentListMap.cs
r36658 r36733 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.Linq; 3 using System.Linq; 4 4 using System.Text; 5 5 … … 8 8 class DocumentListMap 9 9 { 10 private DocumentList list; 11 DocumentSet documentSet; 12 public DocumentListMap(DocumentSet documentSet) 13 { 14 this.documentSet = documentSet; 15 list = new DocumentList(documentSet); 16 } 17 private SortedList<string, IDChain> map = new SortedList<string, IDChain>(); 18 //private SortedList<string, Document> removed = new SortedList<string, Document>(); 10 private DocumentList list=new DocumentList(); 11 private SortedList<string, Document> map = new SortedList<string, Document>(); 19 12 public void add(Document d) 20 13 { 21 if (contains(d.id)) return; 22 //list.add(d); 23 var idc=list.insertID(d.id); 24 /*if (removed.ContainsKey(d.id)) 25 { 26 removed.Remove(d.id); 27 }*/ 28 map.Add(d.id, idc); 14 list.add(d); 15 map.Add(d.id, d); 29 16 } 30 17 31 18 32 public IEnumerable<Document>getRecents()19 internal DocumentList getRecents() 33 20 { 34 foreach (var idc in list.getIDS()) 35 { 36 /*if (!removed.ContainsKey(id)) 37 {*/ 38 yield return byIdChain(idc); 39 //} 40 } 41 //return list; 42 } 43 public Document byIdChain(IDChain idc) 44 { 45 if (idc.document == null) { 46 idc.document= documentSet.createDocument(idc.id); 47 } 48 return idc.document; 49 } 50 IDChain getIDChain(string id) 51 { 52 return map[id]; 21 return list; 53 22 } 54 23 public Document byId(string id) 55 24 { 56 return byIdChain(getIDChain(id));25 return map[id]; 57 26 } 58 27 … … 62 31 } 63 32 64 internal boolupdate(Document document)33 internal void update(Document document) 65 34 { 66 if (!remove(document)) return false; 35 if (!contains(document.id)) return; 36 list.Remove(document); 37 map.Remove(document.id); 67 38 document.clearLastUpdate(); 68 39 add(document); 69 return true;70 40 } 71 41 … … 73 43 { 74 44 if (!contains(document.id)) return false; 75 //list.Remove(document); 76 //removed.Add(document.id, document); 77 list.removeIDChain(getIDChain(document.id)); 45 list.Remove(document); 78 46 map.Remove(document.id); 79 47 return true; -
lang/csharp/soyText/soyText/DocumentSearcher.cs
r36658 r36733 3 3 using System.Linq; 4 4 using System.Text; 5 5 6 6 namespace SoyText 7 7 { … … 21 21 public IEnumerable<Document> search() 22 22 { 23 var rec = documentSet.getRecents();24 /*var rec = new DocumentList();23 var rec0 = documentSet.getRecents(); 24 var rec = new DocumentList(); 25 25 lock (rec0) 26 26 { 27 27 foreach (var d in rec0) rec.Add(d.Key, d.Value); 28 } */28 } 29 29 //var res = new DocumentList(); 30 30 if (searchCondition == null || searchCondition is AnyCondition) … … 32 32 foreach (var d in rec) 33 33 { 34 if (skip !=0 && d. lastUpdate >= skip)34 if (skip !=0 && d.Value.lastUpdate >= skip) 35 35 { 36 36 continue; 37 37 } 38 yield return d ;38 yield return d.Value; 39 39 //res.Add(d.Key, d.Value); 40 40 if (terminated) break; … … 42 42 yield break; 43 43 } 44 var c = 0;//rec.Count;44 var c = rec.Count; 45 45 var cnt = 0; 46 46 var found = 0; … … 49 49 Debug.print("文書を検索: " + searchCondition + "(" + cnt + "/" + c + ") - " + found + "件見つかりました"); 50 50 cnt++; 51 if (skip != 0 && d. lastUpdate >= skip)51 if (skip != 0 && d.Value.lastUpdate >= skip) 52 52 { 53 53 continue; 54 54 } 55 if (searchCondition.matches(d ))55 if (searchCondition.matches(d.Value)) 56 56 { 57 57 //if (!res.ContainsKey(d.Key)) 58 58 //{ 59 59 found++; 60 yield return d ;60 yield return d.Value; 61 61 // res.Add(d.Key, d.Value); 62 62 //} -
lang/csharp/soyText/soyText/DocumentSet.cs
r36658 r36733 5 5 using System.Text; 6 6 using System.Text.RegularExpressions; 7 using System.Threading; 8 7 using System.Threading; 8 9 9 namespace SoyText 10 10 { … … 53 53 private Document addToCache(Document d) 54 54 { 55 if (cache == null) cache = new DocumentListMap( this);55 if (cache == null) cache = new DocumentListMap(); 56 56 lock (cache) 57 57 { … … 66 66 } 67 67 static int count = 0; 68 public IEnumerable<Document>getRecents()68 public DocumentList getRecents() 69 69 { 70 /*if (cache != null) return cache.getRecents();70 if (cache != null) return cache.getRecents(); 71 71 Debug.syslog("Getrecent called " + (++count) + "times"); 72 72 Debug.print("文書一覧取得中..."); 73 //var res = new DocumentList(); 73 74 74 searchMax(DocumentState.active, true);*/ 75 if (cache == null) cache = new DocumentListMap(this); 76 75 /*searchMax(DocumentState.active, true); 76 searchMax(DocumentState.archived, false); 77 searchMax(DocumentState.indexed,true);*/ 78 searchMax(DocumentState.active, true); 79 if (cache == null) cache = new DocumentListMap(); 80 Debug.print("文書一覧並べ替え中..."); 81 //res.Sort(byRecency); 82 Debug.print("END: 文書一覧並べ替え中..."); 77 83 78 84 return cache.getRecents(); … … 155 161 return s.search(); 156 162 } 157 /*public Document getOldestActiveDocument()163 public Document getOldestActiveDocument() 158 164 { 159 165 var r = getRecents(); 160 166 return r[0]; 161 } */167 } 162 168 163 169 /*internal IEnumerable<object> search(SearchCondition condition) -
lang/csharp/soyText/soyText/EditorTab.cs
r36658 r36733 3 3 using System.ComponentModel; 4 4 using System.Drawing; 5 using System.Data; 5 using System.Data; 6 6 using System.Linq; 7 7 using System.Text; … … 9 9 using System.Text.RegularExpressions; 10 10 11 11 12 12 namespace SoyText 13 13 { … … 65 65 bool listInited = false; 66 66 ListSyncer listSyncer; 67 string listSyncerCondition(string condition)68 {69 var syncC = condition;70 if (syncC == null || syncC == "")71 {72 syncC = "-type:SearchLog";73 }74 return syncC;75 }76 67 public EditorTab(Form2 parent,string condition, bool searchOnLoad) 77 68 { … … 89 80 inst++; 90 81 defaultInstance = this; 91 92 listSyncer = documentSet.listSyncerSet.add(docListBox, listSyncerCondition(condition)); 82 listSyncer = documentSet.listSyncerSet.add(docListBox, condition); 93 83 94 84 tagSet.onTagFound += delegate(string tag) … … 175 165 refreshTagFilters(); 176 166 } 177 178 listSyncer.condExpr = listSyncerCondition(condition);167 168 listSyncer.condExpr = condition; 179 169 if (titleChanged != null) titleChanged(kw); 180 170 if (documentSearcher != null && !ftSearching) documentSearcher.terminate(); … … 201 191 { 202 192 tagSet.add(d); 203 //Debug.syslog("doc - id=" + d.id);204 193 if (documentSet.searchLogSet.add(d)) 205 194 { 206 //Debug.syslog("newtab - id=" + d.id+" / "+d.parsed["condition"]+" ft = "+ft+" closed ="+d.parsed["closed"]);195 Debug.syslog("newtab - " + d.parsed["condition"]+" ft = "+ft+" closed ="+d.parsed["closed"]); 207 196 if (ft && d.parsed["closed"] != "true") 208 197 { … … 216 205 else 217 206 { 218 //Debug.syslog("listSyncer.add - id=" + d.id);219 207 cnt++; 220 208 listSyncer.add(d); … … 824 812 ExecForm.open(curDoc); 825 813 } 814 826 815 private void docListBox_DragEnter(object sender, DragEventArgs e) 827 816 { … … 837 826 foreach (var f in s) 838 827 { 839 var d =documentSet.createDocument();828 var d=documentSet.createDocument(); 840 829 d.str["type"] = "file"; 841 830 d.str["tag"] = "file"; -
lang/csharp/soyText/soyText/LoggedDocumentSearcher.cs
r36658 r36733 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using System.Text; 4 using System.Text; 5 5 6 6 namespace SoyText … … 64 64 65 65 66 var rec = documentSet.getRecents();67 /*var rec = new DocumentList();66 var rec0 = documentSet.getRecents(); 67 var rec = new DocumentList(); 68 68 lock (rec0) 69 69 { 70 70 foreach (var d in rec0) rec.Add(d.Key, d.Value); 71 } */72 73 var c = 0;//rec.Count;71 } 72 73 var c = rec.Count; 74 74 var cnt = 0; 75 75 var found = 0; … … 79 79 { 80 80 checkTimeout(timeOutTime); 81 var d = dent ;//.Value;81 var d = dent.Value; 82 82 if (newestDoc==null) newestDoc=d; 83 83 oldestDoc=d; -
lang/csharp/soyText/soyText/SearchLogSet.cs
r36658 r36733 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using System.Text; 4 using System.Text; 5 5 6 6 namespace SoyText … … 13 13 this.superSet = superSet; 14 14 expr2doc = new Dictionary<string, Document>(); 15 recents = new List<Document>();15 recents = new DocumentList(); 16 16 } 17 17 Dictionary<string,Document> expr2doc = null; 18 List<Document>recents;18 DocumentList recents; 19 19 20 20 internal bool add(Document d) … … 26 26 { 27 27 expr2doc[c] = d; 28 recents. Add(d);28 recents.add(d); 29 29 } 30 30 else … … 34 34 return true; 35 35 } 36 internal List<Document>getRecents()36 internal DocumentList getRecents() 37 37 { 38 38 return recents; -
lang/csharp/soyText/soyText/bin/Debug/soyText.application
r36650 r36733 12 12 </dsig:Transforms> 13 13 <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 14 <dsig:DigestValue> WO7NaKrov9ZJeYckPZ/bkERtzPY=</dsig:DigestValue>14 <dsig:DigestValue>QbKbYGZG9Rv42NJ5HdbgHy312Us=</dsig:DigestValue> 15 15 </hash> 16 16 </dependentAssembly> -
lang/csharp/soyText/soyText/bin/Debug/soyText.exe.manifest
r36650 r36733 114 114 </dependency> 115 115 <dependency> 116 <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="soyText.exe" size="1 29024">116 <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="soyText.exe" size="133120"> 117 117 <assemblyIdentity name="soyText" version="1.0.0.0" language="neutral" processorArchitecture="msil" /> 118 118 <hash> … … 121 121 </dsig:Transforms> 122 122 <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 123 <dsig:DigestValue> dYPQ1A1O7P3dwDWj5Wy78F6mfTM=</dsig:DigestValue>123 <dsig:DigestValue>s4/FGjF4J8K2w7O1vFRDjCIgxfk=</dsig:DigestValue> 124 124 </hash> 125 125 </dependentAssembly> 126 126 </dependency> 127 <file name="soyText.ico" size=" 1150">127 <file name="soyText.ico" size="5430"> 128 128 <hash> 129 129 <dsig:Transforms> … … 131 131 </dsig:Transforms> 132 132 <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 133 <dsig:DigestValue> vhj8XTvtrUg7dbYknTlxCp11YXc=</dsig:DigestValue>133 <dsig:DigestValue>fAA37rDzj6wr6z6Bsj7TxnDzcUY=</dsig:DigestValue> 134 134 </hash> 135 135 </file> -
lang/csharp/soyText/soyText/bin/Debug/soyText.vshost.application
r36650 r36733 12 12 </dsig:Transforms> 13 13 <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 14 <dsig:DigestValue> WO7NaKrov9ZJeYckPZ/bkERtzPY=</dsig:DigestValue>14 <dsig:DigestValue>QbKbYGZG9Rv42NJ5HdbgHy312Us=</dsig:DigestValue> 15 15 </hash> 16 16 </dependentAssembly> -
lang/csharp/soyText/soyText/bin/Release/soyText.application
r36488 r36733 5 5 <deployment install="true" mapFileExtensions="true" /> 6 6 <dependency> 7 <dependentAssembly dependencyType="install" codebase="soyText.exe.manifest" size="7 046">7 <dependentAssembly dependencyType="install" codebase="soyText.exe.manifest" size="7506"> 8 8 <assemblyIdentity name="soyText.exe" version="1.0.0.2" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" /> 9 9 <hash> … … 12 12 </dsig:Transforms> 13 13 <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 14 <dsig:DigestValue> D8FXY2X0SyPowP4MtjnbgPBYw4A=</dsig:DigestValue>14 <dsig:DigestValue>beohKYxz5iqQyoXCfRTTIMvb+aA=</dsig:DigestValue> 15 15 </hash> 16 16 </dependentAssembly> -
lang/csharp/soyText/soyText/bin/Release/soyText.exe.manifest
r36488 r36733 2 2 <asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1"> 3 3 <asmv1:assemblyIdentity name="soyText.exe" version="1.0.0.2" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" /> 4 <description asmv2:iconFile="soyText.ico" xmlns="urn:schemas-microsoft-com:asm.v1" /> 4 5 <application /> 5 6 <entryPoint> … … 113 114 </dependency> 114 115 <dependency> 115 <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="soyText.exe" size="1 04448">116 <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="soyText.exe" size="115200"> 116 117 <assemblyIdentity name="soyText" version="1.0.0.0" language="neutral" processorArchitecture="msil" /> 117 118 <hash> … … 120 121 </dsig:Transforms> 121 122 <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 122 <dsig:DigestValue> Rif36i8Fo2qIUJGDoABT5aNp1Lc=</dsig:DigestValue>123 <dsig:DigestValue>9XmM9u3b7qEvhIzZPefannEyiyA=</dsig:DigestValue> 123 124 </hash> 124 125 </dependentAssembly> 125 126 </dependency> 127 <file name="soyText.ico" size="1150"> 128 <hash> 129 <dsig:Transforms> 130 <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" /> 131 </dsig:Transforms> 132 <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 133 <dsig:DigestValue>vhj8XTvtrUg7dbYknTlxCp11YXc=</dsig:DigestValue> 134 </hash> 135 </file> 126 136 </asmv1:assembly>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)