Example #1
0
 protected ChildView(SourceView master, string name, string configFileName = null)
     : base(master, configFileName)
 {
     Title = name;
     Master = master;
     Frame.Activated += (a, b) => Master.SelectSource(Source);
 }
Example #2
0
        static Control CreateView(this Compound compound, int viewPosition, SourceView master)
        {
            var x = compound
                .CachedResults
                .Select(i => i.Data.CreateView(master))
                .ToArray();

            var result = new TableLayoutPanel
            {
                AutoSize = true,
                AutoSizeMode = AutoSizeMode.GrowAndShrink,
                ColumnCount = 2,
                RowCount = x.Length,
                CellBorderStyle = TableLayoutPanelCellBorderStyle.Single
            };

            for(var i = 0; i < x.Length; i++)
            {
                var control = ((i < viewPosition ? "" : "?") + i).CreateView(1.5);
                var sourcePart = compound.Syntax.Statements[i].SourcePart;
                control.Click += (a, b) => master.SelectSource(sourcePart);
                result.Controls.Add(control, 0, i);
                result.Controls.Add(x[i], 1, i);
            }

            return result;
        }