Hi, I've written a small SWF GUI for consulting event logs and its entries that mimics the Windows Event Viewer.
It's far from complete, but it's usable. A screenshot is (temporary) available here: http://nant.sourceforge.net/screenshot.png However, I seem to have a Makefile (lack of knowlege) problem: I need to compile a .resx file (EventViewer.resx) into a .resources using resgen, but I can't manage to get it to work. I don't know anything about Make (or the Mono buildsystem), so it's probably something easy. Can someone have a look at this ? Miguel, is it ok to commit this patch (or should I wait until the Makefile issue is resolved) ? Gert
Index: AssemblyInfo.cs =================================================================== --- AssemblyInfo.cs (revision 0) +++ AssemblyInfo.cs (revision 0) @@ -0,0 +1,15 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] Property changes on: AssemblyInfo.cs ___________________________________________________________________ Name: svn:eol-style + native Index: default.build =================================================================== --- default.build (revision 0) +++ default.build (revision 0) @@ -0,0 +1,24 @@ +<project name="EventViewer" default="build"> + <target name="clean"> + <delete file="eventvwr.exe" /> + </target> + + <target name="build"> + <csc target="winexe" output="eventvwr.exe" warnaserror="true" win32icon="resources/eventlog.ico"> + <sources> + <includesfile name="eventvwr.exe.sources" /> + </sources> + <references> + <include name="System.dll" /> + <include name="System.Drawing.dll" /> + <include name="System.Windows.Forms.dll" /> + </references> + <resources prefix="Mono.Tools.EventViewer" dynamicprefix="true"> + <include name="Resources/*.ico" /> + <include name="**/*.resx" /> + </resources> + </csc> + </target> + + <target name="rebuild" depends="clean, build" /> +</project> Property changes on: default.build ___________________________________________________________________ Name: svn:eol-style + native Index: eventvwr.exe.sources =================================================================== --- eventvwr.exe.sources (revision 0) +++ eventvwr.exe.sources (revision 0) @@ -0,0 +1,2 @@ +AssemblyInfo.cs +EventViewer.cs \ No newline at end of file Property changes on: eventvwr.exe.sources ___________________________________________________________________ Name: svn:eol-style + native Index: EventViewer.csproj =================================================================== --- EventViewer.csproj (revision 0) +++ EventViewer.csproj (revision 0) @@ -0,0 +1,129 @@ +<VisualStudioProject> + <CSHARP + ProjectType = "Local" + ProductVersion = "7.10.3077" + SchemaVersion = "2.0" + ProjectGuid = "{1F3EF126-6207-4AC7-9D60-3D45FB527A1B}" + > + <Build> + <Settings + ApplicationIcon = "Resources\eventlog.ico" + AssemblyKeyContainerName = "" + AssemblyName = "EventViewer" + AssemblyOriginatorKeyFile = "" + DefaultClientScript = "JScript" + DefaultHTMLPageLayout = "Grid" + DefaultTargetSchema = "IE50" + DelaySign = "false" + OutputType = "WinExe" + PreBuildEvent = "" + PostBuildEvent = "" + RootNamespace = "Mono.Tools.EventViewer" + RunPostBuildEvent = "OnBuildSuccess" + StartupObject = "" + > + <Config + Name = "Debug" + AllowUnsafeBlocks = "false" + BaseAddress = "285212672" + CheckForOverflowUnderflow = "false" + ConfigurationOverrideFile = "" + DefineConstants = "DEBUG;TRACE" + DocumentationFile = "" + DebugSymbols = "true" + FileAlignment = "4096" + IncrementalBuild = "false" + NoStdLib = "false" + NoWarn = "" + Optimize = "false" + OutputPath = "bin\Debug\" + RegisterForComInterop = "false" + RemoveIntegerChecks = "false" + TreatWarningsAsErrors = "false" + WarningLevel = "4" + /> + <Config + Name = "Release" + AllowUnsafeBlocks = "false" + BaseAddress = "285212672" + CheckForOverflowUnderflow = "false" + ConfigurationOverrideFile = "" + DefineConstants = "TRACE" + DocumentationFile = "" + DebugSymbols = "false" + FileAlignment = "4096" + IncrementalBuild = "false" + NoStdLib = "false" + NoWarn = "" + Optimize = "true" + OutputPath = "bin\Release\" + RegisterForComInterop = "false" + RemoveIntegerChecks = "false" + TreatWarningsAsErrors = "false" + WarningLevel = "4" + /> + </Settings> + <References> + <Reference + Name = "System" + AssemblyName = "System" + HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll" + /> + <Reference + Name = "System.Drawing" + AssemblyName = "System.Drawing" + HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll" + /> + <Reference + Name = "System.Windows.Forms" + AssemblyName = "System.Windows.Forms" + HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll" + /> + </References> + </Build> + <Files> + <Include> + <File + RelPath = "App.ico" + BuildAction = "Content" + /> + <File + RelPath = "AssemblyInfo.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "EventViewer.cs" + SubType = "Form" + BuildAction = "Compile" + /> + <File + RelPath = "EventViewer.resx" + DependentUpon = "EventViewer.cs" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "Resources\computer.ico" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "Resources\error.ico" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "Resources\eventlog.ico" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "Resources\info.ico" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "Resources\warning.ico" + BuildAction = "EmbeddedResource" + /> + </Include> + </Files> + </CSHARP> +</VisualStudioProject> + Property changes on: EventViewer.csproj ___________________________________________________________________ Name: svn:eol-style + native Index: EventViewer.resx =================================================================== --- EventViewer.resx (revision 0) +++ EventViewer.resx (revision 0) @@ -0,0 +1,287 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 1.3 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">1.3</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1">this is my long string</data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + [base64 mime encoded serialized .NET Framework object] + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + [base64 mime encoded string representing a byte array form of the .NET Framework object] + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used forserialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>1.3</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="statusBar1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="statusBar1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="statusBar1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="toolBar1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="toolBar1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="toolBar1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="panel1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="panel1.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </data> + <data name="panel1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="panel1.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>8, 8</value> + </data> + <data name="panel1.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </data> + <data name="panel1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="entryList.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="entryList.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="entryList.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="imageList1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="imageList1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="imageList1.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </data> + <data name="splitter1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="splitter1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="splitter1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="logTree.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="logTree.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="logTree.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="mainMenu1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="mainMenu1.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>122, 17</value> + </data> + <data name="mainMenu1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="menuItem1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="menuItem1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="menuItem2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="menuItem2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="menuItem3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="menuItem3.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="menuItem4.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="menuItem4.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>(Default)</value> + </data> + <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="$this.Name"> + <value>EventViewer</value> + </data> + <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>8, 8</value> + </data> + <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </data> + <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>80</value> + </data> + <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </data> + <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + AAABAAMAEBAQAAAAAAAoAQAANgAAABAQAAABAAgAaAUAAF4BAAAQEAAAAQAgAGgEAADGBgAAKAAAABAA + AAAgAAAAAQAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAgACAAAAAgACAAICA + AACAgIAAwMDAAAAA/wAA/wAAAP//AP8AAAD/AP8A//8AAP///wAREREREREREREAAAAAAAAREQ////9f + 8BEQgPiIiIjwEREP////X/AREID4h4iF8BERD/+f9XXwERCA+PeIWPAREQ//l/9/8BEQgPiXjHjwEREP + /5f8f/AREID4mIyI8BERD////3/wERCA///8//AREQ//////8BERF3d3d3dxEf//AADAAwAAwAMAAIAD + AADAAwAAgAMAAMADAACAAwAAwAMAAIADAADAAwAAgAMAAMADAACAAwAAwAMAAOAHAAAoAAAAEAAAACAA + AAABAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAICA + gADA3MAA8MqmAKo/KgD/PyoAAF8qAFVfKgCqXyoA/18qAAB/KgBVfyoAqn8qAP9/KgAAnyoAVZ8qAKqf + KgD/nyoAAL8qAFW/KgCqvyoA/78qAADfKgBV3yoAqt8qAP/fKgAA/yoAVf8qAKr/KgD//yoAAABVAFUA + VQCqAFUA/wBVAA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/5L6s/7iejP9rSzP/AAAAAAAA + AABy5P//AKfp/5d/b//99vL/ADP//wAz//+5m47/x6SS/wBmAP8AZgD/pnlj/9CxpP+slIP/aUoy/wAA + AAAAAAAAAAAAAK+Vgf///fz//fn3/wAz//8AM///5NfQ/+7d1f/y3NH/AGYA/wBmAP/Kr6L/noh4/2ZH + Mf8AAAAAAAAAABmGt/+0mof////////8/P/Su6//u6SY/7mbjv/Bn43/vpWC/7qMeP8AZgD/AGYA/56I + eP9mRzH/AAAAAAAAAABy5P//AKfr/6GJev//////ADP//wAz///NyMT/AGYA/+zd2P/fz8f/AGYA/wBm + AP+slIP/aUoy/wAAAAAAAAAAAAAAAL2mk////////////wAz//8AM///r5OG/8Shj/8AZgD/AGYA/wBm + AP/u2dD/uJ6M/2tLM/8AAAAAAAAAABmGt//Dqpn///////////8AM///ADP//87Nzf/u6ej//fby//zx + 6//87eb/+unf/7uhjv9rSzP/AAAAAAAAAABy5P//AKfq/6eSg///////ADP//wAz//+5m47/x6SS/86i + jf/KmIL/xZB2//zt5v+7oY7/a0sz/wAAAAAAAAAAAAAAAM22o9b////0/////wAz//8AM///8/Pz//v7 + +//+/fz//fj3//328v/88Oz/u6GO/2tLM/8AAAAAAAAAAAAAAADaxbbk//////////////////////// + //////////////78/P/++ff//fbx/7uhjv9rSzP/AAAAAAAAAAAAAAAA1b2sp9W9rKffyrz82sW1+9nE + tPzZwrL92MGw/dfAr/7Wv67+1r6t/ta+rf7MuKnTl31pKAAAAADAAQj1wAH19YABCvWAAfX9wAE294AB + Xl6AAV5ewAH1/YABWq+AAa/UwAFegoABDf2AAaQ2wAHUr8AB9AnAAQr9 +</value> + </data> +</root> \ No newline at end of file Index: EventViewer.cs =================================================================== --- EventViewer.cs (revision 0) +++ EventViewer.cs (revision 0) @@ -0,0 +1,296 @@ +using System; +using System.Diagnostics; +using System.Drawing; +using System.Globalization; +using System.IO; +using System.Reflection; +using System.Windows.Forms; + +namespace Mono.Tools.EventViewer +{ + public class EventViewer : System.Windows.Forms.Form + { + private System.Windows.Forms.StatusBar statusBar1; + private System.Windows.Forms.ToolBar toolBar1; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Splitter splitter1; + private System.Windows.Forms.MainMenu mainMenu1; + private System.Windows.Forms.MenuItem menuItem1; + private System.Windows.Forms.MenuItem menuItem2; + private System.Windows.Forms.MenuItem menuItem3; + private System.Windows.Forms.MenuItem menuItem4; + private System.Windows.Forms.TreeView logTree; + private System.Windows.Forms.ListView entryList; + private System.Windows.Forms.ImageList imageList1; + private System.ComponentModel.IContainer components; + + public EventViewer () + { + InitializeComponent (); + LoadIcons (imageList1); + RetrieveLogs (Environment.MachineName); + logTree.ExpandAll (); + } + + /// <summary> + /// Clean up any resources being used. + /// </summary> + protected override void Dispose (bool disposing) + { + if (disposing) { + if (components != null) { + components.Dispose (); + } + } + base.Dispose (disposing); + } + + private void LoadIcons (ImageList imageList) + { + Assembly assembly = typeof (EventViewer).Assembly; + imageList.Images.Add (LoadIconResource (assembly, "error.ico")); + imageList.Images.Add (LoadIconResource (assembly, "info.ico")); + imageList.Images.Add (LoadIconResource (assembly, "warning.ico")); + imageList.Images.Add (LoadIconResource (assembly, "eventlog.ico")); + imageList.Images.Add (LoadIconResource (assembly, "computer.ico")); + } + + private void InitializeComponent () + { + this.components = new System.ComponentModel.Container (); + System.Resources.ResourceManager resources = new System.Resources.ResourceManager (typeof (EventViewer)); + this.statusBar1 = new System.Windows.Forms.StatusBar (); + this.toolBar1 = new System.Windows.Forms.ToolBar (); + this.panel1 = new System.Windows.Forms.Panel (); + this.entryList = new System.Windows.Forms.ListView (); + this.imageList1 = new System.Windows.Forms.ImageList (this.components); + this.splitter1 = new System.Windows.Forms.Splitter (); + this.logTree = new System.Windows.Forms.TreeView (); + this.mainMenu1 = new System.Windows.Forms.MainMenu (); + this.menuItem1 = new System.Windows.Forms.MenuItem (); + this.menuItem2 = new System.Windows.Forms.MenuItem (); + this.menuItem3 = new System.Windows.Forms.MenuItem (); + this.menuItem4 = new System.Windows.Forms.MenuItem (); + this.panel1.SuspendLayout (); + this.SuspendLayout (); + // + // statusBar1 + // + this.statusBar1.Location = new System.Drawing.Point (0, 355); + this.statusBar1.Name = "statusBar1"; + this.statusBar1.Size = new System.Drawing.Size (472, 22); + this.statusBar1.TabIndex = 0; + // + // toolBar1 + // + this.toolBar1.ButtonSize = new System.Drawing.Size (30, 25); + this.toolBar1.DropDownArrows = true; + this.toolBar1.Location = new System.Drawing.Point (0, 0); + this.toolBar1.Name = "toolBar1"; + this.toolBar1.ShowToolTips = true; + this.toolBar1.Size = new System.Drawing.Size (472, 31); + this.toolBar1.TabIndex = 1; + // + // panel1 + // + this.panel1.Controls.Add (this.entryList); + this.panel1.Controls.Add (this.splitter1); + this.panel1.Controls.Add (this.logTree); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point (0, 31); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size (472, 324); + this.panel1.TabIndex = 2; + // + // entryList + // + this.entryList.Dock = System.Windows.Forms.DockStyle.Fill; + this.entryList.FullRowSelect = true; + this.entryList.Location = new System.Drawing.Point (179, 0); + this.entryList.MultiSelect = false; + this.entryList.Name = "entryList"; + this.entryList.Size = new System.Drawing.Size (293, 324); + this.entryList.SmallImageList = this.imageList1; + this.entryList.TabIndex = 2; + this.entryList.TabStop = false; + this.entryList.View = System.Windows.Forms.View.Details; + // + // imageList1 + // + this.imageList1.ImageSize = new System.Drawing.Size (16, 16); + this.imageList1.TransparentColor = System.Drawing.Color.Transparent; + // + // splitter1 + // + this.splitter1.Location = new System.Drawing.Point (176, 0); + this.splitter1.Name = "splitter1"; + this.splitter1.Size = new System.Drawing.Size (3, 324); + this.splitter1.TabIndex = 1; + this.splitter1.TabStop = false; + // + // logTree + // + this.logTree.Dock = System.Windows.Forms.DockStyle.Left; + this.logTree.ImageList = this.imageList1; + this.logTree.Location = new System.Drawing.Point (0, 0); + this.logTree.Name = "logTree"; + this.logTree.Scrollable = false; + this.logTree.Size = new System.Drawing.Size (176, 324); + this.logTree.TabIndex = 0; + this.logTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler (this.logTree_AfterSelect); + // + // mainMenu1 + // + this.mainMenu1.MenuItems.AddRange (new System.Windows.Forms.MenuItem [] { + this.menuItem1, + this.menuItem3}); + // + // menuItem1 + // + this.menuItem1.Index = 0; + this.menuItem1.MenuItems.AddRange (new System.Windows.Forms.MenuItem [] { this.menuItem2 }); + this.menuItem1.Text = "&File"; + // + // menuItem2 + // + this.menuItem2.Index = 0; + this.menuItem2.Text = "Exit"; + this.menuItem2.Click += new System.EventHandler (this.menuItem2_Click); + // + // menuItem3 + // + this.menuItem3.Index = 1; + this.menuItem3.MenuItems.AddRange (new System.Windows.Forms.MenuItem [] { this.menuItem4 }); + this.menuItem3.Text = "&Help"; + // + // menuItem4 + // + this.menuItem4.Index = 0; + this.menuItem4.Text = "About Event Viewer..."; + // + // EventViewer + // + this.AutoScaleBaseSize = new System.Drawing.Size (5, 13); + this.ClientSize = new System.Drawing.Size (472, 377); + this.Controls.Add (this.panel1); + this.Controls.Add (this.toolBar1); + this.Controls.Add (this.statusBar1); + this.Icon = ((System.Drawing.Icon) (resources.GetObject ("$this.Icon"))); + this.Menu = this.mainMenu1; + this.Name = "EventViewer"; + this.Text = "Event Viewer"; + this.panel1.ResumeLayout (false); + this.ResumeLayout (false); + } + + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + static void Main () + { + try { + Application.Run (new EventViewer ()); + } catch (Exception ex) { + MessageBox.Show (ex.ToString ()); + } + } + + private void RetrieveLogs (string machineName) + { + EventLog [] eventLogs = EventLog.GetEventLogs (machineName); + TreeNode machineNode = new TreeNode ("Event Viewer (" + machineName + ")", 4, 4); + logTree.Nodes.Add (machineNode); + foreach (EventLog eventLog in eventLogs) { + machineNode.Nodes.Add (new TreeNode (eventLog.Log, 3, 3)); + } + } + + private void DisplayLogList (string logName, string machineName) + { + entryList.BeginUpdate (); + try { + this.Cursor = Cursors.WaitCursor; + // remove current items + entryList.Items.Clear (); + // remove current columns + entryList.Columns.Clear (); + // create necessary columns + entryList.Columns.Add ("Type", 100, HorizontalAlignment.Left); + entryList.Columns.Add ("Date", 100, HorizontalAlignment.Left); + entryList.Columns.Add ("Time", 100, HorizontalAlignment.Left); + entryList.Columns.Add ("Source", 200, HorizontalAlignment.Left); + entryList.Columns.Add ("Category", 100, HorizontalAlignment.Left); + entryList.Columns.Add ("Event", 100, HorizontalAlignment.Left); + entryList.Columns.Add ("User", 100, HorizontalAlignment.Left); + entryList.Columns.Add ("Computer", 100, HorizontalAlignment.Left); + // add eventlog entries + using (EventLog eventLog = new EventLog (logName, machineName)) { + EventLogEntryCollection entries = eventLog.Entries; + foreach (EventLogEntry entry in entries) { + ListViewItem item = new ListViewItem (new string [] { + entry.EntryType.ToString (), + entry.TimeGenerated.ToShortDateString (), + entry.TimeGenerated.ToLongTimeString(), + entry.Source, + entry.Category, +#if NET_2_0 + event.InstanceId.ToString (), +#else + entry.EventID.ToString (), +#endif + entry.UserName, + entry.MachineName}, + GetImageIndex (entry)); + entryList.Items.Add (item); + } + } + + } finally { + this.Cursor = Cursors.Default; + entryList.EndUpdate (); + } + } + + private static int GetImageIndex (EventLogEntry entry) + { + switch (entry.EntryType) { + case EventLogEntryType.Error: + case EventLogEntryType.FailureAudit: + return 0; + case EventLogEntryType.Information: + case EventLogEntryType.SuccessAudit: + return 1; + case EventLogEntryType.Warning: + return 2; + default: + return 1; + } + } + + private void logTree_AfterSelect (object sender, System.Windows.Forms.TreeViewEventArgs e) + { + if (e.Node.Parent == null) { + } else { + DisplayLogList (e.Node.Text, "."); + } + } + + private void menuItem2_Click (object sender, System.EventArgs e) + { + this.Close (); + } + + private static Icon LoadIconResource (Assembly assembly, string name) + { + string manifestResourceName = typeof (EventViewer).Namespace + + ".Resources." + name; + Stream s = assembly.GetManifestResourceStream (manifestResourceName); + if (s == null) { + throw new ArgumentException (string.Format (CultureInfo.InvariantCulture, + "Icon '{0}' does not exist.", name)); + } + return new Icon (s); + } + } +} Property changes on: EventViewer.cs ___________________________________________________________________ Name: svn:eol-style + native Index: ChangeLog =================================================================== --- ChangeLog (revision 0) +++ ChangeLog (revision 0) @@ -0,0 +1,3 @@ +2006-08-15 Gert Driesen <[EMAIL PROTECTED]> + + * Initial import Property changes on: ChangeLog ___________________________________________________________________ Name: svn:eol-style + native Index: eventvwr.exe.resources =================================================================== --- eventvwr.exe.resources (revision 0) +++ eventvwr.exe.resources (revision 0) @@ -0,0 +1,6 @@ +-resource:EventViewer.resources,Mono.Tools.EventViewer.EventViewer.resources +-resource:Resources/error.ico,Mono.Tools.EventViewer.Resources.error.ico +-resource:Resources/info.ico,Mono.Tools.EventViewer.Resources.info.ico +-resource:Resources/warning.ico,Mono.Tools.EventViewer.Resources.warning.ico +-resource:Resources/eventlog.ico,Mono.Tools.EventViewer.Resources.eventlog.ico +-resource:Resources/computer.ico,Mono.Tools.EventViewer.Resources.computer.ico Property changes on: eventvwr.exe.resources ___________________________________________________________________ Name: svn:eol-style + native Index: Resources/error.ico =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: Resources/error.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: Resources/info.ico =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: Resources/info.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: Resources/computer.ico =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: Resources/computer.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: Resources/ChangeLog =================================================================== --- Resources/ChangeLog (revision 0) +++ Resources/ChangeLog (revision 0) @@ -0,0 +1,3 @@ +2006-08-15 Gert Driesen <[EMAIL PROTECTED]> + + * Initial import Property changes on: Resources/ChangeLog ___________________________________________________________________ Name: svn:eol-style + native Index: Resources/eventlog.ico =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: Resources/eventlog.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: Resources/warning.ico =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: Resources/warning.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: Makefile =================================================================== --- Makefile (revision 0) +++ Makefile (revision 0) @@ -0,0 +1,44 @@ +thisdir = tools/eventvwr +SUBDIRS = +include ../../build/rules.make + +RESX_RESOURCES = \ + eventvwr.exe.resources + +RESOURCES = $(RESX_RESOURCES) + +PREBUILT = $(RESX_RESOURCES:=.prebuilt) + +IMAGES_RESOURCES = \ + Resources/error.ico \ + Resources/info.ico \ + Resources/warning.ico \ + Resources/eventlog.ico \ + Resources/computer.ico + +EXTRA_DISTFILES = \ + eventvwr.exe.resources \ + $(RESX_RESOURCES:.resources=.resx) $(PREBUILT) \ + $(IMAGES_RESOURCES) + +LOCAL_MCS_FLAGS = -r:System.Drawing.dll -r:System.Windows.Forms.dll \ + -win32icon:Resources/eventlog.ico \ + @eventvwr.exe.resources + +PROGRAM = $(topdir)/class/lib/$(PROFILE)/eventvwr.exe + +CLEAN_FILES = eventvwr.exe *.mdb + +include ../../build/executable.make + +EventViewer.resources: EventViewer.resx + $(RESGEN) $^ + +$(RESX_RESOURCES): %.resources: %.resx + $(RESGEN) $< || cp [EMAIL PROTECTED] $@ + +$(PREBUILT): %.prebuilt: % + cp $* $@ + +dist-default: $(PREBUILT) + Property changes on: Makefile ___________________________________________________________________ Name: svn:eol-style + native Index: EventViewer.sln =================================================================== --- EventViewer.sln (revision 0) +++ EventViewer.sln (revision 0) @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventViewer", "EventViewer.csproj", "{1F3EF126-6207-4AC7-9D60-3D45FB527A1B}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {1F3EF126-6207-4AC7-9D60-3D45FB527A1B}.Debug.ActiveCfg = Debug|.NET + {1F3EF126-6207-4AC7-9D60-3D45FB527A1B}.Debug.Build.0 = Debug|.NET + {1F3EF126-6207-4AC7-9D60-3D45FB527A1B}.Release.ActiveCfg = Release|.NET + {1F3EF126-6207-4AC7-9D60-3D45FB527A1B}.Release.Build.0 = Release|.NET + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal Property changes on: EventViewer.sln ___________________________________________________________________ Name: svn:eol-style + native
thisdir = tools SUBDIRS = \ al cilc corcompare ictool mono-xsd security wsdl genxs sqlsharp \ disco soapsuds browsercaps-updater monop gacutil \ resgen macpack mkbundle dtd2rng dtd2xsd mjs prj2make mono-service \ mono-shlib-cop compiler-tester mono-xmltool net_1_1_bootstrap_SUBDIRS = gacutil security resgen net_2_0_bootstrap_SUBDIRS = resgen net_2_0_SUBDIRS = corcompare wsdl compiler-tester monop xbuild resgen DIST_ONLY_SUBDIRS = xbuild include ../build/rules.make DISTFILES = \ assemblies.xml \ mono-win32-setup-dark.bmp \ mono-win32-setup-light.bmp \ mono-win32-setup.nsi \ scan-tests.pl \ tinderbox/smtp.c \ tinderbox/tinderbox.sh test-local run-test-local run-test-ondotnet-local all-local install-local uninstall-local: @: dist-local: dist-default clean-local: rm -f *.exe *.dll *.pdb cormissing.xml
_______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list