Commit for development environment setup

This commit is contained in:
2023-06-19 16:12:33 -04:00
parent be72063a3c
commit bbce2ad0a6
2209 changed files with 1171775 additions and 625 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace XSL_Transform
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain());
}
}
}

View File

@@ -0,0 +1,33 @@
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("XSL Transform")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Volian Enterprises, Inc.")]
[assembly: AssemblyProduct("XSL Transform")]
[assembly: AssemblyCopyright("Copyright © Volian Enterprises, Inc. 2006")]
[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("7e95cb06-46be-49c6-81e1-92302d9017e4")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace XSL_Transform.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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", "2.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()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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("XSL_Transform.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
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">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</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 for serialized 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="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<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>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace XSL_Transform.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.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;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,82 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{74593BA8-2F88-4FF2-89A6-9FBD358231D7}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>XSL_Transform</RootNamespace>
<AssemblyName>XSL Transform</AssemblyName>
<ApplicationIcon>ARW05RT.ICO</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="frmMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmMain.Designer.cs">
<DependentUpon>frmMain.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="frmMain.resx">
<SubType>Designer</SubType>
<DependentUpon>frmMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="ARW05RT.ICO" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XSL Transform", "XSL Transform.csproj", "{74593BA8-2F88-4FF2-89A6-9FBD358231D7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{74593BA8-2F88-4FF2-89A6-9FBD358231D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{74593BA8-2F88-4FF2-89A6-9FBD358231D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74593BA8-2F88-4FF2-89A6-9FBD358231D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74593BA8-2F88-4FF2-89A6-9FBD358231D7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,591 @@
namespace XSL_Transform
{
partial class frmMain
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.TabPage tpSX;
System.Windows.Forms.TabPage tpRS;
System.Windows.Forms.TabPage tpSR;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
this.tbSX = new System.Windows.Forms.TextBox();
this.wbRS = new System.Windows.Forms.WebBrowser();
this.tbSR = new System.Windows.Forms.TextBox();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tcSource = new System.Windows.Forms.TabControl();
this.tpSS = new System.Windows.Forms.TabPage();
this.tbSS = new System.Windows.Forms.TextBox();
this.tcResults = new System.Windows.Forms.TabControl();
this.tpRX = new System.Windows.Forms.TabPage();
this.wbRX = new System.Windows.Forms.WebBrowser();
this.tpRR = new System.Windows.Forms.TabPage();
this.wbRR = new System.Windows.Forms.WebBrowser();
this.tpXslHelp = new System.Windows.Forms.TabPage();
this.wbXSLHelp = new System.Windows.Forms.WebBrowser();
this.tpXPathHelp = new System.Windows.Forms.TabPage();
this.wbXPathHelp = new System.Windows.Forms.WebBrowser();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.xMLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.miOpenXML = new System.Windows.Forms.ToolStripMenuItem();
this.miSaveXML = new System.Windows.Forms.ToolStripMenuItem();
this.miSaveAsXML = new System.Windows.Forms.ToolStripMenuItem();
this.xSLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.miOpenXSL = new System.Windows.Forms.ToolStripMenuItem();
this.miSaveXSL = new System.Windows.Forms.ToolStripMenuItem();
this.miSaveAsXSL = new System.Windows.Forms.ToolStripMenuItem();
this.resultToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.miTransform = new System.Windows.Forms.ToolStripMenuItem();
this.miQuery = new System.Windows.Forms.ToolStripMenuItem();
this.miSaveAsResults = new System.Windows.Forms.ToolStripMenuItem();
this.miQuit = new System.Windows.Forms.ToolStripMenuItem();
this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.specialToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ofdxml = new System.Windows.Forms.OpenFileDialog();
this.sfdxml = new System.Windows.Forms.SaveFileDialog();
this.ofdxsl = new System.Windows.Forms.OpenFileDialog();
this.sfdxsl = new System.Windows.Forms.SaveFileDialog();
this.sfdResults = new System.Windows.Forms.SaveFileDialog();
this.ofdResults = new System.Windows.Forms.OpenFileDialog();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.RowLbl = new System.Windows.Forms.ToolStripStatusLabel();
this.ColLbl = new System.Windows.Forms.ToolStripStatusLabel();
this.miRefreshXML = new System.Windows.Forms.ToolStripMenuItem();
this.miRefreshXSL = new System.Windows.Forms.ToolStripMenuItem();
tpSX = new System.Windows.Forms.TabPage();
tpRS = new System.Windows.Forms.TabPage();
tpSR = new System.Windows.Forms.TabPage();
tpSX.SuspendLayout();
tpRS.SuspendLayout();
tpSR.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.tcSource.SuspendLayout();
this.tpSS.SuspendLayout();
this.tcResults.SuspendLayout();
this.tpRX.SuspendLayout();
this.tpRR.SuspendLayout();
this.tpXslHelp.SuspendLayout();
this.tpXPathHelp.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
// tpSX
//
tpSX.Controls.Add(this.tbSX);
tpSX.Location = new System.Drawing.Point(4, 22);
tpSX.Name = "tpSX";
tpSX.Padding = new System.Windows.Forms.Padding(3);
tpSX.Size = new System.Drawing.Size(426, 463);
tpSX.TabIndex = 0;
tpSX.Text = "XML";
tpSX.UseVisualStyleBackColor = true;
//
// tbSX
//
this.tbSX.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbSX.Location = new System.Drawing.Point(3, 3);
this.tbSX.Multiline = true;
this.tbSX.Name = "tbSX";
this.tbSX.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tbSX.Size = new System.Drawing.Size(420, 457);
this.tbSX.TabIndex = 0;
this.tbSX.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tbSX_MouseUp);
this.tbSX.TextChanged += new System.EventHandler(this.tbTextChanged);
//
// tpRS
//
tpRS.Controls.Add(this.wbRS);
tpRS.Location = new System.Drawing.Point(4, 22);
tpRS.Name = "tpRS";
tpRS.Padding = new System.Windows.Forms.Padding(3);
tpRS.Size = new System.Drawing.Size(419, 463);
tpRS.TabIndex = 1;
tpRS.Text = "XSL";
tpRS.UseVisualStyleBackColor = true;
//
// wbRS
//
this.wbRS.Dock = System.Windows.Forms.DockStyle.Fill;
this.wbRS.Location = new System.Drawing.Point(3, 3);
this.wbRS.MinimumSize = new System.Drawing.Size(20, 20);
this.wbRS.Name = "wbRS";
this.wbRS.Size = new System.Drawing.Size(413, 457);
this.wbRS.TabIndex = 1;
//
// tpSR
//
tpSR.Controls.Add(this.tbSR);
tpSR.Location = new System.Drawing.Point(4, 22);
tpSR.Name = "tpSR";
tpSR.Size = new System.Drawing.Size(426, 463);
tpSR.TabIndex = 2;
tpSR.Text = "Results";
tpSR.UseVisualStyleBackColor = true;
//
// tbSR
//
this.tbSR.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbSR.Location = new System.Drawing.Point(0, 0);
this.tbSR.Multiline = true;
this.tbSR.Name = "tbSR";
this.tbSR.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tbSR.Size = new System.Drawing.Size(426, 463);
this.tbSR.TabIndex = 1;
this.tbSR.TextChanged += new System.EventHandler(this.tbTextChanged);
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 24);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.tcSource);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.tcResults);
this.splitContainer1.Size = new System.Drawing.Size(865, 489);
this.splitContainer1.SplitterDistance = 434;
this.splitContainer1.TabIndex = 0;
//
// tcSource
//
this.tcSource.Controls.Add(tpSX);
this.tcSource.Controls.Add(this.tpSS);
this.tcSource.Controls.Add(tpSR);
this.tcSource.Dock = System.Windows.Forms.DockStyle.Fill;
this.tcSource.Location = new System.Drawing.Point(0, 0);
this.tcSource.Name = "tcSource";
this.tcSource.SelectedIndex = 0;
this.tcSource.Size = new System.Drawing.Size(434, 489);
this.tcSource.TabIndex = 0;
//
// tpSS
//
this.tpSS.Controls.Add(this.tbSS);
this.tpSS.Location = new System.Drawing.Point(4, 22);
this.tpSS.Name = "tpSS";
this.tpSS.Padding = new System.Windows.Forms.Padding(3);
this.tpSS.Size = new System.Drawing.Size(426, 463);
this.tpSS.TabIndex = 1;
this.tpSS.Text = "XSL";
this.tpSS.UseVisualStyleBackColor = true;
//
// tbSS
//
this.tbSS.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbSS.Location = new System.Drawing.Point(3, 3);
this.tbSS.Multiline = true;
this.tbSS.Name = "tbSS";
this.tbSS.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tbSS.Size = new System.Drawing.Size(420, 457);
this.tbSS.TabIndex = 1;
this.tbSS.TextChanged += new System.EventHandler(this.tbTextChanged);
//
// tcResults
//
this.tcResults.Controls.Add(this.tpRX);
this.tcResults.Controls.Add(tpRS);
this.tcResults.Controls.Add(this.tpRR);
this.tcResults.Controls.Add(this.tpXslHelp);
this.tcResults.Controls.Add(this.tpXPathHelp);
this.tcResults.Dock = System.Windows.Forms.DockStyle.Fill;
this.tcResults.Location = new System.Drawing.Point(0, 0);
this.tcResults.Name = "tcResults";
this.tcResults.SelectedIndex = 0;
this.tcResults.Size = new System.Drawing.Size(427, 489);
this.tcResults.TabIndex = 1;
this.tcResults.SelectedIndexChanged += new System.EventHandler(this.tcResults_SelectedIndexChanged);
//
// tpRX
//
this.tpRX.Controls.Add(this.wbRX);
this.tpRX.Location = new System.Drawing.Point(4, 22);
this.tpRX.Name = "tpRX";
this.tpRX.Padding = new System.Windows.Forms.Padding(3);
this.tpRX.Size = new System.Drawing.Size(419, 463);
this.tpRX.TabIndex = 0;
this.tpRX.Text = "XML";
this.tpRX.UseVisualStyleBackColor = true;
//
// wbRX
//
this.wbRX.Dock = System.Windows.Forms.DockStyle.Fill;
this.wbRX.Location = new System.Drawing.Point(3, 3);
this.wbRX.MinimumSize = new System.Drawing.Size(20, 20);
this.wbRX.Name = "wbRX";
this.wbRX.Size = new System.Drawing.Size(413, 457);
this.wbRX.TabIndex = 0;
//
// tpRR
//
this.tpRR.Controls.Add(this.wbRR);
this.tpRR.Location = new System.Drawing.Point(4, 22);
this.tpRR.Name = "tpRR";
this.tpRR.Size = new System.Drawing.Size(419, 463);
this.tpRR.TabIndex = 2;
this.tpRR.Text = "Results";
this.tpRR.UseVisualStyleBackColor = true;
//
// wbRR
//
this.wbRR.Dock = System.Windows.Forms.DockStyle.Fill;
this.wbRR.Location = new System.Drawing.Point(0, 0);
this.wbRR.MinimumSize = new System.Drawing.Size(20, 20);
this.wbRR.Name = "wbRR";
this.wbRR.Size = new System.Drawing.Size(419, 463);
this.wbRR.TabIndex = 1;
//
// tpXslHelp
//
this.tpXslHelp.Controls.Add(this.wbXSLHelp);
this.tpXslHelp.Location = new System.Drawing.Point(4, 22);
this.tpXslHelp.Name = "tpXslHelp";
this.tpXslHelp.Size = new System.Drawing.Size(419, 463);
this.tpXslHelp.TabIndex = 3;
this.tpXslHelp.Text = "XSL Help";
this.tpXslHelp.UseVisualStyleBackColor = true;
//
// wbXSLHelp
//
this.wbXSLHelp.Dock = System.Windows.Forms.DockStyle.Fill;
this.wbXSLHelp.Location = new System.Drawing.Point(0, 0);
this.wbXSLHelp.MinimumSize = new System.Drawing.Size(20, 20);
this.wbXSLHelp.Name = "wbXSLHelp";
this.wbXSLHelp.Size = new System.Drawing.Size(419, 463);
this.wbXSLHelp.TabIndex = 3;
//
// tpXPathHelp
//
this.tpXPathHelp.Controls.Add(this.wbXPathHelp);
this.tpXPathHelp.Location = new System.Drawing.Point(4, 22);
this.tpXPathHelp.Name = "tpXPathHelp";
this.tpXPathHelp.Size = new System.Drawing.Size(419, 463);
this.tpXPathHelp.TabIndex = 4;
this.tpXPathHelp.Text = "XPath Help";
this.tpXPathHelp.UseVisualStyleBackColor = true;
//
// wbXPathHelp
//
this.wbXPathHelp.Dock = System.Windows.Forms.DockStyle.Fill;
this.wbXPathHelp.Location = new System.Drawing.Point(0, 0);
this.wbXPathHelp.MinimumSize = new System.Drawing.Size(20, 20);
this.wbXPathHelp.Name = "wbXPathHelp";
this.wbXPathHelp.Size = new System.Drawing.Size(419, 463);
this.wbXPathHelp.TabIndex = 2;
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.xMLToolStripMenuItem,
this.xSLToolStripMenuItem,
this.resultToolStripMenuItem,
this.miQuit,
this.searchToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(865, 24);
this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1";
//
// xMLToolStripMenuItem
//
this.xMLToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.miOpenXML,
this.miSaveXML,
this.miSaveAsXML,
this.miRefreshXML});
this.xMLToolStripMenuItem.Name = "xMLToolStripMenuItem";
this.xMLToolStripMenuItem.Size = new System.Drawing.Size(38, 20);
this.xMLToolStripMenuItem.Text = "XML";
//
// miOpenXML
//
this.miOpenXML.Name = "miOpenXML";
this.miOpenXML.Size = new System.Drawing.Size(152, 22);
this.miOpenXML.Tag = "0";
this.miOpenXML.Text = "Open";
this.miOpenXML.Click += new System.EventHandler(this.miOpen_Click);
//
// miSaveXML
//
this.miSaveXML.Name = "miSaveXML";
this.miSaveXML.Size = new System.Drawing.Size(152, 22);
this.miSaveXML.Tag = "0";
this.miSaveXML.Text = "Save";
this.miSaveXML.Click += new System.EventHandler(this.miSave_Click);
//
// miSaveAsXML
//
this.miSaveAsXML.Name = "miSaveAsXML";
this.miSaveAsXML.Size = new System.Drawing.Size(152, 22);
this.miSaveAsXML.Tag = "0";
this.miSaveAsXML.Text = "Save As";
this.miSaveAsXML.Click += new System.EventHandler(this.miSaveAs_Click);
//
// xSLToolStripMenuItem
//
this.xSLToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.miOpenXSL,
this.miSaveXSL,
this.miSaveAsXSL,
this.miRefreshXSL});
this.xSLToolStripMenuItem.Name = "xSLToolStripMenuItem";
this.xSLToolStripMenuItem.Size = new System.Drawing.Size(36, 20);
this.xSLToolStripMenuItem.Text = "XSL";
//
// miOpenXSL
//
this.miOpenXSL.Name = "miOpenXSL";
this.miOpenXSL.Size = new System.Drawing.Size(152, 22);
this.miOpenXSL.Tag = "1";
this.miOpenXSL.Text = "Open";
this.miOpenXSL.Click += new System.EventHandler(this.miOpen_Click);
//
// miSaveXSL
//
this.miSaveXSL.Name = "miSaveXSL";
this.miSaveXSL.Size = new System.Drawing.Size(152, 22);
this.miSaveXSL.Tag = "1";
this.miSaveXSL.Text = "Save";
this.miSaveXSL.Click += new System.EventHandler(this.miSave_Click);
//
// miSaveAsXSL
//
this.miSaveAsXSL.Name = "miSaveAsXSL";
this.miSaveAsXSL.Size = new System.Drawing.Size(152, 22);
this.miSaveAsXSL.Tag = "1";
this.miSaveAsXSL.Text = "Save As";
this.miSaveAsXSL.Click += new System.EventHandler(this.miSaveAs_Click);
//
// resultToolStripMenuItem
//
this.resultToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.miTransform,
this.miQuery,
this.miSaveAsResults});
this.resultToolStripMenuItem.Name = "resultToolStripMenuItem";
this.resultToolStripMenuItem.Size = new System.Drawing.Size(49, 20);
this.resultToolStripMenuItem.Text = "Result";
//
// miTransform
//
this.miTransform.Name = "miTransform";
this.miTransform.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T)));
this.miTransform.Size = new System.Drawing.Size(172, 22);
this.miTransform.Text = "Transform";
this.miTransform.Click += new System.EventHandler(this.miTransform_Click);
//
// miQuery
//
this.miQuery.Name = "miQuery";
this.miQuery.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Q)));
this.miQuery.Size = new System.Drawing.Size(172, 22);
this.miQuery.Text = "Query";
this.miQuery.Click += new System.EventHandler(this.miQuery_Click);
//
// miSaveAsResults
//
this.miSaveAsResults.Name = "miSaveAsResults";
this.miSaveAsResults.Size = new System.Drawing.Size(172, 22);
this.miSaveAsResults.Tag = "2";
this.miSaveAsResults.Text = "Save";
this.miSaveAsResults.Click += new System.EventHandler(this.miSaveAs_Click);
//
// miQuit
//
this.miQuit.Name = "miQuit";
this.miQuit.Size = new System.Drawing.Size(39, 20);
this.miQuit.Text = "&Quit";
this.miQuit.Click += new System.EventHandler(this.miQuit_Click);
//
// searchToolStripMenuItem
//
this.searchToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.specialToolStripMenuItem});
this.searchToolStripMenuItem.Name = "searchToolStripMenuItem";
this.searchToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
this.searchToolStripMenuItem.Text = "Search";
//
// specialToolStripMenuItem
//
this.specialToolStripMenuItem.Name = "specialToolStripMenuItem";
this.specialToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
this.specialToolStripMenuItem.Text = "Special Characters";
this.specialToolStripMenuItem.Click += new System.EventHandler(this.specialToolStripMenuItem_Click);
//
// ofdxml
//
this.ofdxml.FileOk += new System.ComponentModel.CancelEventHandler(this.OpenFileOk);
//
// sfdxml
//
this.sfdxml.FileOk += new System.ComponentModel.CancelEventHandler(this.SaveFileOk);
//
// ofdxsl
//
this.ofdxsl.FileOk += new System.ComponentModel.CancelEventHandler(this.OpenFileOk);
//
// sfdxsl
//
this.sfdxsl.FileOk += new System.ComponentModel.CancelEventHandler(this.SaveFileOk);
//
// sfdResults
//
this.sfdResults.FileOk += new System.ComponentModel.CancelEventHandler(this.SaveFileOk);
//
// ofdResults
//
this.ofdResults.FileOk += new System.ComponentModel.CancelEventHandler(this.OpenFileOk);
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.RowLbl,
this.ColLbl});
this.statusStrip1.Location = new System.Drawing.Point(0, 513);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(865, 22);
this.statusStrip1.TabIndex = 2;
this.statusStrip1.Text = "statusStrip1";
//
// RowLbl
//
this.RowLbl.Name = "RowLbl";
this.RowLbl.Size = new System.Drawing.Size(41, 17);
this.RowLbl.Text = "Row: 0";
//
// ColLbl
//
this.ColLbl.Name = "ColLbl";
this.ColLbl.Size = new System.Drawing.Size(55, 17);
this.ColLbl.Text = "Column: 0";
//
// miRefreshXML
//
this.miRefreshXML.Name = "miRefreshXML";
this.miRefreshXML.Size = new System.Drawing.Size(152, 22);
this.miRefreshXML.Tag = "0";
this.miRefreshXML.Text = "Refresh";
this.miRefreshXML.Click += new System.EventHandler(this.miRefresh_Click);
//
// miRefreshXSL
//
this.miRefreshXSL.Name = "miRefreshXSL";
this.miRefreshXSL.Size = new System.Drawing.Size(152, 22);
this.miRefreshXSL.Tag = "1";
this.miRefreshXSL.Text = "Refresh";
this.miRefreshXSL.Click += new System.EventHandler(this.miRefresh_Click);
//
// frmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(865, 535);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.menuStrip1);
this.Controls.Add(this.statusStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "frmMain";
this.Text = "XML Query and Transform Tool";
tpSX.ResumeLayout(false);
tpSX.PerformLayout();
tpRS.ResumeLayout(false);
tpSR.ResumeLayout(false);
tpSR.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
this.tcSource.ResumeLayout(false);
this.tpSS.ResumeLayout(false);
this.tpSS.PerformLayout();
this.tcResults.ResumeLayout(false);
this.tpRX.ResumeLayout(false);
this.tpRR.ResumeLayout(false);
this.tpXslHelp.ResumeLayout(false);
this.tpXPathHelp.ResumeLayout(false);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.TabControl tcSource;
private System.Windows.Forms.TabPage tpSS;
private System.Windows.Forms.TabControl tcResults;
private System.Windows.Forms.TabPage tpRX;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem xMLToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem miOpenXML;
private System.Windows.Forms.ToolStripMenuItem miSaveXML;
private System.Windows.Forms.ToolStripMenuItem miSaveAsXML;
private System.Windows.Forms.ToolStripMenuItem xSLToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem miOpenXSL;
private System.Windows.Forms.ToolStripMenuItem miSaveXSL;
private System.Windows.Forms.ToolStripMenuItem miSaveAsXSL;
private System.Windows.Forms.ToolStripMenuItem resultToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem miTransform;
private System.Windows.Forms.ToolStripMenuItem miQuery;
private System.Windows.Forms.ToolStripMenuItem miSaveAsResults;
private System.Windows.Forms.ToolStripMenuItem miQuit;
private System.Windows.Forms.OpenFileDialog ofdxml;
private System.Windows.Forms.SaveFileDialog sfdxml;
private System.Windows.Forms.OpenFileDialog ofdxsl;
private System.Windows.Forms.SaveFileDialog sfdxsl;
private System.Windows.Forms.SaveFileDialog sfdResults;
private System.Windows.Forms.TabPage tpRR;
private System.Windows.Forms.TextBox tbSX;
private System.Windows.Forms.TextBox tbSS;
private System.Windows.Forms.TextBox tbSR;
private System.Windows.Forms.WebBrowser wbRX;
private System.Windows.Forms.WebBrowser wbRS;
private System.Windows.Forms.WebBrowser wbRR;
private System.Windows.Forms.OpenFileDialog ofdResults;
private System.Windows.Forms.TabPage tpXslHelp;
private System.Windows.Forms.TabPage tpXPathHelp;
private System.Windows.Forms.WebBrowser wbXSLHelp;
private System.Windows.Forms.WebBrowser wbXPathHelp;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel RowLbl;
private System.Windows.Forms.ToolStripStatusLabel ColLbl;
private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem specialToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem miRefreshXML;
private System.Windows.Forms.ToolStripMenuItem miRefreshXSL;
}
}

