Exemplo n.º 1
0
        public static Grid SrcmbrHoverHandler(DataTable ContentTable, ScreenItemInstance Instance)
        {
            string srcmbr, srcfName, srcfLib;
            ObservableCollection <string> Lines = new ObservableCollection <string>();

            {
                var rv = GetSrcmbrName(ContentTable, Instance);
                srcfName = rv.Item1;
                srcfLib  = rv.Item2;
                srcmbr   = rv.Item3;
            }

            SrcmbrModel model = new SrcmbrModel()
            {
                Lines    = Lines,
                SrcfName = srcfName,
                Srcmbr   = srcmbr
            };

            var lines = GetSrcmbrLines(srcfName, srcfLib, srcmbr);

            foreach (var line in lines)
            {
                Lines.Add(line);
            }

            var grid = BuildControls(model);

            return(grid);
        }
Exemplo n.º 2
0
        private static StackPanel gridMain_AddSrcmbrNameRow(Grid gridMain, SrcmbrModel model)
        {
            var sp = new StackPanel();

            sp.Orientation = Orientation.Horizontal;
            sp.Background  = Brushes.LightBlue;

            {
                var lab1 = new Label();
                lab1.Content           = "Source file:";
                lab1.FontWeight        = FontWeights.Bold;
                lab1.VerticalAlignment = VerticalAlignment.Center;
                lab1.Margin            = new Thickness(0, 0, 3, 0);
                sp.Children.Add(lab1);
            }

            {
                var tb = new TextBlock();
                tb.VerticalAlignment = VerticalAlignment.Center;

                var binding = new Binding();
                binding.Source = model;
                binding.Path   = new PropertyPath("SrcfName");
                binding.Mode   = BindingMode.OneWay;
                BindingOperations.SetBinding(tb, TextBlock.TextProperty, binding);
                sp.Children.Add(tb);
            }

            {
                var lab1 = new Label();
                lab1.Content           = "Source member:";
                lab1.FontWeight        = FontWeights.Bold;
                lab1.Margin            = new Thickness(3, 0, 3, 0);
                lab1.VerticalAlignment = VerticalAlignment.Center;
                sp.Children.Add(lab1);
            }

            {
                var tb = new TextBlock();
                tb.VerticalAlignment = VerticalAlignment.Center;

                var binding = new Binding();
                binding.Source = model;
                binding.Path   = new PropertyPath("Srcmbr");
                binding.Mode   = BindingMode.OneWay;
                BindingOperations.SetBinding(tb, TextBlock.TextProperty, binding);
                sp.Children.Add(tb);
            }

            return(sp);
        }
Exemplo n.º 3
0
        public static Grid SrcmbrHoverHandler(string SrcfName, string SrcfLib, string Srcmbr)
        {
            ObservableCollection <string> Lines = new ObservableCollection <string>();

            SrcmbrModel model = new SrcmbrModel()
            {
                Lines    = Lines,
                SrcfName = SrcfName,
                Srcmbr   = Srcmbr
            };

            var lines = GetSrcmbrLines(SrcfName, SrcfLib, Srcmbr);

            foreach (var line in lines)
            {
                Lines.Add(line);
            }

            var grid = BuildControls(model);

            return(grid);
        }
Exemplo n.º 4
0
        private static Grid BuildControls(SrcmbrModel model)
        {
            Grid gridMain = new Grid();

            gridMain.ColumnDefinitions.AddStarColumn();
            gridMain.RowDefinitions.AddAutoRow();
            gridMain.RowDefinitions.AddAutoRow();
            gridMain.RowDefinitions.AddStarRow();
            gridMain.RowDefinitions.AddAutoRow();

            var sp = gridMain_AddSrcmbrNameRow(gridMain, model);

            gridMain.AddUIElement(sp, 0, 0);

            var but = gridMain.AddButton("butOk", "OK", 3, 0);

            but.Click += But_Click;
            but.HorizontalAlignment = HorizontalAlignment.Left;
            but.Margin  = new Thickness(5);
            but.Padding = new Thickness(5, 0, 5, 0);

            var listBox1 = gridMain.AddListBox(null, 2, 0);

            listBox1.FontFamily = new System.Windows.Media.FontFamily("Lucida console");
            listBox1.FontSize   = 12;
            listBox1.Padding    = new Thickness(3);

            var binding = new Binding();

            binding.Source = model;
            binding.Path   = new PropertyPath("Lines");
            binding.Mode   = BindingMode.OneWay;
            BindingOperations.SetBinding(listBox1, ListBox.ItemsSourceProperty, binding);

            return(gridMain);
        }