public static void RepertoryText(NumberingEditor.NumberingRichTextBox ew) { int ss = ew.SelectionStart; int se = ew.SelectionStart + ew.SelectionLength; string st = ew.SelectedText; if (se>0) se--; if (st.IndexOf('\n')>-1){ string insertString; char [] c = ew.Text.ToCharArray(); int i=0; for(i=se;i<c.Length;i++){ if (c[i]=='\n'){ i++; break; } } ew.SelectionStart = i; ew.SelectionLength = 0; insertString = "regionend: InstanceId;"; ew.SelectedText = insertString; ew.SelectedText = "\n"; ew.SelectionStart = i+insertString.Length+1; for(i=ss;i>0;i--){ if (c[i]=='\n'){ i++; break; } } ew.SelectionStart = i; ew.SelectionLength = 0; insertString = "regionbegin: InstanceId, Activation;"; ew.SelectedText = insertString; ew.SelectedText = "\n"; ew.SelectionStart = i+insertString.Length+1; } else{ int nl = ew.Text.IndexOf('\n',se); if(nl>=0){ nl++; ew.SelectionStart = nl; ew.SelectionLength = 0; } else { nl=ew.Text.Length; ew.SelectionStart = nl; ew.SelectionLength = 0; ew.SelectedText = "\n"; } string insertString = "regionbegin: InstanceId, Activation;"; ew.SelectedText = insertString; ew.SelectedText = "\n"; insertString = "regionend: InstanceId;"; ew.SelectedText = insertString; ew.SelectedText = "\n"; ew.SelectionStart = nl+insertString.Length+1; } }
public static void RepertoryText(NumberingEditor.NumberingRichTextBox ew) { int ss = ew.SelectionStart; int se = ew.SelectionStart + ew.SelectionLength; if (se>0) se--; string insertString; char [] c = ew.Text.ToCharArray(); int i=0; for(i=se;i<c.Length;i++){ if (c[i]=='\n'){ i++; break; } } ew.SelectionStart = i; ew.SelectionLength = 0; insertString = "task: InstanceId, TaskText;"; ew.SelectedText = insertString; ew.SelectedText = "\n"; ew.SelectionStart = i+insertString.Length+1; }
public void MakeText(NumberingEditor.NumberingRichTextBox ew) { at(ew); }
public Editor(object parent, NumberingEditor.NumberingRichTextBox ew) { mRtb = ew; mscCommands.Clear(); instances.Clear(); mParent = parent; //define msc draw commands command,elementIds,instanceIds,text,[format] mscCommands.Add(new MSCCommandSyntax("actor",new int[]{},new int[]{1},new int[]{2,3},new int[]{4,5},true)); //in help mscCommands.Add(new MSCCommandSyntax("comment",new int[]{},new int[]{1},new int[]{2},new int[]{3})); //in help mscCommands.Add(new MSCCommandSyntax("commentoverall",new int[]{},new int[]{},new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("create",new int[]{},new int[]{1,2},new int[]{3,4,5})); //in help mscCommands.Add(new MSCCommandSyntax("dummyprocess",new int[]{},new int[]{1},new int[]{},new int[]{2,3},true)); //in help mscCommands.Add(new MSCCommandSyntax("found",new int[]{},new int[]{1},new int[]{2,3},new int[]{4})); //in help // mscCommands.Add(new MSCCommandSyntax("inlinebegin",new int[]{1},new int[]{2,3},new int[]{4})); //not supported // mscCommands.Add(new MSCCommandSyntax("inlineend",new int[]{1},new int[]{},new int[]{})); //not supported // mscCommands.Add(new MSCCommandSyntax("inlineseperator",new int[]{1},new int[]{},new int[]{})); //not supported mscCommands.Add(new MSCCommandSyntax("fragmentbegin",new int[]{1},new int[]{2,3},new int[]{4})); //in help mscCommands.Add(new MSCCommandSyntax("fragmentend",new int[]{1},new int[]{},new int[]{})); //in help mscCommands.Add(new MSCCommandSyntax("fragmentseparator",new int[]{1},new int[]{},new int[]{})); //in help mscCommands.Add(new MSCCommandSyntax("fragmenttext",new int[]{1},new int[]{},new int[]{2})); //in help mscCommands.Add(new MSCCommandSyntax("linecomment",new int[]{},new int[]{1},new int[]{2},new int[]{3,4})); //in help mscCommands.Add(new MSCCommandSyntax("lost",new int[]{},new int[]{1},new int[]{2,3},new int[]{4})); //in help mscCommands.Add(new MSCCommandSyntax("mark",new int[]{},new int[]{1},new int[]{2},new int[]{3})); //in help mscCommands.Add(new MSCCommandSyntax("measurebegin",new int[]{},new int[]{1},new int[]{2},new int[]{3,4})); //in help mscCommands.Add(new MSCCommandSyntax("measureend",new int[]{},new int[]{1},new int[]{2})); //in help mscCommands.Add(new MSCCommandSyntax("measurestart",new int[]{},new int[]{1},new int[]{2,3},new int[]{4,5})); //in help mscCommands.Add(new MSCCommandSyntax("measurestop",new int[]{},new int[]{1},new int[]{2,3},new int[]{4,5})); //in help mscCommands.Add(new MSCCommandSyntax("msg",new int[]{},new int[]{1,2},new int[]{3},new int[]{4})); //in help mscCommands.Add(new MSCCommandSyntax("msgbegin",new int[]{1},new int[]{2,3},new int[]{4},new int[]{5})); //in help mscCommands.Add(new MSCCommandSyntax("msgend",new int[]{1},new int[]{},new int[]{})); //in help mscCommands.Add(new MSCCommandSyntax("process",new int[]{},new int[]{1},new int[]{2,3},new int[]{4,5},true)); //in help mscCommands.Add(new MSCCommandSyntax("ref",new int[]{},new int[]{1,2},new int[]{3})); //in help mscCommands.Add(new MSCCommandSyntax("regionend",new int[]{},new int[]{1},new int[]{})); //in help // mscCommands.Add(new MSCCommandSyntax("regionstart",new int[]{},new int[]{1},new int[]{},new int[]{2})); //not supported mscCommands.Add(new MSCCommandSyntax("regionbegin",new int[]{},new int[]{1},new int[]{},new int[]{2})); //in help mscCommands.Add(new MSCCommandSyntax("settimer",new int[]{},new int[]{1},new int[]{2},new int[]{3})); //in help // mscCommands.Add(new MSCCommandSyntax("sidecomment",new int[]{},new int[]{},new int[]{1},new int[]{2})); //not supported mscCommands.Add(new MSCCommandSyntax("state",new int[]{},new int[]{1},new int[]{2},new int[]{3,4})); //in help mscCommands.Add(new MSCCommandSyntax("stateoverall",new int[]{},new int[]{},new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("stop",new int[]{},new int[]{1},new int[]{})); //in help mscCommands.Add(new MSCCommandSyntax("stoptimer",new int[]{},new int[]{1},new int[]{2},new int[]{3})); //in help mscCommands.Add(new MSCCommandSyntax("task",new int[]{},new int[]{1},new int[]{2},new int[]{3})); mscCommands.Add(new MSCCommandSyntax("timeout",new int[]{},new int[]{1},new int[]{2},new int[]{3})); //in help // mscCommands.Add(new MSCCommandSyntax("timeoutbegin",new int[]{},new int[]{1},new int[]{2},new int[]{3,4})); //not supported // mscCommands.Add(new MSCCommandSyntax("timeoutend",new int[]{},new int[]{1},new int[]{2},new int[]{3})); //not supported // mscCommands.Add(new MSCCommandSyntax("timeoutstop",new int[]{},new int[]{1},new int[]{2},new int[]{3})); //not supported mscCommands.Add(new MSCCommandSyntax("timerbegin",new int[]{1},new int[]{2},new int[]{3},new int[]{4,5})); //in help mscCommands.Add(new MSCCommandSyntax("timerend",new int[]{1},new int[]{},new int[]{2},new int[]{3})); //in help // define property commands mscCommands.Add(new MSCCommandSyntax("printauthor", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("printcompany", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("printversion", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("printdate", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("printcreationdate", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("printfilename", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("printfootline", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("author", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("company", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("version", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("date", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("backcolor", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("fillcolor", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("textcolor", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("lineoffset", new int[]{1})); //in help // mscCommands.Add(new MSCCommandSyntax("mscname", new int[]{1})); //not supported mscCommands.Add(new MSCCommandSyntax("diagramname", new int[]{1})); //in help // mscCommands.Add(new MSCCommandSyntax("mscheight", new int[]{1,2})); //not supported // mscCommands.Add(new MSCCommandSyntax("mscmarginbottom", new int[]{1,2})); //not supported // mscCommands.Add(new MSCCommandSyntax("mscmarginleft", new int[]{1,2})); //not supported // mscCommands.Add(new MSCCommandSyntax("mscmarginright", new int[]{1,2})); //not supported // mscCommands.Add(new MSCCommandSyntax("mscmargintop", new int[]{1,2})); //not supported // mscCommands.Add(new MSCCommandSyntax("mscwidth", new int[]{1,2})); //not supported // mscCommands.Add(new MSCCommandSyntax("mscstyle", new int[]{1},new RunCommandFunction(((Output)mParent).CBMscStyle))); //not supported mscCommands.Add(new MSCCommandSyntax("diagramstyle", new int[]{1},new RunCommandFunction(((Output)mParent).CBMscStyle))); //in help mscCommands.Add(new MSCCommandSyntax("pagesize", new int[]{1,2,3})); //in help mscCommands.Add(new MSCCommandSyntax("pagemargins", new int[]{1,2,3,4,5})); //in help mscCommands.Add(new MSCCommandSyntax("left", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("right", new int[]{1})); //in help mscCommands.Add(new MSCCommandSyntax("font", new int[]{1,2,3})); //in help mscCommands.Add(new MSCCommandSyntax("nextpage", new int[]{})); //in help //mscCommands.Add(new MSCCommandSyntax("mscfont", new int[]{1})); //this.ThChecks = new Thread(new ThreadStart(Checks)); //this.ThChecks.Start(); }
void RtbMscEditor_LineChanged(object sender, NumberingEditor.LineChangedEventArgs e) { SetLineNumber(e.Line); }
public static void RepertoryText(NumberingEditor.NumberingRichTextBox ew) { }
public static void RepertoryText(NumberingEditor.NumberingRichTextBox ew) { int ss = ew.SelectionStart; int se = ew.SelectionStart + ew.SelectionLength; if (se>0) se--; string insertString; char [] c = ew.Text.ToCharArray(); int i=0; for(i=se;i<c.Length;i++){ if (c[i]=='\n'){ i++; break; } } ew.SelectionStart = i; ew.SelectionLength = 0; insertString = "create: InstanceIdSource, InstanceIdDestination, MessageText, ProcessName, ProcessDescription;"; ew.SelectedText = insertString; ew.SelectedText = "\n"; ew.SelectionStart = i+insertString.Length+1; }