Example #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);
        }
        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();
            }
        }
Example #3
0
 private static string GetFullText(IBaseConstruct bc)
 {
     return(bc != null?bc.GetFullText() : string.Empty);
 }
 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;
 }