diff --git a/UsageDataCollector/Project/Common/QuickViewer/MainForm.Designer.cs b/UsageDataCollector/Project/Common/QuickViewer/MainForm.Designer.cs new file mode 100644 index 0000000..548b5c4 --- /dev/null +++ b/UsageDataCollector/Project/Common/QuickViewer/MainForm.Designer.cs @@ -0,0 +1,68 @@ +namespace QuickViewer +{ + partial class MainForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.FileContents = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // FileContents + // + this.FileContents.AllowDrop = true; + this.FileContents.Dock = System.Windows.Forms.DockStyle.Fill; + this.FileContents.Location = new System.Drawing.Point(0, 0); + this.FileContents.Multiline = true; + this.FileContents.Name = "FileContents"; + this.FileContents.ReadOnly = true; + this.FileContents.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.FileContents.Size = new System.Drawing.Size(650, 386); + this.FileContents.TabIndex = 0; + this.FileContents.DragDrop += new System.Windows.Forms.DragEventHandler(this.MainForm_DragDrop); + this.FileContents.DragEnter += new System.Windows.Forms.DragEventHandler(this.MainForm_DragEnter); + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(650, 386); + this.Controls.Add(this.FileContents); + this.Name = "MainForm"; + this.Text = "Xml.Gz Quick Viewer"; + this.DragDrop += new System.Windows.Forms.DragEventHandler(this.MainForm_DragDrop); + this.DragEnter += new System.Windows.Forms.DragEventHandler(this.MainForm_DragEnter); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox FileContents; + } +} + diff --git a/UsageDataCollector/Project/Common/QuickViewer/MainForm.cs b/UsageDataCollector/Project/Common/QuickViewer/MainForm.cs new file mode 100644 index 0000000..57cd7d4 --- /dev/null +++ b/UsageDataCollector/Project/Common/QuickViewer/MainForm.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using ICSharpCode.UsageDataCollector.ServiceLibrary.Import; +using ICSharpCode.UsageDataCollector.Contracts; +using System.Runtime.Serialization; +using System.IO; + +namespace QuickViewer +{ + public partial class MainForm : Form + { + public MainForm() + { + InitializeComponent(); + } + + private void MainForm_DragDrop(object sender, DragEventArgs e) + { + try + { + string[] fileDrop = (string[])e.Data.GetData(DataFormats.FileDrop); + + if (null != fileDrop) + { + string filename = fileDrop.GetValue(0).ToString(); + + UsageDataMessage currentMessage = FileImporter.ReadMessage(filename); + + DataContractSerializer dataContractSerializer = new DataContractSerializer(typeof(UsageDataMessage)); + using (MemoryStream memoryStream = new MemoryStream()) + { + dataContractSerializer.WriteObject(memoryStream, currentMessage); + byte[] data = new byte[memoryStream.Length]; + Array.Copy(memoryStream.GetBuffer(), data, data.Length); + string message = Encoding.UTF8.GetString(data); + + FileContents.Text = message; + } + } + } + catch (Exception ex) + { + FileContents.Text = ex.ToString(); + } + } + + + private void MainForm_DragEnter(object sender, DragEventArgs e) + { + if (e.Data.GetDataPresent(DataFormats.FileDrop)) + e.Effect = DragDropEffects.Copy; + else + e.Effect = DragDropEffects.None; + + } + } +} diff --git a/UsageDataCollector/Project/Common/QuickViewer/MainForm.resx b/UsageDataCollector/Project/Common/QuickViewer/MainForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/UsageDataCollector/Project/Common/QuickViewer/MainForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/UsageDataCollector/Project/Common/QuickViewer/Program.cs b/UsageDataCollector/Project/Common/QuickViewer/Program.cs new file mode 100644 index 0000000..935e739 --- /dev/null +++ b/UsageDataCollector/Project/Common/QuickViewer/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace QuickViewer +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} diff --git a/UsageDataCollector/Project/Common/QuickViewer/Properties/AssemblyInfo.cs b/UsageDataCollector/Project/Common/QuickViewer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..2dab612 --- /dev/null +++ b/UsageDataCollector/Project/Common/QuickViewer/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("QuickViewer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("QuickViewer")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b71cddb5-b387-4981-a581-a5a122b95262")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/UsageDataCollector/Project/Common/QuickViewer/Properties/Resources.Designer.cs b/UsageDataCollector/Project/Common/QuickViewer/Properties/Resources.Designer.cs new file mode 100644 index 0000000..82b5167 --- /dev/null +++ b/UsageDataCollector/Project/Common/QuickViewer/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30128.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace QuickViewer.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("QuickViewer.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/UsageDataCollector/Project/Common/QuickViewer/Properties/Resources.resx b/UsageDataCollector/Project/Common/QuickViewer/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/UsageDataCollector/Project/Common/QuickViewer/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/UsageDataCollector/Project/Common/QuickViewer/Properties/Settings.Designer.cs b/UsageDataCollector/Project/Common/QuickViewer/Properties/Settings.Designer.cs new file mode 100644 index 0000000..6a6763f --- /dev/null +++ b/UsageDataCollector/Project/Common/QuickViewer/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30128.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace QuickViewer.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/UsageDataCollector/Project/Common/QuickViewer/Properties/Settings.settings b/UsageDataCollector/Project/Common/QuickViewer/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/UsageDataCollector/Project/Common/QuickViewer/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/UsageDataCollector/Project/Common/QuickViewer/QuickViewer.csproj b/UsageDataCollector/Project/Common/QuickViewer/QuickViewer.csproj new file mode 100644 index 0000000..9d27da9 --- /dev/null +++ b/UsageDataCollector/Project/Common/QuickViewer/QuickViewer.csproj @@ -0,0 +1,98 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {84BB051B-45B8-4EAB-9F65-C1FDAC8B1592} + WinExe + Properties + QuickViewer + QuickViewer + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + MainForm.cs + + + + + MainForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {6B1CFE35-DA17-4DEB-9C6E-227E5E251DA0} + UsageDataCollector + + + {E6CCDC4E-C30E-4752-AF7B-FF6638E3A270} + CollectorServiceLibrary + + + + + \ No newline at end of file diff --git a/UsageDataCollector/Project/UsageDataCollector.sln b/UsageDataCollector/Project/UsageDataCollector.sln index 0062896..ff97fd3 100644 --- a/UsageDataCollector/Project/UsageDataCollector.sln +++ b/UsageDataCollector/Project/UsageDataCollector.sln @@ -28,6 +28,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImportWindowsService", "Col EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Collector Standalone Importers", "Collector Standalone Importers", "{5F7C732A-96C2-4FC4-8DD1-EC88516B4513}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickViewer", "Common\QuickViewer\QuickViewer.csproj", "{84BB051B-45B8-4EAB-9F65-C1FDAC8B1592}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -108,6 +110,16 @@ Global {90DD834E-361C-4CE5-820D-39FA11AA51BD}.Release|Mixed Platforms.Build.0 = Release|x86 {90DD834E-361C-4CE5-820D-39FA11AA51BD}.Release|x86.ActiveCfg = Release|x86 {90DD834E-361C-4CE5-820D-39FA11AA51BD}.Release|x86.Build.0 = Release|x86 + {84BB051B-45B8-4EAB-9F65-C1FDAC8B1592}.Debug|Any CPU.ActiveCfg = Debug|x86 + {84BB051B-45B8-4EAB-9F65-C1FDAC8B1592}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {84BB051B-45B8-4EAB-9F65-C1FDAC8B1592}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {84BB051B-45B8-4EAB-9F65-C1FDAC8B1592}.Debug|x86.ActiveCfg = Debug|x86 + {84BB051B-45B8-4EAB-9F65-C1FDAC8B1592}.Debug|x86.Build.0 = Debug|x86 + {84BB051B-45B8-4EAB-9F65-C1FDAC8B1592}.Release|Any CPU.ActiveCfg = Release|x86 + {84BB051B-45B8-4EAB-9F65-C1FDAC8B1592}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {84BB051B-45B8-4EAB-9F65-C1FDAC8B1592}.Release|Mixed Platforms.Build.0 = Release|x86 + {84BB051B-45B8-4EAB-9F65-C1FDAC8B1592}.Release|x86.ActiveCfg = Release|x86 + {84BB051B-45B8-4EAB-9F65-C1FDAC8B1592}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -117,6 +129,7 @@ Global {39FA12F8-7E1D-4556-9964-918A08941092} = {E5B88BBA-744F-47D3-B339-3344AB0BE521} {81EA4A79-EC96-4992-9A1D-DCE2108D1395} = {E5B88BBA-744F-47D3-B339-3344AB0BE521} {3C72C5DF-EE0C-494A-8B28-F74DB14F7040} = {6428D1F1-E354-4853-8612-9439591A0562} + {84BB051B-45B8-4EAB-9F65-C1FDAC8B1592} = {6428D1F1-E354-4853-8612-9439591A0562} {6B1CFE35-DA17-4DEB-9C6E-227E5E251DA0} = {136C766C-A1BE-4453-A1D1-6A93224FA64F} {90DD834E-361C-4CE5-820D-39FA11AA51BD} = {5F7C732A-96C2-4FC4-8DD1-EC88516B4513} {0F122E2A-2B69-4269-8FF1-DCF8772231C1} = {5F7C732A-96C2-4FC4-8DD1-EC88516B4513} diff --git a/UsageDataCollector/SampleData/07f26ea5-a8c9-48e3-996e-3881ab51dd0d.xml.gz b/UsageDataCollector/SampleData/07f26ea5-a8c9-48e3-996e-3881ab51dd0d.xml.gz new file mode 100644 index 0000000..3f7d013 Binary files /dev/null and b/UsageDataCollector/SampleData/07f26ea5-a8c9-48e3-996e-3881ab51dd0d.xml.gz differ diff --git a/UsageDataCollector/SampleData/3da9cde7-ad82-42c6-bcf1-71d8458b83e0.xml.gz b/UsageDataCollector/SampleData/3da9cde7-ad82-42c6-bcf1-71d8458b83e0.xml.gz new file mode 100644 index 0000000..043ce6e Binary files /dev/null and b/UsageDataCollector/SampleData/3da9cde7-ad82-42c6-bcf1-71d8458b83e0.xml.gz differ diff --git a/UsageDataCollector/SampleData/4460b6db-6d63-43f0-a51f-0c64187d101c.xml.gz b/UsageDataCollector/SampleData/4460b6db-6d63-43f0-a51f-0c64187d101c.xml.gz new file mode 100644 index 0000000..9530a79 Binary files /dev/null and b/UsageDataCollector/SampleData/4460b6db-6d63-43f0-a51f-0c64187d101c.xml.gz differ diff --git a/UsageDataCollector/SampleData/4aa0dd73-f6d3-43e8-85ad-ec63474a2ba2.xml.gz b/UsageDataCollector/SampleData/4aa0dd73-f6d3-43e8-85ad-ec63474a2ba2.xml.gz new file mode 100644 index 0000000..2b29a3f Binary files /dev/null and b/UsageDataCollector/SampleData/4aa0dd73-f6d3-43e8-85ad-ec63474a2ba2.xml.gz differ diff --git a/UsageDataCollector/SampleData/4b21b9df-caf0-49a1-85db-75dde608a334.xml.gz b/UsageDataCollector/SampleData/4b21b9df-caf0-49a1-85db-75dde608a334.xml.gz new file mode 100644 index 0000000..bf1cfbc Binary files /dev/null and b/UsageDataCollector/SampleData/4b21b9df-caf0-49a1-85db-75dde608a334.xml.gz differ diff --git a/UsageDataCollector/SampleData/5072c3dd-7c6e-4927-aeb4-647716a3963b.xml.gz b/UsageDataCollector/SampleData/5072c3dd-7c6e-4927-aeb4-647716a3963b.xml.gz new file mode 100644 index 0000000..7850941 Binary files /dev/null and b/UsageDataCollector/SampleData/5072c3dd-7c6e-4927-aeb4-647716a3963b.xml.gz differ diff --git a/UsageDataCollector/SampleData/74a92690-4787-4d56-b65a-458c5fb426a1.xml.gz b/UsageDataCollector/SampleData/74a92690-4787-4d56-b65a-458c5fb426a1.xml.gz new file mode 100644 index 0000000..eb80883 Binary files /dev/null and b/UsageDataCollector/SampleData/74a92690-4787-4d56-b65a-458c5fb426a1.xml.gz differ diff --git a/UsageDataCollector/SampleData/8b6eb4d8-79ab-4301-b8b9-7887ef5474a7.xml.gz b/UsageDataCollector/SampleData/8b6eb4d8-79ab-4301-b8b9-7887ef5474a7.xml.gz new file mode 100644 index 0000000..a9b40c6 Binary files /dev/null and b/UsageDataCollector/SampleData/8b6eb4d8-79ab-4301-b8b9-7887ef5474a7.xml.gz differ diff --git a/UsageDataCollector/SampleData/978c6fc1-70a0-422b-a835-d19cae7478cc.xml.gz b/UsageDataCollector/SampleData/978c6fc1-70a0-422b-a835-d19cae7478cc.xml.gz new file mode 100644 index 0000000..2c73a2b Binary files /dev/null and b/UsageDataCollector/SampleData/978c6fc1-70a0-422b-a835-d19cae7478cc.xml.gz differ diff --git a/UsageDataCollector/SampleData/_SerializationException_Test_6e5cec84-728d-4202-b957-bfa13e27d72e.xml.gz b/UsageDataCollector/SampleData/_SerializationException_Test_6e5cec84-728d-4202-b957-bfa13e27d72e.xml.gz new file mode 100644 index 0000000..dd480e2 Binary files /dev/null and b/UsageDataCollector/SampleData/_SerializationException_Test_6e5cec84-728d-4202-b957-bfa13e27d72e.xml.gz differ diff --git a/UsageDataCollector/SampleData/c36500b1-134e-4893-9c9f-de6a84e96c8b.xml.gz b/UsageDataCollector/SampleData/c36500b1-134e-4893-9c9f-de6a84e96c8b.xml.gz new file mode 100644 index 0000000..45b73e3 Binary files /dev/null and b/UsageDataCollector/SampleData/c36500b1-134e-4893-9c9f-de6a84e96c8b.xml.gz differ diff --git a/UsageDataCollector/SampleData/d75e68fd-0879-492c-ab2f-f5be072396f5.xml.gz b/UsageDataCollector/SampleData/d75e68fd-0879-492c-ab2f-f5be072396f5.xml.gz new file mode 100644 index 0000000..99e0125 Binary files /dev/null and b/UsageDataCollector/SampleData/d75e68fd-0879-492c-ab2f-f5be072396f5.xml.gz differ diff --git a/UsageDataCollector/SampleData/dd023fa0-e5ff-4287-8476-07a987cce288.xml.gz b/UsageDataCollector/SampleData/dd023fa0-e5ff-4287-8476-07a987cce288.xml.gz new file mode 100644 index 0000000..b4200ff Binary files /dev/null and b/UsageDataCollector/SampleData/dd023fa0-e5ff-4287-8476-07a987cce288.xml.gz differ diff --git a/UsageDataCollector/SampleData/e322256f-a2f2-451f-bf70-3def9e97bd89.xml.gz b/UsageDataCollector/SampleData/e322256f-a2f2-451f-bf70-3def9e97bd89.xml.gz new file mode 100644 index 0000000..f5f62f9 Binary files /dev/null and b/UsageDataCollector/SampleData/e322256f-a2f2-451f-bf70-3def9e97bd89.xml.gz differ