Пример #1
0
        private static string GetObjectText(IBaseConstruct obj)
        {
            string text = obj.IsLeaf ? obj.GetFullText() : obj.GetOuterText();

            text = Common.Utility.StandardizeLineBreaks(text, Common.Utility.LineBreaks.Unix);
            if (text.IndexOf('\n') == 0)
            {
                text = text.Remove(0, 1);
            }
            return(text);
        }
Пример #2
0
        private void ComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox box = sender as ComboBox;

            if (box == null)
            {
                return;
            }

            List <IBaseConstruct> constructs;
            SyntaxEditor          editor;

            if (sender == userComboBox)
            {
                constructs = userOptions;
                editor     = userSyntaxEditor;
            }
            else if (sender == templateComboBox)
            {
                constructs = templateOptions;
                editor     = templateSyntaxEditor;
            }
            else
            {
                constructs = prevgenOptions;
                editor     = prevgenSyntaxEditor;
            }

            if (box.SelectedIndex == 0)
            {
                editor.Text = "";
            }
            else
            {
                IBaseConstruct construct = constructs[box.SelectedIndex - 1];
                editor.Text = construct.GetFullText().TrimStart();
            }
        }
Пример #3
0
 private static string GetFullText(IBaseConstruct bc)
 {
     return(bc != null?bc.GetFullText() : string.Empty);
 }
Пример #4
0
 private static string GetObjectText(IBaseConstruct obj)
 {
     string text = obj.IsLeaf ? obj.GetFullText() : obj.GetOuterText();
     text = Common.Utility.StandardizeLineBreaks(text, Common.Utility.LineBreaks.Unix);
     if (text.IndexOf('\n') == 0)
         text = text.Remove(0, 1);
     return text;
 }