View File

@@ -0,0 +1,289 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml.Xsl;
using System.Xml;
using System.IO;
using System.Text.RegularExpressions;
namespace XSL_Transform
{
public partial class frmMain : Form
{
private bool[] _Dirty = new bool[] { false, false, false };
private string[] _Name = new string[] { "XML", "XSL", "Results" };
private SaveFileDialog[] _Sfd;
private OpenFileDialog[] _Ofd;
private TextBox[] _Tb;
private WebBrowser[] _Wb;
private Dictionary<OpenFileDialog, Tabs> _OpenDict = new Dictionary<OpenFileDialog, Tabs>();
private Dictionary<SaveFileDialog, Tabs> _SaveDict = new Dictionary<SaveFileDialog, Tabs>();
private Dictionary<TextBox, Tabs> _TextBoxDict = new Dictionary<TextBox, Tabs>();
enum Tabs : int
{
XML=0,XSL=1,Results=2
}
public frmMain()
{
InitializeComponent();
_Sfd = new SaveFileDialog[] { sfdxml, sfdxsl, sfdResults };
_Ofd = new OpenFileDialog[] { ofdxml, ofdxsl, ofdResults };
_Tb = new TextBox[] { tbSX, tbSS, tbSR };
_Wb = new WebBrowser[] { wbRX, wbRS, wbRR };
foreach (Tabs tab in Enum.GetValues(typeof(Tabs)))
{
_SaveDict.Add(_Sfd[(int)tab], tab);
_OpenDict.Add(_Ofd[(int)tab], tab);
_TextBoxDict.Add(_Tb[(int)tab], tab);
}
}
void SaveFileOk(object sender, CancelEventArgs e)
{
SaveIt(_SaveDict[(SaveFileDialog)sender]);
}
private void SaveIt(Tabs tab)
{
_Ofd[(int)tab].FileName = _Sfd[(int)tab].FileName;
StreamWriter sw = File.CreateText(_Sfd[(int)tab].FileName);
sw.Write(_Tb[(int)tab].Text);
sw.Close();
_Dirty[(int)tab] = false;
}
void OpenFileOk(object sender, CancelEventArgs e)
{
OpenIt(_OpenDict[(OpenFileDialog) sender]);
}
private void ShowTab(Tabs tabs)
{
if (tcResults.SelectedIndex == (int)tabs)
ShowActiveTab();
else
tcResults.SelectedIndex = (int)tabs;// Activate the Approproate Browser
}
private void OpenIt(Tabs tab)
{
_Sfd[(int)tab].FileName = _Ofd[(int)tab].FileName;
LoadTB(_Tb[(int)tab],_Ofd[(int)tab].FileName);
_Dirty[(int)tab] = false;
tcSource.SelectedIndex = (int)tab;// Activate the Appropriate Tab
ShowTab(tab);
}
private bool SaveChanges(Tabs tab)
{
if (!_Dirty[(int)tab]) return true;
DialogResult dr = MessageBox.Show("Save changes to " + _Name[(int)tab] + " file?", "Save Changes",
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (dr == DialogResult.Cancel) return false;
if (dr == DialogResult.Yes) SaveIt(tab);
return true;
}
private void LoadTB(TextBox tb, string fileName)
{
FileInfo f = new FileInfo(fileName);
StreamReader sr = f.OpenText();
tb.Text = sr.ReadToEnd();
sr.Close();
}
private void miQuit_Click(object sender, EventArgs e)
{
if (SaveChanges()) this.Close();
}
private bool SaveChanges()
{
foreach (Tabs tab in Enum.GetValues(typeof(Tabs)))
if (!SaveChanges(tab)) return false;
return true;
}
private Tabs TabValue(ToolStripDropDownItem mi)
{
return (Tabs)int.Parse(mi.Tag.ToString());
}
private void miOpen_Click(object sender, EventArgs e)
{
Tabs tab = TabValue((ToolStripDropDownItem)sender);
if (SaveChanges(tab))
_Ofd[(int)tab].ShowDialog();
}
private void miRefresh_Click(object sender, EventArgs e)
{
Tabs tab = TabValue((ToolStripDropDownItem)sender);
OpenIt(tab);
}
private void miSaveAs_Click(object sender, EventArgs e)
{
Tabs tab = TabValue((ToolStripDropDownItem)sender);
_Sfd[(int)tab].ShowDialog();
}
private void miSave_Click(object sender, EventArgs e)
{
Tabs tab = TabValue((ToolStripDropDownItem)sender);
if (_Sfd[(int)tab].FileName == string.Empty)
_Sfd[(int)tab].ShowDialog();
else
SaveIt(tab);
}
private string FormatException(Exception ex)
{
return string.Format("{0} - {1}", ex.GetType().Name, ex.Message);
}
private void ShowException(Exception ex)
{
ShowException(ex, null);
}
private void ShowException(Exception ex,string sResults)
{
if (sResults != null)
{
LoadTB(tbSR, sResults);
}
StringBuilder sb = new StringBuilder(FormatException(ex));
sb.Append("\r\n");
for (; ex.InnerException != null; ex = ex.InnerException)
{
sb.Append(FormatException(ex.InnerException));
sb.Append("\r\n");
}
tbSR.SelectionStart = 0;
tbSR.SelectedText=sb.ToString();
}
private void miQuery_Click(object sender, EventArgs e)
{
try
{
XmlDocument xd = new XmlDocument();
xd.LoadXml(tbSX.Text);
XmlNodeList nl = xd.SelectNodes(tbSS.Text);
if (nl.Count > 0)
{
StringBuilder sb= new StringBuilder("<Results>");
foreach (XmlNode nd in nl)
sb.Append(string.Format("\r\n <Result Type='{0}'>{1}</Result>",nd.GetType().Name,nd.OuterXml));
sb.Append("\r\n</Results>");
tbSR.Text = sb.ToString();
}
else
tbSR.Text = "No nodes found matching criteria";
}
catch (Exception ex)
{
ShowException(ex);
}
ShowTab(Tabs.Results);
}
private void miTransform_Click(object sender, EventArgs e)
{
string sXSL = Save(tbSS, "tmpS");
string sXML = Save(tbSX, "tmpX");
string sResults = Application.StartupPath + "\\" + "tmpR.XML";
try
{
XslCompiledTransform xsl = new XslCompiledTransform();
xsl.Load(sXSL);
xsl.Transform(sXML, sResults); // Perform Transform
LoadTB(tbSR, sResults);
}
catch (Exception ex)
{
ShowException(ex,sResults);
}
ShowTab(Tabs.Results);
}
private void ShowActiveTab()
{
Tabs tab = (Tabs)tcResults.SelectedIndex;
_Wb[(int)tab].Navigate(Save(_Tb[(int)tab], _Name[(int)tab]));
}
private void tcResults_SelectedIndexChanged(object sender, EventArgs e)
{
switch (tcResults.SelectedIndex)
{
case 3:
if (wbXSLHelp.Url == null)
wbXSLHelp.Navigate("http://www.w3schools.com/xsl/default.asp");
break;
case 4:
if (wbXPathHelp.Url == null)
wbXPathHelp.Navigate("http://www.w3schools.com/xpath/");
break;
default:
ShowActiveTab();
break;
}
}
private string Extension(string txt)
{
if (txt.Substring(0, 5) == "<html") return ".html";
try
{
XmlDocument xd = new XmlDocument();
xd.LoadXml(txt);
if (xd.OuterXml == string.Empty) return ".txt";
else return ".xml";
}
catch (Exception)
{
return ".txt";
}
}
private string Save(TextBox tb, string path)
{
if (tb.Text == string.Empty) return "about:blank";
string sPath = Application.StartupPath + "\\" + path + Extension(tb.Text) ;
StreamWriter sw = File.CreateText(sPath);
sw.Write(tb.Text);
sw.Close();
return sPath;
}
private void tbTextChanged(object sender, EventArgs e)
{
_Dirty[(int)_TextBoxDict[(TextBox)sender]] = true;
}
private void tbSX_MouseUp(object sender, MouseEventArgs e)
{
RefreshLabels(tbSX.Text, tbSX.SelectionStart);
}
private void RefreshLabels(string s, int location)
{
int row = 0;
int col = 0;
int ii = 0;
while (ii < location)
{
if (s[ii] == '\r')
{
row++;
col = 0;
}
if (s[ii] != '\n') col++;
ii++;
}
RowLbl.Text = string.Format("Row: {0}", row);
ColLbl.Text = string.Format("Col: {0}", col);
}
private void specialToolStripMenuItem_Click(object sender, EventArgs e)
{
SortedList<int, int> sl = new SortedList<int, int>();
foreach (Match match in Regex.Matches(tbSX.Text,"&#x([0-9]*);"))
{
int num = int.Parse(match.Value.Substring(3).TrimEnd(";".ToCharArray()));
if(num != 9 && num != 10 && num != 13){
if (sl.ContainsKey(num)) sl[num] = sl[num] + 1;
else sl[num] = 1;
}
}
// When all done show the results in a list.
tbSR.Text = "Special Characters";
foreach (int key in sl.Keys)
{
tbSR.Text += string.Format("\r\n{0} Ctrl-{1} - {2}", key, Convert.ToChar('A' - 1 + key), sl[key]);
}
ShowTab(Tabs.Results);
}
}
}

View File

@@ -0,0 +1,176 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
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">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</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 for serialized 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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="tpSX.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="tpRS.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="tpSR.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ofdxml.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>126, 17</value>
</metadata>
<metadata name="sfdxml.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>256, 17</value>
</metadata>
<metadata name="ofdxsl.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>340, 17</value>
</metadata>
<metadata name="sfdxsl.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>470, 17</value>
</metadata>
<metadata name="sfdResults.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>598, 17</value>
</metadata>
<metadata name="ofdResults.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>700, 17</value>
</metadata>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>803, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAIAICAQAAAAAADoAgAAJgAAABAQEAAAAAAAKAEAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAIAC
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAICAgADAwMAAAAD/AAD/
AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////
//////////////////////////P////4/////D////wP///+A////gD///8AP4AAAA8AAAADAAAAAAAA
AAOAAAAP//8AP//+AP///gP///wP///8P///+P////P/////////////////////////////////////
//8oAAAAEAAAACAAAAABAAQAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAA
AACAAIAAgIAAAICAgADAwMAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//
AAD//wAA/P8AAP4/AAD+DwAAgAMAAAAAAACAAQAA/gcAAP4fAAD8fwAA/f8AAP//AAD//wAA//8AAA==
</value>
</data>
</root>