public virtual void FillTypeList( ClassOrStructBlock callingClass, IFillable <TextPictureInfo> typeListToFill) { foreach (string s in EmbeddedTypes) { TextPictureInfo result = new TextPictureInfo(s); if (s == "object" || s == "string") { result.Picture = Icons.TypeClass; } else { result.Picture = Icons.TypeStruct; } typeListToFill.Add(result); } CodeUnitBlock codeUnit = callingClass.Root as CodeUnitBlock; if (codeUnit != null && codeUnit.UsingSection != null) { foreach (UsingDirective u in codeUnit.UsingDirectives) { CacheUsing(u); IList <Type> types = null; Types.TryGetValue(u.Text, out types); if (types != null) { AddTypes(types, typeListToFill); } } } }
public static string Print(CodeUnitBlock block) { PrettyPrinter visitor = new PrettyPrinter(); block.AcceptVisitor(visitor); return(visitor.ToString()); }
private void ButtonOpen_Click(object sender, EventArgs e) { string fileName = AskOpenFileName(); if (!string.IsNullOrEmpty(fileName) && File.Exists(fileName)) { CodeUnit = LoadFromString(File.ReadAllText(fileName)); } }
public static MethodBlock FindMain(CodeUnitBlock root) { IEnumerable <MethodBlock> results = FindMethods(root, "Main"); IEnumerator <MethodBlock> enumerator = results.GetEnumerator(); if (enumerator != null && enumerator.MoveNext()) { return(enumerator.Current); } return(null); }
public static IEnumerable <MethodBlock> FindMethods( CodeUnitBlock root, string methodName) { foreach (MethodBlock method in root.FindChildrenRecursive <MethodBlock>()) { if (method.Name == methodName) { yield return(method); } } }
public EditorForm() { InitializeComponent(); viewWindow1.Repaint += viewWindow1_Repaint; CodeUnit = new CodeUnitBlock(); ToggleContextHelp(); ButtonContextHelp.Checked = !SplitterMain.Panel2Collapsed; DisplayContextHelp(); EnableUI(); }
public static LanguageService Get(Block blockFromTreeWithLanguageService) { if (blockFromTreeWithLanguageService != null && blockFromTreeWithLanguageService.Root != null) { CodeUnitBlock codeUnit = blockFromTreeWithLanguageService.Root as CodeUnitBlock; if (codeUnit != null) { return(codeUnit.LanguageService); } } return(null); }
public OptionsForm(CodeUnitBlock codeUnit) { InitializeComponent(); CodeUnit = codeUnit; DesignOfUniversalControlCombo.SelectedValueChanged += DesignOfUniversalControlCombo_SelectedValueChanged; DesignOfUniversalControlCombo.Value = Settings.Current.DesignOfUniversalControl; CurlyCombo.SelectedItem = Settings.Current.CurliesInUniversalControl.ToString(); CurlyCombo.SelectedValueChanged += CurlyCombo_SelectedValueChanged; FontSizeBox.Value = Settings.Current.FontSize; StylesProperties.Fill(StyleFactory.Instance); StylesProperties.Changed += StylesProperties_Changed; }
public virtual void Visit(CodeUnitBlock block) { }
public override void Visit(CodeUnitBlock block) { }
public static string Print(CodeUnitBlock block) { PrettyPrinter visitor = new PrettyPrinter(); block.AcceptVisitor(visitor); return visitor.ToString(); }
public override void Visit(CodeUnitBlock block) { VisitContainer(block); }
public static void ShowOptions(CodeUnitBlock codeUnit) { (new OptionsForm(codeUnit)).ShowDialog(); }