Changeset 33649

Show
Ignore:
Timestamp:
05/28/09 20:09:43 (4 years ago)
Author:
hoge1e3
Message:
 
Location:
lang/csharp/soyText/soyText
Files:
15 modified

Legend:

Unmodified
Added
Removed
  • lang/csharp/soyText/soyText/AttributeCondition.cs

    r32951 r33649  
    66namespace SoyText 
    77{ 
    8     class AttributeCondition 
     8    internal class AttributeCondition: SearchCondition 
    99    { 
    10         public string key; 
    11         public string value; 
    12  
     10        string key; 
     11        string value; 
     12        public AttributeCondition(string key, string value) 
     13        { 
     14            this.key = key; 
     15            this.value = value.ToLower(); 
     16        } 
     17        public override bool matches(Document d) 
     18        { 
     19            var a=d.parsed[key]; 
     20            return a!=null && a.ToLower().IndexOf(value) >= 0; 
     21        } 
     22        public override bool matches(DocumentLine d) 
     23        { 
     24            return false; 
     25        } 
    1326    } 
    1427} 
  • lang/csharp/soyText/soyText/DocumentList.cs

    r33578 r33649  
    88    public class DocumentList: SortedList<long,Document> 
    99    { 
     10        public void add(Document d) 
     11        { 
     12            Add(d.uniqueLastUpdate, d); 
     13        } 
    1014    } 
    1115} 
  • lang/csharp/soyText/soyText/EditorTab.cs

    r33484 r33649  
    223223        } 
    224224        TerminableThread tth = new TerminableThread(); 
    225         private void Form1_KeyDown(object sender, KeyEventArgs e) 
    226         { 
    227             if (e.KeyCode.Equals(Keys.F11)) 
    228             { 
    229                 /*new Thread(delegate() 
    230                 { 
    231                     var oldActive = documentSet.getOldestActiveDocument(); 
    232                     workspace.indexer.make(oldActive); 
    233                 }).Start();*/ 
    234             } 
    235             if (e.KeyCode.Equals(Keys.F9)) 
    236             { 
    237                 var p = new PythonEngine(); 
    238                 var res = p.evaluate(this , curDoc.parsed.cdr); 
    239                 //Debug.print(res); 
    240                 Text = res; 
    241                 /* 
    242                 tth.exec(delegate(TerminableThread t) 
    243                 { 
    244                     for (var i = 0; i < 20; i++) 
    245                     { 
    246                         Debug.print("TTH " + i); 
    247                         Thread.Sleep(500); 
    248                         if (t.terminated) break; 
    249                     } 
    250                 }); 
    251                 Text = curDoc.parsed.getValue("title");*/ 
    252             } 
    253         } 
     225         
    254226 
    255227        private void NewMenuItem_Click(object sender, EventArgs e) 
  • lang/csharp/soyText/soyText/Form2.Designer.cs

    r33507 r33649  
    5050            this.閉じるCToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 
    5151            this.tabControl1 = new SoyText.TabControl2(); 
     52            this.tESTToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 
    5253            this.menuStrip1.SuspendLayout(); 
    5354            this.tabMenu.SuspendLayout(); 
     
    163164            //  
    164165            this.実行RToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 
    165             this.外部プログラムを実行RToolStripMenuItem}); 
     166            this.外部プログラムを実行RToolStripMenuItem, 
     167            this.tESTToolStripMenuItem}); 
    166168            this.実行RToolStripMenuItem.Name = "実行RToolStripMenuItem"; 
    167169            this.実行RToolStripMenuItem.Size = new System.Drawing.Size(57, 20); 
     
    186188            this.閉じるCToolStripMenuItem}); 
    187189            this.tabMenu.Name = "tabMenu"; 
    188             this.tabMenu.Size = new System.Drawing.Size(153, 48); 
     190            this.tabMenu.Size = new System.Drawing.Size(117, 26); 
    189191            //  
    190192            // 閉じるCToolStripMenuItem 
    191193            //  
    192194            this.閉じるCToolStripMenuItem.Name = "閉じるCToolStripMenuItem"; 
    193             this.閉じるCToolStripMenuItem.Size = new System.Drawing.Size(152, 22); 
     195            this.閉じるCToolStripMenuItem.Size = new System.Drawing.Size(116, 22); 
    194196            this.閉じるCToolStripMenuItem.Text = "閉じる(&C)"; 
    195197            this.閉じるCToolStripMenuItem.Click += new System.EventHandler(this.閉じるCToolStripMenuItem_Click); 
     
    206208            this.tabControl1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tabControl1_MouseDown); 
    207209            this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); 
     210            //  
     211            // tESTToolStripMenuItem 
     212            //  
     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); 
    208217            //  
    209218            // Form2 
     
    250259        private ContextMenuStrip tabMenu; 
    251260        private ToolStripMenuItem 閉じるCToolStripMenuItem; 
     261        private ToolStripMenuItem tESTToolStripMenuItem; 
    252262    } 
    253263} 
  • lang/csharp/soyText/soyText/Form2.cs

    r33578 r33649  
    162162        } 
    163163 
     164        private void tESTToolStripMenuItem_Click(object sender, EventArgs e) 
     165        { 
     166            curTab.curDoc.parsed.setValue("test", "desu"); 
     167            curTab.curDoc.save(); 
     168        } 
     169 
    164170    } 
    165171} 
  • lang/csharp/soyText/soyText/ParsedDocument.cs

    r33484 r33649  
    4242            cdr = ""; 
    4343            var newLines = ""; 
     44            var valueSetted = false; 
    4445            foreach (var line in Regex.Split(src.content, "\r*\n")) 
    4546            { 
    4647                if (resting) { newLines += line + "\n"; continue; } 
    4748                var m = Regex.Match(line, "^[ \t]*$"); 
    48                 var valueSetted = false; 
    4949                if (m.Success) 
    5050                { 
    5151                    if (!valueSetted) 
    5252                    { 
    53                         newLines += key + ": " + value + "\n"; 
     53                        newLines += key + ": " + value + "\r\n"; 
    5454                    } 
    5555                    resting = true; 
     
    6262                    if (k.Equals(key)) 
    6363                    { 
    64                         newLines += key + ": " + value + "\n"; 
     64                        newLines += key + ": " + value + "\r\n"; 
    6565                        valueSetted = true; 
    6666                    } 
    6767                    else 
    6868                    { 
    69                         newLines += line + "\n"; 
     69                        newLines += line + "\r\n"; 
    7070                    } 
    7171                } 
    7272                else 
    7373                { 
    74                     newLines += line + "\n"; 
     74                    newLines += line + "\r\n"; 
    7575                } 
    7676            } 
  • lang/csharp/soyText/soyText/SearchCondition.cs

    r32912 r33649  
    1616            if (s.Length == 1) 
    1717            { 
    18                 return new KeywordCondition(expr); 
     18                var n = new Reg("^-"); 
     19                if (n.m(s[0])) 
     20                { 
     21                    return new NotCondition(fromExpression(n.post)); 
     22                } 
     23                var r = new Reg("^([^:]+):"); 
     24                if (r.m(s[0])) 
     25                { 
     26                    return new AttributeCondition(r[1], r.post); 
     27                } 
     28                else 
     29                { 
     30                    return new KeywordCondition(expr); 
     31                } 
    1932            } 
    2033            if (s.Length == 0) 
  • lang/csharp/soyText/soyText/SearchLogSet.cs

    r33578 r33649  
    99    { 
    1010        DocumentSet superSet; 
    11         DocumentList list = null; 
    12         internal bool addIfContains(Document d) 
     11        public SearchLogSet(DocumentSet superSet) 
     12        { 
     13            this.superSet = superSet; 
     14            list = new Dictionary<string, Document>(); 
     15            recents = new DocumentList(); 
     16        } 
     17        Dictionary<string,Document> list = null; 
     18        DocumentList recents; 
     19 
     20        internal bool add(Document d) 
    1321        { 
    1422            if (d.parsed["type"] != "SearchLog") return false; 
    15             list.Add(d.uniqueLastUpdate, d); 
     23            var c=d.parsed["condition"]; 
     24            if (!list.ContainsKey(c)) { 
     25                           list[c]=d; 
     26                           recents.add(d); 
     27            } 
    1628            return true; 
    1729        } 
    1830        internal DocumentList getRecents() 
    1931        { 
    20             return list; 
     32            return recents; 
     33        } 
     34        public void add(string searchExpr) 
     35        { 
     36            var c = searchExpr; 
     37            if (!list.ContainsKey(c)) 
     38            { 
     39                var d = superSet.createDocument(); 
     40                d.parsed["type"] = "SearchLog"; 
     41                d.parsed["condition"] = c; 
     42                d.save(); 
     43                add(d); 
     44            } 
    2145        } 
    2246    } 
  • lang/csharp/soyText/soyText/bin/Debug/soyText.application

    r33578 r33649  
    1212        </dsig:Transforms> 
    1313        <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 
    14         <dsig:DigestValue>yllOjAJh5FQBMq+0fPbgiYaPPIY=</dsig:DigestValue> 
     14        <dsig:DigestValue>NzImv/+409azqvCZyF3CI7ckSG0=</dsig:DigestValue> 
    1515      </hash> 
    1616    </dependentAssembly> 
  • lang/csharp/soyText/soyText/bin/Debug/soyText.exe.manifest

    r33578 r33649  
    113113  </dependency> 
    114114  <dependency> 
    115     <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="soyText.exe" size="79872"> 
     115    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="soyText.exe" size="80896"> 
    116116      <assemblyIdentity name="soyText" version="1.0.0.0" language="neutral" processorArchitecture="msil" /> 
    117117      <hash> 
     
    120120        </dsig:Transforms> 
    121121        <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 
    122         <dsig:DigestValue>SM+YQyrIGxxBmOx2qOf4KCKAS44=</dsig:DigestValue> 
     122        <dsig:DigestValue>xoIpTSHlzPf6s71Jq19Wy0TeQ30=</dsig:DigestValue> 
    123123      </hash> 
    124124    </dependentAssembly> 
  • lang/csharp/soyText/soyText/bin/Debug/soyText.vshost.application

    r33578 r33649  
    1212        </dsig:Transforms> 
    1313        <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> 
    14         <dsig:DigestValue>yllOjAJh5FQBMq+0fPbgiYaPPIY=</dsig:DigestValue> 
     14        <dsig:DigestValue>NzImv/+409azqvCZyF3CI7ckSG0=</dsig:DigestValue> 
    1515      </hash> 
    1616    </dependentAssembly> 
  • lang/csharp/soyText/soyText/soyText.csproj

    r33578 r33649  
    135135    <Compile Include="MatchLine.cs" /> 
    136136    <Compile Include="Mkdir.cs" /> 
     137    <Compile Include="NotCondition.cs" /> 
    137138    <Compile Include="ParsedDocument.cs" /> 
    138139    <Compile Include="ProcessExecutor.cs" />