Code.ElementInList(int)

Here are the examples of the csharp api class Code.ElementInList(int) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

1. Example

Project: Unity3D-Python-Editor
Source File: Code.cs
View license
public string GetLine(int NumberLine)
    {
        if(!ElementInList(NumberLine))
            return string.Empty;

        return string.Join("",Lines[NumberLine-1].ToArray());
    }

2. Example

Project: Unity3D-Python-Editor
Source File: Code.cs
View license
private void UpdateLineText(int NumberLine, string LineText)
    {   
        if(InterpreterView) {
            CurrentLine = LineText;
            return;
        }

        if(!ElementInList(NumberLine))
            return;

        Lines[NumberLine-1] = new List<string>();

        foreach(Match results in Regex.Matches(LineText,@"(\t)|(\w+)|(\s+)|(.)"))
            Lines[NumberLine-1].Add(results.Value);

        CurrentLine = LineText;
    }

3. Example

Project: Unity3D-Python-Editor
Source File: Code.cs
View license
public void RemoveText()
    {
        if(!ElementInList(Line) && !InterpreterView)
            return;

        if(Column > 0) {
            //Remove single char.
            GoLeft();
            string LineTab = CurrentLine;

            LineTab = LineTab.Remove(Math.Max(0,ColumnIndex),1);
            UpdateLineText(Line,LineTab);           

        }else if(!InterpreterView && Line != 1) {
            //Remove line.
            Lines[Line-2].Add(CurrentLine);

            Lines.RemoveAt(Line-1);
            GoUp();

            Column = GetLine(Line-1).IndexOf(CurrentLine);
            SetColumnIndex();
        }
    }