You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(174) |
Nov
(85) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(56) |
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
(1) |
Jul
(132) |
Aug
(5) |
Sep
|
Oct
(314) |
Nov
(133) |
Dec
(18) |
2006 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Oleg T. <he...@us...> - 2004-10-25 18:18:16
|
Update of /cvsroot/mvp-xml/Common/v1/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23399/v1/test Modified Files: CommonTest.csproj Log Message: Added XmlBaseAwareXmltextReader impl and test. Index: CommonTest.csproj =================================================================== RCS file: /cvsroot/mvp-xml/Common/v1/test/CommonTest.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CommonTest.csproj 27 Sep 2004 16:31:14 -0000 1.1 +++ CommonTest.csproj 25 Oct 2004 18:18:06 -0000 1.2 @@ -243,6 +243,15 @@ BuildAction = "Compile" /> <File + RelPath = "XmlBaseAwareXmlTextReaderTests\test.xml" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "XmlBaseAwareXmlTextReaderTests\Tests.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "XmlFragments\publishers.xml" BuildAction = "EmbeddedResource" /> |
From: Oleg T. <he...@us...> - 2004-10-25 18:18:16
|
Update of /cvsroot/mvp-xml/Common/v1/test/XmlBaseAwareXmlTextReaderTests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23399/v1/test/XmlBaseAwareXmlTextReaderTests Added Files: Tests.cs test.xml Log Message: Added XmlBaseAwareXmltextReader impl and test. --- NEW FILE: test.xml --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Tests.cs --- using System; using System.Xml; using System.Xml.XPath; using Mvp.Xml.Common; using NUnit.Framework; namespace Mvp.Xml.Tests.XmlBaseAwareXmlTextReaderTests { [TestFixture] public class Tests { [Test] public void BasicTest() { XmlTextReader r = new XmlBaseAwareXmlTextReader( Globals.GetResource( this.GetType().Namespace + ".test.xml")); XPathDocument doc = new XPathDocument(r); XPathNavigator nav = doc.CreateNavigator(); XPathNodeIterator ni = nav.Select("/catalog"); ni.MoveNext(); Assert.IsTrue(ni.Current.BaseURI == ""); ni = nav.Select("/catalog/files/file"); ni.MoveNext(); Assert.IsTrue(ni.Current.BaseURI == "file:///d:/Files/"); } } } |
From: Oleg T. <he...@us...> - 2004-10-25 18:17:06
|
Update of /cvsroot/mvp-xml/Common/v1/test/XmlBaseAwareXmlTextReaderTests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23118/XmlBaseAwareXmlTextReaderTests Log Message: Directory /cvsroot/mvp-xml/Common/v1/test/XmlBaseAwareXmlTextReaderTests added to the repository |
From: Oleg T. <he...@us...> - 2004-10-22 14:56:51
|
Update of /cvsroot/mvp-xml/XInclude/v1/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32008/v1/src Modified Files: XIncludingReader.cs Log Message: Fixed ReadOuterXml()/ReadInnerXml() and Depth. Index: XIncludingReader.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/XIncludingReader.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- XIncludingReader.cs 20 Oct 2004 19:28:12 -0000 1.13 +++ XIncludingReader.cs 22 Oct 2004 14:56:42 -0000 1.14 @@ -29,9 +29,7 @@ /// </summary> /// <author>Oleg Tkachenko, ol...@tk...</author> /// <remarks> - /// Open Issues: - /// o Outer/Inner/Xml/Text - /// o Depth on included items? + /// Open Issues: /// o GetAttribute(int i)? /// o MoveToAttribute(int i)? /// o GetEntity on custom XmlResolver @@ -331,7 +329,12 @@ /// <summary>See <see cref="XmlReader.Depth"/></summary> public override int Depth { - get { return _reader.Depth; } + get { + if (_readers.Count == 0) + return _reader.Depth; + else + return ((XmlReader)_readers.Peek()).Depth + _reader.Depth; + } } /// <summary>See <see cref="XmlReader.EOF"/></summary> @@ -595,14 +598,28 @@ return _reader.XmlLang; case XIncludingReaderState.ExposingXmlLangAttrValue: return String.Empty; - default: - StringWriter sw = new StringWriter(); - XmlTextWriter xw = new XmlTextWriter(sw); - int depth = Depth; - while (Read() && Depth != depth) - xw.WriteNode(this, false); - xw.Close(); - return sw.ToString(); + default: + if (NodeType == XmlNodeType.Element) + { + int depth = Depth; + if (Read()) + { + StringWriter sw = new StringWriter(); + XmlTextWriter xw = new XmlTextWriter(sw); + while (Depth > depth) + xw.WriteNode(this, false); + xw.Close(); + return sw.ToString(); + } + else + return String.Empty; + } + else if (NodeType == XmlNodeType.Attribute) + { + return Value; + } + else + return String.Empty; } } @@ -619,12 +636,20 @@ return @"xml:lang="" + _reader.XmlLang + @"""; case XIncludingReaderState.ExposingXmlLangAttrValue: return String.Empty; - default: - StringWriter sw = new StringWriter(); - XmlTextWriter xw = new XmlTextWriter(sw); - xw.WriteNode(this, false); - xw.Close(); - return sw.ToString(); + default: + if (NodeType == XmlNodeType.Element) + { + StringWriter sw = new StringWriter(); + XmlTextWriter xw = new XmlTextWriter(sw); + xw.WriteNode(this, false); + xw.Close(); + return sw.ToString(); + } + else if (NodeType == XmlNodeType.Attribute) + { + return String.Format("{0=\"{1}\"}", Name, Value); + } else + return String.Empty; } } |
From: Oleg T. <he...@us...> - 2004-10-22 14:56:51
|
Update of /cvsroot/mvp-xml/XInclude/v1/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32008/v1/test Modified Files: EntryPoint.cs XIncludeReaderTests.cs Log Message: Fixed ReadOuterXml()/ReadInnerXml() and Depth. Index: EntryPoint.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/EntryPoint.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- EntryPoint.cs 20 Oct 2004 19:28:13 -0000 1.4 +++ EntryPoint.cs 22 Oct 2004 14:56:42 -0000 1.5 @@ -14,7 +14,7 @@ //NistTests rt = new NistTests(); try { - rt.DepthTest(); + rt.InnerXmlTest(); } catch (Exception e) { Index: XIncludeReaderTests.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/XIncludeReaderTests.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- XIncludeReaderTests.cs 20 Oct 2004 19:28:13 -0000 1.5 +++ XIncludeReaderTests.cs 22 Oct 2004 14:56:42 -0000 1.6 @@ -240,8 +240,8 @@ xir.MoveToContent(); XmlDocument doc = new XmlDocument(); doc.PreserveWhitespace = true; - doc.Load(xir); - string outerXml2 = doc.OuterXml; + doc.Load(xir); + string outerXml2 = doc.DocumentElement.OuterXml; Assert.AreEqual(outerXml, outerXml2); } @@ -260,7 +260,7 @@ XmlDocument doc = new XmlDocument(); doc.PreserveWhitespace = true; doc.Load(xir); - string innerXml2 = doc.InnerXml; + string innerXml2 = doc.DocumentElement.InnerXml; Assert.AreEqual(innerXml, innerXml2); } |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 21:24:30
|
Update of /cvsroot/mvp-xml/Design/v1/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4681/v1/src Modified Files: changelog.txt Log Message: Index: changelog.txt =================================================================== RCS file: /cvsroot/mvp-xml/Design/v1/src/changelog.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- changelog.txt 10 Oct 2004 15:26:43 -0000 1.1 +++ changelog.txt 21 Oct 2004 21:24:20 -0000 1.2 @@ -1,3 +1,8 @@ +October 21, 2004 + +Renamed tool to XGen, added setup and test project. + +--------------------------------------------------------- October 10, 2004 Initial release of the SGen custom tool. |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 21:07:11
|
Update of /cvsroot/mvp-xml/Design/v1/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1302/v1/src Removed Files: Design.suo Log Message: --- Design.suo DELETED --- |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 21:04:20
|
Update of /cvsroot/mvp-xml/Design/v1/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv747/v1/src Modified Files: Design.sln Design.suo Log Message: Index: Design.suo =================================================================== RCS file: /cvsroot/mvp-xml/Design/v1/src/Design.suo,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvs6V91WF and /tmp/cvsh0xDrL differ Index: Design.sln =================================================================== RCS file: /cvsroot/mvp-xml/Design/v1/src/Design.sln,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Design.sln 21 Oct 2004 20:51:56 -0000 1.2 +++ Design.sln 21 Oct 2004 21:04:10 -0000 1.3 @@ -7,6 +7,10 @@ ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Design.Tests", "..\Design.Tests\Design.Tests.csproj", "{4C7101B3-6736-46B1-B1AD-9FE4E2F685D5}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -19,6 +23,10 @@ {A379C40D-C984-4E63-933A-BE96E9A599B7}.Release.Build.0 = Release|.NET {0836E643-A9ED-421E-8426-1CB68F125B66}.Debug.ActiveCfg = Debug {0836E643-A9ED-421E-8426-1CB68F125B66}.Release.ActiveCfg = Release + {4C7101B3-6736-46B1-B1AD-9FE4E2F685D5}.Debug.ActiveCfg = Debug|.NET + {4C7101B3-6736-46B1-B1AD-9FE4E2F685D5}.Debug.Build.0 = Debug|.NET + {4C7101B3-6736-46B1-B1AD-9FE4E2F685D5}.Release.ActiveCfg = Release|.NET + {4C7101B3-6736-46B1-B1AD-9FE4E2F685D5}.Release.Build.0 = Release|.NET EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 21:04:09
|
Update of /cvsroot/mvp-xml/Design/v1/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv615/v1/tests Added Files: AssemblyInfo.cs Customer.cs Customer.Serialization.cs Design.Tests.csproj Design.Tests.sln TestSerialization.cs Log Message: --- NEW FILE: Customer.Serialization.cs --- namespace Mvp.Xml.Design.Tests { using System.Xml.Serialization; using System; /// <summary>Custom serializer for Customer type.</summary public class CustomerSerializer : System.Xml.Serialization.XmlSerializer { CustomerReader _reader; CustomerWriter _writer; /// <summary>Constructs the serializer with default reader and writer instances.</summary> public CustomerSerializer() { } /// <summary>Constructs the serializer with a pre-built reader.</summary> public CustomerSerializer(CustomerReader reader) { _reader = reader; } /// <summary>Constructs the serializer with a pre-built writer.</summary> public CustomerSerializer(CustomerWriter writer) { _writer = writer; } /// <summary>Constructs the serializer with pre-built reader and writer.</summary> public CustomerSerializer(CustomerReader reader, CustomerWriter writer) { _reader = reader; _writer = writer; } /// <summary>See <see cref="XmlSerializer.CreateReader"/>.</summary> protected override XmlSerializationReader CreateReader() { if (_reader != null) return _reader; else return new CustomerReader(); } /// <summary>See <see cref="XmlSerializer.CreateWriter"/>.</summary> protected override XmlSerializationWriter CreateWriter() { if (_writer != null) return _writer; else return new CustomerWriter(); } /// <summary>See <see cref="XmlSerializer.Deserialize"/>.</summary> protected override object Deserialize(XmlSerializationReader reader) { if (!(reader is CustomerReader)) throw new ArgumentException("reader"); return ((CustomerReader)reader).Read(); } /// <summary>See <see cref="XmlSerializer.Serialize"/>.</summary> protected override void Serialize(object o, XmlSerializationWriter writer) { if (!(writer is CustomerWriter)) throw new ArgumentException("writer"); ((CustomerWriter)writer).Write((Mvp.Xml.Design.Tests.Customer)o); } public class Reader : System.Xml.Serialization.XmlSerializationReader { /// <remarks/> protected virtual Mvp.Xml.Design.Tests.Customer Read1_Customer(bool isNullable, bool checkType) { if (isNullable && ReadNull()) return null; if (checkType) { System.Xml.XmlQualifiedName t = GetXsiType(); if (t == null || ((object) ((System.Xml.XmlQualifiedName)t).Name == (object)id1_Customer && (object) ((System.Xml.XmlQualifiedName)t).Namespace == (object)id2_Item)) ; else throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)t); } Mvp.Xml.Design.Tests.Customer o = new Mvp.Xml.Design.Tests.Customer(); bool[] paramsRead = new bool[2]; while (Reader.MoveToNextAttribute()) { if (!IsXmlnsAttribute(Reader.Name)) { UnknownNode((object)o); } } Reader.MoveToElement(); if (Reader.IsEmptyElement) { Reader.Skip(); return o; } Reader.ReadStartElement(); Reader.MoveToContent(); while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) { if (Reader.NodeType == System.Xml.XmlNodeType.Element) { if (!paramsRead[0] && ((object) Reader.LocalName == (object)id3_FirstName && (object) Reader.NamespaceURI == (object)id2_Item)) { o.@FirstName = Reader.ReadElementString(); paramsRead[0] = true; } else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id4_LastName && (object) Reader.NamespaceURI == (object)id2_Item)) { o.@LastName = Reader.ReadElementString(); paramsRead[1] = true; } else { UnknownNode((object)o); } } else { UnknownNode((object)o); } Reader.MoveToContent(); } ReadEndElement(); return o; } /// <remarks/> protected virtual System.Object Read2_Object(bool isNullable, bool checkType) { if (isNullable && ReadNull()) return null; if (checkType) { System.Xml.XmlQualifiedName t = GetXsiType(); if (t == null) return ReadTypedPrimitive(new System.Xml.XmlQualifiedName("anyType", "http://www.w3.org/2001/XMLSchema")); else if (((object) ((System.Xml.XmlQualifiedName)t).Name == (object)id1_Customer && (object) ((System.Xml.XmlQualifiedName)t).Namespace == (object)id2_Item)) return Read1_Customer(isNullable, false); else return ReadTypedPrimitive((System.Xml.XmlQualifiedName)t); } System.Object o = new System.Object(); bool[] paramsRead = new bool[0]; while (Reader.MoveToNextAttribute()) { if (!IsXmlnsAttribute(Reader.Name)) { UnknownNode((object)o); } } Reader.MoveToElement(); if (Reader.IsEmptyElement) { Reader.Skip(); return o; } Reader.ReadStartElement(); Reader.MoveToContent(); while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) { if (Reader.NodeType == System.Xml.XmlNodeType.Element) { UnknownNode((object)o); } else { UnknownNode((object)o); } Reader.MoveToContent(); } ReadEndElement(); return o; } protected override void InitCallbacks() { } protected internal object Read4_Customer() { object o = null; Reader.MoveToContent(); if (Reader.NodeType == System.Xml.XmlNodeType.Element) { if (((object) Reader.LocalName == (object)id1_Customer && (object) Reader.NamespaceURI == (object)id2_Item)) { o = Read1_Customer(true, true); } else { throw CreateUnknownNodeException(); } } else { UnknownNode(null); } return (object)o; } System.String id1_Customer; System.String id4_LastName; System.String id3_FirstName; System.String id2_Item; protected override void InitIDs() { id1_Customer = Reader.NameTable.Add(@"Customer"); id4_LastName = Reader.NameTable.Add(@"LastName"); id3_FirstName = Reader.NameTable.Add(@"FirstName"); id2_Item = Reader.NameTable.Add(@""); } } public class Writer : System.Xml.Serialization.XmlSerializationWriter { void Write1_Customer(string n, string ns, Mvp.Xml.Design.Tests.Customer o, bool isNullable, bool needType) { if ((object)o == null) { if (isNullable) WriteNullTagLiteral(n, ns); return; } if (!needType) { System.Type t = o.GetType(); if (t == typeof(Mvp.Xml.Design.Tests.Customer)) ; else { throw CreateUnknownTypeException(o); } } WriteStartElement(n, ns, o); if (needType) WriteXsiType(@"Customer", @""); WriteElementString(@"FirstName", @"", ((System.String)o.@FirstName)); WriteElementString(@"LastName", @"", ((System.String)o.@LastName)); WriteEndElement(o); } void Write2_Object(string n, string ns, System.Object o, bool isNullable, bool needType) { if ((object)o == null) { if (isNullable) WriteNullTagLiteral(n, ns); return; } if (!needType) { System.Type t = o.GetType(); if (t == typeof(System.Object)) ; else if (t == typeof(Mvp.Xml.Design.Tests.Customer)) { Write1_Customer(n, ns, (Mvp.Xml.Design.Tests.Customer)o, isNullable, true); return; } else { WriteTypedPrimitive(n, ns, o, true); return; } } WriteStartElement(n, ns, o); WriteEndElement(o); } protected override void InitCallbacks() { } protected internal void Write3_Customer(object o) { WriteStartDocument(); if (o == null) { WriteNullTagLiteral(@"Customer", @""); return; } TopLevelElement(); Write1_Customer(@"Customer", @"", ((Mvp.Xml.Design.Tests.Customer)o), true, false); } } /// <remarks/> } public class CustomerReader : CustomerSerializer.Reader { /// <remarks/> protected override Mvp.Xml.Design.Tests.Customer Read1_Customer(bool isNullable, bool checkType) { Mvp.Xml.Design.Tests.Customer obj = base.Read1_Customer(isNullable, checkType); CustomerDeserializedHandler handler = CustomerDeserialized; if (handler != null) handler(obj); return obj; } /// <summary>Reads an object of type Mvp.Xml.Design.Tests.Customer.</summary> internal Mvp.Xml.Design.Tests.Customer Read() { return (Mvp.Xml.Design.Tests.Customer) Read4_Customer(); } /// /// <remarks/> public event CustomerDeserializedHandler CustomerDeserialized; } /// /// <remarks/> public delegate void CustomerDeserializedHandler(Mvp.Xml.Design.Tests.Customer customer); public class CustomerWriter : CustomerSerializer.Writer { /// <summary>Writes an object of type Mvp.Xml.Design.Tests.Customer.</summary> internal void Write(Mvp.Xml.Design.Tests.Customer obj) { Write3_Customer(obj); }} } --- NEW FILE: Design.Tests.csproj --- <VisualStudioProject> <CSHARP ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" ProjectGuid = "{4C7101B3-6736-46B1-B1AD-9FE4E2F685D5}" > <Build> <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" AssemblyName = "Mvp.Xml.Design.Tests" AssemblyOriginatorKeyFile = "" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "Library" PreBuildEvent = "" PostBuildEvent = "" RootNamespace = "Mvp.Xml.Design.Tests" 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.Data" AssemblyName = "System.Data" HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" /> <Reference Name = "System.XML" AssemblyName = "System.Xml" HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> <Reference Name = "nunit.framework" AssemblyName = "nunit.framework" HintPath = "C:\Program Files\NUnit 2.2\bin\nunit.framework.dll" AssemblyFolderKey = "hklm\dn\nunit.framework" /> </References> </Build> <Files> <Include> <File RelPath = "AssemblyInfo.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Customer.cs" SubType = "Code" BuildAction = "Compile" Generator = "Mvp.Xml.XGen" LastGenOutput = "Customer.Serialization.cs" /> <File RelPath = "Customer.Serialization.cs" DependentUpon = "Customer.cs" SubType = "Code" BuildAction = "Compile" AutoGen = "True" /> <File RelPath = "TestSerialization.cs" SubType = "Code" BuildAction = "Compile" /> </Include> </Files> </CSHARP> </VisualStudioProject> --- NEW FILE: Design.Tests.sln --- Microsoft Visual Studio Solution File, Format Version 8.00 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Design", "..\src\Design.csproj", "{A379C40D-C984-4E63-933A-BE96E9A599B7}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Setup", "..\setup\setup.vdproj", "{0836E643-A9ED-421E-8426-1CB68F125B66}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Design.Tests", "Design.Tests.csproj", "{4C7101B3-6736-46B1-B1AD-9FE4E2F685D5}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {A379C40D-C984-4E63-933A-BE96E9A599B7}.Debug.ActiveCfg = Debug|.NET {A379C40D-C984-4E63-933A-BE96E9A599B7}.Debug.Build.0 = Debug|.NET {A379C40D-C984-4E63-933A-BE96E9A599B7}.Release.ActiveCfg = Release|.NET {A379C40D-C984-4E63-933A-BE96E9A599B7}.Release.Build.0 = Release|.NET {0836E643-A9ED-421E-8426-1CB68F125B66}.Debug.ActiveCfg = Debug {0836E643-A9ED-421E-8426-1CB68F125B66}.Release.ActiveCfg = Release {4C7101B3-6736-46B1-B1AD-9FE4E2F685D5}.Debug.ActiveCfg = Debug|.NET {4C7101B3-6736-46B1-B1AD-9FE4E2F685D5}.Debug.Build.0 = Debug|.NET {4C7101B3-6736-46B1-B1AD-9FE4E2F685D5}.Release.ActiveCfg = Release|.NET {4C7101B3-6736-46B1-B1AD-9FE4E2F685D5}.Release.Build.0 = Release|.NET EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal --- NEW FILE: Customer.cs --- using System; namespace Mvp.Xml.Design.Tests { public class Customer { public string FirstName { get { return _name; } set { _name = value; } } string _name; public string LastName { get { return _lname; } set { _lname = value; } } string _lname; } } --- NEW FILE: TestSerialization.cs --- using System; using NUnit.Framework; namespace Mvp.Xml.Design.Tests { [TestFixture] public class TestSerialization { [Test] public void SerializePubs() { } } } --- NEW FILE: AssemblyInfo.cs --- using System.Reflection; using System.Runtime.CompilerServices; // // 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("")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // // 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 Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.*")] // // In order to sign your assembly you must specify a key to use. Refer to the // Microsoft .NET Framework documentation for more information on assembly signing. // // Use the attributes below to control which key is used for signing. // // Notes: // (*) If no key is specified, the assembly is not signed. // (*) KeyName refers to a key that has been installed in the Crypto Service // Provider (CSP) on your machine. KeyFile refers to a file which contains // a key. // (*) If the KeyFile and the KeyName values are both specified, the // following processing occurs: // (1) If the KeyName can be found in the CSP, that key is used. // (2) If the KeyName does not exist and the KeyFile does exist, the key // in the KeyFile is installed into the CSP and used. // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. // When specifying the KeyFile, the location of the KeyFile should be // relative to the project output directory which is // %Project Directory%\obj\<configuration>. For example, if your KeyFile is // located in the project directory, you would specify the AssemblyKeyFile // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework // documentation for more information on this. // [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:52:06
|
Update of /cvsroot/mvp-xml/Design/v1/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30705/v1/src Modified Files: Design.csproj Design.sln Design.suo SR.cs SR.resx Log Message: Index: Design.suo =================================================================== RCS file: /cvsroot/mvp-xml/Design/v1/src/Design.suo,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsgSlWKI and /tmp/cvs2wgcSM differ Index: Design.csproj =================================================================== RCS file: /cvsroot/mvp-xml/Design/v1/src/Design.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Design.csproj 10 Oct 2004 15:26:43 -0000 1.1 +++ Design.csproj 21 Oct 2004 20:51:56 -0000 1.2 @@ -36,7 +36,7 @@ NoStdLib = "false" NoWarn = "" Optimize = "false" - OutputPath = "bin\Debug\" + OutputPath = "..\bin\" RegisterForComInterop = "true" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" @@ -56,7 +56,7 @@ NoStdLib = "false" NoWarn = "" Optimize = "true" - OutputPath = "bin\Release\" + OutputPath = "..\bin\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" @@ -99,6 +99,7 @@ Name = "microsoft.visualstudio.designer.interfaces" AssemblyName = "Microsoft.VisualStudio.Designer.Interfaces" HintPath = "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\microsoft.visualstudio.designer.interfaces.dll" + Private = "False" /> <Reference Name = "System.Drawing" @@ -111,6 +112,16 @@ HintPath = "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\PublicAssemblies\VSLangProj2.dll" AssemblyFolderKey = "hklm\publicassemblies" /> + <Reference + Name = "System.Management" + AssemblyName = "System.Management" + HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Management.dll" + /> + <Reference + Name = "System.Configuration.Install" + AssemblyName = "System.Configuration.Install" + HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Configuration.Install.dll" + /> </References> </Build> <Files> @@ -121,11 +132,24 @@ BuildAction = "Compile" /> <File + RelPath = "changelog.txt" + BuildAction = "Content" + /> + <File RelPath = "DebugUtils.cs" SubType = "Code" BuildAction = "Compile" /> <File + RelPath = "license.txt" + BuildAction = "Content" + /> + <File + RelPath = "ProjectInstaller.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "ReflectionHelper.cs" SubType = "Code" BuildAction = "Compile" @@ -151,27 +175,27 @@ BuildAction = "Compile" /> <File - RelPath = "CustomTools\SGen\ClassPicker.cs" + RelPath = "CustomTools\XGen\ClassPicker.cs" SubType = "Form" BuildAction = "Compile" /> <File - RelPath = "CustomTools\SGen\ClassPicker.resx" + RelPath = "CustomTools\XGen\ClassPicker.resx" DependentUpon = "ClassPicker.cs" BuildAction = "EmbeddedResource" /> <File - RelPath = "CustomTools\SGen\SGenRunner.cs" + RelPath = "CustomTools\XGen\XGenRunner.cs" SubType = "Code" BuildAction = "Compile" /> <File - RelPath = "CustomTools\SGen\SGenTool.cs" + RelPath = "CustomTools\XGen\XGenTool.cs" SubType = "Code" BuildAction = "Compile" /> <File - RelPath = "CustomTools\SGen\XmlSerializerGenerator.cs" + RelPath = "CustomTools\XGen\XmlSerializerGenerator.cs" SubType = "Code" BuildAction = "Compile" /> Index: Design.sln =================================================================== RCS file: /cvsroot/mvp-xml/Design/v1/src/Design.sln,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Design.sln 10 Oct 2004 15:26:43 -0000 1.1 +++ Design.sln 21 Oct 2004 20:51:56 -0000 1.2 @@ -3,6 +3,10 @@ ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Setup", "..\setup\setup.vdproj", "{0836E643-A9ED-421E-8426-1CB68F125B66}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -13,6 +17,8 @@ {A379C40D-C984-4E63-933A-BE96E9A599B7}.Debug.Build.0 = Debug|.NET {A379C40D-C984-4E63-933A-BE96E9A599B7}.Release.ActiveCfg = Release|.NET {A379C40D-C984-4E63-933A-BE96E9A599B7}.Release.Build.0 = Release|.NET + {0836E643-A9ED-421E-8426-1CB68F125B66}.Debug.ActiveCfg = Debug + {0836E643-A9ED-421E-8426-1CB68F125B66}.Release.ActiveCfg = Release EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection Index: SR.cs =================================================================== RCS file: /cvsroot/mvp-xml/Design/v1/src/SR.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SR.cs 10 Oct 2004 15:26:43 -0000 1.1 +++ SR.cs 21 Oct 2004 20:51:56 -0000 1.2 @@ -65,8 +65,24 @@ return SR.GetString("Tool_NoDTEProjectItem"); } } + + /// <summary>An error occurrent, and it's received as a parameter.</summary> + public static string XGenTool_GeneralError(object arg0) + { + return SR.GetString("XGenTool_GeneralError", arg0); + } - /// <summary>Current project object retrieved by EnvDTE is not a VSProject item. See ms-help://MS.VSCC.2003/MS.MSDNQTR.2003OCT.1033/vbcon/html/vxlrfvslangprojvsproject.htm</summary> + + /// <summary>The selected element doesn't contain any class definitions.</summary> + public static string XGenTool_NoClassFound + { + get + { + return SR.GetString("XGenTool_NoClassFound"); + } + } + + /// <summary>Current project object retrieved by EnvDTE is not a VSProject item. See ms-help://MS.VSCC.2003/MS.MSDNQTR.2003OCT.1033/vbcon/html/vxlrfvslangprojvsproject.htm</summary> public static string Tool_UnsupportedProjectType { get Index: SR.resx =================================================================== RCS file: /cvsroot/mvp-xml/Design/v1/src/SR.resx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SR.resx 10 Oct 2004 15:26:43 -0000 1.1 +++ SR.resx 21 Oct 2004 20:51:56 -0000 1.2 @@ -1,406 +1,417 @@ <?xml version="1.0" encoding="utf-8" ?> <root> - <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" /> - <xsd:attribute name="type" type="xsd:string" /> - <xsd:attribute name="mimetype" type="xsd:string" /> - </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.0.0.0</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="Tool_AttributeMissing" type="System.String" mimetype="System.String"> - <value>Type '{0}' must have the '{1}' attribute.</value> - <comment>CustomTool-derived class doesn't implement a required attribute.</comment> - </data> - <data name="Tool_NoDTEProjectItem" type="System.String" mimetype="System.String"> - <value>Can't get current project item.</value> - <comment>The EnvDTE.ProjectItem is not set. Probably there's no item selected.</comment> - </data> - <data name="Tool_UnsupportedProjectType" type="System.String" mimetype="System.String"> - <value>Current project type is unsupported for this tool.</value> - <comment>Current project object retrieved by EnvDTE is not a VSProject item. See ms-help://MS.VSCC.2003/MS.MSDNQTR.2003OCT.1033/vbcon/html/vxlrfvslangprojvsproject.htm</comment> - </data> - <data name="Tool_UnsupportedCodeDomOutput" type="System.String" mimetype="System.String"> - <value>Output of type CodeDom must be either a CodeNamespace or a CodeCompileUnit.</value> - <comment>An invalid output was assigned the type OutputType.CodeDom</comment> - </data> - <data name="Tool_NoCodeDomSupport" type="System.String" mimetype="System.String"> - <value>Current project type can't have code elements, or can't compile to a .NET language. Supported project types are C# and VB.NET.</value> - <comment>The project isn't C# or VB.</comment> - </data> - <data name="Tool_Success" type="System.String" mimetype="System.String"> - <value>Success.</value> - <comment>The engine run without errors.</comment> - </data> - <data name="Gral_TypeMustImplementInterface" type="System.String" mimetype="System.String"> - <value>Type '{0}' doesn't implement required interface '{1}'.</value> - <comment>Type received as the first parameter does not implement the interface passed as the second parameter.</comment> - </data> - <data name="Gral_TypeMustInherit" type="System.String" mimetype="System.String"> - <value>Type '{0}' doesn't inherit from required base class '{1}'.</value> - <comment>Type received as the first parameter does not inherit from the base class passed as the second parameter.</comment> - </data> - <data name="ValueBinder_InvalidExpression" type="System.String" mimetype="System.String"> - <value>Expression '{0}' is invalid. Check .NET documentation for the DataBinder.Eval expression syntax.</value> - <comment>The expression receivedz in the first parameter is not in the expected format.</comment> - </data> - <data name="ValueBinder_MemberNotFound" type="System.String" mimetype="System.String"> - <value>Field or property '{0}' was not found in type '{1}'. Expression being evaluated was '{2}', for target '{3}'.</value> - <comment>First parameter is the field or property name, next the type where it's missing. Finally, the full expression and the originating target for which the expression was being evaluated.</comment> - </data> - <data name="ValueBinder_MethodArgumentsInvalid" type="System.String" mimetype="System.String"> - <value>Method '{0}' doesn't match the arguments received. Expression being evaluated was '{1}', for target '{2}'.</value> - <comment>First parameter is the method name name, next the full expression and the originating target for which the expression was being evaluated.</comment> - </data> - <data name="ValueBinder_IndexNotNumber" type="System.String" mimetype="System.String"> - <value>Argument '{0}' is not a valid number. </value> - <comment>Receives the indexer value that couldn't be converted to Int32.</comment> - </data> - <data name="ValueBinder_IndexEnumInvalid" type="System.String" mimetype="System.String"> - <value>Enum value '{0}' is invalid.</value> - <comment>Receives the full enum indexer that failed.</comment> - </data> - <data name="ValueBinder_NoIndexerFound" type="System.String" mimetype="System.String"> - <value>Type '{0}' doesn't have an indexer. Expression being evaluated was '{1}'.</value> - <comment>Receives the type that doesn't have the indexer, and the full expression.</comment> - </data> - <data name="ValueBinder_CantConvertValue" type="System.String" mimetype="System.String"> - <value>Value of type '{0}' can't be converted to type '{1}' expected by member '{2}'.</value> - <comment>Receives incoming value type, expected type and member name.</comment> - </data> - <data name="ValueBinder_CantAssignToMethod" type="System.String" mimetype="System.String"> - <value>Can't assign a value to a method return value. Expression being evaluated was '{0}'.</value> - <comment>{0}=full expression. The last segment of the expression is a method call, and the user tries to set a value on it.</comment> - </data> - <data name="Embedded_Success" type="System.String" mimetype="System.String"> - <value>Embedded resources generated.</value> - <comment>Sucess message.</comment> - </data> - <data name="Embedded_Error" type="System.String" mimetype="System.String"> - <value>#error Couldn't generate resource. + <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" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + </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.0.0.0</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="Tool_AttributeMissing" type="System.String" mimetype="System.String"> + <value>Type '{0}' must have the '{1}' attribute.</value> + <comment>CustomTool-derived class doesn't implement a required attribute.</comment> + </data> + <data name="Tool_NoDTEProjectItem" type="System.String" mimetype="System.String"> + <value>Can't get current project item.</value> + <comment>The EnvDTE.ProjectItem is not set. Probably there's no item selected.</comment> + </data> + <data name="Tool_UnsupportedProjectType" type="System.String" mimetype="System.String"> + <value>Current project type is unsupported for this tool.</value> + <comment>Current project object retrieved by EnvDTE is not a VSProject item. See ms-help://MS.VSCC.2003/MS.MSDNQTR.2003OCT.1033/vbcon/html/vxlrfvslangprojvsproject.htm</comment> + </data> + <data name="Tool_UnsupportedCodeDomOutput" type="System.String" mimetype="System.String"> + <value>Output of type CodeDom must be either a CodeNamespace or a CodeCompileUnit.</value> + <comment>An invalid output was assigned the type OutputType.CodeDom</comment> + </data> + <data name="Tool_NoCodeDomSupport" type="System.String" mimetype="System.String"> + <value>Current project type can't have code elements, or can't compile to a .NET language. Supported project types are C# and VB.NET.</value> + <comment>The project isn't C# or VB.</comment> + </data> + <data name="Tool_Success" type="System.String" mimetype="System.String"> + <value>Success.</value> + <comment>The engine run without errors.</comment> + </data> + <data name="Gral_TypeMustImplementInterface" type="System.String" mimetype="System.String"> + <value>Type '{0}' doesn't implement required interface '{1}'.</value> + <comment>Type received as the first parameter does not implement the interface passed as the second parameter.</comment> + </data> + <data name="Gral_TypeMustInherit" type="System.String" mimetype="System.String"> + <value>Type '{0}' doesn't inherit from required base class '{1}'.</value> + <comment>Type received as the first parameter does not inherit from the base class passed as the second parameter.</comment> + </data> + <data name="ValueBinder_InvalidExpression" type="System.String" mimetype="System.String"> + <value>Expression '{0}' is invalid. Check .NET documentation for the DataBinder.Eval expression syntax.</value> + <comment>The expression receivedz in the first parameter is not in the expected format.</comment> + </data> + <data name="ValueBinder_MemberNotFound" type="System.String" mimetype="System.String"> + <value>Field or property '{0}' was not found in type '{1}'. Expression being evaluated was '{2}', for target '{3}'.</value> + <comment>First parameter is the field or property name, next the type where it's missing. Finally, the full expression and the originating target for which the expression was being evaluated.</comment> + </data> + <data name="ValueBinder_MethodArgumentsInvalid" type="System.String" mimetype="System.String"> + <value>Method '{0}' doesn't match the arguments received. Expression being evaluated was '{1}', for target '{2}'.</value> + <comment>First parameter is the method name name, next the full expression and the originating target for which the expression was being evaluated.</comment> + </data> + <data name="ValueBinder_IndexNotNumber" type="System.String" mimetype="System.String"> + <value>Argument '{0}' is not a valid number. </value> + <comment>Receives the indexer value that couldn't be converted to Int32.</comment> + </data> + <data name="ValueBinder_IndexEnumInvalid" type="System.String" mimetype="System.String"> + <value>Enum value '{0}' is invalid.</value> + <comment>Receives the full enum indexer that failed.</comment> + </data> + <data name="ValueBinder_NoIndexerFound" type="System.String" mimetype="System.String"> + <value>Type '{0}' doesn't have an indexer. Expression being evaluated was '{1}'.</value> + <comment>Receives the type that doesn't have the indexer, and the full expression.</comment> + </data> + <data name="ValueBinder_CantConvertValue" type="System.String" mimetype="System.String"> + <value>Value of type '{0}' can't be converted to type '{1}' expected by member '{2}'.</value> + <comment>Receives incoming value type, expected type and member name.</comment> + </data> + <data name="ValueBinder_CantAssignToMethod" type="System.String" mimetype="System.String"> + <value>Can't assign a value to a method return value. Expression being evaluated was '{0}'.</value> + <comment>{0}=full expression. The last segment of the expression is a method call, and the user tries to set a value on it.</comment> + </data> + <data name="Embedded_Success" type="System.String" mimetype="System.String"> + <value>Embedded resources generated.</value> + <comment>Sucess message.</comment> + </data> + <data name="Embedded_Error" type="System.String" mimetype="System.String"> + <value>#error Couldn't generate resource. /* {0} */</value> - <comment>An error occurrent, and it's received as a parameter.</comment> - </data> - <data name="Embedded_NoLocaleDefined" type="System.String" mimetype="System.String"> - <value>The file doesn't contain a valid locale in its name.</value> - <comment>The file can't be used to generate a localized resource.</comment> - </data> - <data name="Embedded_CantFindMain" type="System.String" mimetype="System.String"> - <value>Main resource file for this localized version wasn't found.</value> - <comment>Can't find the main file resource.</comment> - </data> - <data name="Embedded_CantFindMainClass" type="System.String" mimetype="System.String"> - <value>Parent main resource file for this localized version was found, but its corresponding resource class wasn't. + <comment>An error occurrent, and it's received as a parameter.</comment> + </data> + <data name="Embedded_NoLocaleDefined" type="System.String" mimetype="System.String"> + <value>The file doesn't contain a valid locale in its name.</value> + <comment>The file can't be used to generate a localized resource.</comment> + </data> + <data name="Embedded_CantFindMain" type="System.String" mimetype="System.String"> + <value>Main resource file for this localized version wasn't found.</value> + <comment>Can't find the main file resource.</comment> + </data> + <data name="Embedded_CantFindMainClass" type="System.String" mimetype="System.String"> + <value>Parent main resource file for this localized version was found, but its corresponding resource class wasn't. Check that its CustomTool property is set to the appropriate generator.</value> - <comment>Can't find the main file resource class.</comment> - </data> - <data name="ValueEditor_CantConvertValue" type="System.String" mimetype="System.String"> - <value>Value of type '{0}' can't be converted to type '{1}' expected by argument.</value> - <comment>Receives incoming value type and expected type.</comment> - </data> - <data name="ValueEditor_InvalidValue" type="System.String" mimetype="System.String"> - <value>The value specified is invalid.</value> - <comment></comment> - </data> - <data name="Step_ShowHelp" type="System.String" mimetype="System.String"> - <value>Show Help</value> - <comment>Allows the user to click and see additional help.</comment> - </data> - <data name="IdeWizard_MissingParameter" type="System.String" mimetype="System.String"> - <value>Parameter '{0}' is required. Check wizard definision file.</value> - <comment>A custom param in the .vsz file is missing. That is the first argument to the method.</comment> - </data> - <data name="Ide_ToolsMenu" type="System.String" mimetype="System.String"> - <value>Microsoft Reference Architecture</value> - <comment>Caption of the main menu item in Tools.</comment> - </data> - <data name="Ide_ToolsMenuTooltip" type="System.String" mimetype="System.String"> - <value>Provides access to the Reference Architecture wizards and design tools.</value> - </data> - <data name="Ide_CantInitializeMainTool" type="System.String" mimetype="System.String"> - <value>Main tool menu can't be initialized.</value> - <comment>An error happened while adding the tool menu.</comment> - </data> - <data name="Gral_ServiceUnavailable" type="System.String" mimetype="System.String"> - <value>Can't perform operation because service '{0}' is not setup properly. Ensure the Microsoft IPE Wizards add-in is loaded.</value> - <comment>Receives the service that is unavailable.</comment> - </data> - <data name="XsdFileEditor_Filter" type="System.String" mimetype="System.String"> - <value>XML Schema Files (*.xsd)|*.xsd</value> - <comment>Filter for the open dialog.</comment> - </data> - <data name="XsdFileEditor_Title" type="System.String" mimetype="System.String"> - <value>Select XML Schema File</value> - <comment>Title of the dialog.</comment> - </data> - <data name="Gral_ConfigurationFileNotSet" type="System.String" mimetype="System.String"> - <value>Main configuration file must be selected. Use the context menu option to select it.</value> - <comment>Config file is required for the current operation.</comment> - </data> - <data name="Gral_DeployScriptNotSet" type="System.String" mimetype="System.String"> - <value>Main deploy script file must be selected. Use the context menu option to select it.</value> - <comment>Deploy script file is required for the current operation.</comment> - </data> - <data name="XmlNodeListFactory_IHasXmlNodeMissing" type="System.String" mimetype="System.String"> - <value>The XPath query was not executed against an XmlNode-based object (such as XmlDocument).</value> - <comment>The factory received an XPathNodeIterator that was not obtained from querying an XmlDocument or XmlNode.</comment> - </data> - <data name="ValueEditor_Error" type="System.String" mimetype="System.String"> - <value>An error occurred while editing the value.</value> - <comment>Generic error handling.</comment> - </data> - <data name="CommandService_StackEmpty" type="System.String" mimetype="System.String"> - <value>List of commands is empty. Can't perform Undo operation.</value> - <comment>Someone called Undo without executing commands first.</comment> - </data> - <data name="CommandService_ExecuteError" type="System.String" mimetype="System.String"> - <value>Command failed: {0}. + <comment>Can't find the main file resource class.</comment> + </data> + <data name="ValueEditor_CantConvertValue" type="System.String" mimetype="System.String"> + <value>Value of type '{0}' can't be converted to type '{1}' expected by argument.</value> + <comment>Receives incoming value type and expected type.</comment> + </data> + <data name="ValueEditor_InvalidValue" type="System.String" mimetype="System.String"> + <value>The value specified is invalid.</value> + <comment></comment> + </data> + <data name="Step_ShowHelp" type="System.String" mimetype="System.String"> + <value>Show Help</value> + <comment>Allows the user to click and see additional help.</comment> + </data> + <data name="IdeWizard_MissingParameter" type="System.String" mimetype="System.String"> + <value>Parameter '{0}' is required. Check wizard definision file.</value> + <comment>A custom param in the .vsz file is missing. That is the first argument to the method.</comment> + </data> + <data name="Ide_ToolsMenu" type="System.String" mimetype="System.String"> + <value>Microsoft Reference Architecture</value> + <comment>Caption of the main menu item in Tools.</comment> + </data> + <data name="Ide_ToolsMenuTooltip" type="System.String" mimetype="System.String"> + <value>Provides access to the Reference Architecture wizards and design tools.</value> + </data> + <data name="Ide_CantInitializeMainTool" type="System.String" mimetype="System.String"> + <value>Main tool menu can't be initialized.</value> + <comment>An error happened while adding the tool menu.</comment> + </data> + <data name="Gral_ServiceUnavailable" type="System.String" mimetype="System.String"> + <value>Can't perform operation because service '{0}' is not setup properly. Ensure the Microsoft IPE Wizards add-in is loaded.</value> + <comment>Receives the service that is unavailable.</comment> + </data> + <data name="XsdFileEditor_Filter" type="System.String" mimetype="System.String"> + <value>XML Schema Files (*.xsd)|*.xsd</value> + <comment>Filter for the open dialog.</comment> + </data> + <data name="XsdFileEditor_Title" type="System.String" mimetype="System.String"> + <value>Select XML Schema File</value> + <comment>Title of the dialog.</comment> + </data> + <data name="Gral_ConfigurationFileNotSet" type="System.String" mimetype="System.String"> + <value>Main configuration file must be selected. Use the context menu option to select it.</value> + <comment>Config file is required for the current operation.</comment> + </data> + <data name="Gral_DeployScriptNotSet" type="System.String" mimetype="System.String"> + <value>Main deploy script file must be selected. Use the context menu option to select it.</value> + <comment>Deploy script file is required for the current operation.</comment> + </data> + <data name="XmlNodeListFactory_IHasXmlNodeMissing" type="System.String" mimetype="System.String"> + <value>The XPath query was not executed against an XmlNode-based object (such as XmlDocument).</value> + <comment>The factory received an XPathNodeIterator that was not obtained from querying an XmlDocument or XmlNode.</comment> + </data> + <data name="ValueEditor_Error" type="System.String" mimetype="System.String"> + <value>An error occurred while editing the value.</value> + <comment>Generic error handling.</comment> + </data> + <data name="CommandService_StackEmpty" type="System.String" mimetype="System.String"> + <value>List of commands is empty. Can't perform Undo operation.</value> + <comment>Someone called Undo without executing commands first.</comment> + </data> + <data name="CommandService_ExecuteError" type="System.String" mimetype="System.String"> + <value>Command failed: {0}. Error: {1}</value> - <comment>{0}=command name/description, {1}=exception.</comment> - </data> - <data name="CommandService_UndoError" type="System.String" mimetype="System.String"> - <value>Couldn't undo command '{0}'. Error was: + <comment>{0}=command name/description, {1}=exception.</comment> + </data> + <data name="CommandService_UndoError" type="System.String" mimetype="System.String"> + <value>Couldn't undo command '{0}'. Error was: {1}.</value> - <comment>{0}=command name/description, {1}=exception.</comment> - </data> - <data name="CommandService_ConfirmCaption" type="System.String" mimetype="System.String"> - <value>Confirm '{0}' execution</value> - <comment>{0}=command description. Title for the dialog</comment> - </data> - <data name="ExpressionEvaluator_EmptyArgumentReference" type="System.String" mimetype="System.String"> - <value>Argument reference can't be empty. It must be in the form '$(Argument)'. Value was '{0}'.</value> - <comment>An expression contained an empty argument reference. {0} is the full invalid expression.</comment> - </data> - <data name="ExpressionEvaluator_OpenArgumentReference" type="System.String" mimetype="System.String"> - <value>Argument reference not properly closed: '{0}'. Argument reference can't be empty. It must be in the form '$(Argument)'. Full value was '{1}'. </value> - <comment>An argument reference is missing the right parenthesis. {0} is the invalid open section, {1} is the full expression. </comment> - </data> - <data name="CommandService_InvalidRestoreState" type="System.String" mimetype="System.String"> - <value>Restore point state is invalid. Can't restore service state.</value> - <comment>Only the private class generated by the service can be used to restore its state.</comment> - </data> - <data name="Step_ConfirmReExecution" type="System.String" mimetype="System.String"> - <value>Some commands have already been executed. Do you want to undo them before executing with current arguments?</value> - <comment></comment> - </data> - <data name="Command_ArgumentRequired" type="System.String" mimetype="System.String"> - <value>Argument '{0}' is required for the execution of command '{1}'.</value> - <comment>{0}=missing argument. {1}=command type.</comment> - </data> - <data name="Command_UnsupportedArgumentType" type="System.String" mimetype="System.String"> - <value>Argument '{0}' has a type '{1}' which is not supported by command '{2}'. It must be one of: + <comment>{0}=command name/description, {1}=exception.</comment> + </data> + <data name="CommandService_ConfirmCaption" type="System.String" mimetype="System.String"> + <value>Confirm '{0}' execution</value> + <comment>{0}=command description. Title for the dialog</comment> + </data> + <data name="ExpressionEvaluator_EmptyArgumentReference" type="System.String" mimetype="System.String"> + <value>Argument reference can't be empty. It must be in the form '$(Argument)'. Value was '{0}'.</value> + <comment>An expression contained an empty argument reference. {0} is the full invalid expression.</comment> + </data> + <data name="ExpressionEvaluator_OpenArgumentReference" type="System.String" mimetype="System.String"> + <value>Argument reference not properly closed: '{0}'. Argument reference can't be empty. It must be in the form '$(Argument)'. Full value was '{1}'. </value> + <comment>An argument reference is missing the right parenthesis. {0} is the invalid open section, {1} is the full expression. </comment> + </data> + <data name="CommandService_InvalidRestoreState" type="System.String" mimetype="System.String"> + <value>Restore point state is invalid. Can't restore service state.</value> + <comment>Only the private class generated by the service can be used to restore its state.</comment> + </data> + <data name="Step_ConfirmReExecution" type="System.String" mimetype="System.String"> + <value>Some commands have already been executed. Do you want to undo them before executing with current arguments?</value> + <comment></comment> + </data> + <data name="Command_ArgumentRequired" type="System.String" mimetype="System.String"> + <value>Argument '{0}' is required for the execution of command '{1}'.</value> + <comment>{0}=missing argument. {1}=command type.</comment> + </data> + <data name="Command_UnsupportedArgumentType" type="System.String" mimetype="System.String"> + <value>Argument '{0}' has a type '{1}' which is not supported by command '{2}'. It must be one of: {3}.</value> - <comment>{0}=argument name. {1}=argument type. {2}=command name, and {3}=concat list of valid types.</comment> - </data> - <data name="Step_ExecutionFailed" type="System.String" mimetype="System.String"> - <value>Execution failed for some commands.</value> - <comment>Some command didn't execute sucessfully.</comment> - </data> - <data name="Dte_ProjectDoesntExist" type="System.String" mimetype="System.String"> - <value>Project '{0}' doesn't exist in current solution.</value> - <comment>{0}=project that doesn't exist in solution.</comment> - </data> - <data name="Dte_ParentItemNotFound" type="System.String" mimetype="System.String"> - <value>Parent item at location '{0}' doesn't exist.</value> - <comment>{0}=path for the non-existent item.</comment> - </data> - <data name="AddProject_InvalidKind" type="System.String" mimetype="System.String"> - <value>Project kind must be either "C#" or "VB". Received invalid '{0}' value.</value> - <comment>{0}=invalid project kind.</comment> - </data> - <data name="Dte_TargetProjectExists" type="System.String" mimetype="System.String"> - <value>Target project file '{0}' already exists.</value> - <comment>{0}=target file name.</comment> - </data> - <data name="AddProject_CantDeleteFolder" type="System.String" mimetype="System.String"> - <value>Folder '{0}' couldn't be deleted. Please remove it manually. Error was: + <comment>{0}=argument name. {1}=argument type. {2}=command name, and {3}=concat list of valid types.</comment> + </data> + <data name="Step_ExecutionFailed" type="System.String" mimetype="System.String"> + <value>Execution failed for some commands.</value> + <comment>Some command didn't execute sucessfully.</comment> + </data> + <data name="Dte_ProjectDoesntExist" type="System.String" mimetype="System.String"> + <value>Project '{0}' doesn't exist in current solution.</value> + <comment>{0}=project that doesn't exist in solution.</comment> + </data> + <data name="Dte_ParentItemNotFound" type="System.String" mimetype="System.String"> + <value>Parent item at location '{0}' doesn't exist.</value> + <comment>{0}=path for the non-existent item.</comment> + </data> + <data name="AddProject_InvalidKind" type="System.String" mimetype="System.String"> + <value>Project kind must be either "C#" or "VB". Received invalid '{0}' value.</value> + <comment>{0}=invalid project kind.</comment> + </data> + <data name="Dte_TargetProjectExists" type="System.String" mimetype="System.String"> + <value>Target project file '{0}' already exists.</value> + <comment>{0}=target file name.</comment> + </data> + <data name="AddProject_CantDeleteFolder" type="System.String" mimetype="System.String"> + <value>Folder '{0}' couldn't be deleted. Please remove it manually. Error was: '{1}'.</value> - <comment>{0}=folder to remove, {1}=error message.</comment> - </data> - <data name="HandlersConverter_InvalidHandlers" type="System.String" mimetype="System.String"> - <value>The following handlers don't exist in the configuration file: + <comment>{0}=folder to remove, {1}=error message.</comment> + </data> + <data name="HandlersConverter_InvalidHandlers" type="System.String" mimetype="System.String"> + <value>The following handlers don't exist in the configuration file: {0}</value> - <comment>{0}=join of invalid handlers</comment> - </data> - <data name="AddProject_CantAddProject" type="System.String" mimetype="System.String"> - <value>Project '{0}' couldn't be added. Retry with another name or check whether the target folder is empty.</value> - <comment>{0}= project failing to be added.</comment> - </data> - <data name="AddProject_InvalidPath" type="System.String" mimetype="System.String"> - <value>Can't find path '{0}' in current solution.</value> - <comment>{0}=invalid path</comment> - </data> - <data name="Gral_ComponentNotSited" type="System.String" mimetype="System.String"> - <value>The component hasn't been propertly initialized yet.</value> - <comment>An operation requires the component to be sited and it hasn't been yet.</comment> - </data> - <data name="Deployer_InvalidResource" type="System.String" mimetype="System.String"> - <value>Resource '{0}' wasn't found in current assembly. </value> - <comment>Resource to deploy doesn't exist. {0}=resource name</comment> - </data> - <data name="SolutionClassBrowserEditor_MSAB" type="System.String" mimetype="System.String"> - <value>Microsoft.ApplicationBlocks</value> - <comment>Checked to skip MS projects from the list.</comment> - </data> - <data name="SolutionClassBrowserEditor_SDAF" type="System.String" mimetype="System.String"> - <value>Microsoft.ReferenceArchitecture</value> - <comment>Checked to skip MS projects from the list.</comment> - </data> - <data name="WizardController_ConfirmExecution" type="System.String" mimetype="System.String"> - <value>Confirm wizard execution</value> - <comment>Title of the prompt for executing the wizard, if any.</comment> - </data> - <data name="AddProject_CantRemoveProject" type="System.String" mimetype="System.String"> - <value>Project '{0}' couldn't be removed. You will have to do so manually.</value> - <comment>For some reason removing the project didn't work. {0}=project name.</comment> - </data> - <data name="AddProject_ProjectAlreadyExists" type="System.String" mimetype="System.String"> - <value>Project '{0}' already exists in the solution.</value> - <comment>The project name selected is already present in the solution. {0}=project name.</comment> - </data> - <data name="Step_NoTipProvided" type="System.String" mimetype="System.String"> - <value>No tips available.</value> - </data> - <data name="XmlValidate_GeneralError" type="System.String" mimetype="System.String"> - <value>#error Couldn't process XML file! + <comment>{0}=join of invalid handlers</comment> + </data> + <data name="AddProject_CantAddProject" type="System.String" mimetype="System.String"> + <value>Project '{0}' couldn't be added. Retry with another name or check whether the target folder is empty.</value> + <comment>{0}= project failing to be added.</comment> + </data> + <data name="AddProject_InvalidPath" type="System.String" mimetype="System.String"> + <value>Can't find path '{0}' in current solution.</value> + <comment>{0}=invalid path</comment> + </data> + <data name="Gral_ComponentNotSited" type="System.String" mimetype="System.String"> + <value>The component hasn't been propertly initialized yet.</value> + <comment>An operation requires the component to be sited and it hasn't been yet.</comment> + </data> + <data name="Deployer_InvalidResource" type="System.String" mimetype="System.String"> + <value>Resource '{0}' wasn't found in current assembly. </value> + <comment>Resource to deploy doesn't exist. {0}=resource name</comment> + </data> + <data name="SolutionClassBrowserEditor_MSAB" type="System.String" mimetype="System.String"> + <value>Microsoft.ApplicationBlocks</value> + <comment>Checked to skip MS projects from the list.</comment> + </data> + <data name="SolutionClassBrowserEditor_SDAF" type="System.String" mimetype="System.String"> + <value>Microsoft.ReferenceArchitecture</value> + <comment>Checked to skip MS projects from the list.</comment> + </data> + <data name="WizardController_ConfirmExecution" type="System.String" mimetype="System.String"> + <value>Confirm wizard execution</value> + <comment>Title of the prompt for executing the wizard, if any.</comment> + </data> + <data name="AddProject_CantRemoveProject" type="System.String" mimetype="System.String"> + <value>Project '{0}' couldn't be removed. You will have to do so manually.</value> + <comment>For some reason removing the project didn't work. {0}=project name.</comment> + </data> + <data name="AddProject_ProjectAlreadyExists" type="System.String" mimetype="System.String"> + <value>Project '{0}' already exists in the solution.</value> + <comment>The project name selected is already present in the solution. {0}=project name.</comment> + </data> + <data name="Step_NoTipProvided" type="System.String" mimetype="System.String"> + <value>No tips available.</value> + </data> + <data name="XmlValidate_GeneralError" type="System.String" mimetype="System.String"> + <value>#error Couldn't process XML file! {0}</value> - <comment>An error happened. Exception as argument 0.</comment> - </data> - <data name="XmlValidate_NoSchemaLocation" type="System.String" mimetype="System.String"> - <value>No location for the schema was specified. Set an absolute or XML file-relative location for the schema in the Custom Tool Namespace property for the file.</value> - </data> - <data name="XmlValidate_Succeeded" type="System.String" mimetype="System.String"> - <value>Validation succeeded.</value> - </data> - <data name="XmlValidate_Failed" type="System.String" mimetype="System.String"> - <value>Validation failed. Errors: + <comment>An error happened. Exception as argument 0.</comment> + </data> + <data name="XmlValidate_NoSchemaLocation" type="System.String" mimetype="System.String"> + <value>No location for the schema was specified. Set an absolute or XML file-relative location for the schema in the Custom Tool Namespace property for the file.</value> + </data> + <data name="XmlValidate_Succeeded" type="System.String" mimetype="System.String"> + <value>Validation succeeded.</value> + </data> + <data name="XmlValidate_Failed" type="System.String" mimetype="System.String"> + <value>Validation failed. Errors: {0}</value> - <comment>{0}=errors.</comment> - </data> - <data name="Configuration_InvalidWizardConfig" type="System.String" mimetype="System.String"> - <value>Wizard configuration is invalid. Errors: + <comment>{0}=errors.</comment> + </data> + <data name="Configuration_InvalidWizardConfig" type="System.String" mimetype="System.String"> + <value>Wizard configuration is invalid. Errors: {0}</value> - <comment>{0}=errors.</comment> - </data> - <data name="AddOrSelectFolder_PathIsNotFolder" type="System.String" mimetype="System.String"> - <value>An item already exists with path '{0}' and it's not a folder.</value> - <comment>Tried to select a non-folder with a path. Receives the failing path.</comment> - </data> - <data name="Dte_NoActiveProject" type="System.String" mimetype="System.String"> - <value>A project must be selected before using this component.</value> - <comment>No active project was found.</comment> - </data> - <data name="DependencyEvaluator_InvalidExpression" type="System.String" mimetype="System.String"> - <value>Dependency expression '{0}' is invalid.</value> - <comment>Invalid expression received as argument 0.</comment> - </data> - <data name="DependencyEvaluator_DuplicateOperator" type="System.String" mimetype="System.String"> - <value>Duplicate operator '{0}' found in expression '{1}'.</value> - <comment>{0}=duplicate match, {1}=full expression.</comment> - </data> - <data name="DependencyEvaluator_OperatorMissing" type="System.String" mimetype="System.String"> - <value>Either 'and' or 'or' operators must precede argument name '{0}'. Expression was '{1}'.</value> - <comment>{0}=argument matched without operator. {1}=full expression.</comment> - </data> - <data name="CommandService_CommandCanceled" type="System.String" mimetype="System.String"> - <value>Command canceled by user.</value> - <comment>The user didn't accept the command execution.</comment> - </data> - <data name="AddOrSelectProject_PathRequiredForNew" type="System.String" mimetype="System.String"> - <value>A target folder for the new project must be selected, or an existing one must be selected to be used as a sibling.</value> - <comment>A new project has to be created, but the folder wasn't selected.</comment> - </data> - <data name="DependencyEvaluator_ValueNotComparable" type="System.String" mimetype="System.String"> - <value>Argument is of type {0} which can't be used for comparisons. (does not implement IComparable)</value> - <comment>An argument is used for a comparison but its value does not implement IComparable.</comment> - </data> - <data name="DependencyEvaluator_UnsupportedComparison" type="System.String" mimetype="System.String"> - <value>Comparison operator '{0}' is not supported.</value> - <comment>{0}=the operator.</comment> - </data> - <data name="WizardController_NonExistingAlias" type="System.String" mimetype="System.String"> - <value>There's no type definition with name '{0}' in the current wizard configuration.</value> - <comment>{0}=the type alias that wasn't found. We know it's an alias as it doesn't contain a colon separating the assembly name for a FQTN.</comment> - </data> - <data name="ExecuteTransformation_AssemblyNotSpecified" type="System.String" mimetype="System.String"> - <value>The template argument '{0}' can't be located as a file, and Assembly argument was not specified to load it from an embedded resource.</value> - <comment>The template argument '{0}' can't be located as a file, and Assembly argument was not specified to load it from an embedded resource.</comment> - </data> - <data name="ExecuteTransformation_AssemblyNotFound" type="System.String" mimetype="System.String"> - <value>Assembly '{0}' not found.</value> - <comment>{0}=assembly name that couldn't be loaded.</comment> - </data> - <data name="ExecuteTransformation_EmbeddedTemplateNotFound" type="System.String" mimetype="System.String"> - <value>Embedded resource with name '{0}' containing transformation template was not found in assembly '{1}'.</value> - <comment>{0}=resource name not found, and {1}=assembly name where we probed.</comment> - </data> - <data name="ExecuteTransformation_EmbeddedConfigNotFound" type="System.String" mimetype="System.String"> - <value>Embedded resource with name '{0}' containing configuration for the transformation engine was not found in assembly '{1}'.</value> - <comment>{0}=resource name not found, and {1}=assembly name where we probed.</comment> - </data> - <data name="ExecuteTransformation_TemplateFileNotFound" type="System.String" mimetype="System.String"> - <value>Can't load template file.</value> - <comment>FileNotFoundException</comment> - </data> - <data name="ExecuteTransformation_ConfigFileNotFound" type="System.String" mimetype="System.String"> - <value>Can't load configuration file.</value> - <comment>FileNotFoundException</comment> - </data> - <data name="ExpressionEvaluator_ArgumentMissing" type="System.String" mimetype="System.String"> - <value>Argument '{0}' is missing in the current context.</value> - <comment>An expression uses an argument that hasn't been specified.</comment> - </data> - <data name="DteHelper_PathNotRelativeToSln" type="System.String" mimetype="System.String"> - <value>File '{0}' is not relative to the solution file '{1}'.</value> - <comment>{0}=file that is not relative to {1}, which is the solution filename.</comment> - </data> - <data name="DteHelper_UnsupportedProjectKind" type="System.String" mimetype="System.String"> - <value>Project '{0}' is not a C# or VB.NET project.</value> - <comment>{0}=name of the non-C#/VB. project.</comment> - </data> - <data name="Gral_LanguageCSharp" type="System.String" mimetype="System.String"> - <value>C#</value> - <comment>The C# language.</comment> - </data> - <data name="Gral_LanguageVisualBasic" type="System.String" mimetype="System.String"> - <value>VB</value> - <comment>The Visual Basic language.</comment> - </data> - <data name="OutputWindowService_InitializedMsg" type="System.String" mimetype="System.String"> - <value>Microsoft IPE Wizard Framework Output Window Service loaded.</value> - <comment>Output window was created.</comment> - </data> + <comment>{0}=errors.</comment> + </data> + <data name="AddOrSelectFolder_PathIsNotFolder" type="System.String" mimetype="System.String"> + <value>An item already exists with path '{0}' and it's not a folder.</value> + <comment>Tried to select a non-folder with a path. Receives the failing path.</comment> + </data> + <data name="Dte_NoActiveProject" type="System.String" mimetype="System.String"> + <value>A project must be selected before using this component.</value> + <comment>No active project was found.</comment> + </data> + <data name="DependencyEvaluator_InvalidExpression" type="System.String" mimetype="System.String"> + <value>Dependency expression '{0}' is invalid.</value> + <comment>Invalid expression received as argument 0.</comment> + </data> + <data name="DependencyEvaluator_DuplicateOperator" type="System.String" mimetype="System.String"> + <value>Duplicate operator '{0}' found in expression '{1}'.</value> + <comment>{0}=duplicate match, {1}=full expression.</comment> + </data> + <data name="DependencyEvaluator_OperatorMissing" type="System.String" mimetype="System.String"> + <value>Either 'and' or 'or' operators must precede argument name '{0}'. Expression was '{1}'.</value> + <comment>{0}=argument matched without operator. {1}=full expression.</comment> + </data> + <data name="CommandService_CommandCanceled" type="System.String" mimetype="System.String"> + <value>Command canceled by user.</value> + <comment>The user didn't accept the command execution.</comment> + </data> + <data name="AddOrSelectProject_PathRequiredForNew" type="System.String" mimetype="System.String"> + <value>A target folder for the new project must be selected, or an existing one must be selected to be used as a sibling.</value> + <comment>A new project has to be created, but the folder wasn't selected.</comment> + </data> + <data name="DependencyEvaluator_ValueNotComparable" type="System.String" mimetype="System.String"> + <value>Argument is of type {0} which can't be used for comparisons. (does not implement IComparable)</value> + <comment>An argument is used for a comparison but its value does not implement IComparable.</comment> + </data> + <data name="DependencyEvaluator_UnsupportedComparison" type="System.String" mimetype="System.String"> + <value>Comparison operator '{0}' is not supported.</value> + <comment>{0}=the operator.</comment> + </data> + <data name="WizardController_NonExistingAlias" type="System.String" mimetype="System.String"> + <value>There's no type definition with name '{0}' in the current wizard configuration.</value> + <comment>{0}=the type alias that wasn't found. We know it's an alias as it doesn't contain a colon separating the assembly name for a FQTN.</comment> + </data> + <data name="ExecuteTransformation_AssemblyNotSpecified" type="System.String" mimetype="System.String"> + <value>The template argument '{0}' can't be located as a file, and Assembly argument was not specified to load it from an embedded resource.</value> + <comment>The template argument '{0}' can't be located as a file, and Assembly argument was not specified to load it from an embedded resource.</comment> + </data> + <data name="ExecuteTransformation_AssemblyNotFound" type="System.String" mimetype="System.String"> + <value>Assembly '{0}' not found.</value> + <comment>{0}=assembly name that couldn't be loaded.</comment> + </data> + <data name="ExecuteTransformation_EmbeddedTemplateNotFound" type="System.String" mimetype="System.String"> + <value>Embedded resource with name '{0}' containing transformation template was not found in assembly '{1}'.</value> + <comment>{0}=resource name not found, and {1}=assembly name where we probed.</comment> + </data> + <data name="ExecuteTransformation_EmbeddedConfigNotFound" type="System.String" mimetype="System.String"> + <value>Embedded resource with name '{0}' containing configuration for the transformation engine was not found in assembly '{1}'.</value> + <comment>{0}=resource name not found, and {1}=assembly name where we probed.</comment> + </data> + <data name="ExecuteTransformation_TemplateFileNotFound" type="System.String" mimetype="System.String"> + <value>Can't load template file.</value> + <comment>FileNotFoundException</comment> + </data> + <data name="ExecuteTransformation_ConfigFileNotFound" type="System.String" mimetype="System.String"> + <value>Can't load configuration file.</value> + <comment>FileNotFoundException</comment> + </data> + <data name="ExpressionEvaluator_ArgumentMissing" type="System.String" mimetype="System.String"> + <value>Argument '{0}' is missing in the current context.</value> + <comment>An expression uses an argument that hasn't been specified.</comment> + </data> + <data name="DteHelper_PathNotRelativeToSln" type="System.String" mimetype="System.String"> + <value>File '{0}' is not relative to the solution file '{1}'.</value> + <comment>{0}=file that is not relative to {1}, which is the solution filename.</comment> + </data> + <data name="DteHelper_UnsupportedProjectKind" type="System.String" mimetype="System.String"> + <value>Project '{0}' is not a C# or VB.NET project.</value> + <comment>{0}=name of the non-C#/VB. project.</comment> + </data> + <data name="Gral_LanguageCSharp" type="System.String" mimetype="System.String"> + <value>C#</value> + <comment>The C# language.</comment> + </data> + <data name="Gral_LanguageVisualBasic" type="System.String" mimetype="System.String"> + <value>VB</value> + <comment>The Visual Basic language.</comment> + </data> + <data name="OutputWindowService_InitializedMsg" type="System.String" mimetype="System.String"> + <value>Microsoft IPE Wizard Framework Output Window Service loaded.</value> + <comment>Output window was created.</comment> + </data> + <data name="XGenTool_NoClassFound" type="System.String" mimetype="System.String"> + <value>#error The selected element doesn't contain any class definitions.</value> + <comment>#error The selected element doesn't contain any class definitions.</comment> + </data> + <data name="XGenTool_GeneralError" type="System.String" mimetype="System.String"> + <value>#error Couldn't generate code. +/* +{0} +*/</value> + <comment>An error occurrent, and it's received as a parameter.</comment> + </data> </root> \ No newline at end of file |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:52:05
|
Update of /cvsroot/mvp-xml/Design/v1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30705/v1 Modified Files: .cvsignore Log Message: Index: .cvsignore =================================================================== RCS file: /cvsroot/mvp-xml/Design/v1/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- .cvsignore 10 Oct 2004 15:26:42 -0000 1.1 +++ .cvsignore 21 Oct 2004 20:51:56 -0000 1.2 @@ -1 +1,2 @@ -NMatrix.Xml.suo \ No newline at end of file +NMatrix.Xml.suo +bin \ No newline at end of file |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:46:45
|
Update of /cvsroot/mvp-xml/Design/v1/src/CustomTools/SGen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29254/v1/src/CustomTools/SGen Removed Files: ClassPicker.cs ClassPicker.resx SGenRunner.cs SGenTool.cs XmlSerializerGenerator.cs Log Message: --- ClassPicker.cs DELETED --- --- ClassPicker.resx DELETED --- --- SGenTool.cs DELETED --- --- SGenRunner.cs DELETED --- --- XmlSerializerGenerator.cs DELETED --- |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:42:17
|
Update of /cvsroot/mvp-xml/Design/v1/src/CustomTools/XsdToClasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28388/v1/src/CustomTools/XsdToClasses Added Files: ICodeExtension.cs Processor.cs Schema.cs Schema.txt Schema.xml Schema.xsd Schema.xsx XsdToClasses.cs Log Message: --- NEW FILE: Schema.xsx --- <?xml version="1.0" encoding="utf-8"?> <!--This file is auto-generated by the XML Schema Designer. It holds layout information for components on the designer surface.--> <XSDDesignerLayout layoutVersion="2" viewPortLeft="4099" viewPortTop="0" zoom="100"> <Code_XmlElement left="4445" top="423" width="5292" height="1773" selected="0" zOrder="0" index="0" expanded="1"> <Extension_XmlElement left="4472" top="2704" width="5239" height="2223" selected="0" zOrder="1" index="0" expanded="1" /> </Code_XmlElement> </XSDDesignerLayout> --- NEW FILE: XsdToClasses.cs --- #region Usage /* Usage: * Add an .xsd file to the project and set: * Custom Tool: XsdCodeGen */ #endregion Usage #region using using System; using System.CodeDom; using System.ComponentModel; using System.ComponentModel.Design; using System.Xml.Schema; using System.IO; using System.Reflection; using System.Runtime.InteropServices; using System.CodeDom.Compiler; using System.Text; using System.Collections; #endregion namespace Mvp.Xml.Design.CustomTools { /// <summary> /// Processes XSD files and generates the corresponding classes. /// </summary> [Guid("2A9EF75D-26B5-4670-B7C6-F7AA63926439")] [CustomTool("XsdToClasses", "Microsoft IPE Classes Generator", true)] [ComVisible(true)] [VersionSupport("7.1")] [VersionSupport("7.0")] [CategorySupport(CategorySupportAttribute.CSharpCategory)] [CategorySupport(CategorySupportAttribute.VBCategory)] public class XsdToClasses : CustomTool { #region GenerateCode /// <summary> /// Generates the output. /// </summary> protected override byte[] GenerateCode(string inputFileName, string inputFileContent) { string code = ""; try { // Process the file. CodeNamespace ns = Processor.Process(inputFileName, FileNameSpace); // Generate code for it. CodeGeneratorOptions opt = new CodeGeneratorOptions(); opt.BracingStyle = "C"; StringWriter sw = new StringWriter(); GetCodeWriter().GenerateCodeFromNamespace(ns, sw, opt); // Finaly assign it to the result to return. code = sw.ToString(); } catch(Exception e) { code = String.Format("#error Couldn't generate code!\n/*\n{0}\n*/", e); } // Convert to bytes. return System.Text.Encoding.ASCII.GetBytes(code); } #endregion GenerateCode #region Registration and Installation /// <summary> /// Registers the generator. /// </summary> [ComRegisterFunction] public static void RegisterClass(Type type) { CustomTool.Register(typeof(XsdToClasses)); } /// <summary> /// Unregisters the generator. /// </summary> [ComUnregisterFunction] public static void UnregisterClass(Type t) { CustomTool.UnRegister(typeof(XsdToClasses)); } #endregion Registration and Installation } } --- NEW FILE: ICodeExtension.cs --- using System; namespace Mvp.Xml.Design.CustomTools { /// <summary> /// Interface for extension types that wish to participate in the /// WXS code generation process. /// </summary> public interface ICodeExtension { /// <summary> /// Extension points for code customization. /// </summary> /// <param name="code">The namespace being generated.</param> /// <param name="schema">The source schema.</param> void Process(System.CodeDom.CodeNamespace code, System.Xml.Schema.XmlSchema schema); } } --- NEW FILE: Schema.txt --- System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: File or assembly name Microsoft.ApplicationBlocks.IPE, or one of its dependencies, was not found. File name: "Microsoft.ApplicationBlocks.IPE" at System.Reflection.Assembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) at Microsoft.ApplicationBlocks.IPE.Transformations.ReflectionHelper.LoadType(String className, Boolean callingAssembly) at Microsoft.ApplicationBlocks.IPE.Transformations.Configuration.EngineItemValidator.Validate(Object objectToValidate, Object fullLoadedConfig, XPathNavigator document) at Microsoft.ApplicationBlocks.IPE.Transformations.Configuration.ConfigurationManager.ValidateObject(Object current, Type currentType, IpeConfiguration fullConfig, XPathNavigator document) at Microsoft.ApplicationBlocks.IPE.Transformations.Configuration.ConfigurationManager.ValidateObject(Object current, Type currentType, IpeConfiguration fullConfig, XPathNavigator document) at Microsoft.ApplicationBlocks.IPE.Transformations.Configuration.ConfigurationManager.ValidateObject(Object current, Type currentType, IpeConfiguration fullConfig, XPathNavigator document) at Microsoft.ApplicationBlocks.IPE.Transformations.Configuration.ConfigurationManager.ValidateObject(Object current, Type currentType, IpeConfiguration fullConfig, XPathNavigator document) at Microsoft.ApplicationBlocks.IPE.Transformations.Configuration.ConfigurationManager.ValidateObject(Object current, Type currentType, IpeConfiguration fullConfig, XPathNavigator document) at Microsoft.ApplicationBlocks.IPE.Transformations.Configuration.ConfigurationManager.PerformValidation() at Microsoft.ApplicationBlocks.IPE.Transformations.RuntimeFactory.CreateEngine(Stream stream, IServiceProvider parentProvider) at Microsoft.ApplicationBlocks.IPE.Transformations.RuntimeFactory.CreateEngine(String configuration, IServiceProvider parentProvider) at Microsoft.ApplicationBlocks.IPE.Transformations.RuntimeFactory.CreateEngine(String configuration) at Microsoft.ApplicationBlocks.IPE.Transformations.Design.IsolatedRunner..ctor(String configFile) === Pre-bind state information === LOG: DisplayName = Microsoft.ApplicationBlocks.IPE, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c2890f7f3ab20b71 (Fully-specified) LOG: Appbase = E:\DiscoDany\Clarius\Microsoft\Redmond\Wizards\src\Microsoft.ApplicationBlocks.IPE.Wizards\bin\Debug LOG: Initial PrivatePath = NULL Calling assembly : Microsoft.ApplicationBlocks.IPE.Tests.Assets, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c2890f7f3ab20b71. === LOG: Publisher policy file is not found. LOG: Host configuration file not found. LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config\machine.config. LOG: Post-policy reference: Microsoft.ApplicationBlocks.IPE, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c2890f7f3ab20b71 LOG: Attempting download of new URL file:///E:/DiscoDany/Clarius/Microsoft/Redmond/Wizards/src/Microsoft.ApplicationBlocks.IPE.Wizards/bin/Debug/Microsoft.ApplicationBlocks.IPE.DLL. LOG: Attempting download of new URL file:///E:/DiscoDany/Clarius/Microsoft/Redmond/Wizards/src/Microsoft.ApplicationBlocks.IPE.Wizards/bin/Debug/Microsoft.ApplicationBlocks.IPE/Microsoft.ApplicationBlocks.IPE.DLL. LOG: Attempting download of new URL file:///E:/DiscoDany/Clarius/Microsoft/Redmond/Wizards/src/Microsoft.ApplicationBlocks.IPE.Wizards/bin/Debug/Microsoft.ApplicationBlocks.IPE.EXE. LOG: Attempting download of new URL file:///E:/DiscoDany/Clarius/Microsoft/Redmond/Wizards/src/Microsoft.ApplicationBlocks.IPE.Wizards/bin/Debug/Microsoft.ApplicationBlocks.IPE/Microsoft.ApplicationBlocks.IPE.EXE. --- End of inner exception stack trace --- Server stack trace: at System.Reflection.RuntimeConstructorInfo.InternalInvoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark) at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo) at System.AppDomain.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes) at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes) at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes) at Microsoft.ApplicationBlocks.IPE.Transformations.Design.DesignDomain..ctor(DTE ide, String configFile, ProjectItem current) at Microsoft.ApplicationBlocks.IPE.Transformations.Design.EngineRunner.GenerateCode(String inputFileName, String inputFileContent) --- NEW FILE: Processor.cs --- #region using using System; using System.CodeDom; using System.CodeDom.Compiler; using System.IO; using System.Xml; using System.Xml.Schema; using System.Xml.Serialization; using System.Xml.XPath; #endregion using namespace Mvp.Xml.Design.CustomTools { /// <summary> /// Processes WXS files and builds code for them. /// </summary> /// <remarks>This tool can be used externally too, that's why /// it's public and separated from the VS Custom Tool code.</remarks> public sealed class Processor { #region Ctor and Fields private static XPathExpression Extensions; static Processor() { XPathNavigator nav = new XmlDocument().CreateNavigator(); // Select all extension types. Extensions = nav.Compile(String.Format( "/xs:schema/xs:annotation/xs:appinfo/{0}:{1}/{0}:{2}/@{3}", Schema.Prefix, Schema.ElementNames.Code, Schema.ElementNames.Extension, Schema.AttributeNames.Type)); // Create and set namespace resolution context. XmlNamespaceManager nsmgr = new XmlNamespaceManager(nav.NameTable); nsmgr.AddNamespace("xs", XmlSchema.Namespace); nsmgr.AddNamespace(Schema.Prefix, Schema.Namespace); Extensions.SetContext(nsmgr); } private Processor() {} #endregion Ctor and Fields #region Process /// <summary> /// Processes the schema. /// </summary> /// <param name="xsdFile">The full path to the WXS file to process.</param> /// <param name="targetNamespace">The namespace to put generated classes in.</param> /// <returns>The CodeDom tree generated from the schema.</returns> public static CodeNamespace Process(string xsdFile, string targetNamespace) { // Load the XmlSchema and its collection. XmlSchema xsd; using (FileStream fs = new FileStream(xsdFile, FileMode.Open)) { xsd = XmlSchema.Read(fs, null); xsd.Compile(null); } #region Import types XmlSchemas schemas = new XmlSchemas(); schemas.Add(xsd); // Create the importer for these schemas. XmlSchemaImporter importer = new XmlSchemaImporter(schemas); // System.CodeDom namespace for the XmlCodeExporter to put classes in. CodeNamespace ns = new CodeNamespace(targetNamespace); XmlCodeExporter exporter = new XmlCodeExporter(ns); // Iterate schema top-level elements and export code for each. foreach (XmlSchemaElement element in xsd.Elements.Values) { // Import the mapping first. XmlTypeMapping mapping = importer.ImportTypeMapping( element.QualifiedName); // Export the code finally. exporter.ExportTypeMapping(mapping); } #endregion Import types #region Execute extensions XPathNavigator nav = new XPathDocument(xsdFile).CreateNavigator(); XPathNodeIterator it = nav.Select(Extensions); while (it.MoveNext()) { Type t = Type.GetType(it.Current.Value, true); // Is the type an ICodeExtension? Type iface = t.GetInterface(typeof(ICodeExtension).Name); if (iface == null) { throw new ArgumentException(SR.Gral_TypeMustImplementInterface( t, typeof(ICodeExtension))); } ICodeExtension ext = (ICodeExtension) Activator.CreateInstance(t); // Run it! ext.Process(ns, xsd); } #endregion Execute extensions #region Make each type serializable foreach (CodeTypeDeclaration td in ns.Types) { AddSerializable(td); } #endregion Make each type serializable return ns; } #endregion Proces #region Add SerializableAttribute private static void AddSerializable(CodeTypeDeclaration type) { type.CustomAttributes.Add( new CodeAttributeDeclaration(typeof(SerializableAttribute).FullName)); foreach (CodeTypeMember m in type.Members) { if (m is CodeTypeDeclaration) AddSerializable((CodeTypeDeclaration) m); } } #endregion Add SerializableAttribute } } --- NEW FILE: Schema.xml --- <?xml version="1.0" encoding="utf-8" ?> <IpeConfiguration xmlns="urn:schemas-microsoft-com:ipe-configuration" xmlns:t="urn:schemas-microsoft-com:ipe-task"> <Transformation Name="GenerateSchemaClass"> <Parameters> <Parameter Name="SchemaLocation" Type="System.String" Multiplicity="0" DefaultValue="..\..\Schema.xsd" /> <Parameter Name="TargetNamespace" Type="System.String" Multiplicity="0" DefaultValue="Mvp.Xml.Design.CustomTools" /> <Parameter Name="XmlPrefix" Type="System.String" Multiplicity="0" DefaultValue="pag" /> </Parameters> <Tasks> <Task Type="Microsoft.ApplicationBlocks.IPE.Tests.Assets.Xsd2Cs.Generator, Microsoft.ApplicationBlocks.IPE.Tests.Assets, Version=1.0.0.0" /> <Task Type="Microsoft.ApplicationBlocks.IPE.Tasks.SolutionItemCodeDom, Microsoft.ApplicationBlocks.IPE, Version=1.0.0.0" t:OutputKey="CodeDom" t:Target="Schema.cs" /> </Tasks> </Transformation> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.ApplicationBlocks.IPE.Tests.Assets" /> <!-- Design domain location is the output folder, i.e. bin\Debug|Release --> <codeBase version="1.0.0.0" href="%IPE%\bin\Microsoft.ApplicationBlocks.IPE.Tests.Assets.dll"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.ApplicationBlocks.IPE" /> <!-- Design domain location is the output folder, i.e. bin\Debug|Release --> <codeBase version="1.0.0.0" href="%IPE%\bin\Microsoft.ApplicationBlocks.IPE.dll"/> </dependentAssembly> </assemblyBinding> </runtime> </IpeConfiguration> --- NEW FILE: Schema.xsd --- <?xml version="1.0" encoding="utf-8" ?> <xs:schema id="Schema" targetNamespace="http://www.microsoft.com/practices" elementFormDefault="qualified" xmlns="http://www.microsoft.com/practices" xmlns:mstns="http://www.microsoft.com/practices" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Code"> <xs:complexType> <xs:sequence> <xs:element name="Extension"> <xs:complexType> <xs:simpleContent> <xs:restriction base="xs:string"> <xs:attribute name="Type" type="xs:string" /> <xs:attribute name="Location" type="xs:string" /> </xs:restriction> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> --- NEW FILE: Schema.cs --- //------------------------------------------------------------------------------ // <autogenerated> // This code was generated by a tool. // Runtime Version: 1.1.4322.573 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </autogenerated> //------------------------------------------------------------------------------ namespace Mvp.Xml.Design.CustomTools { /// <remaks/> public sealed class Schema { /// <remaks/> public const string Namespace = "http://www.microsoft.com/practices"; /// <remaks/> public const string Prefix = "pag"; private Schema() { } /// <remaks/> /// <summary>Holds elements that are valid in the schema.</summary> public sealed class ElementNames { /// <remaks/> public const string Code = "Code"; /// <remaks/> public const string Extension = "Extension"; private ElementNames() { } } /// <summary>Holds attributes that are valid in the schema.</summary> /// <remaks/> public sealed class AttributeNames { /// <remaks/> public const string Type = "Type"; /// <remaks/> public const string Location = "Location"; private AttributeNames() { } } } } |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:42:17
|
Update of /cvsroot/mvp-xml/Design/v1/src/CustomTools/XsdToClasses/Extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28388/v1/src/CustomTools/XsdToClasses/Extensions Added Files: ArraysToCollectionsExtension.cs DocumentationExtension.cs FieldsToPropertiesExtension.cs InitializeFieldsExtension.cs Log Message: --- NEW FILE: InitializeFieldsExtension.cs --- #region using using System; using System.CodeDom; #endregion using namespace Mvp.Xml.Design.CustomTools.Extensions { /// <summary> /// Initializes all non-ValueType properties to /// a new instance. /// </summary> internal class InitializeFieldsExtension : ICodeExtension { #region ICodeExtension Members public void Process(System.CodeDom.CodeNamespace code, System.Xml.Schema.XmlSchema schema) { foreach (CodeTypeDeclaration type in code.Types) { foreach (CodeTypeMember member in type.Members) { if (member is CodeMemberField) { CodeMemberField field = (CodeMemberField) member; Type ft = Type.GetType(field.Type.BaseType); // If we have a class we can construct. if (ft == null || (ft.IsClass && ft != typeof(string))) { field.InitExpression = new CodeObjectCreateExpression(field.Type); } } } } } #endregion ICodeExtension Members } } --- NEW FILE: FieldsToPropertiesExtension.cs --- #region using using System; using System.CodeDom; #endregion using namespace Mvp.Xml.Design.CustomTools.Extensions { /// <summary> /// Converts the default public fields into properties backed by a private field. /// </summary> internal class FieldsToPropertiesExtension : ICodeExtension { #region ICodeExtension Members public void Process(System.CodeDom.CodeNamespace code, System.Xml.Schema.XmlSchema schema) { foreach (CodeTypeDeclaration type in code.Types) { if (type.IsClass || type.IsStruct) { // Copy the colletion to an array for safety. We will be // changing this collection. CodeTypeMember[] members = new CodeTypeMember[type.Members.Count]; type.Members.CopyTo(members, 0); foreach (CodeTypeMember member in members) { // Process fields only. if (member is CodeMemberField) { CodeMemberProperty prop = new CodeMemberProperty(); prop.Name = member.Name; prop.Attributes = member.Attributes; prop.Type = ((CodeMemberField)member).Type; // Copy attributes from field to the property. prop.CustomAttributes.AddRange(member.CustomAttributes); member.CustomAttributes.Clear(); // Copy comments from field to the property. prop.Comments.AddRange(member.Comments); member.Comments.Clear(); // Modify the field. member.Attributes = MemberAttributes.Private; Char[] letters = member.Name.ToCharArray(); letters[0] = Char.ToLower(letters[0]); member.Name = String.Concat("_", new string(letters)); prop.HasGet = true; prop.HasSet = true; // Add get/set statements pointing to field. Generates: // return this._fieldname; prop.GetStatements.Add( new CodeMethodReturnStatement( new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), member.Name))); // Generates: // this._fieldname = value; prop.SetStatements.Add( new CodeAssignStatement( new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), member.Name), new CodeArgumentReferenceExpression("value"))); // Finally add the property to the type type.Members.Add(prop); } } } } } #endregion ICodeExtension Members } } --- NEW FILE: ArraysToCollectionsExtension.cs --- #region using using System; using System.CodeDom; using System.Collections; using System.Xml.Schema; #endregion using namespace Mvp.Xml.Design.CustomTools.Extensions { /// <summary> /// Converts array-based properties into collection-based ones, and /// creates a typed <see cref="CollectionBase"/> inherited class for it. /// </summary> internal class ArraysToCollectionsExtension : ICodeExtension { #region ICodeExtension Members public void Process(CodeNamespace code, XmlSchema schema) { // Copy as we will be adding types. CodeTypeDeclaration[] types = new CodeTypeDeclaration[code.Types.Count]; code.Types.CopyTo(types, 0); foreach (CodeTypeDeclaration type in types) { if (type.IsClass || type.IsStruct) { foreach (CodeTypeMember member in type.Members) { // Process fields only, but not those that are System.Xml.* typed. if (member is CodeMemberField && ((CodeMemberField)member).Type.ArrayElementType != null && !((CodeMemberField)member).Type.BaseType.StartsWith("System.Xml")) { CodeMemberField field = (CodeMemberField) member; CodeTypeDeclaration col = GetCollection(code, field.Type.ArrayElementType); // Change field type to collection. field.Type = new CodeTypeReference(col.Name); } } } } } #endregion ICodeExtension Members #region Helper methods private CodeTypeDeclaration GetCollection(CodeNamespace code, CodeTypeReference forType) { string name = forType.BaseType + "Collection"; // Try to locate an existing collection for the same type. foreach (CodeTypeDeclaration td in code.Types) { if (td.Name == name) return td; } CodeTypeDeclaration col = new CodeTypeDeclaration(name); col.Comments.Add(new CodeCommentStatement("<remarks/>", true)); col.BaseTypes.Add(typeof(CollectionBase)); col.Attributes = MemberAttributes.Final | MemberAttributes.Public; // Add method CodeMemberMethod add = new CodeMemberMethod(); add.Comments.Add(new CodeCommentStatement("<remarks/>", true)); add.Attributes = MemberAttributes.Final | MemberAttributes.Public; add.Name = "Add"; add.ReturnType = new CodeTypeReference(typeof(int)); add.Parameters.Add(new CodeParameterDeclarationExpression ( forType, "value")); // Generates: return base.InnerList.Add(value); add.Statements.Add(new CodeMethodReturnStatement ( new CodeMethodInvokeExpression( new CodePropertyReferenceExpression( new CodeBaseReferenceExpression(), "InnerList"), "Add", new CodeExpression[] { new CodeArgumentReferenceExpression("value") } ) ) ); // Add to type. col.Members.Add(add); // Indexer property ('this') CodeMemberProperty indexer = new CodeMemberProperty(); indexer.Comments.Add(new CodeCommentStatement("<remarks/>", true)); indexer.Attributes = MemberAttributes.Final | MemberAttributes.Public; indexer.Name = "Item"; indexer.Type = forType; indexer.Parameters.Add(new CodeParameterDeclarationExpression ( typeof(int), "idx")); indexer.HasGet = true; indexer.HasSet = true; // Generates: return (theType) base.InnerList[idx]; indexer.GetStatements.Add( new CodeMethodReturnStatement ( new CodeCastExpression( forType, new CodeIndexerExpression( new CodePropertyReferenceExpression( new CodeBaseReferenceExpression(), "InnerList"), new CodeExpression[] { new CodeArgumentReferenceExpression("idx") }) ) ) ); // Generates: base.InnerList[idx] = value; indexer.SetStatements.Add( new CodeAssignStatement( new CodeIndexerExpression( new CodePropertyReferenceExpression( new CodeBaseReferenceExpression(), "InnerList"), new CodeExpression[] { new CodeArgumentReferenceExpression("idx") }), new CodeArgumentReferenceExpression("value") ) ); // Add to type. col.Members.Add(indexer); // Add to namespace. code.Types.Add(col); return col; } #endregion Helper methods } } --- NEW FILE: DocumentationExtension.cs --- #region using using System; using System.CodeDom; #endregion using namespace Mvp.Xml.Design.CustomTools.Extensions { /// <summary> /// Adds documentation items as comments on code. /// </summary> internal class DocumentationExtension : ICodeExtension { #region ICodeExtension Members public void Process(System.CodeDom.CodeNamespace code, System.Xml.Schema.XmlSchema schema) { // TODO: add XML comments to code. } #endregion ICodeExtension Members } } |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:42:17
|
Update of /cvsroot/mvp-xml/Design/v1/src/CustomTools/XsdInfer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28388/v1/src/CustomTools/XsdInfer Added Files: Infer.cs Readme.txt XsdInfer.cs Log Message: --- NEW FILE: Infer.cs --- using System; using System.IO; using System.Xml; using System.Xml.Schema; using System.Collections; using System.Diagnostics; using System.Globalization; namespace Microsoft.XsdInference { /// <summary> /// Infer class serves for infering XML Schema from given XML instance document. /// </summary> /// <remarks>See http://apps.gotdotnet.com/xmltools/xsdinference/.</remarks> internal class Infer { internal static XmlQualifiedName ST_boolean = new XmlQualifiedName("boolean", XmlSchema.Namespace); internal static XmlQualifiedName ST_byte = new XmlQualifiedName("byte", XmlSchema.Namespace); internal static XmlQualifiedName ST_unsignedByte = new XmlQualifiedName("unsignedByte", XmlSchema.Namespace); [...1948 lines suppressed...] newElement.IsAbstract = copyElement.IsAbstract; if (copyElement.IsNillable) { newElement.IsNillable = copyElement.IsNillable; } newElement.LineNumber = copyElement.LineNumber; newElement.LinePosition = copyElement.LinePosition; newElement.Name = copyElement.Name; newElement.Namespaces = copyElement.Namespaces; newElement.RefName = copyElement.RefName; newElement.SchemaType = copyElement.SchemaType; newElement.SchemaTypeName = copyElement.SchemaTypeName; newElement.SourceUri = copyElement.SourceUri; newElement.SubstitutionGroup = copyElement.SubstitutionGroup; newElement.UnhandledAttributes = copyElement.UnhandledAttributes; return newElement; } } } --- NEW FILE: XsdInfer.cs --- #region Usage /* Usage: * Add an .xml file to the project and set: * Custom Tool: XsdInfer */ #endregion Usage #region using using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.IO; using System.Reflection; using System.Runtime.InteropServices; using System.Text; using System.Xml; using System.Xml.Schema; using Microsoft.XsdInference; #endregion namespace Mvp.Xml.Design.CustomTools { /// <summary> /// Processes XSD files and generates the corresponding classes. /// </summary> [Guid("37882B13-FBC3-46ef-90B2-249504DC6925")] [CustomTool("XsdInference", "Microsoft IPE XSD Inference", false)] [ComVisible(true)] [VersionSupport("7.1")] [VersionSupport("7.0")] [CategorySupport(CategorySupportAttribute.CSharpCategory)] [CategorySupport(CategorySupportAttribute.VBCategory)] public class XsdInfer : CustomTool { #region GenerateCode /// <summary> /// Generates the output. /// </summary> protected override byte[] GenerateCode(string inputFileName, string inputFileContent) { try { Infer inf = new Infer(); using (Stream fs = File.OpenRead(inputFileName)) { XmlSchemaCollection col = inf.InferSchema(new XmlTextReader(fs)); using (MemoryStream mem = new MemoryStream()) { XmlTextWriter tw = new XmlTextWriter(mem, System.Text.Encoding.UTF8); foreach (XmlSchema sch in col) { // Can there be multiple ones?! sch.Write(tw); } return mem.ToArray(); } } } catch(Exception e) { return System.Text.Encoding.ASCII.GetBytes( String.Format("#error Couldn't generate code!\n/*\n{0}\n*/", e)); } } #endregion GenerateCode #region GetDefaultExtension /// <summary> /// This tool generates XML Schema files. /// </summary> public override string GetDefaultExtension() { return ".xsd"; } #endregion GetDefaultExtension #region Registration and Installation /// <summary> /// Registers the generator. /// </summary> [ComRegisterFunction] public static void RegisterClass(Type type) { CustomTool.Register(typeof(XsdInfer)); } /// <summary> /// Unregisters the generator. /// </summary> [ComUnregisterFunction] public static void UnregisterClass(Type t) { CustomTool.UnRegister(typeof(XsdInfer)); } #endregion Registration and Installation } } --- NEW FILE: Readme.txt --- Update from: http://apps.gotdotnet.com/xmltools/xsdinference/ Released by Microsoft. |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:42:17
|
Update of /cvsroot/mvp-xml/Design/v1/src/CustomTools/XGen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28388/v1/src/CustomTools/XGen Added Files: ClassPicker.cs ClassPicker.resx XGenRunner.cs XGenTool.cs XmlSerializerGenerator.cs Log Message: --- NEW FILE: ClassPicker.cs --- using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; namespace Mvp.Xml.Design.CustomTools.XGen { /// <summary> /// Summary description for ClassPicker. /// </summary> public class ClassPicker : System.Windows.Forms.Form { private System.Windows.Forms.Label label1; private System.Windows.Forms.Button btnCancel; private System.Windows.Forms.Button btnAccept; private System.Windows.Forms.CheckedListBox lstClasses; /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null; public ClassPicker() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // } /// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if(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() { this.lstClasses = new System.Windows.Forms.CheckedListBox(); this.label1 = new System.Windows.Forms.Label(); this.btnCancel = new System.Windows.Forms.Button(); this.btnAccept = new System.Windows.Forms.Button(); this.SuspendLayout(); // // lstClasses // this.lstClasses.Location = new System.Drawing.Point(8, 56); this.lstClasses.Name = "lstClasses"; this.lstClasses.Size = new System.Drawing.Size(384, 214); this.lstClasses.TabIndex = 0; // // label1 // this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label1.Location = new System.Drawing.Point(8, 8); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(384, 48); this.label1.TabIndex = 1; this.label1.Text = "Select the classes you will use as the root of a deserialization process. A custo" + "m XmlSerializer and supporting classes will be generated for each of the selecte" + "d ones:"; // // btnCancel // this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCancel.Location = new System.Drawing.Point(316, 280); this.btnCancel.Name = "btnCancel"; this.btnCancel.TabIndex = 2; this.btnCancel.Text = "&Cancel"; // // btnAccept // this.btnAccept.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnAccept.Location = new System.Drawing.Point(236, 280); this.btnAccept.Name = "btnAccept"; this.btnAccept.TabIndex = 3; this.btnAccept.Text = "&Accept"; // // ClassPicker // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(400, 309); this.Controls.Add(this.btnAccept); this.Controls.Add(this.btnCancel); this.Controls.Add(this.label1); this.Controls.Add(this.lstClasses); this.Name = "ClassPicker"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = " Class Picker"; this.ResumeLayout(false); } #endregion } } --- NEW FILE: XGenRunner.cs --- using System; using System.IO; namespace Mvp.Xml.Design.CustomTools.XGen { /// <summary> /// Class that performs the actual code generation in the isolated design domain. /// </summary> internal class XGenRunner : MarshalByRefObject { /// <summary> /// Generates the code for the received type. /// </summary> public XGenRunner(string outputFile, string forType, string targetNamespace) { using (StreamWriter writer = new StreamWriter(outputFile)) { writer.Write(XmlSerializerGenerator.GenerateCode( Type.GetType(forType), targetNamespace)); } } } } --- NEW FILE: ClassPicker.resx --- <?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="lstClasses.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> <data name="lstClasses.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> <data name="lstClasses.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> <data name="btnCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> <data name="btnCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> <data name="btnCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> <data name="btnAccept.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> <data name="btnAccept.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> <data name="btnAccept.Modifiers" 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.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>4, 4</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.Name"> <value>ClassPicker</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> </root> --- NEW FILE: XGenTool.cs --- #region using using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.IO; using System.Reflection; using System.Runtime.InteropServices; using System.Text; using System.Xml; using System.Xml.Schema; using EnvDTE; using VSLangProj; #endregion namespace Mvp.Xml.Design.CustomTools.XGen { /// <summary> /// Generates custom typed XmlSerializers. /// </summary> /// <remarks> /// On any class set the Custom Tool property to "SGen". /// This tool supports C# projects only, as that's the code generated /// by the XmlSerializer class. /// </remarks> [Guid("983A6445-3277-4cd1-97DF-5AA11A537921")] [CustomTool("Mvp.Xml.XGen", "MVP XML XmlSerializer Generation Tool", false)] [ComVisible(true)] [VersionSupport("7.1")] [CategorySupport(CategorySupportAttribute.CSharpCategory)] public class XGenTool : CustomTool { static string ConfigFile; #region Static config initialization static XGenTool() { AssemblyName name = Assembly.GetExecutingAssembly().GetName(); ConfigFile = Path.GetTempFileName() + ".config"; using (StreamWriter sw = new StreamWriter(ConfigFile)) { // Keep serialization files. Required for SGen to work. sw.Write(@"<?xml version='1.0' encoding='utf-8' ?> <configuration> <system.diagnostics> <switches> <add name='XmlSerialization.Compilation' value='4'/> </switches> </system.diagnostics> </configuration>"); } } #endregion Static config initialization #region GenerateCode /// <summary> /// Generates the output. /// </summary> protected override byte[] GenerateCode(string inputFileName, string inputFileContent) { AppDomain domain = null; try { // Force compilation of the current project. We need the type in the output. ProjectItem item = base.CurrentItem; item.DTE.Solution.SolutionBuild.BuildProject( item.DTE.Solution.SolutionBuild.ActiveConfiguration.Name, item.ContainingProject.UniqueName, true); // Copy Design assembly to output for the isolated AppDomain. string output = item.ContainingProject.ConfigurationManager.ActiveConfiguration.Properties.Item("OutputPath").Value.ToString(); output = Path.Combine(item.ContainingProject.Properties.Item("FullPath").Value.ToString(), output); string asmfile = ReflectionHelper.GetAssemblyPath(Assembly.GetExecutingAssembly()); File.Copy(asmfile, Path.Combine(output, Path.GetFileName(asmfile)), true); CodeClass targetclass = null; foreach (CodeElement element in item.FileCodeModel.CodeElements) { if (element is CodeNamespace) { foreach (CodeElement codec in ((CodeNamespace)element).Members) { if (codec is CodeClass) { targetclass = (CodeClass) codec; break; } } } else if (element is CodeClass) { targetclass = (CodeClass) element; } if (targetclass != null) { break; } } if (targetclass == null) { return System.Text.Encoding.ASCII.GetBytes( SR.XGenTool_NoClassFound); } string codefile = Path.GetTempFileName(); AppDomainSetup setup = new AppDomainSetup(); setup.ApplicationName = "Mvp.Xml Design Domain"; setup.ApplicationBase = output; setup.ConfigurationFile = ConfigFile; domain = AppDomain.CreateDomain("Mvp.Xml Design Domain", null, setup); // Runner ctor will dump the output to the file we pass. domain.CreateInstance( Assembly.GetExecutingAssembly().FullName, typeof(XGenRunner).FullName, false, 0, null, new object[] { codefile, targetclass.FullName + ", " + item.ContainingProject.Properties.Item("AssemblyName").Value.ToString(), base.FileNameSpace }, null, null, null); string code; using (StreamReader reader = new StreamReader(codefile)) { code = reader.ReadToEnd(); } return System.Text.Encoding.ASCII.GetBytes(code); } catch (Exception e) { return System.Text.Encoding.ASCII.GetBytes(SR.XGenTool_GeneralError(e)); } finally { if (domain != null) { AppDomain.Unload(domain); } } } #endregion GenerateCode #region GetDefaultExtension /// <summary> /// This tool generates code, and the default extension equals that of the current code provider. /// </summary> public override string GetDefaultExtension() { return "Serialization." + base.CodeProvider.FileExtension; } #endregion GetDefaultExtension #region Registration and Installation /// <summary> /// Registers the generator. /// </summary> [ComRegisterFunction] public static void RegisterClass(Type type) { CustomTool.Register(typeof(XGenTool)); } /// <summary> /// Unregisters the generator. /// </summary> [ComUnregisterFunction] public static void UnregisterClass(Type t) { CustomTool.UnRegister(typeof(XGenTool)); } #endregion Registration and Installation } } --- NEW FILE: XmlSerializerGenerator.cs --- #region using using System; using System.Collections; using System.CodeDom; using System.CodeDom.Compiler; using System.IO; using System.Reflection; using System.Text.RegularExpressions; using System.Xml.Serialization; #endregion using namespace Mvp.Xml.Design.CustomTools.XGen { /// <summary> /// Generates source code for custom XmlSerializer for a type. /// </summary> public class XmlSerializerGenerator { #region Consts & Fields // Parses private methods. static Regex PrivateMethods = new Regex(@" # Returned type # (?<return>[^\s]+)\s # Method call start # (?<method> (?<name>Read\d+_ # Object being read # (?<object>[^\(]+))\( # Method arguments # (?<arguments>[^\)]+) # Method call end # \))\s{", RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled | RegexOptions.Multiline); /// <summary> /// The return type of the read method. /// </summary> const string ReadMethodReturnType = "return"; /// <summary> /// Full method signature excluding return type. /// </summary> const string ReadMethodFullSignature = "method"; /// <summary> /// Method name. /// </summary> const string ReadMethodName = "name"; /// <summary> /// Method arguments. /// </summary> const string ReadMethodArguments = "arguments"; /// <summary> /// Name of the object being read. /// </summary> const string ReadMethodObjectName = "object"; /// <summary> /// Removes the type declaration from a list of method arguments retrieved by <see cref="PrivateMethods"/>. /// </summary> static Regex RemoveTypeFromArguments = new Regex(@"[^\s,]+[\s]", RegexOptions.Compiled); static Regex PublicRead = new Regex(@"public object (?<method>Read\d+_(?<object>[^\(]+))", RegexOptions.Compiled | RegexOptions.Multiline); /// <summary> /// The root object name of the element to (de)serialize. /// </summary> const string PublicRootObject = "object"; /// <summary> /// The name of the public read method. /// </summary> const string PublicMethodName = "method"; static Regex PublicWrite = new Regex(@"public void (?<method>Write\d+_(?<object>[^\(]+))", RegexOptions.Compiled | RegexOptions.Multiline); #region Code templates /// <summary> /// Template for the override for each element being read. /// {0}=Return type /// {1}=Method name /// {2}=Delegate name /// {3}=Event name /// {4}=Arguments with type definition /// {5}=Arguments with no type /// </summary> const string TemplateMethodOverride = @" /// <remarks/> protected override {0} {1}({4}) {{ {0} obj = base.{1}({5}); {2} handler = {3}; if (handler != null) handler(obj); return obj; }}"; /// <summary> /// Template for the public Read method for the root object /// in the custom reader firing events. /// {0}=Return type /// {1}=Read method name generated by serializer for root object. /// </summary> const string TemplateReadMethod = @" /// <summary>Reads an object of type {0}.</summary> internal {0} Read() {{ return ({0}) {1}(); }}"; /// <summary> /// Template for the public Write method for the root object /// in the custom writer. /// {0}=Object type name /// {1}=Write method name generated by serializer for root object. /// </summary> const string TemplateWriteMethod = @" /// <summary>Writes an object of type {0}.</summary> internal void Write({0} obj) {{ {1}(obj); }}"; /// <summary> /// Template for custom serializer class members. /// {0}=Name of the serializer class /// {1}=Reader type name /// {2}=Writer type name /// {3}=Root object type /// </summary> const string TemplateCustomSerializer = @" {1} _reader; {2} _writer; /// <summary>Constructs the serializer with default reader and writer instances.</summary> public {0}() {{ }} /// <summary>Constructs the serializer with a pre-built reader.</summary> public {0}({1} reader) {{ _reader = reader; }} /// <summary>Constructs the serializer with a pre-built writer.</summary> public {0}({2} writer) {{ _writer = writer; }} /// <summary>Constructs the serializer with pre-built reader and writer.</summary> public {0}({1} reader, {2} writer) {{ _reader = reader; _writer = writer; }} /// <summary>See <see cref=""XmlSerializer.CreateReader""/>.</summary> protected override XmlSerializationReader CreateReader() {{ if (_reader != null) return _reader; else return new {1}(); }} /// <summary>See <see cref=""XmlSerializer.CreateWriter""/>.</summary> protected override XmlSerializationWriter CreateWriter() {{ if (_writer != null) return _writer; else return new {2}(); }} /// <summary>See <see cref=""XmlSerializer.Deserialize""/>.</summary> protected override object Deserialize(XmlSerializationReader reader) {{ if (!(reader is {1})) throw new ArgumentException(""reader""); return (({1})reader).Read(); }} /// <summary>See <see cref=""XmlSerializer.Serialize""/>.</summary> protected override void Serialize(object o, XmlSerializationWriter writer) {{ if (!(writer is {2})) throw new ArgumentException(""writer""); (({2})writer).Write(({3})o); }}"; #endregion Code templates #endregion Consts & Fields /// <summary> /// Generates the code for a type. /// </summary> /// <param name="type">The type to generate custom XmlSerializer for.</param> /// <param name="targetNamespace">Target namespace to use for the generated classes.</param> /// <returns>Raw C# source code.</returns> public static string GenerateCode(Type type, string targetNamespace) { #region Retrieve XmlSerializer output string output; XmlSerializer ser = new XmlSerializer(type); // Here starts the horrible reflection hacks! //ser.tempAssembly.assembly.Location FieldInfo fitempasm = ser.GetType().GetField("tempAssembly", BindingFlags.NonPublic | BindingFlags.Instance); object tempasm = fitempasm.GetValue(ser); FieldInfo fiasm = tempasm.GetType().GetField("assembly", BindingFlags.NonPublic | BindingFlags.Instance); Assembly asm = (Assembly) fiasm.GetValue(tempasm); string codebase = new Uri(asm.CodeBase).LocalPath; string code = Path.Combine( Path.GetDirectoryName(codebase), Path.GetFileNameWithoutExtension(codebase) + ".0.cs"); using (StreamReader sr = new StreamReader(code)) { output = sr.ReadToEnd(); } #endregion Retrieve XmlSerializer output #region Create CodeDom System.CodeDom.CodeNamespace ns = new System.CodeDom.CodeNamespace(targetNamespace); ns.Imports.Add(new CodeNamespaceImport("System.Xml.Serialization")); ns.Imports.Add(new CodeNamespaceImport("System")); CodeTypeDeclaration serializer = new CodeTypeDeclaration(type.Name + "Serializer"); serializer.BaseTypes.Add(typeof(XmlSerializer)); serializer.Comments.Add(new CodeCommentStatement( "<summary>Custom serializer for " + type.Name + " type.</summary", true)); ns.Types.Add(serializer); #endregion Create CodeDom #region Initial string manipulation & custom XmlSerializer creation // Remove assembly attribute. output = output.Replace("[assembly:System.Security.AllowPartiallyTrustedCallers()]", ""); // Replace namespace. output = output.Replace("Microsoft.Xml.Serialization.GeneratedAssembly", type.FullName + "Serialization"); // Give generated classes more friendly names. output = output.Replace("public class XmlSerializationWriter1", @"/// <remarks/> public class Writer"); output = output.Replace("public class XmlSerializationReader1", @"/// <remarks/> public class Reader"); // Find the method that is the entry point for reading the object. Match readmatch = PublicRead.Match(output); string rootobject = readmatch.Groups[PublicRootObject].Value; // Now add custom serializer members with the new info. string sm = String.Format( TemplateCustomSerializer, serializer.Name, rootobject + "Reader", rootobject + "Writer", type.FullName); serializer.Members.Add(new CodeSnippetTypeMember(sm)); #endregion Initial string manipulation & custom XmlSerializer creation #region Create custom event rising typed reader CodeTypeDeclaration reader = new CodeTypeDeclaration(rootobject + "Reader"); reader.BaseTypes.Add(serializer.Name + ".Reader"); ns.Types.Add(reader); // For each read method Match readm = PrivateMethods.Match(output); while (readm.Success) { string objectread = readm.Groups[ReadMethodObjectName].Value; // Skip the generic reading method. if (objectread.ToLower() == "object") { readm = readm.NextMatch(); continue; } // Create a delegate for the event to expose. CodeTypeDelegate del = new CodeTypeDelegate( objectread + "DeserializedHandler"); char[] name = objectread.ToCharArray(); name[0] = Char.ToLower(name[0]); del.Parameters.Add(new CodeParameterDeclarationExpression( readm.Groups[ReadMethodReturnType].Value, new string(name))); del.Comments.Add(new CodeCommentStatement("/// <remarks/>", true)); ns.Types.Add(del); // Expose event. CodeMemberEvent ev = new CodeMemberEvent(); ev.Name = objectread + "Deserialized"; ev.Attributes = MemberAttributes.Public; ev.Type = new CodeTypeReference(del.Name); ev.Comments.Add(new CodeCommentStatement("/// <remarks/>", true)); reader.Members.Add(ev); // Override base method. string mo = String.Format( TemplateMethodOverride, readm.Groups[ReadMethodReturnType].Value, readm.Groups[ReadMethodName].Value, del.Name, ev.Name, readm.Groups[ReadMethodArguments].Value, // Arguments contain type + parameter name. Remove type for method call. RemoveTypeFromArguments.Replace( readm.Groups[ReadMethodArguments].Value, "")); reader.Members.Add(new CodeSnippetTypeMember(mo)); readm = readm.NextMatch(); } // Add the "final" public read method. reader.Members.Add(new CodeSnippetTypeMember( String.Format(TemplateReadMethod, type.FullName, readmatch.Groups[PublicMethodName].Value))); // Turn original public method into internal protected output = PublicRead.Replace(output, "protected internal object ${method}"); // Turn all private methods into protected virtual, as they are overriden // by the custom event rising reader. output = PrivateMethods.Replace(output, @"/// <remarks/> protected virtual ${return} ${method} {"); #endregion Create custom event rising typed reader #region Create custom writer CodeTypeDeclaration writer = new CodeTypeDeclaration(rootobject + "Writer"); writer.BaseTypes.Add(serializer.Name + ".Writer"); ns.Types.Add(writer); // Find the method that is the entry point for writing the object. Match writematch = PublicWrite.Match(output); // Add the "final" public write method. writer.Members.Add(new CodeSnippetTypeMember( String.Format(TemplateWriteMethod, type.FullName, writematch.Groups[PublicMethodName].Value))); // Turn original public method into internal protected output = PublicWrite.Replace(output, "protected internal void ${method}"); #endregion Create custom writer #region Make generated reader and writer classes inner classes of custom serializer int indexofreader = output.IndexOf("public class Reader"); int indexofwriter = output.IndexOf("public class Writer"); string genw = output.Substring( indexofwriter, indexofreader - indexofwriter); string genr = output.Substring( indexofreader, output.Length - indexofreader - 4); // Add #pragma to avoid compiler warnings. // TODO: Check how to do this for v1.x. //genr = "#pragma warning disable CS0642\n" + genr + "\n#pragma warning restore CS0642"; //genw = "#pragma warning disable CS0642\n" + genw + "\n#pragma warning restore CS0642"; serializer.Members.Add(new CodeSnippetTypeMember(genr)); serializer.Members.Add(new CodeSnippetTypeMember(genw)); #endregion Make generated reader and writer classes inner classes of custom serializer #region Generate code from CodeDom ICodeGenerator gen = new Microsoft.CSharp.CSharpCodeProvider().CreateGenerator(); CodeGeneratorOptions opt = new CodeGeneratorOptions(); opt.BracingStyle = "C"; StringWriter finalcode = new StringWriter(); gen.GenerateCodeFromNamespace(ns, finalcode, opt); #endregion Generate code from CodeDom //output = finalcode.ToString() + output; return finalcode.ToString(); //return output; } } } |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:42:17
|
Update of /cvsroot/mvp-xml/Design/v1/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28388/v1/src Added Files: DteHelper.cs ProjectInstaller.cs Log Message: --- NEW FILE: ProjectInstaller.cs --- #region using using System; using System.Collections; using System.ComponentModel; using System.Configuration.Install; using System.Reflection; using System.Runtime.InteropServices; #endregion using namespace Mvp.Xml.Design { /// <summary> /// Registers the project with COM. /// </summary> [RunInstaller(true)] [System.ComponentModel.DesignerCategory("Code")] public class ProjectInstaller : System.Configuration.Install.Installer { public override void Install(IDictionary stateSaver) { base.Install(stateSaver); new RegistrationServices().RegisterAssembly( Assembly.GetExecutingAssembly(), AssemblyRegistrationFlags.SetCodeBase); } public override void Rollback(IDictionary savedState) { base.Rollback (savedState); new RegistrationServices().UnregisterAssembly( Assembly.GetExecutingAssembly()); } public override void Uninstall(IDictionary savedState) { base.Uninstall (savedState); new RegistrationServices().UnregisterAssembly( Assembly.GetExecutingAssembly()); } } } --- NEW FILE: DteHelper.cs --- #region using using System; using System.IO; using EnvDTE; using VSLangProj; #endregion using namespace Mvp.Xml.Design { /// <summary> /// Provides utility methods for working with the DTE. /// </summary> internal sealed class DteHelper { private DteHelper() { } #region BuildPath public static string BuildPath(SelectedItem toSelectedItem) { if (toSelectedItem.ProjectItem != null) { return BuildPath(toSelectedItem.ProjectItem); } else if (toSelectedItem.Project != null) { return BuildPath(toSelectedItem.Project); } return toSelectedItem.Name; } public static string BuildPath(Project toProject) { string path = ""; // Solution folders are exposed with the same kind as solution items. // This eases compatibility with VS2003 in the future. if (toProject.Kind == Constants.vsProjectKindSolutionItems) { string folder = ""; foreach (Project project in toProject.DTE.Solution.Projects) { folder = project.Name; // Only build the path if it's not the same top-level project. if (project == toProject) { break; } else if (BuildPathToFolder(project, toProject, ref folder)) { break; } } path = folder + path; } else { if (toProject.ParentProjectItem == null) { return toProject.Name; } else { string folder = ""; foreach (Project project in toProject.DTE.Solution.Projects) { folder = project.Name; // Only build the path if it's not the same top-level project. if (project == toProject) { break; } else if (BuildPathToFolder(project, toProject, ref folder)) { break; } } path = folder + path; } } return path; } public static string BuildPath(ProjectItem toItem) { string path = ""; if (toItem.ContainingProject != null) { if (!BuildPathFromCollection(toItem.ContainingProject.ProjectItems, toItem, ref path)) return ""; path = BuildPath(toItem.ContainingProject); path = path + Path.DirectorySeparatorChar + toItem.Name; } else { path = toItem.Name; } return path; } private static bool BuildPathFromCollection(ProjectItems items, ProjectItem target, ref string path) { if (items == null) return false; foreach (ProjectItem item in items) { if (item == target) { path = path + Path.DirectorySeparatorChar + target.Name; return true; } else { string tmp = path + Path.DirectorySeparatorChar + item.Name; ProjectItems childitems = item.ProjectItems; if (childitems == null && item.Object is Project) childitems = ((Project)item.Object).ProjectItems; bool found = BuildPathFromCollection(childitems, target, ref tmp); if (found) { path = tmp; return true; } } } return false; } /// <summary> /// Recursively tries to build a path from the parent project to the child one. /// Returns true if the path can be built. /// </summary> private static bool BuildPathToFolder(Project parent, Project target, ref string path) { if (parent == null) return false; foreach (ProjectItem item in parent.ProjectItems) { if (item.Object == target) { path = path + Path.DirectorySeparatorChar + target.Name; return true; } else if (item.Kind == Constants.vsProjectItemKindSolutionItems) { string tmp = path + Path.DirectorySeparatorChar + item.Name; bool found = BuildPathToFolder(item.Object as Project, target, ref tmp); if (found) { path = tmp; return true; } } } return false; } #endregion BuildPath #region Find methods /// <summary> /// Finds a project in the solution, given its output assembly name. /// </summary> /// <returns>A <see cref="Project"/> reference or <see langword="null" /> if /// it doesn't exist. Project can be C# or VB.</returns> public static Project FindProjectByAssemblyName(DTE vs, string name) { foreach (Project p in (Projects) vs.GetObject("CSharpProjects")) { if (p.Properties.Item("AssemblyName").Value.ToString() == name) return p; } foreach (Project p in (Projects) vs.GetObject("VBProjects")) { if (p.Properties.Item("AssemblyName").Value.ToString() == name) return p; } return null; } /// <summary> /// Finds a project in the solution, given its name. /// </summary> /// <returns>A <see cref="Project"/> reference or <see langword="null" /> if /// it doesn't exist. Project can be C# or VB.</returns> public static Project FindProjectByName(DTE vs, string name) { // Try the quick ones first. try { foreach (Project p in (Projects)vs.GetObject("CSharpProjects")) { if (p.Name == name) return p; } } catch { } // C# may not be installed. try { foreach (Project p in (Projects)vs.GetObject("VBProjects")) { if (p.Name == name) return p; } } catch { } // VB may not be installed. // We've no option but to iterate everything now. foreach (Project p in vs.Solution.Projects) { if (p.Name == name) { return p; } else if (p.ProjectItems != null) { Project inner = FindProjectByName(p.ProjectItems, name); if (inner != null) { return inner; } } } return null; } private static Project FindProjectByName(ProjectItems items, string name) { foreach (ProjectItem item in items) { if (item.Object is Project && ((Project)item.Object).Name == name) { return item.Object as Project; } else if (item.ProjectItems != null) { Project p = FindProjectByName(item.ProjectItems, name); if (p != null) { return p; } } } return null; } /// <summary> /// Finds a project item in the received collection, given its name. /// </summary> /// <param name="collection">The initial collection to start the search.</param> /// <param name="name">The name of the item to locate.</param> /// <param name="recursive">Specifies whether to search in items collections in turn.</param> /// <returns>A <see cref="Project"/> reference or <see langword="null" /> if /// it doesn't exist. Project can be C# or VB.</returns> public static ProjectItem FindItemByName(ProjectItems collection, string name, bool recursive) { foreach (ProjectItem item in collection) { if (item.Name == name) return item; // Recurse if specified. if (recursive) { ProjectItem child = FindItemByName(item.ProjectItems, name, recursive); if (child != null) return child; } } return null; } /// <summary> /// Finds a project item in the solution hierarchy, given its /// folder-like location path. /// </summary> /// <returns>The project item or <see langword="null" /> if /// it doesn't exist.</returns> public static ProjectItem FindItemByPath(Solution root, string path) { string[] allpaths = path.Split(System.IO.Path.DirectorySeparatorChar, System.IO.Path.AltDirectorySeparatorChar); // First path is the project/solution folder to look into. Project prj = null; foreach (Project p in root.Projects) { if (p.Name == allpaths[0]) { prj = p; break; } } if (prj == null) return null; string[] paths = new string[allpaths.Length - 1]; // If there are no child paths, this is not an item but the project itself. if (paths.Length == 0) return null; Array.Copy(allpaths, 1, paths, 0, paths.Length); return FindInCollectionRecursive(prj.ProjectItems, paths, 0); } private static ProjectItem FindInCollectionRecursive(ProjectItems collection, string[] paths, int index) { foreach (ProjectItem item in collection) { if (item.Name == paths[index]) { if (index == paths.Length - 1) { // We reached the item we were looking for. return item; } else { // Otherwise, keep processing. // If item is a project/solution folder, cast before moving on. if (item.Object is Project) { return FindInCollectionRecursive( ((Project)item.Object).ProjectItems, paths, ++index); } else { return FindInCollectionRecursive(item.ProjectItems, paths, ++index); } } } } // Item wasn't found. return null; } #endregion Find methods #region Get methods /// <summary> /// Retrieves the code file extension for the project. /// </summary> public static string GetDefaultExtension(Project project) { if (project.Kind == PrjKind.prjKindCSharpProject) return ".cs"; else if (project.Kind == PrjKind.prjKindVBProject) return ".vb"; else throw new NotSupportedException(String.Format( System.Globalization.CultureInfo.CurrentCulture, Properties.Resources.DteHelper_UnsupportedProjectKind, project.Name)); } /// <summary> /// Retrieves a default namespace to use for project items. /// </summary> public static string GetProjectNamespace(Project project) { string ns = project.Properties.Item("DefaultNamespace").Value.ToString(); if (ns == null || ns == String.Empty) ns = project.Properties.Item("RootNamespace").Value.ToString(); if (ns == null || ns == String.Empty) ns = project.Properties.Item("AssemblyName").Value.ToString(); return ns; } /// <summary> /// Retrieves the project currently selected, if any. /// </summary> public static Project GetSelectedProject(DTE vs) { foreach (object obj in (object[]) vs.ActiveSolutionProjects) { if (obj is Project) return obj as Project; } return null; } /// <summary> /// Returns the item file name relative to the containing solution. /// </summary> public static string GetFilePathRelative(ProjectItem item) { return GetFilePathRelative(item.DTE, item.get_FileNames(1)); } /// <summary> /// Turns the file name received into a path relative to the containing solution. /// </summary> public static string GetFilePathRelative(DTE vs, string file) { if (!file.StartsWith(Path.GetDirectoryName(vs.Solution.FullName))) throw new ArgumentException(String.Format( System.Globalization.CultureInfo.CurrentCulture, Properties.Resources.DteHelper_PathNotRelativeToSln, file, vs.Solution.FullName)); string relative = file.Replace(Path.GetDirectoryName(vs.Solution.FullName), ""); if (relative.StartsWith(Path.DirectorySeparatorChar.ToString())) relative = relative.Substring(1); return relative; } /// <summary> /// Turns the relative file name received into full path, based on the containing solution location. /// </summary> public static string GetPathFull(DTE vs, string file) { if (Path.IsPathRooted(file) && !file.StartsWith(Path.GetDirectoryName(vs.Solution.FullName))) throw new ArgumentException(String.Format( System.Globalization.CultureInfo.CurrentCulture, Properties.Resources.DteHelper_PathNotRelativeToSln, file, vs.Solution.FullName)); return Path.Combine(Path.GetDirectoryName(vs.Solution.FullName), file); } #endregion Get methods #region Select methods /// <summary> /// Selects a project in the solution explorer. /// </summary> public static void SelectProject(Project project) { // Select the parent folder to add the project to it. Window win = project.DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer); win.Activate(); win.SetFocus(); UIHierarchy hier = win.Object as UIHierarchy; UIHierarchyItem sol = hier.UIHierarchyItems.Item(1); sol.Select(vsUISelectionType.vsUISelectionTypeSelect); // Remove project file name from path. string name = Path.GetDirectoryName(project.UniqueName); // Web projects can't be located through UniqueName. if (IsWebProject(project)) { // Locate by folder relative to solution one. // TODO: this will not work if project is NOT inside solution! name = Path.GetDirectoryName(project.Properties.Item("FullPath").Value.ToString()); string slnpath = Path.GetDirectoryName(project.DTE.Solution.FullName); name = name.Substring(name.IndexOf(slnpath) + slnpath.Length + 1); } // Perform selection. UIHierarchyItem item = null; try { item = hier.GetItem(Path.Combine(sol.Name, name)); } catch (ArgumentException) { // Retry selection by name (much slower!) item = FindProjectByName(project.Name, hier.UIHierarchyItems); } if (item != null) item.Select(vsUISelectionType.vsUISelectionTypeSelect); } private static UIHierarchyItem FindProjectByName(string name, UIHierarchyItems items) { foreach (UIHierarchyItem item in items) { if (item.Name == name) { ProjectItem pi = item.Object as ProjectItem; // Check the project name or the subproject name (for ETP). if (pi.ContainingProject.Name == name || (pi.SubProject != null && pi.SubProject.Name == name)) return item; } if (item.UIHierarchyItems != null) { UIHierarchyItem uii = FindProjectByName(name, item.UIHierarchyItems); if (uii != null) return uii; } } return null; } /// <summary> /// Selects a solution explorer item, based on /// its relative path with regards to the solution. /// </summary> public static UIHierarchyItem SelectItem(DTE vs, string path) { // Select the parent folder to add the project to it. Window win = vs.Windows.Item(Constants.vsWindowKindSolutionExplorer); win.Activate(); win.SetFocus(); UIHierarchy hier = win.Object as UIHierarchy; UIHierarchyItem sol = hier.UIHierarchyItems.Item(1); sol.Select(vsUISelectionType.vsUISelectionTypeSelect); // Perform selection. UIHierarchyItem item = FindHierarchyItemByPath(sol.UIHierarchyItems, path.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar), 0); if (item != null) item.Select(vsUISelectionType.vsUISelectionTypeSelect); return item; } #region Find manually /// <summary> /// UIHierarchy.GetItem does not always work :S, so I do it by hand here. /// </summary> private static UIHierarchyItem FindHierarchyItemByPath(UIHierarchyItems items, string[] paths, int index) { foreach (UIHierarchyItem item in items) { if (item.Name == paths[index]) { if (index == paths.Length - 1) // We reached the item we were looking for. return item; else // Otherwise, keep processing. return FindHierarchyItemByPath(item.UIHierarchyItems, paths, ++index); } } // Item wasn't found. return null; } #endregion Find manually #endregion Select methods #region IsXXX methods /// <summary> /// Determines whether the project is a web project. /// </summary> public static bool IsWebProject(Project project) { // TODO: Is there a better way? return project.Properties.Item("WebServerVersion").Value != null && project.Properties.Item("WebServerVersion").Value.ToString() != String.Empty; } /// <summary> /// Determines whether the item is a child of the solution itself, /// that is, it's not contained in a project. Examples are the Solution Items folder /// and its items and Solution Folders. /// </summary> public static bool IsSolutionChild(SelectedItem item) { // Solution folders are exposed with the same kind as solution items. // This eases compatibility with VS2003 in the future. // It's either a direct folder or an item contained in one. if (item.ProjectItem != null) { return (item.ProjectItem.Object is Project && ((Project)item.ProjectItem.Object).Kind == Constants.vsProjectKindSolutionItems) || item.ProjectItem.ContainingProject == null || item.ProjectItem.ContainingProject.Kind == Constants.vsProjectKindSolutionItems; } else if (item.Project != null) { return (item.Project.Kind == Constants.vsProjectKindSolutionItems); } // All other cases go to the solution. return true; } #endregion IsXXX methods } } |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:42:17
|
Update of /cvsroot/mvp-xml/Design/v1/src/CustomTools/XmlValidate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28388/v1/src/CustomTools/XmlValidate Added Files: XmlValidate.cs Log Message: --- NEW FILE: XmlValidate.cs --- #region Usage /* Usage: * Add an .xml file to the project and set: * Custom Tool: XmlValidate * Custom Tool Namespace: SchemaFile.xsd[#Capitalize] * First segment is the schema to use for validation. * Optional second segment allows to use the functionality described * in http://weblogs.asp.net/cazzu/archive/2004/05/10/129106.aspx. */ #endregion Usage #region using using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.IO; using System.Reflection; using System.Runtime.InteropServices; using System.Text; using System.Xml; using System.Xml.Schema; #endregion namespace Mvp.Xml.Design.CustomTools { /// <summary> /// Validates an XML file with an XSD schema. /// </summary> /// <remarks> /// Usage: Add an .xml file to the project and set: /// <para> /// Custom Tool: XmlValidate /// Custom Tool Namespace: SchemaFile.xsd /// </para> /// </remarks> [Guid("C4033005-CF59-492e-A7ED-911E0B7E04D5")] [CustomTool("XmlValidate", "Microsoft IPE Xml Validation", false)] [ComVisible(true)] [VersionSupport("7.1")] [VersionSupport("7.0")] [CategorySupport(CategorySupportAttribute.CSharpCategory)] [CategorySupport(CategorySupportAttribute.VBCategory)] public class XmlValidate : CustomTool { #region GenerateCode StringBuilder _errors; /// <summary> /// Generates the output. /// </summary> protected override byte[] GenerateCode(string inputFileName, string inputFileContent) { try { _errors = new StringBuilder(); if (base.FileNameSpace == null || base.FileNameSpace == String.Empty) return System.Text.Encoding.ASCII.GetBytes( SR.XmlValidate_NoSchemaLocation); string schemalocation = base.FileNamespace; // Schema location is relative to document. if (!Path.IsPathRooted(schemalocation)) { schemalocation = Path.Combine(Path.GetDirectoryName(inputFileName), schemalocation); } using (Stream fs = File.OpenRead(inputFileName)) { XmlValidatingReader vr = new XmlValidatingReader(new XmlTextReader(fs)); using (Stream xs = File.OpenRead(schemalocation)) { vr.Schemas.Add(XmlSchema.Read(xs, null)); } vr.ValidationEventHandler += new ValidationEventHandler(OnValidate); // Validate it! while (vr.Read()) {} string errors = _errors.ToString(); if (errors.Length == 0) { return System.Text.Encoding.ASCII.GetBytes( SR.XmlValidate_Succeeded); } else { return System.Text.Encoding.ASCII.GetBytes( SR.XmlValidate_Failed(errors)); } } } catch (Exception e) { return System.Text.Encoding.ASCII.GetBytes( SR.XmlValidate_GeneralError(e)); } } private void OnValidate(object sender, ValidationEventArgs e) { _errors.AppendFormat("{0}: {1}\n", e.Severity, e.Message); } #endregion GenerateCode #region GetDefaultExtension /// <summary> /// This tool reports validation errors. /// </summary> public override string GetDefaultExtension() { return ".txt"; } #endregion GetDefaultExtension #region Registration and Installation /// <summary> /// Registers the generator. /// </summary> [ComRegisterFunction] public static void RegisterClass(Type type) { CustomTool.Register(typeof(XmlValidate)); } /// <summary> /// Unregisters the generator. /// </summary> [ComUnregisterFunction] public static void UnregisterClass(Type t) { CustomTool.UnRegister(typeof(XmlValidate)); } #endregion Registration and Installation } } |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:42:14
|
Update of /cvsroot/mvp-xml/Design/v1/setup In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28388/v1/setup Added Files: Setup.vdproj Log Message: --- NEW FILE: Setup.vdproj --- "DeployProject" { "VSVersion" = "3:701" "ProjectType" = "8:{2C2AF0D9-9B47-4FE5-BEF2-169778172667}" "IsWebType" = "8:FALSE" "ProjectName" = "8:Setup" "LanguageId" = "3:1033" "CodePage" = "3:1252" "UILanguageId" = "3:1033" "SccProjectName" = "8:" "SccLocalPath" = "8:" "SccAuxPath" = "8:" "SccProvider" = "8:" "Hierarchy" { "Entry" { "MsmKey" = "8:_2090D92F765D47F7BADD9F4AADA8FDA1" "OwnerKey" = "8:_UNDEFINED" [...1082 lines suppressed...] "System" = "11:FALSE" "Permanent" = "11:FALSE" "SharedLegacy" = "11:FALSE" "PackageAs" = "3:1" "Register" = "3:1" "Exclude" = "11:FALSE" "IsDependency" = "11:FALSE" "IsolateTo" = "8:" "ProjectOutputGroupRegister" = "3:2" "OutputConfiguration" = "8:" "OutputGroupCanonicalName" = "8:Built" "OutputProjectGuid" = "8:{A379C40D-C984-4E63-933A-BE96E9A599B7}" "ShowKeyOutput" = "11:TRUE" "ExcludeFilters" { } } } } } |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:38:21
|
Update of /cvsroot/mvp-xml/Design/v1/src/CustomTools/XsdToClasses/Extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27602/Extensions Log Message: Directory /cvsroot/mvp-xml/Design/v1/src/CustomTools/XsdToClasses/Extensions added to the repository |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:37:55
|
Update of /cvsroot/mvp-xml/Design/v1/src/CustomTools/XsdToClasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27463/XsdToClasses Log Message: Directory /cvsroot/mvp-xml/Design/v1/src/CustomTools/XsdToClasses added to the repository |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:37:55
|
Update of /cvsroot/mvp-xml/Design/v1/src/CustomTools/XmlValidate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27463/XmlValidate Log Message: Directory /cvsroot/mvp-xml/Design/v1/src/CustomTools/XmlValidate added to the repository |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:37:55
|
Update of /cvsroot/mvp-xml/Design/v1/src/CustomTools/XGen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27463/XGen Log Message: Directory /cvsroot/mvp-xml/Design/v1/src/CustomTools/XGen added to the repository |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:37:55
|
Update of /cvsroot/mvp-xml/Design/v1/src/CustomTools/XsdInfer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27463/XsdInfer Log Message: Directory /cvsroot/mvp-xml/Design/v1/src/CustomTools/XsdInfer added to the repository |
From: Daniel C. \(kzu\) <dca...@us...> - 2004-10-21 20:37:20
|
Update of /cvsroot/mvp-xml/Design/v1/setup In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27402/setup Log Message: Directory /cvsroot/mvp-xml/Design/v1/setup added to the repository |