Interaction logic for SnapshotItem.xaml
상속: System.Windows.Controls.UserControl
예제 #1
0
        private void Add_Clicked(TrakHound_UI.Button bt)
        {
            var snapshot = new Controls.SnapshotItem(this);

            snapshot.SettingChanged += Snapshot_SettingChanged;
            snapshot.RemoveClicked  += Snapshot_RemoveClicked;
            SnapshotItems.Add(snapshot);

            SettingChanged?.Invoke(null, null, null);
        }
예제 #2
0
        private void Snapshot_RemoveClicked(Controls.SnapshotItem item)
        {
            int index = SnapshotItems.ToList().FindIndex(x => x.Id == item.Id);

            if (index >= 0)
            {
                SnapshotItems.RemoveAt(index);
            }

            SettingChanged?.Invoke(null, null, null);
        }
예제 #3
0
        public void LoadConfiguration(DataTable dt)
        {
            LoadGeneratedEventItems(dt);

            string address = "/GeneratedData/SnapShotData/";

            string   filter = "address LIKE '" + address + "*'";
            DataView dv     = dt.AsDataView();

            dv.RowFilter = filter;
            DataTable temp_dt = dv.ToTable();

            temp_dt.PrimaryKey = new DataColumn[] { temp_dt.Columns["address"] };

            SnapshotItems.Clear();

            foreach (DataRow row in temp_dt.Rows)
            {
                var snapshot = new Snapshot();
                snapshot.Name = DataTable_Functions.TrakHound.GetRowAttribute("name", row);

                string type = DataTable_Functions.TrakHound.GetLastNode(row);
                if (type != null)
                {
                    switch (type.ToLower())
                    {
                    case "collected": snapshot.Type = SnapshotType.Collected; break;

                    case "generated": snapshot.Type = SnapshotType.Generated; break;

                    case "variable": snapshot.Type = SnapshotType.Variable; break;
                    }
                }

                snapshot.Link = DataTable_Functions.TrakHound.GetRowAttribute("link", row);

                var item = new Controls.SnapshotItem(this, snapshot);
                item.SettingChanged += Snapshot_SettingChanged;
                item.RemoveClicked  += Snapshot_RemoveClicked;
                SnapshotItems.Add(item);
            }

            if (!Loaded)
            {
                LoadCollectedItems(probeData);
            }
        }
예제 #4
0
        private void Add_Clicked(TrakHound_UI.Button bt)
        {
            var snapshot = new Controls.SnapshotItem(this);
            snapshot.SettingChanged += Snapshot_SettingChanged;
            snapshot.RemoveClicked += Snapshot_RemoveClicked;
            SnapshotItems.Add(snapshot);

            SettingChanged?.Invoke(null, null, null);
        }
예제 #5
0
        public void LoadConfiguration(DataTable dt)
        {
            LoadGeneratedEventItems(dt);

            string address = "/GeneratedData/SnapShotData/";

            string filter = "address LIKE '" + address + "*'";
            DataView dv = dt.AsDataView();
            dv.RowFilter = filter;
            DataTable temp_dt = dv.ToTable();
            temp_dt.PrimaryKey = new DataColumn[] { temp_dt.Columns["address"] };

            SnapshotItems.Clear();

            foreach (DataRow row in temp_dt.Rows)
            {
                var snapshot = new Snapshot();
                snapshot.Name = DataTable_Functions.TrakHound.GetRowAttribute("name", row);

                string type = DataTable_Functions.TrakHound.GetLastNode(row);
                if (type != null)
                {
                    switch (type.ToLower())
                    {
                        case "collected": snapshot.Type = SnapshotType.Collected; break;
                        case "generated": snapshot.Type = SnapshotType.Generated; break;
                        case "variable": snapshot.Type = SnapshotType.Variable; break;
                    }
                }

                snapshot.Link = DataTable_Functions.TrakHound.GetRowAttribute("link", row);

                var item = new Controls.SnapshotItem(this, snapshot);
                item.SettingChanged += Snapshot_SettingChanged;
                item.RemoveClicked += Snapshot_RemoveClicked;
                SnapshotItems.Add(item);
            }

            if (!Loaded) LoadCollectedItems(probeData);
        }