current work
git-svn-id: https://lsleditor.svn.sourceforge.net/svnroot/lsleditor@10 3f4676ac-adda-40fd-8265-58d1435b1672
This commit is contained in:
parent
3151e1e342
commit
e6edb01d66
3 changed files with 1067 additions and 972 deletions
|
@ -2020,7 +2020,59 @@ namespace LSLEditor
|
||||||
EndUpdate();
|
EndUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void doOutline()
|
||||||
|
{
|
||||||
|
//TODO: finish the outline class and such
|
||||||
|
// still a work in progress trying to figure out exactly how i wanna do this.
|
||||||
|
int len = this.Lines.Length;
|
||||||
|
if (len < 1)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Dictionary<int, Helpers.OutlineHelper> list = new Dictionary<int, LSLEditor.Helpers.OutlineHelper>();
|
||||||
|
using (StringReader reader = new StringReader(this.Text))
|
||||||
|
{
|
||||||
|
string line;
|
||||||
|
|
||||||
|
int lineNumber = 0;
|
||||||
|
while ((line = reader.ReadLine()) != null)
|
||||||
|
{
|
||||||
|
string[] words = line.Split(' ');
|
||||||
|
foreach (string word in words)
|
||||||
|
{
|
||||||
|
if (keyWords.ContainsKeyWord(word))
|
||||||
|
{
|
||||||
|
KeyWordInfo k = keyWords.GetKeyWordInfo(word);
|
||||||
|
switch (k.type)
|
||||||
|
{
|
||||||
|
case KeyWordTypeEnum.Functions:
|
||||||
|
list.Add(lineNumber, new LSLEditor.Helpers.OutlineHelper(k, lineNumber));
|
||||||
|
break;
|
||||||
|
case KeyWordTypeEnum.Events:
|
||||||
|
break;
|
||||||
|
case KeyWordTypeEnum.Constants:
|
||||||
|
break;
|
||||||
|
case KeyWordTypeEnum.Class:
|
||||||
|
break;
|
||||||
|
case KeyWordTypeEnum.Vars:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lineNumber++;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//TODO: parse dict and create the outline in the treeview
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
public void SaveCurrentFile(string strPath)
|
public void SaveCurrentFile(string strPath)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
17
trunk/Helpers/OutlineHelper.cs
Normal file
17
trunk/Helpers/OutlineHelper.cs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace LSLEditor.Helpers
|
||||||
|
{
|
||||||
|
class OutlineHelper
|
||||||
|
{
|
||||||
|
public KeyWordInfo info;
|
||||||
|
public int line;
|
||||||
|
public OutlineHelper(KeyWordInfo i, int l)
|
||||||
|
{
|
||||||
|
this.info = i;
|
||||||
|
this.line = l;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1970
trunk/LSLEditorForm.Designer.cs
generated
1970
trunk/LSLEditorForm.Designer.cs
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue