private void FillDataGrid(string baseName)
        {
            DataGrid DG = new DataGrid();

            PlaceForData.Children.Add(DG);


            ////Colors
            DG.Background    = Brushes.Black;
            DG.IsReadOnly    = true;
            DG.RowBackground = Brushes.Gray;
            ///
            DG.Columns.Add(new DataGridTextColumn());
            List <string[]> rules = FileAdapter.GetAllRuleForDisplay(baseName);
            List <DataItem> items = new List <DataItem>();

            foreach (string[] rule in rules)
            {
                items.Add(new DataItem()
                {
                    warunki = rule[0], rezultat = rule[1]
                });
            }
            DG.ItemsSource = items;
        }
Exemple #2
0
        public DelRule(string baseName)
        {
            InitializeComponent();
            this.baseName = baseName;
            List <string[]> Rules = FileAdapter.GetAllRuleForDisplay(baseName);

            GoodRules = new List <string>();
            foreach (string[] rule in Rules)
            {
                GoodRules.Add(rule[0] + " = " + rule[1]);
            }
            RuleComboBox.ItemsSource = GoodRules;
        }