Interaction logic for Window1.xaml
Inheritance: System.Windows.Window
Exemplo n.º 1
0
        public LoggerManager()
            : base(GearsetSettings.Instance.LoggerConfig)
        {
            // Create the back-end collections
            Streams     = new ObservableCollection <StreamItem>();
            LogItems    = new FixedLengthQueue <LogItem>(500);
            LogItemsOld = new FixedLengthQueue <LogItem>(10000);
            //LogItems.DequeueTarget = LogItemsOld;
            Streams.Add(defaultStream = new StreamItem {
                Name = "Default", Enabled = true, Color = colors[currentColor++]
            });

            // Create the window.
            Window = new LoggerWindow();

            Window.Top               = Config.Top;
            Window.Left              = Config.Left;
            Window.Width             = Config.Width;
            Window.Height            = Config.Height;
            Window.IsVisibleChanged += new DependencyPropertyChangedEventHandler(logger_IsVisibleChanged);
            Window.SoloRequested    += new EventHandler <SoloRequestedEventArgs>(logger_SoloRequested);

            WindowHelper.EnsureOnScreen(Window);

            if (Config.Visible)
            {
                Window.Show();
            }

            filteredView        = CollectionViewSource.GetDefaultView(LogItems);
            filteredView.Filter = (a) => ((LogItem)a).Stream.Enabled;
            filteredView.GroupDescriptions.Add(new PropertyGroupDescription("UpdateNumber"));
            Window.LogListBox.DataContext    = filteredView;
            Window.StreamListBox.DataContext = Streams;

            Window.LocationChanged += new EventHandler(logger_LocationChanged);
            Window.SizeChanged     += new SizeChangedEventHandler(logger_SizeChanged);

            scrollViewer = GetDescendantByType(Window.LogListBox, typeof(ScrollViewer)) as ScrollViewer;
        }
Exemplo n.º 2
0
        public LoggerManager()
            : base(GearsetSettings.Instance.LoggerConfig)
        {
            // Create the back-end collections
            Streams = new ObservableCollection<StreamItem>();
            LogItems = new FixedLengthQueue<LogItem>(500);
            LogItemsOld = new FixedLengthQueue<LogItem>(10000);
            //LogItems.DequeueTarget = LogItemsOld;
            Streams.Add(_defaultStream = new StreamItem { Name = "Default", Enabled = true, Color = _colors[_currentColor++] });

            // Create the window.
            Window = new LoggerWindow();

            Window.Top = Config.Top;
            Window.Left = Config.Left;
            Window.Width = Config.Width;
            Window.Height = Config.Height;
            Window.IsVisibleChanged += logger_IsVisibleChanged;
            Window.SoloRequested += logger_SoloRequested;

            WindowHelper.EnsureOnScreen(Window);

            if (Config.Visible)
                Window.Show();

            FilteredView = CollectionViewSource.GetDefaultView(LogItems);
            FilteredView.Filter = a => ((LogItem)a).Stream.Enabled;
            FilteredView.GroupDescriptions.Add(new PropertyGroupDescription("UpdateNumber"));
            Window.LogListBox.DataContext = FilteredView;
            Window.StreamListBox.DataContext = Streams;

            Window.LocationChanged += logger_LocationChanged;
            Window.SizeChanged += logger_SizeChanged;

            _scrollViewer = GetDescendantByType(Window.LogListBox, typeof(ScrollViewer)) as ScrollViewer;
        }