Beispiel #1
0
 // this is the master, general constructor
 public Filter(FilterSet parent)
 {
     Active = true;
     InclusionFilter = true;
     filterlist = new ObservableCollection<FilterItem>();
     Parent = parent;
 }
Beispiel #2
0
        //    public static DataGrid PacketDG;    // copy of packet data grid reference, static so that other classes can refer to it
        // TEMPORARY - PROVISION FOR VIEWING QF EXLUDED PACKETS
        // WHEN NO LONGER NEEDED, ALSO DELETE
        //        CODE IN ETHER AND IP4 HEADER STATIC CONSTRUCTORS THAT CREATES THE EXTRA HF ENTRIES
        //public static DataGrid ExclDG;    // copy of packet data grid reference, static so that other classes can refer to it
        public MainWindow()
        {
            pkts = new ObservableCollection<Packet>();
            // line below is deprecated
            // exclpkts = new ObservableCollection<Packet>();

            filters = new FilterSet();

            grouplistlist = new ObservableCollection<GList>();
            grouplistlist.Add(new DNSGList("DNS Groups"));
            grouplistlist.Add(new DHCP4GList("DHCP4 Groups"));
            grouplistlist.Add(new TCPGList("TCP Groups"));
            grouplistlist.Add(new UDPGList("UDP Groups"));
            grouplistlist.Add(new ARPGList("ARP Groups"));
            grouplistlist.Add(new GList("Ungrouped Packets"));

            InitializeComponent();

            grid.DataContext = this;
            //QFExclGrid.DataContext = qfexcluded;
            //PacketDG = PacketDataGrid;
            //ExclDG = QFExclGrid;

            // try to restore window position and other settings - see "Programing WPF Second Edition" page 321
            try
            {
                Rect bounds = Properties.Settings.Default.WindowPositionMain;
                WindowState = WindowState.Normal;
                Top = bounds.Top;
                Left = bounds.Left;
                Width = bounds.Width;
                Height = bounds.Height;
                GUIUtil.Instance.Hex = Properties.Settings.Default.Hex;
                GUIUtil.Instance.UseAliases = Properties.Settings.Default.UseAliases;
            }
            catch
            { MessageBox.Show("problem retrieving stored settings"); }

            Closing += MainWindow_Closing;   // add handler for Closing event, to save window state
        }