Ejemplo n.º 1
0
 private void window1_Loaded(object sender, RoutedEventArgs e)
 {
     log.Info("Setting the UI Culture to fr-FR");
     Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR");
     //log.Info("Setting Max Width to " + SystemParameters.PrimaryScreenWidth);
     //MaxWidth = SystemParameters.PrimaryScreenWidth;
     log.Info("Initializing event handler for ListView control");
     listView1.AddHandler(ButtonBase.ClickEvent, new RoutedEventHandler(listView1_HeaderClicked));
     log.Info("Setting the RecentFileList to" + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)));
     RecentFileList.UseXmlPersister(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "YourLog4NetViewer"));
     //RecentFileList.UseXmlPersister(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "EnaxosLogViewer.filehistory.xml"));
     log.Info("Initializing the RecentFiles menu click");
     RecentFileList.MenuClick += (s, ee) => openFile(ee.FilePath);
     log.Info("Initializing Error Bitmap");
     imageError.Source = Imaging.CreateBitmapSourceFromHIcon(SystemIcons.Error.Handle, Int32Rect.Empty, null);
     log.Info("Initializing Info Bitmap");
     imageInfo.Source = Imaging.CreateBitmapSourceFromHIcon(SystemIcons.Information.Handle, Int32Rect.Empty, null);
     log.Info("Initializing Warn  Bitmap");
     imageWarn.Source = Imaging.CreateBitmapSourceFromHIcon(SystemIcons.Warning.Handle, Int32Rect.Empty, null);
     log.Info("Initializing Debug Bitmap");
     imageDebug.Source = Imaging.CreateBitmapSourceFromHIcon(SystemIcons.Question.Handle, Int32Rect.Empty, null);
     Title             = string.Format(Properties.Resources.WindowTitle + (!string.IsNullOrWhiteSpace(FileName) ? " - " + FileName : string.Empty), Assembly.GetExecutingAssembly().GetName().Version);
     log.Info("Setting the title as " + Title);
     log.Info("Applying ExpressionDark Theme");
     this.ApplyTheme("ExpressionDark");
     log.Info("Setting the GridView widths for each column");
     foreach (var gvc in GridView1.Columns)
     {
         gvc.Width = gvc.ActualWidth;
         gvc.Width = Double.NaN;
     }
     mergedFiles.ForEach(mergedFile => RecentFileList.InsertFile(mergedFile));
 }
Ejemplo n.º 2
0
        public Window1()
        {
            InitializeComponent();
            listView1.AddHandler(GridViewColumnHeader.ClickEvent, new RoutedEventHandler(ListView1_HeaderClicked));
            RecentFileList.UseXmlPersister();
            RecentFileList.MenuClick += (s, e) => OpenFile(e.Filepath);

            imageError.Source = Imaging.CreateBitmapSourceFromHIcon(SystemIcons.Error.Handle, Int32Rect.Empty, null);
            imageInfo.Source  = Imaging.CreateBitmapSourceFromHIcon(SystemIcons.Information.Handle, Int32Rect.Empty, null);
            imageWarn.Source  = Imaging.CreateBitmapSourceFromHIcon(SystemIcons.Warning.Handle, Int32Rect.Empty, null);
            imageDebug.Source = Imaging.CreateBitmapSourceFromHIcon(SystemIcons.Question.Handle, Int32Rect.Empty, null);

            Title = string.Format("LogViewer  v.{0}", Assembly.GetExecutingAssembly().GetName().Version);
        }
Ejemplo n.º 3
0
        public LogViewerWindow()
        {
            InitializeComponent();
            this.DataContext = this;
            listView1.AddHandler(ButtonBase.ClickEvent, new RoutedEventHandler(ListView1_HeaderClicked));

            RecentFileList.UseXmlPersister();
            RecentFileList.MenuClick += (s, e) => OpenFile(e.Filepath);

            InitLevelIcons();

            Title = string.Format("LogViewer  v.{0}", Assembly.GetExecutingAssembly().GetName().Version);

            EntryCollection = CollectionViewSource.GetDefaultView(Entries);
            PopulateLevelDropDown();
        }