From 49f1209035aac1fcfad5dbbe25f7b2306d3be86c Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 7 Dec 2017 14:19:05 -0800 Subject: Support MSI backends creating custom tables and remove WixToolset.Data.WindowsInstaller --- .../ObjectField.cs | 183 --------------------- 1 file changed, 183 deletions(-) delete mode 100644 src/WixToolset.Data.WindowsInstaller/ObjectField.cs (limited to 'src/WixToolset.Data.WindowsInstaller/ObjectField.cs') diff --git a/src/WixToolset.Data.WindowsInstaller/ObjectField.cs b/src/WixToolset.Data.WindowsInstaller/ObjectField.cs deleted file mode 100644 index 42ef111b..00000000 --- a/src/WixToolset.Data.WindowsInstaller/ObjectField.cs +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Data -{ - using System; - using System.Diagnostics; - using System.Globalization; - using System.Xml; - - /// - /// Field containing data for an object column in a row. - /// - public sealed class ObjectField : Field - { - /// - /// Instantiates a new Field. - /// - /// Column definition for this field. - internal ObjectField(ColumnDefinition columnDefinition) : - base(columnDefinition) - { - } - - /// - /// Gets or sets the index of the embedded file in a library. - /// - /// The index of the embedded file. - public int? EmbeddedFileIndex { get; set; } - - /// - /// Gets or sets the previous index of the embedded file in the library. - /// - /// The previous index of the embedded file. - public int? PreviousEmbeddedFileIndex { get; set; } - - /// - /// Gets or sets the path to the embedded cabinet of the previous file. - /// - /// The path of the cabinet containing the previous file. - public Uri PreviousBaseUri { get; set; } - - /// - /// Gets the base URI of the object field. - /// - /// The base URI of the object field. - public Uri BaseUri { get; private set; } - - /// - /// Gets or sets the unresolved data for this field. - /// - /// Unresolved Data in the field. - public string UnresolvedData { get; set; } - - /// - /// Gets or sets the unresolved previous data. - /// - /// The unresolved previous data. - public string UnresolvedPreviousData { get; set; } - - /// - /// Parse a field from the xml. - /// - /// XmlReader where the intermediate is persisted. - internal override void Read(XmlReader reader) - { - Debug.Assert("field" == reader.LocalName); - - bool empty = reader.IsEmptyElement; - - this.BaseUri = new Uri(reader.BaseURI); - - while (reader.MoveToNextAttribute()) - { - switch (reader.LocalName) - { - case "cabinetFileId": - this.EmbeddedFileIndex = Convert.ToInt32(reader.Value); - break; - case "modified": - this.Modified = reader.Value.Equals("yes"); - break; - case "previousData": - this.PreviousData = reader.Value; - break; - case "unresolvedPreviousData": - this.UnresolvedPreviousData = reader.Value; - break; - case "unresolvedData": - this.UnresolvedData = reader.Value; - break; - case "previousCabinetFileId": - this.PreviousEmbeddedFileIndex = Convert.ToInt32(reader.Value); - break; - } - } - - if (!empty) - { - bool done = false; - - while (!done && reader.Read()) - { - switch (reader.NodeType) - { - case XmlNodeType.Element: - throw new XmlException(); - case XmlNodeType.CDATA: - case XmlNodeType.Text: - if (0 < reader.Value.Length) - { - this.Data = reader.Value; - } - break; - case XmlNodeType.EndElement: - done = true; - break; - } - } - - if (!done) - { - throw new XmlException(); - } - } - } - - /// - /// Persists a field in an XML format. - /// - /// XmlWriter where the Field should persist itself as XML. - internal override void Write(XmlWriter writer) - { - writer.WriteStartElement("field", Intermediate.XmlNamespaceUri); - - if (this.EmbeddedFileIndex.HasValue) - { - writer.WriteStartAttribute("cabinetFileId"); - writer.WriteValue(this.EmbeddedFileIndex); - writer.WriteEndAttribute(); - } - - if (this.Modified) - { - writer.WriteAttributeString("modified", "yes"); - } - - if (null != this.UnresolvedPreviousData) - { - writer.WriteAttributeString("unresolvedPreviousData", this.UnresolvedPreviousData); - } - - if (null != this.PreviousData) - { - writer.WriteAttributeString("previousData", this.PreviousData); - } - - if (null != this.UnresolvedData) - { - writer.WriteAttributeString("unresolvedData", this.UnresolvedData); - } - - if (this.PreviousEmbeddedFileIndex.HasValue) - { - writer.WriteStartAttribute("previousCabinetFileId"); - writer.WriteValue(this.PreviousEmbeddedFileIndex); - writer.WriteEndAttribute(); - } - - // Convert the data to a string that will persist nicely (nulls as String.Empty). - string text = Convert.ToString(this.Data, CultureInfo.InvariantCulture); - if (this.Column.UseCData) - { - writer.WriteCData(text); - } - else - { - writer.WriteString(text); - } - - writer.WriteEndElement(); - } - } -} -- cgit v1.2.3-55-g6feb