From 187836e59f27b69e5bc85316b8c9739f1b53a6ce Mon Sep 17 00:00:00 2001 From: Michael Cessna Date: Thu, 7 May 2026 16:34:48 -0500 Subject: [PATCH 1/8] INFORCRM-34691: CS1286371 Google calendar not syncing (SData Sync Config) Fix required for Windows Update KB5068861 where a web request can lead to a 403 Forbidden error if the User-Agent is missing. --- .github/workflows/build-and-test.yml | 55 + .gitignore | 5 + .../SDataClientTests.cs | 121 + .../Saleslogix.SData.Client.Test_4_0.csproj | 41 +- Saleslogix.SData.Client/Directory.Build.props | 16 + .../Framework/SDataRequest.cs | 8 +- Saleslogix.SData.Client/LinqBridge.cs | 3100 ----------------- .../LinqToXml/Extensions.cs | 176 - .../LinqToXml/LoadOptions.cs | 39 - .../LinqToXml/SaveOptions.cs | 40 - .../LinqToXml/XAttribute.cs | 344 -- Saleslogix.SData.Client/LinqToXml/XCData.cs | 71 - Saleslogix.SData.Client/LinqToXml/XComment.cs | 60 - .../LinqToXml/XContainer.cs | 235 -- .../LinqToXml/XDeclaration.cs | 101 - .../LinqToXml/XDocument.cs | 292 -- .../LinqToXml/XDocumentType.cs | 106 - Saleslogix.SData.Client/LinqToXml/XElement.cs | 818 ----- .../LinqToXml/XIterators.cs | 139 - Saleslogix.SData.Client/LinqToXml/XName.cs | 171 - .../LinqToXml/XNamespace.cs | 139 - Saleslogix.SData.Client/LinqToXml/XNode.cs | 346 -- .../LinqToXml/XNodeDocumentOrderComparer.cs | 155 - .../LinqToXml/XNodeEqualityComparer.cs | 187 - .../LinqToXml/XNodeNavigator.cs | 422 --- .../LinqToXml/XNodeReader.cs | 547 --- .../LinqToXml/XNodeWriter.cs | 403 --- Saleslogix.SData.Client/LinqToXml/XObject.cs | 223 -- .../LinqToXml/XObjectChange.cs | 36 - .../LinqToXml/XObjectChangeEventArgs.cs | 56 - .../LinqToXml/XProcessingInstruction.cs | 82 - .../LinqToXml/XStreamingElement.cs | 184 - Saleslogix.SData.Client/LinqToXml/XText.cs | 70 - Saleslogix.SData.Client/LinqToXml/XUtil.cs | 152 - .../Properties/AssemblyInfo.cs | 10 +- Saleslogix.SData.Client/SDataClient.cs | 11 +- Saleslogix.SData.Client/SDataConstants.cs | 7 + .../Saleslogix.SData.Client_452.csproj | 1 + .../Saleslogix.SData.Client_472.csproj | 1 + .../Saleslogix.SData.Client_48.csproj | 1 + .../Saleslogix.SData.Client_4_0.csproj | 5 + .../Saleslogix.SData.Client_net8.0.csproj | 10 +- .../DotNetStandardApp.csproj | 8 + .../NUnitTestAdapter/Mono.Cecil.Mdb.dll | Bin 0 -> 43520 bytes .../NUnitTestAdapter/Mono.Cecil.Pdb.dll | Bin 0 -> 79872 bytes .../NUnitTestAdapter/Mono.Cecil.Rocks.dll | Bin 0 -> 22528 bytes dependencies/NUnitTestAdapter/Mono.Cecil.dll | Bin 0 -> 268800 bytes .../NUnit.VisualStudio.TestAdapter.dll | Bin 0 -> 40960 bytes .../NUnitTestAdapter/NUnitTestAdapter.props | 46 + dependencies/NUnitTestAdapter/nunit.core.dll | Bin 0 -> 147456 bytes .../nunit.core.interfaces.dll | Bin 0 -> 53248 bytes dependencies/NUnitTestAdapter/nunit.util.dll | Bin 0 -> 122880 bytes nuget.config | 11 + 53 files changed, 335 insertions(+), 8716 deletions(-) create mode 100644 .github/workflows/build-and-test.yml create mode 100644 Saleslogix.SData.Client/Directory.Build.props delete mode 100644 Saleslogix.SData.Client/LinqBridge.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/Extensions.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/LoadOptions.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/SaveOptions.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XAttribute.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XCData.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XComment.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XContainer.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XDeclaration.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XDocument.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XDocumentType.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XElement.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XIterators.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XName.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XNamespace.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XNode.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XNodeDocumentOrderComparer.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XNodeEqualityComparer.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XNodeNavigator.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XNodeReader.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XNodeWriter.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XObject.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XObjectChange.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XObjectChangeEventArgs.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XProcessingInstruction.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XStreamingElement.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XText.cs delete mode 100644 Saleslogix.SData.Client/LinqToXml/XUtil.cs create mode 100644 Saleslogix.SData.Client/SDataConstants.cs create mode 100644 dependencies/NUnitTestAdapter/Mono.Cecil.Mdb.dll create mode 100644 dependencies/NUnitTestAdapter/Mono.Cecil.Pdb.dll create mode 100644 dependencies/NUnitTestAdapter/Mono.Cecil.Rocks.dll create mode 100644 dependencies/NUnitTestAdapter/Mono.Cecil.dll create mode 100644 dependencies/NUnitTestAdapter/NUnit.VisualStudio.TestAdapter.dll create mode 100644 dependencies/NUnitTestAdapter/NUnitTestAdapter.props create mode 100644 dependencies/NUnitTestAdapter/nunit.core.dll create mode 100644 dependencies/NUnitTestAdapter/nunit.core.interfaces.dll create mode 100644 dependencies/NUnitTestAdapter/nunit.util.dll create mode 100644 nuget.config diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 00000000..f9c947da --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,55 @@ +name: Build and Test + +on: + push: + branches: [ main, master, develop ] + pull_request: + branches: [ main, master, develop ] + workflow_dispatch: + +jobs: + build-framework: + name: Build .NET Framework & Run Tests + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v2 + + - name: Build Framework solution + run: msbuild DotNetSDataClient.Framework.sln /t:Rebuild /p:Configuration=Debug /verbosity:minimal + + - name: Install NUnit console runner + run: nuget install NUnit.Runners -Version 2.7.1 -OutputDirectory packages -Source https://api.nuget.org/v3/index.json + + - name: Run tests + run: packages/NUnit.Runners.2.7.1/tools/nunit-console.exe dist/Debug/Net40/Saleslogix.SData.Client.Test.dll /nologo /result=test-results.xml + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-results + path: test-results.xml + + build-standard: + name: Build .NET Standard/8 + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Build Standard solution + run: dotnet build DotNetSDataClient.Standard.sln -c Debug --verbosity minimal diff --git a/.gitignore b/.gitignore index d49c5cc7..deecbeb9 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ *.sdf ipch/ obj/ +objnet/ [Bb]in [Dd]ebug*/ [Rr]elease*/ @@ -33,6 +34,10 @@ _ReSharper*/ [Tt]est[Rr]esult* *.ReSharper +#NuGet +packages/ +*.nupkg + #OS junk files Thumbs.db *.DS_Store diff --git a/Saleslogix.SData.Client.Test/SDataClientTests.cs b/Saleslogix.SData.Client.Test/SDataClientTests.cs index 70932531..fe4352e0 100644 --- a/Saleslogix.SData.Client.Test/SDataClientTests.cs +++ b/Saleslogix.SData.Client.Test/SDataClientTests.cs @@ -10,6 +10,127 @@ namespace Saleslogix.SData.Client.Test [TestFixture] public class SDataClientTests { + #region UserAgent Tests + + [Test] + public void UserAgent_NotSet_UsesDefault() + { + // When UserAgent is not set at all, the default should be used. + SDataRequest capturedRequest = null; + var requestMock = new Mock(null, null, null); + requestMock.SetupAllProperties(); + requestMock.Setup(x => x.GetResponse()).Returns(new SDataResponse(HttpStatusCode.OK, null, null, null, null, null, null, null, null)); + var requestFactory = new Func(uri => + { + capturedRequest = requestMock.Object; + return capturedRequest; + }); + + var client = new SDataClient("test://dummy", requestFactory); + // Do NOT set client.UserAgent - leave it at default + client.Execute(new SDataParameters { Path = "test" }); + + Assert.That(capturedRequest.UserAgent, Is.EqualTo(SDataConstants.UserAgent)); + } + + [Test] + public void UserAgent_SetToNull_FallsBackToDefault() + { + // When UserAgent is explicitly set to null, the default should be used. + SDataRequest capturedRequest = null; + var requestMock = new Mock(null, null, null); + requestMock.SetupAllProperties(); + requestMock.Setup(x => x.GetResponse()).Returns(new SDataResponse(HttpStatusCode.OK, null, null, null, null, null, null, null, null)); + var requestFactory = new Func(uri => + { + capturedRequest = requestMock.Object; + return capturedRequest; + }); + + var client = new SDataClient("test://dummy", requestFactory); + client.UserAgent = null; + client.Execute(new SDataParameters { Path = "test" }); + + Assert.That(capturedRequest.UserAgent, Is.EqualTo(SDataConstants.UserAgent)); + } + + [Test] + public void UserAgent_SetToEmpty_FallsBackToDefault() + { + // When UserAgent is explicitly set to empty string, the default should be used. + SDataRequest capturedRequest = null; + var requestMock = new Mock(null, null, null); + requestMock.SetupAllProperties(); + requestMock.Setup(x => x.GetResponse()).Returns(new SDataResponse(HttpStatusCode.OK, null, null, null, null, null, null, null, null)); + var requestFactory = new Func(uri => + { + capturedRequest = requestMock.Object; + return capturedRequest; + }); + + var client = new SDataClient("test://dummy", requestFactory); + client.UserAgent = ""; + client.Execute(new SDataParameters { Path = "test" }); + + Assert.That(capturedRequest.UserAgent, Is.EqualTo(SDataConstants.UserAgent)); + } + + [Test] + public void UserAgent_SetToWhitespace_FallsBackToDefault() + { + // When UserAgent is explicitly set to whitespace, the default should be used. + SDataRequest capturedRequest = null; + var requestMock = new Mock(null, null, null); + requestMock.SetupAllProperties(); + requestMock.Setup(x => x.GetResponse()).Returns(new SDataResponse(HttpStatusCode.OK, null, null, null, null, null, null, null, null)); + var requestFactory = new Func(uri => + { + capturedRequest = requestMock.Object; + return capturedRequest; + }); + + var client = new SDataClient("test://dummy", requestFactory); + client.UserAgent = " "; + client.Execute(new SDataParameters { Path = "test" }); + + Assert.That(capturedRequest.UserAgent, Is.EqualTo(SDataConstants.UserAgent)); + } + + [Test] + public void UserAgent_SetToCustomValue_UsesCustomValue() + { + // When UserAgent is set to a custom value, that value should be used. + SDataRequest capturedRequest = null; + var requestMock = new Mock(null, null, null); + requestMock.SetupAllProperties(); + requestMock.Setup(x => x.GetResponse()).Returns(new SDataResponse(HttpStatusCode.OK, null, null, null, null, null, null, null, null)); + var requestFactory = new Func(uri => + { + capturedRequest = requestMock.Object; + return capturedRequest; + }); + + var client = new SDataClient("test://dummy", requestFactory); + client.UserAgent = "MyCustomApp/1.0"; + client.Execute(new SDataParameters { Path = "test" }); + + Assert.That(capturedRequest.UserAgent, Is.EqualTo("MyCustomApp/1.0")); + } + + [Test] + public void UserAgent_InstanceIsolation_DoesNotAffectOtherInstances() + { + // Setting UserAgent on one instance should not affect another instance. + var client1 = new SDataClient("test://dummy1"); + var client2 = new SDataClient("test://dummy2"); + + client1.UserAgent = "CustomAgent1"; + + Assert.That(client1.UserAgent, Is.EqualTo("CustomAgent1")); + Assert.That(client2.UserAgent, Is.EqualTo(SDataConstants.UserAgent)); + } + + #endregion [Test] public void Execute_Test() { diff --git a/Saleslogix.SData.Client.Test/Saleslogix.SData.Client.Test_4_0.csproj b/Saleslogix.SData.Client.Test/Saleslogix.SData.Client.Test_4_0.csproj index 63751894..6ad985b9 100644 --- a/Saleslogix.SData.Client.Test/Saleslogix.SData.Client.Test_4_0.csproj +++ b/Saleslogix.SData.Client.Test/Saleslogix.SData.Client.Test_4_0.csproj @@ -40,6 +40,38 @@ ..\dependencies\NUnit\nunit.framework.dll + + ..\dependencies\NUnitTestAdapter\NUnit.VisualStudio.TestAdapter.dll + true + + + ..\dependencies\NUnitTestAdapter\nunit.core.dll + true + + + ..\dependencies\NUnitTestAdapter\nunit.core.interfaces.dll + true + + + ..\dependencies\NUnitTestAdapter\nunit.util.dll + true + + + ..\dependencies\NUnitTestAdapter\Mono.Cecil.dll + true + + + ..\dependencies\NUnitTestAdapter\Mono.Cecil.Mdb.dll + true + + + ..\dependencies\NUnitTestAdapter\Mono.Cecil.Pdb.dll + true + + + ..\dependencies\NUnitTestAdapter\Mono.Cecil.Rocks.dll + true + 3.5 @@ -100,11 +132,4 @@ - - \ No newline at end of file + diff --git a/Saleslogix.SData.Client/Directory.Build.props b/Saleslogix.SData.Client/Directory.Build.props new file mode 100644 index 00000000..14af6435 --- /dev/null +++ b/Saleslogix.SData.Client/Directory.Build.props @@ -0,0 +1,16 @@ + + + + + objnet\ + $(MSBuildThisFileDirectory)objnet\ + + + diff --git a/Saleslogix.SData.Client/Framework/SDataRequest.cs b/Saleslogix.SData.Client/Framework/SDataRequest.cs index 86aaf510..f6973ff3 100644 --- a/Saleslogix.SData.Client/Framework/SDataRequest.cs +++ b/Saleslogix.SData.Client/Framework/SDataRequest.cs @@ -44,7 +44,7 @@ public SDataRequest(string uri = null, HttpMethod method = HttpMethod.Get, objec { Uri = uri; #if !PCL && !NETFX_CORE && !SILVERLIGHT - UserAgent = "DotNetSDataClient"; + UserAgent = SDataConstants.UserAgent; Timeout = 120000; #endif TimeoutRetryAttempts = 1; @@ -444,11 +444,7 @@ private WebRequest CreateRequest(string uri, out MediaType? contentType, out obj httpRequest.ReadWriteTimeout = Timeout; httpRequest.KeepAlive = false; httpRequest.ProtocolVersion = HttpVersion.Version10; - - if (UserAgent != null) - { - httpRequest.UserAgent = UserAgent; - } + httpRequest.UserAgent = !string.IsNullOrWhiteSpace(UserAgent) ? UserAgent : SDataConstants.UserAgent; #endif if (Accept != null) { diff --git a/Saleslogix.SData.Client/LinqBridge.cs b/Saleslogix.SData.Client/LinqBridge.cs deleted file mode 100644 index 3f195115..00000000 --- a/Saleslogix.SData.Client/LinqBridge.cs +++ /dev/null @@ -1,3100 +0,0 @@ -#region License, Terms and Author(s) -// -// LINQBridge -// Copyright (c) 2007 Atif Aziz, Joseph Albahari. All rights reserved. -// -// Author(s): -// -// Atif Aziz, http://www.raboof.com -// -// This library is free software; you can redistribute it and/or modify it -// under the terms of the New BSD License, a copy of which should have -// been delivered along with this distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -#endregion - -// $Id: Enumerable.cs c08984d432b1 2012/04/17 16:05:19 azizatif $ - -namespace System.Linq -{ - #region Imports - - using System; - using System.Collections; - using System.Collections.Generic; - using System.Diagnostics; - using LinqBridge; - - #endregion - - /// - /// Provides a set of static (Shared in Visual Basic) methods for - /// querying objects that implement . - /// - - static partial class Enumerable - { - /// - /// Returns the input typed as . - /// - - public static IEnumerable AsEnumerable(this IEnumerable source) - { - return source; - } - - /// - /// Returns an empty that has the - /// specified type argument. - /// - - public static IEnumerable Empty() - { - return Sequence.Empty; - } - - /// - /// Converts the elements of an to the - /// specified type. - /// - - public static IEnumerable Cast( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - return CastYield(source); - } - - private static IEnumerable CastYield( - IEnumerable source) - { - foreach (var item in source) - yield return (TResult) item; - } - - /// - /// Filters the elements of an based on a specified type. - /// - - public static IEnumerable OfType( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - return OfTypeYield(source); - } - - private static IEnumerable OfTypeYield( - IEnumerable source) - { - foreach (var item in source) - if (item is TResult) - yield return (TResult) item; - } - - /// - /// Generates a sequence of integral numbers within a specified range. - /// - /// The value of the first integer in the sequence. - /// The number of sequential integers to generate. - - public static IEnumerable Range(int start, int count) - { - if (count < 0) - throw new ArgumentOutOfRangeException("count", count, null); - - var end = (long) start + count; - if (end - 1 >= int.MaxValue) - throw new ArgumentOutOfRangeException("count", count, null); - - return RangeYield(start, end); - } - - private static IEnumerable RangeYield(int start, long end) - { - for (var i = start; i < end; i++) - yield return i; - } - - /// - /// Generates a sequence that contains one repeated value. - /// - - public static IEnumerable Repeat(TResult element, int count) - { - if (count < 0) throw new ArgumentOutOfRangeException("count", count, null); - - return RepeatYield(element, count); - } - - private static IEnumerable RepeatYield(TResult element, int count) - { - for (var i = 0; i < count; i++) - yield return element; - } - - /// - /// Filters a sequence of values based on a predicate. - /// - - public static IEnumerable Where( - this IEnumerable source, - Func predicate) - { - if (predicate == null) throw new ArgumentNullException("predicate"); - - return source.Where((item, i) => predicate(item)); - } - - /// - /// Filters a sequence of values based on a predicate. - /// Each element's index is used in the logic of the predicate function. - /// - - public static IEnumerable Where( - this IEnumerable source, - Func predicate) - { - if (source == null) throw new ArgumentNullException("source"); - if (predicate == null) throw new ArgumentNullException("predicate"); - - return WhereYield(source, predicate); - } - - private static IEnumerable WhereYield( - IEnumerable source, - Func predicate) - { - var i = 0; - foreach (var item in source) - if (predicate(item, i++)) - yield return item; - } - - /// - /// Projects each element of a sequence into a new form. - /// - - public static IEnumerable Select( - this IEnumerable source, - Func selector) - { - if (selector == null) throw new ArgumentNullException("selector"); - - return source.Select((item, i) => selector(item)); - } - - /// - /// Projects each element of a sequence into a new form by - /// incorporating the element's index. - /// - - public static IEnumerable Select( - this IEnumerable source, - Func selector) - { - if (source == null) throw new ArgumentNullException("source"); - if (selector == null) throw new ArgumentNullException("selector"); - - return SelectYield(source, selector); - } - - private static IEnumerable SelectYield( - IEnumerable source, - Func selector) - { - var i = 0; - foreach (var item in source) - yield return selector(item, i++); - } - - /// - /// Projects each element of a sequence to an - /// and flattens the resulting sequences into one sequence. - /// - - public static IEnumerable SelectMany( - this IEnumerable source, - Func> selector) - { - if (selector == null) throw new ArgumentNullException("selector"); - - return source.SelectMany((item, i) => selector(item)); - } - - /// - /// Projects each element of a sequence to an , - /// and flattens the resulting sequences into one sequence. The - /// index of each source element is used in the projected form of - /// that element. - /// - - public static IEnumerable SelectMany( - this IEnumerable source, - Func> selector) - { - if (selector == null) throw new ArgumentNullException("selector"); - - return source.SelectMany(selector, (item, subitem) => subitem); - } - - /// - /// Projects each element of a sequence to an , - /// flattens the resulting sequences into one sequence, and invokes - /// a result selector function on each element therein. - /// - - public static IEnumerable SelectMany( - this IEnumerable source, - Func> collectionSelector, - Func resultSelector) - { - if (collectionSelector == null) throw new ArgumentNullException("collectionSelector"); - - return source.SelectMany((item, i) => collectionSelector(item), resultSelector); - } - - /// - /// Projects each element of a sequence to an , - /// flattens the resulting sequences into one sequence, and invokes - /// a result selector function on each element therein. The index of - /// each source element is used in the intermediate projected form - /// of that element. - /// - - public static IEnumerable SelectMany( - this IEnumerable source, - Func> collectionSelector, - Func resultSelector) - { - if (source == null) throw new ArgumentNullException("source"); - if (collectionSelector == null) throw new ArgumentNullException("collectionSelector"); - if (resultSelector == null) throw new ArgumentNullException("resultSelector"); - - return SelectManyYield(source, collectionSelector, resultSelector); - } - - private static IEnumerable SelectManyYield( - this IEnumerable source, - Func> collectionSelector, - Func resultSelector) - { - var i = 0; - foreach (var item in source) - foreach (var subitem in collectionSelector(item, i++)) - yield return resultSelector(item, subitem); - } - - /// - /// Returns elements from a sequence as long as a specified condition is true. - /// - - public static IEnumerable TakeWhile( - this IEnumerable source, - Func predicate) - { - if (predicate == null) throw new ArgumentNullException("predicate"); - - return source.TakeWhile((item, i) => predicate(item)); - } - - /// - /// Returns elements from a sequence as long as a specified condition is true. - /// The element's index is used in the logic of the predicate function. - /// - - public static IEnumerable TakeWhile( - this IEnumerable source, - Func predicate) - { - if (source == null) throw new ArgumentNullException("source"); - if (predicate == null) throw new ArgumentNullException("predicate"); - - return TakeWhileYield(source, predicate); - } - - private static IEnumerable TakeWhileYield( - this IEnumerable source, - Func predicate) - { - var i = 0; - foreach (var item in source) - if (predicate(item, i++)) - yield return item; - else - break; - } - - /// - /// Returns a specified number of contiguous elements from the start - /// of a sequence. - /// - - public static IEnumerable Take( - this IEnumerable source, - int count) - { - return source.TakeWhile((item, i) => i < count); - } - - private static class Futures - { - public static readonly Func Default = () => default(T); - public static readonly Func Undefined = () => { throw new InvalidOperationException(); }; - } - - /// - /// Base implementation of First operator. - /// - - private static TSource FirstImpl( - this IEnumerable source, - Func empty) - { - if (source == null) throw new ArgumentNullException("source"); - Debug.Assert(empty != null); - - var list = source as IList; // optimized case for lists - if (list != null) - return list.Count > 0 ? list[0] : empty(); - - using (var e = source.GetEnumerator()) // fallback for enumeration - return e.MoveNext() ? e.Current : empty(); - } - - /// - /// Returns the first element of a sequence. - /// - - public static TSource First( - this IEnumerable source) - { - return source.FirstImpl(Futures.Undefined); - } - - /// - /// Returns the first element in a sequence that satisfies a specified condition. - /// - - public static TSource First( - this IEnumerable source, - Func predicate) - { - return First(source.Where(predicate)); - } - - /// - /// Returns the first element of a sequence, or a default value if - /// the sequence contains no elements. - /// - - public static TSource FirstOrDefault( - this IEnumerable source) - { - return source.FirstImpl(Futures.Default); - } - - /// - /// Returns the first element of the sequence that satisfies a - /// condition or a default value if no such element is found. - /// - - public static TSource FirstOrDefault( - this IEnumerable source, - Func predicate) - { - return FirstOrDefault(source.Where(predicate)); - } - - /// - /// Base implementation of Last operator. - /// - - private static TSource LastImpl( - this IEnumerable source, - Func empty) - { - if (source == null) throw new ArgumentNullException("source"); - - var list = source as IList; // optimized case for lists - if (list != null) - return list.Count > 0 ? list[list.Count - 1] : empty(); - - using (var e = source.GetEnumerator()) - { - if (!e.MoveNext()) - return empty(); - - var last = e.Current; - while (e.MoveNext()) - last = e.Current; - - return last; - } - } - - /// - /// Returns the last element of a sequence. - /// - public static TSource Last( - this IEnumerable source) - { - return source.LastImpl(Futures.Undefined); - } - - /// - /// Returns the last element of a sequence that satisfies a - /// specified condition. - /// - - public static TSource Last( - this IEnumerable source, - Func predicate) - { - return Last(source.Where(predicate)); - } - - /// - /// Returns the last element of a sequence, or a default value if - /// the sequence contains no elements. - /// - - public static TSource LastOrDefault( - this IEnumerable source) - { - return source.LastImpl(Futures.Default); - } - - /// - /// Returns the last element of a sequence that satisfies a - /// condition or a default value if no such element is found. - /// - - public static TSource LastOrDefault( - this IEnumerable source, - Func predicate) - { - return LastOrDefault(source.Where(predicate)); - } - - /// - /// Base implementation of Single operator. - /// - - private static TSource SingleImpl( - this IEnumerable source, - Func empty) - { - if (source == null) throw new ArgumentNullException("source"); - - using (var e = source.GetEnumerator()) - { - if (e.MoveNext()) - { - var single = e.Current; - if (!e.MoveNext()) - return single; - - throw new InvalidOperationException(); - } - - return empty(); - } - } - - /// - /// Returns the only element of a sequence, and throws an exception - /// if there is not exactly one element in the sequence. - /// - - public static TSource Single( - this IEnumerable source) - { - return source.SingleImpl(Futures.Undefined); - } - - /// - /// Returns the only element of a sequence that satisfies a - /// specified condition, and throws an exception if more than one - /// such element exists. - /// - - public static TSource Single( - this IEnumerable source, - Func predicate) - { - return Single(source.Where(predicate)); - } - - /// - /// Returns the only element of a sequence, or a default value if - /// the sequence is empty; this method throws an exception if there - /// is more than one element in the sequence. - /// - - public static TSource SingleOrDefault( - this IEnumerable source) - { - return source.SingleImpl(Futures.Default); - } - - /// - /// Returns the only element of a sequence that satisfies a - /// specified condition or a default value if no such element - /// exists; this method throws an exception if more than one element - /// satisfies the condition. - /// - - public static TSource SingleOrDefault( - this IEnumerable source, - Func predicate) - { - return SingleOrDefault(source.Where(predicate)); - } - - /// - /// Returns the element at a specified index in a sequence. - /// - - public static TSource ElementAt( - this IEnumerable source, - int index) - { - if (source == null) throw new ArgumentNullException("source"); - - if (index < 0) - throw new ArgumentOutOfRangeException("index", index, null); - - var list = source as IList; - if (list != null) - return list[index]; - - try - { - return source.SkipWhile((item, i) => i < index).First(); - } - catch (InvalidOperationException) // if thrown by First - { - throw new ArgumentOutOfRangeException("index", index, null); - } - } - - /// - /// Returns the element at a specified index in a sequence or a - /// default value if the index is out of range. - /// - - public static TSource ElementAtOrDefault( - this IEnumerable source, - int index) - { - if (source == null) throw new ArgumentNullException("source"); - - if (index < 0) - return default(TSource); - - var list = source as IList; - if (list != null) - return index < list.Count ? list[index] : default(TSource); - - return source.SkipWhile((item, i) => i < index).FirstOrDefault(); - } - - /// - /// Inverts the order of the elements in a sequence. - /// - - public static IEnumerable Reverse( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - return ReverseYield(source); - } - - private static IEnumerable ReverseYield(IEnumerable source) - { - var stack = new Stack(); - foreach (var item in source) - stack.Push(item); - - foreach (var item in stack) - yield return item; - } - - /// - /// Bypasses elements in a sequence as long as a specified condition - /// is true and then returns the remaining elements. - /// - - public static IEnumerable SkipWhile( - this IEnumerable source, - Func predicate) - { - if (predicate == null) throw new ArgumentNullException("predicate"); - - return source.SkipWhile((item, i) => predicate(item)); - } - - /// - /// Bypasses elements in a sequence as long as a specified condition - /// is true and then returns the remaining elements. The element's - /// index is used in the logic of the predicate function. - /// - - public static IEnumerable SkipWhile( - this IEnumerable source, - Func predicate) - { - if (source == null) throw new ArgumentNullException("source"); - if (predicate == null) throw new ArgumentNullException("predicate"); - - return SkipWhileYield(source, predicate); - } - - private static IEnumerable SkipWhileYield( - IEnumerable source, - Func predicate) - { - using (var e = source.GetEnumerator()) - { - for (var i = 0; ; i++) - { - if (!e.MoveNext()) - yield break; - - if (!predicate(e.Current, i)) - break; - } - - do { yield return e.Current; } while (e.MoveNext()); - } - } - - /// - /// Bypasses a specified number of elements in a sequence and then - /// returns the remaining elements. - /// - - public static IEnumerable Skip( - this IEnumerable source, - int count) - { - return source.SkipWhile((item, i) => i < count); - } - - /// - /// Returns the number of elements in a sequence. - /// - - public static int Count( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - var collection = source as ICollection; - return collection != null - ? collection.Count - : source.Aggregate(0, (count, item) => checked(count + 1)); - } - - /// - /// Returns a number that represents how many elements in the - /// specified sequence satisfy a condition. - /// - - public static int Count( - this IEnumerable source, - Func predicate) - { - return Count(source.Where(predicate)); - } - - /// - /// Returns an that represents the total number - /// of elements in a sequence. - /// - - public static long LongCount( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - var array = source as Array; - return array != null - ? array.LongLength - : source.Aggregate(0L, (count, item) => count + 1); - } - - /// - /// Returns an that represents how many elements - /// in a sequence satisfy a condition. - /// - - public static long LongCount( - this IEnumerable source, - Func predicate) - { - return LongCount(source.Where(predicate)); - } - - /// - /// Concatenates two sequences. - /// - - public static IEnumerable Concat( - this IEnumerable first, - IEnumerable second) - { - if (first == null) throw new ArgumentNullException("first"); - if (second == null) throw new ArgumentNullException("second"); - - return ConcatYield(first, second); - } - - private static IEnumerable ConcatYield( - IEnumerable first, - IEnumerable second) - { - foreach (var item in first) - yield return item; - - foreach (var item in second) - yield return item; - } - - /// - /// Creates a from an . - /// - - public static List ToList( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - return new List(source); - } - - /// - /// Creates an array from an . - /// - - public static TSource[] ToArray( - this IEnumerable source) - { - return source.ToList().ToArray(); - } - - /// - /// Returns distinct elements from a sequence by using the default - /// equality comparer to compare values. - /// - - public static IEnumerable Distinct( - this IEnumerable source) - { - return Distinct(source, /* comparer */ null); - } - - /// - /// Returns distinct elements from a sequence by using a specified - /// to compare values. - /// - - public static IEnumerable Distinct( - this IEnumerable source, - IEqualityComparer comparer) - { - if (source == null) throw new ArgumentNullException("source"); - - return DistinctYield(source, comparer); - } - - private static IEnumerable DistinctYield( - IEnumerable source, - IEqualityComparer comparer) - { - var set = new Dictionary(comparer); - var gotNull = false; - - foreach (var item in source) - { - if (item == null) - { - if (gotNull) - continue; - gotNull = true; - } - else - { - if (set.ContainsKey(item)) - continue; - set.Add(item, null); - } - - yield return item; - } - } - - /// - /// Creates a from an - /// according to a specified key - /// selector function. - /// - - public static ILookup ToLookup( - this IEnumerable source, - Func keySelector) - { - return ToLookup(source, keySelector, e => e, /* comparer */ null); - } - - /// - /// Creates a from an - /// according to a specified key - /// selector function and a key comparer. - /// - - public static ILookup ToLookup( - this IEnumerable source, - Func keySelector, - IEqualityComparer comparer) - { - return ToLookup(source, keySelector, e => e, comparer); - } - - /// - /// Creates a from an - /// according to specified key - /// and element selector functions. - /// - - public static ILookup ToLookup( - this IEnumerable source, - Func keySelector, - Func elementSelector) - { - return ToLookup(source, keySelector, elementSelector, /* comparer */ null); - } - - /// - /// Creates a from an - /// according to a specified key - /// selector function, a comparer and an element selector function. - /// - - public static ILookup ToLookup( - this IEnumerable source, - Func keySelector, - Func elementSelector, - IEqualityComparer comparer) - { - if (source == null) throw new ArgumentNullException("source"); - if (keySelector == null) throw new ArgumentNullException("keySelector"); - if (elementSelector == null) throw new ArgumentNullException("elementSelector"); - - var lookup = new Lookup(comparer); - - foreach (var item in source) - { - var key = keySelector(item); - - var grouping = (Grouping) lookup.Find(key); - if (grouping == null) - { - grouping = new Grouping(key); - lookup.Add(grouping); - } - - grouping.Add(elementSelector(item)); - } - - return lookup; - } - - /// - /// Groups the elements of a sequence according to a specified key - /// selector function. - /// - - public static IEnumerable> GroupBy( - this IEnumerable source, - Func keySelector) - { - return GroupBy(source, keySelector, /* comparer */ null); - } - - /// - /// Groups the elements of a sequence according to a specified key - /// selector function and compares the keys by using a specified - /// comparer. - /// - - public static IEnumerable> GroupBy( - this IEnumerable source, - Func keySelector, - IEqualityComparer comparer) - { - return GroupBy(source, keySelector, e => e, comparer); - } - - /// - /// Groups the elements of a sequence according to a specified key - /// selector function and projects the elements for each group by - /// using a specified function. - /// - - public static IEnumerable> GroupBy( - this IEnumerable source, - Func keySelector, - Func elementSelector) - { - return GroupBy(source, keySelector, elementSelector, /* comparer */ null); - } - - /// - /// Groups the elements of a sequence according to a specified key - /// selector function and creates a result value from each group and - /// its key. - /// - - public static IEnumerable> GroupBy( - this IEnumerable source, - Func keySelector, - Func elementSelector, - IEqualityComparer comparer) - { - if (source == null) throw new ArgumentNullException("source"); - if (keySelector == null) throw new ArgumentNullException("keySelector"); - if (elementSelector == null) throw new ArgumentNullException("elementSelector"); - - return ToLookup(source, keySelector, elementSelector, comparer); - } - - /// - /// Groups the elements of a sequence according to a key selector - /// function. The keys are compared by using a comparer and each - /// group's elements are projected by using a specified function. - /// - - public static IEnumerable GroupBy( - this IEnumerable source, - Func keySelector, - Func, TResult> resultSelector) - { - return GroupBy(source, keySelector, resultSelector, /* comparer */ null); - } - - /// - /// Groups the elements of a sequence according to a specified key - /// selector function and creates a result value from each group and - /// its key. The elements of each group are projected by using a - /// specified function. - /// - - public static IEnumerable GroupBy( - this IEnumerable source, - Func keySelector, - Func, TResult> resultSelector, - IEqualityComparer comparer) - { - if (source == null) throw new ArgumentNullException("source"); - if (keySelector == null) throw new ArgumentNullException("keySelector"); - if (resultSelector == null) throw new ArgumentNullException("resultSelector"); - - return ToLookup(source, keySelector, comparer).Select(g => resultSelector(g.Key, g)); - } - - /// - /// Groups the elements of a sequence according to a specified key - /// selector function and creates a result value from each group and - /// its key. The keys are compared by using a specified comparer. - /// - - public static IEnumerable GroupBy( - this IEnumerable source, - Func keySelector, - Func elementSelector, - Func, TResult> resultSelector) - { - return GroupBy(source, keySelector, elementSelector, resultSelector, /* comparer */ null); - } - - /// - /// Groups the elements of a sequence according to a specified key - /// selector function and creates a result value from each group and - /// its key. Key values are compared by using a specified comparer, - /// and the elements of each group are projected by using a - /// specified function. - /// - - public static IEnumerable GroupBy( - this IEnumerable source, - Func keySelector, - Func elementSelector, - Func, TResult> resultSelector, - IEqualityComparer comparer) - { - if (source == null) throw new ArgumentNullException("source"); - if (keySelector == null) throw new ArgumentNullException("keySelector"); - if (elementSelector == null) throw new ArgumentNullException("elementSelector"); - if (resultSelector == null) throw new ArgumentNullException("resultSelector"); - - return ToLookup(source, keySelector, elementSelector, comparer) - .Select(g => resultSelector(g.Key, g)); - } - - /// - /// Applies an accumulator function over a sequence. - /// - - public static TSource Aggregate( - this IEnumerable source, - Func func) - { - if (source == null) throw new ArgumentNullException("source"); - if (func == null) throw new ArgumentNullException("func"); - - using (var e = source.GetEnumerator()) - { - if (!e.MoveNext()) - throw new InvalidOperationException(); - - return e.Renumerable().Skip(1).Aggregate(e.Current, func); - } - } - - /// - /// Applies an accumulator function over a sequence. The specified - /// seed value is used as the initial accumulator value. - /// - - public static TAccumulate Aggregate( - this IEnumerable source, - TAccumulate seed, - Func func) - { - return Aggregate(source, seed, func, r => r); - } - - /// - /// Applies an accumulator function over a sequence. The specified - /// seed value is used as the initial accumulator value, and the - /// specified function is used to select the result value. - /// - - public static TResult Aggregate( - this IEnumerable source, - TAccumulate seed, - Func func, - Func resultSelector) - { - if (source == null) throw new ArgumentNullException("source"); - if (func == null) throw new ArgumentNullException("func"); - if (resultSelector == null) throw new ArgumentNullException("resultSelector"); - - var result = seed; - - foreach (var item in source) - result = func(result, item); - - return resultSelector(result); - } - - /// - /// Produces the set union of two sequences by using the default - /// equality comparer. - /// - - public static IEnumerable Union( - this IEnumerable first, - IEnumerable second) - { - return Union(first, second, /* comparer */ null); - } - - /// - /// Produces the set union of two sequences by using a specified - /// . - /// - - public static IEnumerable Union( - this IEnumerable first, - IEnumerable second, - IEqualityComparer comparer) - { - return first.Concat(second).Distinct(comparer); - } - - /// - /// Returns the elements of the specified sequence or the type - /// parameter's default value in a singleton collection if the - /// sequence is empty. - /// - - public static IEnumerable DefaultIfEmpty( - this IEnumerable source) - { - return source.DefaultIfEmpty(default(TSource)); - } - - /// - /// Returns the elements of the specified sequence or the specified - /// value in a singleton collection if the sequence is empty. - /// - - public static IEnumerable DefaultIfEmpty( - this IEnumerable source, - TSource defaultValue) - { - if (source == null) throw new ArgumentNullException("source"); - - return DefaultIfEmptyYield(source, defaultValue); - } - - private static IEnumerable DefaultIfEmptyYield( - IEnumerable source, - TSource defaultValue) - { - using (var e = source.GetEnumerator()) - { - if (!e.MoveNext()) - yield return defaultValue; - else - do { yield return e.Current; } while (e.MoveNext()); - } - } - - /// - /// Determines whether all elements of a sequence satisfy a condition. - /// - - public static bool All( - this IEnumerable source, - Func predicate) - { - if (source == null) throw new ArgumentNullException("source"); - if (predicate == null) throw new ArgumentNullException("predicate"); - - foreach (var item in source) - if (!predicate(item)) - return false; - - return true; - } - - /// - /// Determines whether a sequence contains any elements. - /// - - public static bool Any( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - using (var e = source.GetEnumerator()) - return e.MoveNext(); - } - - /// - /// Determines whether any element of a sequence satisfies a - /// condition. - /// - - public static bool Any( - this IEnumerable source, - Func predicate) - { - return source.Where(predicate).Any(); - } - - /// - /// Determines whether a sequence contains a specified element by - /// using the default equality comparer. - /// - - public static bool Contains( - this IEnumerable source, - TSource value) - { - return source.Contains(value, /* comparer */ null); - } - - /// - /// Determines whether a sequence contains a specified element by - /// using a specified . - /// - - public static bool Contains( - this IEnumerable source, - TSource value, - IEqualityComparer comparer) - { - if (source == null) throw new ArgumentNullException("source"); - - if (comparer == null) - { - var collection = source as ICollection; - if (collection != null) - return collection.Contains(value); - } - - comparer = comparer ?? EqualityComparer.Default; - return source.Any(item => comparer.Equals(item, value)); - } - - /// - /// Determines whether two sequences are equal by comparing the - /// elements by using the default equality comparer for their type. - /// - - public static bool SequenceEqual( - this IEnumerable first, - IEnumerable second) - { - return first.SequenceEqual(second, /* comparer */ null); - } - - /// - /// Determines whether two sequences are equal by comparing their - /// elements by using a specified . - /// - - public static bool SequenceEqual( - this IEnumerable first, - IEnumerable second, - IEqualityComparer comparer) - { - if (first == null) throw new ArgumentNullException("frist"); - if (second == null) throw new ArgumentNullException("second"); - - comparer = comparer ?? EqualityComparer.Default; - - using (IEnumerator lhs = first.GetEnumerator(), - rhs = second.GetEnumerator()) - { - do - { - if (!lhs.MoveNext()) - return !rhs.MoveNext(); - - if (!rhs.MoveNext()) - return false; - } - while (comparer.Equals(lhs.Current, rhs.Current)); - } - - return false; - } - - /// - /// Base implementation for Min/Max operator. - /// - - private static TSource MinMaxImpl( - this IEnumerable source, - Func lesser) - { - if (source == null) throw new ArgumentNullException("source"); - Debug.Assert(lesser != null); - - if (typeof(TSource).IsClass) // ReSharper disable CompareNonConstrainedGenericWithNull - source = source.Where(e => e != null).DefaultIfEmpty(); // ReSharper restore CompareNonConstrainedGenericWithNull - - return source.Aggregate((a, item) => lesser(a, item) ? a : item); - } - - /// - /// Base implementation for Min/Max operator for nullable types. - /// - - private static TSource? MinMaxImpl( - this IEnumerable source, - TSource? seed, Func lesser) where TSource : struct - { - if (source == null) throw new ArgumentNullException("source"); - Debug.Assert(lesser != null); - - return source.Aggregate(seed, (a, item) => lesser(a, item) ? a : item); - // == MinMaxImpl(Repeat(null, 1).Concat(source), lesser); - } - - /// - /// Returns the minimum value in a generic sequence. - /// - - public static TSource Min( - this IEnumerable source) - { - var comparer = Comparer.Default; - return source.MinMaxImpl((x, y) => comparer.Compare(x, y) < 0); - } - - /// - /// Invokes a transform function on each element of a generic - /// sequence and returns the minimum resulting value. - /// - - public static TResult Min( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Min(); - } - - /// - /// Returns the maximum value in a generic sequence. - /// - - public static TSource Max( - this IEnumerable source) - { - var comparer = Comparer.Default; - return source.MinMaxImpl((x, y) => comparer.Compare(x, y) > 0); - } - - /// - /// Invokes a transform function on each element of a generic - /// sequence and returns the maximum resulting value. - /// - - public static TResult Max( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Max(); - } - - /// - /// Makes an enumerator seen as enumerable once more. - /// - /// - /// The supplied enumerator must have been started. The first element - /// returned is the element the enumerator was on when passed in. - /// DO NOT use this method if the caller must be a generator. It is - /// mostly safe among aggregate operations. - /// - - private static IEnumerable Renumerable(this IEnumerator e) - { - Debug.Assert(e != null); - - do { yield return e.Current; } while (e.MoveNext()); - } - - /// - /// Sorts the elements of a sequence in ascending order according to a key. - /// - - public static IOrderedEnumerable OrderBy( - this IEnumerable source, - Func keySelector) - { - return source.OrderBy(keySelector, /* comparer */ null); - } - - /// - /// Sorts the elements of a sequence in ascending order by using a - /// specified comparer. - /// - - public static IOrderedEnumerable OrderBy( - this IEnumerable source, - Func keySelector, - IComparer comparer) - { - if (source == null) throw new ArgumentNullException("source"); - if (keySelector == null) throw new ArgumentNullException("keySelector"); - - return new OrderedEnumerable(source, keySelector, comparer, /* descending */ false); - } - - /// - /// Sorts the elements of a sequence in descending order according to a key. - /// - - public static IOrderedEnumerable OrderByDescending( - this IEnumerable source, - Func keySelector) - { - return source.OrderByDescending(keySelector, /* comparer */ null); - } - - /// - /// Sorts the elements of a sequence in descending order by using a - /// specified comparer. - /// - - public static IOrderedEnumerable OrderByDescending( - this IEnumerable source, - Func keySelector, - IComparer comparer) - { - if (source == null) throw new ArgumentNullException("source"); - if (source == null) throw new ArgumentNullException("keySelector"); - - return new OrderedEnumerable(source, keySelector, comparer, /* descending */ true); - } - - /// - /// Performs a subsequent ordering of the elements in a sequence in - /// ascending order according to a key. - /// - - public static IOrderedEnumerable ThenBy( - this IOrderedEnumerable source, - Func keySelector) - { - return source.ThenBy(keySelector, /* comparer */ null); - } - - /// - /// Performs a subsequent ordering of the elements in a sequence in - /// ascending order by using a specified comparer. - /// - - public static IOrderedEnumerable ThenBy( - this IOrderedEnumerable source, - Func keySelector, - IComparer comparer) - { - if (source == null) throw new ArgumentNullException("source"); - - return source.CreateOrderedEnumerable(keySelector, comparer, /* descending */ false); - } - - /// - /// Performs a subsequent ordering of the elements in a sequence in - /// descending order, according to a key. - /// - - public static IOrderedEnumerable ThenByDescending( - this IOrderedEnumerable source, - Func keySelector) - { - return source.ThenByDescending(keySelector, /* comparer */ null); - } - - /// - /// Performs a subsequent ordering of the elements in a sequence in - /// descending order by using a specified comparer. - /// - - public static IOrderedEnumerable ThenByDescending( - this IOrderedEnumerable source, - Func keySelector, - IComparer comparer) - { - if (source == null) throw new ArgumentNullException("source"); - - return source.CreateOrderedEnumerable(keySelector, comparer, /* descending */ true); - } - - /// - /// Base implementation for Intersect and Except operators. - /// - - private static IEnumerable IntersectExceptImpl( - this IEnumerable first, - IEnumerable second, - IEqualityComparer comparer, - bool flag) - { - if (first == null) throw new ArgumentNullException("first"); - if (second == null) throw new ArgumentNullException("second"); - - var keys = new List>(); - var flags = new Dictionary, bool>(new KeyComparer(comparer)); - - foreach (var item in from item in first - select new Key(item) into item - where !flags.ContainsKey(item) - select item) - { - flags.Add(item, !flag); - keys.Add(item); - } - - foreach (var item in from item in second - select new Key(item) into item - where flags.ContainsKey(item) - select item) - { - flags[item] = flag; - } - - // - // As per docs, "the marked elements are yielded in the order in - // which they were collected. - // - - return from item in keys where flags[item] select item.Value; - } - - /// - /// Produces the set intersection of two sequences by using the - /// default equality comparer to compare values. - /// - - public static IEnumerable Intersect( - this IEnumerable first, - IEnumerable second) - { - return first.Intersect(second, /* comparer */ null); - } - - /// - /// Produces the set intersection of two sequences by using the - /// specified to compare values. - /// - - public static IEnumerable Intersect( - this IEnumerable first, - IEnumerable second, - IEqualityComparer comparer) - { - return IntersectExceptImpl(first, second, comparer, /* flag */ true); - } - - /// - /// Produces the set difference of two sequences by using the - /// default equality comparer to compare values. - /// - - public static IEnumerable Except( - this IEnumerable first, - IEnumerable second) - { - return first.Except(second, /* comparer */ null); - } - - /// - /// Produces the set difference of two sequences by using the - /// specified to compare values. - /// - - public static IEnumerable Except( - this IEnumerable first, - IEnumerable second, - IEqualityComparer comparer) - { - return IntersectExceptImpl(first, second, comparer, /* flag */ false); - } - - /// - /// Creates a from an - /// according to a specified key - /// selector function. - /// - - public static Dictionary ToDictionary( - this IEnumerable source, - Func keySelector) - { - return source.ToDictionary(keySelector, /* comparer */ null); - } - - /// - /// Creates a from an - /// according to a specified key - /// selector function and key comparer. - /// - - public static Dictionary ToDictionary( - this IEnumerable source, - Func keySelector, - IEqualityComparer comparer) - { - return source.ToDictionary(keySelector, e => e, comparer); - } - - /// - /// Creates a from an - /// according to specified key - /// selector and element selector functions. - /// - - public static Dictionary ToDictionary( - this IEnumerable source, - Func keySelector, - Func elementSelector) - { - return source.ToDictionary(keySelector, elementSelector, /* comparer */ null); - } - - /// - /// Creates a from an - /// according to a specified key - /// selector function, a comparer, and an element selector function. - /// - - public static Dictionary ToDictionary( - this IEnumerable source, - Func keySelector, - Func elementSelector, - IEqualityComparer comparer) - { - if (source == null) throw new ArgumentNullException("source"); - if (keySelector == null) throw new ArgumentNullException("keySelector"); - if (elementSelector == null) throw new ArgumentNullException("elementSelector"); - - var dict = new Dictionary(comparer); - - foreach (var item in source) - { - // - // ToDictionary is meant to throw ArgumentNullException if - // keySelector produces a key that is null and - // Argument exception if keySelector produces duplicate keys - // for two elements. Incidentally, the doucmentation for - // IDictionary.Add says that the Add method - // throws the same exceptions under the same circumstances - // so we don't need to do any additional checking or work - // here and let the Add implementation do all the heavy - // lifting. - // - - dict.Add(keySelector(item), elementSelector(item)); - } - - return dict; - } - - /// - /// Correlates the elements of two sequences based on matching keys. - /// The default equality comparer is used to compare keys. - /// - - public static IEnumerable Join( - this IEnumerable outer, - IEnumerable inner, - Func outerKeySelector, - Func innerKeySelector, - Func resultSelector) - { - return outer.Join(inner, outerKeySelector, innerKeySelector, resultSelector, /* comparer */ null); - } - - /// - /// Correlates the elements of two sequences based on matching keys. - /// The default equality comparer is used to compare keys. A - /// specified is used to compare keys. - /// - - public static IEnumerable Join( - this IEnumerable outer, - IEnumerable inner, - Func outerKeySelector, - Func innerKeySelector, - Func resultSelector, - IEqualityComparer comparer) - { - if (outer == null) throw new ArgumentNullException("outer"); - if (inner == null) throw new ArgumentNullException("inner"); - if (outerKeySelector == null) throw new ArgumentNullException("outerKeySelector"); - if (innerKeySelector == null) throw new ArgumentNullException("innerKeySelector"); - if (resultSelector == null) throw new ArgumentNullException("resultSelector"); - - var lookup = inner.ToLookup(innerKeySelector, comparer); - - return - from o in outer - from i in lookup[outerKeySelector(o)] - select resultSelector(o, i); - } - - /// - /// Correlates the elements of two sequences based on equality of - /// keys and groups the results. The default equality comparer is - /// used to compare keys. - /// - - public static IEnumerable GroupJoin( - this IEnumerable outer, - IEnumerable inner, - Func outerKeySelector, - Func innerKeySelector, - Func, TResult> resultSelector) - { - return outer.GroupJoin(inner, outerKeySelector, innerKeySelector, resultSelector, /* comparer */ null); - } - - /// - /// Correlates the elements of two sequences based on equality of - /// keys and groups the results. The default equality comparer is - /// used to compare keys. A specified - /// is used to compare keys. - /// - - public static IEnumerable GroupJoin( - this IEnumerable outer, - IEnumerable inner, - Func outerKeySelector, - Func innerKeySelector, - Func, TResult> resultSelector, - IEqualityComparer comparer) - { - if (outer == null) throw new ArgumentNullException("outer"); - if (inner == null) throw new ArgumentNullException("inner"); - if (outerKeySelector == null) throw new ArgumentNullException("outerKeySelector"); - if (innerKeySelector == null) throw new ArgumentNullException("innerKeySelector"); - if (resultSelector == null) throw new ArgumentNullException("resultSelector"); - - var lookup = inner.ToLookup(innerKeySelector, comparer); - return outer.Select(o => resultSelector(o, lookup[outerKeySelector(o)])); - } - - private static class Sequence - { - public static readonly IEnumerable Empty = new T[0]; - } - - private sealed class Grouping : List, IGrouping - { - internal Grouping(K key) - { - Key = key; - } - - public K Key { get; private set; } - } - } -} - -// $Id: Enumerable.g.tt 71137f497bf2 2012/04/16 20:01:27 azizatif $ - -namespace System.Linq -{ - #region Imports - - using System; - using System.Collections.Generic; - - #endregion - - // This partial implementation was template-generated: - // Mon, 16 Apr 2012 20:05:53 GMT - - partial class Enumerable - { - /// - /// Computes the sum of a sequence of nullable values. - /// - - public static int Sum( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - int sum = 0; - foreach (var num in source) - sum = checked(sum + num); - - return sum; - } - - /// - /// Computes the sum of a sequence of nullable - /// values that are obtained by invoking a transform function on - /// each element of the input sequence. - /// - - public static int Sum( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Sum(); - } - - /// - /// Computes the average of a sequence of nullable values. - /// - - public static double Average( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - long sum = 0; - long count = 0; - - foreach (var num in source) - checked - { - sum += (int) num; - count++; - } - - if (count == 0) - throw new InvalidOperationException(); - - return (double) sum / count; - } - - /// - /// Computes the average of a sequence of nullable values - /// that are obtained by invoking a transform function on each - /// element of the input sequence. - /// - - public static double Average( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Average(); - } - - - /// - /// Computes the sum of a sequence of values. - /// - - public static int? Sum( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - int sum = 0; - foreach (var num in source) - sum = checked(sum + (num ?? 0)); - - return sum; - } - - /// - /// Computes the sum of a sequence of - /// values that are obtained by invoking a transform function on - /// each element of the input sequence. - /// - - public static int? Sum( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Sum(); - } - - /// - /// Computes the average of a sequence of values. - /// - - public static double? Average( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - long sum = 0; - long count = 0; - - foreach (var num in source.Where(n => n != null)) - checked - { - sum += (int) num; - count++; - } - - if (count == 0) - return null; - - return (double?) sum / count; - } - - /// - /// Computes the average of a sequence of values - /// that are obtained by invoking a transform function on each - /// element of the input sequence. - /// - - public static double? Average( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Average(); - } - - /// - /// Returns the minimum value in a sequence of nullable - /// values. - /// - - public static int? Min( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - return MinMaxImpl(source.Where(x => x != null), null, (min, x) => min < x); - } - - /// - /// Invokes a transform function on each element of a sequence and - /// returns the minimum nullable value. - /// - - public static int? Min( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Min(); - } - - /// - /// Returns the maximum value in a sequence of nullable - /// values. - /// - - public static int? Max( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - return MinMaxImpl(source.Where(x => x != null), - null, (max, x) => x == null || (max != null && x.Value < max.Value)); - } - - /// - /// Invokes a transform function on each element of a sequence and - /// returns the maximum nullable value. - /// - - public static int? Max( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Max(); - } - - /// - /// Computes the sum of a sequence of nullable values. - /// - - public static long Sum( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - long sum = 0; - foreach (var num in source) - sum = checked(sum + num); - - return sum; - } - - /// - /// Computes the sum of a sequence of nullable - /// values that are obtained by invoking a transform function on - /// each element of the input sequence. - /// - - public static long Sum( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Sum(); - } - - /// - /// Computes the average of a sequence of nullable values. - /// - - public static double Average( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - long sum = 0; - long count = 0; - - foreach (var num in source) - checked - { - sum += (long) num; - count++; - } - - if (count == 0) - throw new InvalidOperationException(); - - return (double) sum / count; - } - - /// - /// Computes the average of a sequence of nullable values - /// that are obtained by invoking a transform function on each - /// element of the input sequence. - /// - - public static double Average( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Average(); - } - - - /// - /// Computes the sum of a sequence of values. - /// - - public static long? Sum( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - long sum = 0; - foreach (var num in source) - sum = checked(sum + (num ?? 0)); - - return sum; - } - - /// - /// Computes the sum of a sequence of - /// values that are obtained by invoking a transform function on - /// each element of the input sequence. - /// - - public static long? Sum( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Sum(); - } - - /// - /// Computes the average of a sequence of values. - /// - - public static double? Average( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - long sum = 0; - long count = 0; - - foreach (var num in source.Where(n => n != null)) - checked - { - sum += (long) num; - count++; - } - - if (count == 0) - return null; - - return (double?) sum / count; - } - - /// - /// Computes the average of a sequence of values - /// that are obtained by invoking a transform function on each - /// element of the input sequence. - /// - - public static double? Average( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Average(); - } - - /// - /// Returns the minimum value in a sequence of nullable - /// values. - /// - - public static long? Min( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - return MinMaxImpl(source.Where(x => x != null), null, (min, x) => min < x); - } - - /// - /// Invokes a transform function on each element of a sequence and - /// returns the minimum nullable value. - /// - - public static long? Min( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Min(); - } - - /// - /// Returns the maximum value in a sequence of nullable - /// values. - /// - - public static long? Max( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - return MinMaxImpl(source.Where(x => x != null), - null, (max, x) => x == null || (max != null && x.Value < max.Value)); - } - - /// - /// Invokes a transform function on each element of a sequence and - /// returns the maximum nullable value. - /// - - public static long? Max( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Max(); - } - - /// - /// Computes the sum of a sequence of nullable values. - /// - - public static float Sum( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - float sum = 0; - foreach (var num in source) - sum = checked(sum + num); - - return sum; - } - - /// - /// Computes the sum of a sequence of nullable - /// values that are obtained by invoking a transform function on - /// each element of the input sequence. - /// - - public static float Sum( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Sum(); - } - - /// - /// Computes the average of a sequence of nullable values. - /// - - public static float Average( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - float sum = 0; - long count = 0; - - foreach (var num in source) - checked - { - sum += (float) num; - count++; - } - - if (count == 0) - throw new InvalidOperationException(); - - return (float) sum / count; - } - - /// - /// Computes the average of a sequence of nullable values - /// that are obtained by invoking a transform function on each - /// element of the input sequence. - /// - - public static float Average( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Average(); - } - - - /// - /// Computes the sum of a sequence of values. - /// - - public static float? Sum( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - float sum = 0; - foreach (var num in source) - sum = checked(sum + (num ?? 0)); - - return sum; - } - - /// - /// Computes the sum of a sequence of - /// values that are obtained by invoking a transform function on - /// each element of the input sequence. - /// - - public static float? Sum( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Sum(); - } - - /// - /// Computes the average of a sequence of values. - /// - - public static float? Average( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - float sum = 0; - long count = 0; - - foreach (var num in source.Where(n => n != null)) - checked - { - sum += (float) num; - count++; - } - - if (count == 0) - return null; - - return (float?) sum / count; - } - - /// - /// Computes the average of a sequence of values - /// that are obtained by invoking a transform function on each - /// element of the input sequence. - /// - - public static float? Average( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Average(); - } - - /// - /// Returns the minimum value in a sequence of nullable - /// values. - /// - - public static float? Min( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - return MinMaxImpl(source.Where(x => x != null), null, (min, x) => min < x); - } - - /// - /// Invokes a transform function on each element of a sequence and - /// returns the minimum nullable value. - /// - - public static float? Min( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Min(); - } - - /// - /// Returns the maximum value in a sequence of nullable - /// values. - /// - - public static float? Max( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - return MinMaxImpl(source.Where(x => x != null), - null, (max, x) => x == null || (max != null && x.Value < max.Value)); - } - - /// - /// Invokes a transform function on each element of a sequence and - /// returns the maximum nullable value. - /// - - public static float? Max( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Max(); - } - - /// - /// Computes the sum of a sequence of nullable values. - /// - - public static double Sum( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - double sum = 0; - foreach (var num in source) - sum = checked(sum + num); - - return sum; - } - - /// - /// Computes the sum of a sequence of nullable - /// values that are obtained by invoking a transform function on - /// each element of the input sequence. - /// - - public static double Sum( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Sum(); - } - - /// - /// Computes the average of a sequence of nullable values. - /// - - public static double Average( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - double sum = 0; - long count = 0; - - foreach (var num in source) - checked - { - sum += (double) num; - count++; - } - - if (count == 0) - throw new InvalidOperationException(); - - return (double) sum / count; - } - - /// - /// Computes the average of a sequence of nullable values - /// that are obtained by invoking a transform function on each - /// element of the input sequence. - /// - - public static double Average( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Average(); - } - - - /// - /// Computes the sum of a sequence of values. - /// - - public static double? Sum( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - double sum = 0; - foreach (var num in source) - sum = checked(sum + (num ?? 0)); - - return sum; - } - - /// - /// Computes the sum of a sequence of - /// values that are obtained by invoking a transform function on - /// each element of the input sequence. - /// - - public static double? Sum( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Sum(); - } - - /// - /// Computes the average of a sequence of values. - /// - - public static double? Average( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - double sum = 0; - long count = 0; - - foreach (var num in source.Where(n => n != null)) - checked - { - sum += (double) num; - count++; - } - - if (count == 0) - return null; - - return (double?) sum / count; - } - - /// - /// Computes the average of a sequence of values - /// that are obtained by invoking a transform function on each - /// element of the input sequence. - /// - - public static double? Average( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Average(); - } - - /// - /// Returns the minimum value in a sequence of nullable - /// values. - /// - - public static double? Min( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - return MinMaxImpl(source.Where(x => x != null), null, (min, x) => min < x); - } - - /// - /// Invokes a transform function on each element of a sequence and - /// returns the minimum nullable value. - /// - - public static double? Min( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Min(); - } - - /// - /// Returns the maximum value in a sequence of nullable - /// values. - /// - - public static double? Max( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - return MinMaxImpl(source.Where(x => x != null), - null, (max, x) => x == null || (max != null && x.Value < max.Value)); - } - - /// - /// Invokes a transform function on each element of a sequence and - /// returns the maximum nullable value. - /// - - public static double? Max( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Max(); - } - - /// - /// Computes the sum of a sequence of nullable values. - /// - - public static decimal Sum( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - decimal sum = 0; - foreach (var num in source) - sum = checked(sum + num); - - return sum; - } - - /// - /// Computes the sum of a sequence of nullable - /// values that are obtained by invoking a transform function on - /// each element of the input sequence. - /// - - public static decimal Sum( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Sum(); - } - - /// - /// Computes the average of a sequence of nullable values. - /// - - public static decimal Average( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - decimal sum = 0; - long count = 0; - - foreach (var num in source) - checked - { - sum += (decimal) num; - count++; - } - - if (count == 0) - throw new InvalidOperationException(); - - return (decimal) sum / count; - } - - /// - /// Computes the average of a sequence of nullable values - /// that are obtained by invoking a transform function on each - /// element of the input sequence. - /// - - public static decimal Average( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Average(); - } - - - /// - /// Computes the sum of a sequence of values. - /// - - public static decimal? Sum( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - decimal sum = 0; - foreach (var num in source) - sum = checked(sum + (num ?? 0)); - - return sum; - } - - /// - /// Computes the sum of a sequence of - /// values that are obtained by invoking a transform function on - /// each element of the input sequence. - /// - - public static decimal? Sum( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Sum(); - } - - /// - /// Computes the average of a sequence of values. - /// - - public static decimal? Average( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - decimal sum = 0; - long count = 0; - - foreach (var num in source.Where(n => n != null)) - checked - { - sum += (decimal) num; - count++; - } - - if (count == 0) - return null; - - return (decimal?) sum / count; - } - - /// - /// Computes the average of a sequence of values - /// that are obtained by invoking a transform function on each - /// element of the input sequence. - /// - - public static decimal? Average( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Average(); - } - - /// - /// Returns the minimum value in a sequence of nullable - /// values. - /// - - public static decimal? Min( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - return MinMaxImpl(source.Where(x => x != null), null, (min, x) => min < x); - } - - /// - /// Invokes a transform function on each element of a sequence and - /// returns the minimum nullable value. - /// - - public static decimal? Min( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Min(); - } - - /// - /// Returns the maximum value in a sequence of nullable - /// values. - /// - - public static decimal? Max( - this IEnumerable source) - { - if (source == null) throw new ArgumentNullException("source"); - - return MinMaxImpl(source.Where(x => x != null), - null, (max, x) => x == null || (max != null && x.Value < max.Value)); - } - - /// - /// Invokes a transform function on each element of a sequence and - /// returns the maximum nullable value. - /// - - public static decimal? Max( - this IEnumerable source, - Func selector) - { - return source.Select(selector).Max(); - } - } -} - -// $Id: ExtensionAttribute.cs 898b3d493ed6 2012/04/17 20:09:57 azizatif $ - -namespace System.Runtime.CompilerServices -{ - /// - /// This attribute allows us to define extension methods without - /// requiring .NET Framework 3.5. For more information, see the section, - /// Extension Methods in .NET Framework 2.0 Apps, - /// of Basic Instincts: Extension Methods - /// column in MSDN Magazine, - /// issue Nov 2007. - /// - - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)] - sealed partial class ExtensionAttribute : Attribute { } -} - -// $Id: Func.cs 71137f497bf2 2012/04/16 20:01:27 azizatif $ - -namespace System -{ -#if LINQBRIDGE_LIB - public delegate TResult Func(); - public delegate TResult Func(T a); - public delegate TResult Func(T1 arg1, T2 arg2); - public delegate TResult Func(T1 arg1, T2 arg2, T3 arg3); - public delegate TResult Func(T1 arg1, T2 arg2, T3 arg3, T4 arg4); -#else - delegate TResult Func(); - delegate TResult Func(T a); - delegate TResult Func(T1 arg1, T2 arg2); - delegate TResult Func(T1 arg1, T2 arg2, T3 arg3); - delegate TResult Func(T1 arg1, T2 arg2, T3 arg3, T4 arg4); -#endif -} - -// $Id: IGrouping.cs 71137f497bf2 2012/04/16 20:01:27 azizatif $ - -namespace System.Linq -{ - #region Imports - - using System.Collections.Generic; - - #endregion - - /// - /// Represents a collection of objects that have a common key. - /// - - partial interface IGrouping : IEnumerable - { - /// - /// Gets the key of the . - /// - - TKey Key { get; } - } -} - -// $Id: ILookup.cs 71137f497bf2 2012/04/16 20:01:27 azizatif $ - -namespace System.Linq -{ - using System.Collections.Generic; - - /// - /// Defines an indexer, size property, and Boolean search method for - /// data structures that map keys to - /// sequences of values. - /// - - partial interface ILookup : IEnumerable> - { - bool Contains(TKey key); - int Count { get; } - IEnumerable this[TKey key] { get; } - } -} - -// $Id: Internal.cs 1567e00f1a20 2012/04/17 16:09:51 azizatif $ - -namespace LinqBridge -{ - #region Imports - - using System; - using System.Collections.Generic; - - #endregion - - /// - /// This type is not intended to be used directly from user code. - /// It may be removed or changed in a future version without notice. - /// - - sealed class DelegatingComparer : IComparer - { - private readonly Func _comparer; - - public DelegatingComparer(Func comparer) - { - if (comparer == null) throw new ArgumentNullException("comparer"); - _comparer = comparer; - } - - public int Compare(T x, T y) { return _comparer(x, y); } - } - - /// - /// This type is not intended to be used directly from user code. - /// It may be removed or changed in a future version without notice. - /// - - struct Key - { - public Key(T value) : this() { Value = value; } - public T Value { get; private set; } - } - - /// - /// This type is not intended to be used directly from user code. - /// It may be removed or changed in a future version without notice. - /// - - sealed class KeyComparer : IEqualityComparer> - { - private readonly IEqualityComparer _innerComparer; - - public KeyComparer(IEqualityComparer innerComparer) - { - _innerComparer = innerComparer ?? EqualityComparer.Default; - } - - public bool Equals(Key x, Key y) - { - return _innerComparer.Equals(x.Value, y.Value); - } - - public int GetHashCode(Key obj) - { - return obj.Value == null ? 0 : _innerComparer.GetHashCode(obj.Value); - } - } -} - -// $Id: IOrderedEnumerable.cs 71137f497bf2 2012/04/16 20:01:27 azizatif $ - -namespace System.Linq -{ - using System.Collections.Generic; - - /// - /// Represents a sorted sequence. - /// - - partial interface IOrderedEnumerable : IEnumerable - { - /// - /// Performs a subsequent ordering on the elements of an - /// according to a key. - /// - - IOrderedEnumerable CreateOrderedEnumerable( - Func keySelector, IComparer comparer, bool descending); - } -} - -// $Id: Lookup.cs c08984d432b1 2012/04/17 16:05:19 azizatif $ - -namespace System.Linq -{ - #region Imports - - using System; - using System.Collections; - using System.Collections.Generic; - using IEnumerable=System.Collections.IEnumerable; - using LinqBridge; - - #endregion - - /// - /// Represents a collection of keys each mapped to one or more values. - /// - - internal sealed class Lookup : ILookup - { - private readonly Dictionary, IGrouping> _map; - private readonly List> _orderedKeys; // remember order of insertion - - internal Lookup(IEqualityComparer comparer) - { - _map = new Dictionary, IGrouping>(new KeyComparer(comparer)); - _orderedKeys = new List>(); - } - - internal void Add(IGrouping item) - { - var key = new Key(item.Key); - _map.Add(key, item); - _orderedKeys.Add(key); - } - - internal IEnumerable Find(TKey key) - { - IGrouping grouping; - return _map.TryGetValue(new Key(key), out grouping) ? grouping : null; - } - - /// - /// Gets the number of key/value collection pairs in the . - /// - - public int Count - { - get { return _map.Count; } - } - - /// - /// Gets the collection of values indexed by the specified key. - /// - - public IEnumerable this[TKey key] - { - get - { - IGrouping result; - return _map.TryGetValue(new Key(key), out result) ? result : Enumerable.Empty(); - } - } - - /// - /// Determines whether a specified key is in the . - /// - - public bool Contains(TKey key) - { - return _map.ContainsKey(new Key(key)); - } - - /// - /// Applies a transform function to each key and its associated - /// values and returns the results. - /// - - public IEnumerable ApplyResultSelector( - Func, TResult> resultSelector) - { - if (resultSelector == null) - throw new ArgumentNullException("resultSelector"); - - foreach (var pair in _map) - yield return resultSelector(pair.Key.Value, pair.Value); - } - - /// - /// Returns a generic enumerator that iterates through the . - /// - - public IEnumerator> GetEnumerator() - { - foreach (var key in _orderedKeys) - yield return _map[key]; - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } -} - -// $Id: OrderedEnumerable.cs 71137f497bf2 2012/04/16 20:01:27 azizatif $ - -namespace LinqBridge -{ - #region Imports - - using System; - using System.Collections; - using System.Collections.Generic; - using System.Diagnostics; - using System.Linq; - - #endregion - - internal sealed class OrderedEnumerable : IOrderedEnumerable - { - private readonly IEnumerable _source; - private readonly Func, IComparer> _comparerComposer; - - public OrderedEnumerable(IEnumerable source, - Func keySelector, IComparer comparer, bool descending) : - this(source, (_, next) => next, keySelector, comparer, descending) {} - - private OrderedEnumerable(IEnumerable source, - Func, IComparer> parent, - Func keySelector, IComparer comparer, bool descending) - { - if (source == null) throw new ArgumentNullException("source"); - if (keySelector == null) throw new ArgumentNullException("keySelector"); - Debug.Assert(parent != null); - - _source = source; - - comparer = comparer ?? Comparer.Default; - var direction = descending ? -1 : 1; - - _comparerComposer = (items, next) => - { - Debug.Assert(items != null); - Debug.Assert(next != null); - - var keys = new K[items.Length]; - for (var i = 0; i < items.Length; i++) - keys[i] = keySelector(items[i]); - - return parent(items, new DelegatingComparer((i, j) => - { - var result = direction * comparer.Compare(keys[i], keys[j]); - return result != 0 ? result : next.Compare(i, j); - })); - }; - } - - public IOrderedEnumerable CreateOrderedEnumerable( - Func keySelector, IComparer comparer, bool descending) - { - return new OrderedEnumerable(_source, _comparerComposer, keySelector, comparer, descending); - } - - public IEnumerator GetEnumerator() - { - // - // Sort using Array.Sort but docs say that it performs an - // unstable sort. LINQ, on the other hand, says OrderBy performs - // a stable sort. Use the item position then as a tie - // breaker when all keys compare equal, thus making the sort - // stable. - // - - var items = _source.ToArray(); - var positionComparer = new DelegatingComparer((i, j) => i.CompareTo(j)); - var comparer = _comparerComposer(items, positionComparer); - var keys = new int[items.Length]; - for (var i = 0; i < keys.Length; i++) - keys[i] = i; - Array.Sort(keys, items, comparer); - return ((IEnumerable) items).GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } -} - -// $Id: Action.cs 71137f497bf2 2012/04/16 20:01:27 azizatif $ - -namespace System -{ -#if LINQBRIDGE_LIB - public delegate void Action(); - public delegate void Action(T1 arg1, T2 arg2); - public delegate void Action(T1 arg1, T2 arg2, T3 arg3); - public delegate void Action(T1 arg1, T2 arg2, T3 arg3, T4 arg4); -#else - delegate void Action(); - delegate void Action(T1 arg1, T2 arg2); - delegate void Action(T1 arg1, T2 arg2, T3 arg3); - delegate void Action(T1 arg1, T2 arg2, T3 arg3, T4 arg4); -#endif -} - diff --git a/Saleslogix.SData.Client/LinqToXml/Extensions.cs b/Saleslogix.SData.Client/LinqToXml/Extensions.cs deleted file mode 100644 index 5ef37901..00000000 --- a/Saleslogix.SData.Client/LinqToXml/Extensions.cs +++ /dev/null @@ -1,176 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.CompilerServices; - -namespace System.Xml.Linq -{ - internal static class Extensions - { - public static IEnumerable Ancestors (this IEnumerable source) where T : XNode - { - foreach (T item in source) - for (XElement n = item.Parent as XElement; n != null; n = n.Parent as XElement) - yield return n; - } - - public static IEnumerable Ancestors (this IEnumerable source, XName name) where T : XNode - { - foreach (T item in source) - for (XElement n = item.Parent as XElement; n != null; n = n.Parent as XElement) - if (n.Name == name) - yield return n; - } - - public static IEnumerable AncestorsAndSelf (this IEnumerable source) - { - foreach (XElement item in source) - for (XElement n = item as XElement; n != null; n = n.Parent as XElement) - yield return n; - } - - public static IEnumerable AncestorsAndSelf (this IEnumerable source, XName name) - { - foreach (XElement item in source) - for (XElement n = item as XElement; n != null; n = n.Parent as XElement) - if (n.Name == name) - yield return n; - } - - public static IEnumerable Attributes (this IEnumerable source) - { - foreach (XElement item in source) - foreach (XAttribute attr in item.Attributes ()) - yield return attr; - } - - public static IEnumerable Attributes (this IEnumerable source, XName name) - { - foreach (XElement item in source) - foreach (XAttribute attr in item.Attributes (name)) - yield return attr; - } - - public static IEnumerable DescendantNodes ( - this IEnumerable source) where T : XContainer - { - foreach (XContainer item in source) - foreach (XNode n in item.DescendantNodes ()) - yield return n; - } - - public static IEnumerable DescendantNodesAndSelf ( - this IEnumerable source) - { - foreach (XElement item in source) - foreach (XNode n in item.DescendantNodesAndSelf ()) - yield return n; - } - - public static IEnumerable Descendants ( - this IEnumerable source) where T : XContainer - { - foreach (XContainer item in source) - foreach (XElement n in item.Descendants ()) - yield return n; - } - - public static IEnumerable Descendants ( - this IEnumerable source, XName name) where T : XContainer - { - foreach (XContainer item in source) - foreach (XElement n in item.Descendants (name)) - yield return n; - } - - public static IEnumerable DescendantsAndSelf ( - this IEnumerable source) - { - foreach (XElement item in source) - foreach (XElement n in item.DescendantsAndSelf ()) - yield return n; - } - - public static IEnumerable DescendantsAndSelf ( - this IEnumerable source, XName name) - { - foreach (XElement item in source) - foreach (XElement n in item.DescendantsAndSelf (name)) - yield return n; - } - - public static IEnumerable Elements ( - this IEnumerable source) where T : XContainer - { - foreach (XContainer item in source) - foreach (XElement n in item.Elements ()) - yield return n; - } - - public static IEnumerable Elements ( - this IEnumerable source, XName name) where T : XContainer - { - foreach (XContainer item in source) - foreach (XElement n in item.Elements (name)) - yield return n; - } - - public static IEnumerable InDocumentOrder ( - this IEnumerable source) where T : XNode - { - List list = new List (); - foreach (XNode n in source) - list.Add (n); - list.Sort (XNode.DocumentOrderComparer); - foreach (T n in list) - yield return n; - } - - public static IEnumerable Nodes ( - this IEnumerable source) where T : XContainer - { - foreach (XContainer item in source) - foreach (XNode n in item.Nodes ()) - yield return n; - } - - public static void Remove (this IEnumerable source) - { - foreach (XAttribute item in source) - item.Remove (); - } - - public static void Remove (this IEnumerable source) where T : XNode - { - var l = new List (source); - foreach (T item in l) - item.Remove (); - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/LoadOptions.cs b/Saleslogix.SData.Client/LinqToXml/LoadOptions.cs deleted file mode 100644 index d5e0d6aa..00000000 --- a/Saleslogix.SData.Client/LinqToXml/LoadOptions.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Xml.Linq -{ - [Flags] - internal enum LoadOptions - { - None = 0, - PreserveWhitespace = 1, - SetBaseUri = 2, - SetLineInfo = 4, - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/SaveOptions.cs b/Saleslogix.SData.Client/LinqToXml/SaveOptions.cs deleted file mode 100644 index be089d6b..00000000 --- a/Saleslogix.SData.Client/LinqToXml/SaveOptions.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Xml.Linq -{ - [Flags] - internal enum SaveOptions - { - None = 0, - DisableFormatting = 1, -#if NET_4_0 - OmitDuplicateNamespaces = 2 -#endif - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XAttribute.cs b/Saleslogix.SData.Client/LinqToXml/XAttribute.cs deleted file mode 100644 index 873a2ad0..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XAttribute.cs +++ /dev/null @@ -1,344 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections.Generic; -using System.Text; -using System.Xml; - -namespace System.Xml.Linq -{ - internal class XAttribute : XObject - { - static readonly XAttribute [] empty_array = new XAttribute [0]; - - public static IEnumerable EmptySequence { - get { return empty_array; } - } - - XName name; - string value; - XAttribute next; - XAttribute previous; - - public XAttribute (XAttribute other) - { - if (other == null) - throw new ArgumentNullException ("other"); - name = other.name; - value = other.value; - } - - public XAttribute (XName name, object value) - { - if (name == null) - throw new ArgumentNullException ("name"); - this.name = name; - SetValue (value); - } - - public static explicit operator bool (XAttribute attribute) - { - if (attribute == null) - throw new ArgumentNullException ("attribute"); - return XUtil.ConvertToBoolean (attribute.value); - } - - public static explicit operator bool? (XAttribute attribute) - { - if (attribute == null) - return null; - - return attribute.value == null ? (bool?) null : XUtil.ConvertToBoolean (attribute.value); - } - - public static explicit operator DateTime (XAttribute attribute) - { - if (attribute == null) - throw new ArgumentNullException ("attribute"); - return XUtil.ToDateTime (attribute.value); - } - - public static explicit operator DateTime? (XAttribute attribute) - { - if (attribute == null) - return null; - - return attribute.value == null ? (DateTime?) null : XUtil.ToDateTime (attribute.value); - } - -#if !TARGET_JVM // Same as for System.Xml.XmlConvert.ToDateTimeOffset - - public static explicit operator DateTimeOffset (XAttribute attribute) - { - if (attribute == null) - throw new ArgumentNullException ("attribute"); - return XmlConvert.ToDateTimeOffset (attribute.value); - } - - public static explicit operator DateTimeOffset? (XAttribute attribute) - { - if (attribute == null) - return null; - - return attribute.value == null ? (DateTimeOffset?) null : XmlConvert.ToDateTimeOffset (attribute.value); - } - -#endif - - public static explicit operator decimal (XAttribute attribute) - { - if (attribute == null) - throw new ArgumentNullException ("attribute"); - return XmlConvert.ToDecimal (attribute.value); - } - - public static explicit operator decimal? (XAttribute attribute) - { - if (attribute == null) - return null; - - return attribute.value == null ? (decimal?) null : XmlConvert.ToDecimal (attribute.value); - } - - public static explicit operator double (XAttribute attribute) - { - if (attribute == null) - throw new ArgumentNullException ("attribute"); - return XmlConvert.ToDouble (attribute.value); - } - - public static explicit operator double? (XAttribute attribute) - { - if (attribute == null) - return null; - - return attribute.value == null ? (double?) null : XmlConvert.ToDouble (attribute.value); - } - - public static explicit operator float (XAttribute attribute) - { - if (attribute == null) - throw new ArgumentNullException ("attribute"); - return XmlConvert.ToSingle (attribute.value); - } - - public static explicit operator float? (XAttribute attribute) - { - if (attribute == null) - return null; - - return attribute.value == null ? (float?) null : XmlConvert.ToSingle (attribute.value); - } - - public static explicit operator Guid (XAttribute attribute) - { - if (attribute == null) - throw new ArgumentNullException ("attribute"); - return XmlConvert.ToGuid (attribute.value); - } - - public static explicit operator Guid? (XAttribute attribute) - { - if (attribute == null) - return null; - - return attribute.value == null ? (Guid?) null : XmlConvert.ToGuid (attribute.value); - } - - public static explicit operator int (XAttribute attribute) - { - if (attribute == null) - throw new ArgumentNullException ("attribute"); - return XmlConvert.ToInt32 (attribute.value); - } - - public static explicit operator int? (XAttribute attribute) - { - if (attribute == null) - return null; - - return attribute.value == null ? (int?) null : XmlConvert.ToInt32 (attribute.value); - } - - public static explicit operator long (XAttribute attribute) - { - if (attribute == null) - throw new ArgumentNullException ("attribute"); - return XmlConvert.ToInt64 (attribute.value); - } - - public static explicit operator long? (XAttribute attribute) - { - if (attribute == null) - return null; - - return attribute.value == null ? (long?) null : XmlConvert.ToInt64 (attribute.value); - } - - public static explicit operator uint (XAttribute attribute) - { - if (attribute == null) - throw new ArgumentNullException ("attribute"); - return XmlConvert.ToUInt32 (attribute.value); - } - - public static explicit operator uint? (XAttribute attribute) - { - if (attribute == null) - return null; - - return attribute.value == null ? (uint?) null : XmlConvert.ToUInt32 (attribute.value); - } - - public static explicit operator ulong (XAttribute attribute) - { - if (attribute == null) - throw new ArgumentNullException ("attribute"); - return XmlConvert.ToUInt64 (attribute.value); - } - - public static explicit operator ulong? (XAttribute attribute) - { - if (attribute == null) - return null; - - return attribute.value == null ? (ulong?) null : XmlConvert.ToUInt64 (attribute.value); - } - - public static explicit operator TimeSpan (XAttribute attribute) - { - if (attribute == null) - throw new ArgumentNullException ("attribute"); - return XmlConvert.ToTimeSpan (attribute.value); - } - - public static explicit operator TimeSpan? (XAttribute attribute) - { - if (attribute == null) - return null; - - return attribute.value == null ? (TimeSpan?) null : XmlConvert.ToTimeSpan (attribute.value); - } - - public static explicit operator string (XAttribute attribute) - { - if (attribute == null) - return null; - - return attribute.value; - } - - public bool IsNamespaceDeclaration { - get { return name.Namespace == XNamespace.Xmlns || (name.LocalName == "xmlns" && name.Namespace == XNamespace.None); } - } - - public XName Name { - get { return name; } - } - - public XAttribute NextAttribute { - get { return next; } - internal set { next = value; } - } - - public override XmlNodeType NodeType { - get { return XmlNodeType.Attribute; } - } - - public XAttribute PreviousAttribute { - get { return previous; } - internal set { previous = value; } - } - - public string Value { - get { return XUtil.ToString (value); } - set { SetValue (value); } - } - - public void Remove () - { - if (Parent != null) { - var owner = Owner; - owner.OnRemovingObject (this); - if (next != null) - next.previous = previous; - if (previous != null) - previous.next = next; - if (Parent.FirstAttribute == this) - Parent.FirstAttribute = next; - if (Parent.LastAttribute == this) - Parent.LastAttribute = previous; - SetOwner (null); - owner.OnRemovedObject (this); - } - next = null; - previous = null; - } - - public void SetValue (object value) - { - if (value == null) - throw new ArgumentNullException ("value"); - - OnValueChanging (this); - this.value = XUtil.ToString (value); - OnValueChanged (this); - } - - static readonly char [] escapeChars = new char [] {'<', '>', '&', '"', '\r', '\n', '\t'}; - - public override string ToString () - { - StringBuilder sb = new StringBuilder (); - sb.Append (name.ToString ()); - sb.Append ("=\""); - int start = 0; - do { - int idx = value.IndexOfAny (escapeChars, start); - if (idx < 0) { - if (start > 0) - sb.Append (value, start, value.Length - start); - else - sb.Append (value); - sb.Append ("\""); - return sb.ToString (); - } - sb.Append (value, start, idx - start); - switch (value [idx]) { - case '&': sb.Append ("&"); break; - case '<': sb.Append ("<"); break; - case '>': sb.Append (">"); break; - case '"': sb.Append ("""); break; - case '\r': sb.Append (" "); break; - case '\n': sb.Append (" "); break; - case '\t': sb.Append (" "); break; - } - start = idx + 1; - } while (true); - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XCData.cs b/Saleslogix.SData.Client/LinqToXml/XCData.cs deleted file mode 100644 index db63ee52..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XCData.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Xml; - -namespace System.Xml.Linq -{ - internal class XCData : XText - { - public XCData (string value) - : base (value) - { - } - - public XCData (XCData other) - : base (other) - { - } - - public override XmlNodeType NodeType { - get { return XmlNodeType.CDATA; } - } - - public override void WriteTo (XmlWriter writer) - { - int start = 0; - StringBuilder sb = null; - for (int i = 0; i < Value.Length - 2; i++) { - if (Value [i] == ']' && Value [i + 1] == ']' - && Value [i + 2] == '>') { - if (sb == null) - sb = new StringBuilder (); - sb.Append (Value, start, i - start); - sb.Append ("]]>"); - start = i + 3; - } - } - if (start != 0 && start != Value.Length) - sb.Append (Value, start, Value.Length - start); - writer.WriteCData (sb == null ? Value : sb.ToString ()); - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XComment.cs b/Saleslogix.SData.Client/LinqToXml/XComment.cs deleted file mode 100644 index 6d8c0649..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XComment.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Xml; - -namespace System.Xml.Linq -{ - internal class XComment : XNode - { - string value; - - public XComment (string value) - { - this.value = value; - } - - public XComment (XComment other) - { - this.value = other.value; - } - - public override XmlNodeType NodeType { - get { return XmlNodeType.Comment; } - } - - public string Value { - get { return value; } - set { this.value = value; } - } - - public override void WriteTo (XmlWriter writer) - { - writer.WriteComment (value); - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XContainer.cs b/Saleslogix.SData.Client/LinqToXml/XContainer.cs deleted file mode 100644 index 67878cba..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XContainer.cs +++ /dev/null @@ -1,235 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Xml; - -namespace System.Xml.Linq -{ - internal abstract class XContainer : XNode - { - internal XContainer () - { - } - - XNode first; - XNode last; - - public XNode FirstNode { - get { return first; } - internal set { first = value; } - } - - public XNode LastNode { - get { return last; } - internal set { last = value; } - } - - void CheckChildType (object o, bool addFirst) - { - if (o == null || o is string || o is XNode) - return; - if (o is IEnumerable) { - foreach (object oc in ((IEnumerable) o)) - CheckChildType (oc, addFirst); - return; - } - else - throw new ArgumentException ("Invalid child type: " + o.GetType ()); - } - - public void Add (object content) - { - if (content == null) - return; - - foreach (object o in XUtil.ExpandArray (content)) - { - if (!OnAddingObject (o, false, last, false)) - { - var node = XUtil.ToNode (o); - OnAddingObject (node); - AddNode (node); - OnAddedObject (node); - } - } - } - - void AddNode (XNode n) - { - CheckChildType (n, false); - n = (XNode) XUtil.GetDetachedObject (n); - n.SetOwner (this); - if (first == null) - last = first = n; - else { - last.NextNode = n; - n.PreviousNode = last; - last = n; - } - } - - public void Add (params object [] content) - { - if (content == null) - return; - foreach (object o in XUtil.ExpandArray (content)) - Add (o); - } - - public void AddFirst (object content) - { - if (first == null) - Add (content); - else - first.AddBeforeSelf (XUtil.ExpandArray (content)); - } - - public void AddFirst (params object [] content) - { - if (content == null) - return; - if (first == null) - Add (content); - else - foreach (object o in XUtil.ExpandArray (content)) - if (!OnAddingObject (o, false, first.PreviousNode, true)) - first.AddBeforeSelf (o); - } - - internal virtual bool OnAddingObject (object o, bool rejectAttribute, XNode refNode, bool addFirst) - { - return false; - } - - public XmlWriter CreateWriter () - { - return new XNodeWriter (this); - } - - public IEnumerable Nodes () - { - XNode next; - for (XNode n = FirstNode; n != null; n = next) { - next = n.NextNode; - yield return n; - } - } - - public IEnumerable DescendantNodes () - { - foreach (XNode n in Nodes ()) { - yield return n; - XContainer c = n as XContainer; - if (c != null) - foreach (XNode d in c.DescendantNodes ()) - yield return d; - } - } - - public IEnumerable Descendants () - { - foreach (XNode n in DescendantNodes ()) { - XElement el = n as XElement; - if (el != null) - yield return el; - } - } - - public IEnumerable Descendants (XName name) - { - foreach (XElement el in Descendants ()) - if (el.Name == name) - yield return el; - } - - public IEnumerable Elements () - { - foreach (XNode n in Nodes ()) { - XElement el = n as XElement; - if (el != null) - yield return el; - } - } - - public IEnumerable Elements (XName name) - { - foreach (XElement el in Elements ()) - if (el.Name == name) - yield return el; - } - - public XElement Element (XName name) - { - foreach (XElement el in Elements ()) - if (el.Name == name) - return el; - return null; - } - - internal void ReadContentFrom (XmlReader reader, LoadOptions options) - { - while (!reader.EOF) { - if (reader.NodeType == XmlNodeType.EndElement) - // end of the element. - break; - Add (XNode.ReadFrom (reader, options)); - } - } - - public void RemoveNodes () - { - foreach (XNode n in Nodes ()) - n.Remove (); - } - - public void ReplaceNodes (object content) - { - // First, it creates a snapshot copy, then removes the contents, and then adds the copy. http://msdn.microsoft.com/en-us/library/system.xml.linq.xcontainer.replacenodes.aspx - - if (FirstNode == null) { - Add (content); - return; - } - - var l = new List (); - foreach (var obj in XUtil.ExpandArray (content)) - l.Add (obj); - - RemoveNodes (); - Add (l); - } - - public void ReplaceNodes (params object [] content) - { - ReplaceNodes ((object) content); - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XDeclaration.cs b/Saleslogix.SData.Client/LinqToXml/XDeclaration.cs deleted file mode 100644 index 88b9af22..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XDeclaration.cs +++ /dev/null @@ -1,101 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Xml; - -namespace System.Xml.Linq -{ - internal class XDeclaration - { - string encoding, standalone, version; - - public XDeclaration (string version, string encoding, string standalone) - { - this.version = version; - this.encoding = encoding; - this.standalone = standalone; - } - - public XDeclaration (XDeclaration other) - { - if (other == null) - throw new ArgumentNullException ("other"); - this.version = other.version; - this.encoding = other.encoding; - this.standalone = other.standalone; - } - - public string Encoding { - get { return encoding; } - set { encoding = value; } - } - - public string Standalone { - get { return standalone; } - set { standalone = value; } - } - - public string Version { - get { return version; } - set { version = value; } - } - - public override string ToString () - { - return String.Concat (""); - } - - /* - public override void WriteTo (XmlWriter w) - { - StringBuilder sb = new StringBuilder (); - sb.AppendFormat ("version=\"{0}\"", version); - if (encoding != null) - sb.AppendFormat (" encoding=\"{0}\"", encoding); - if (standalone != null) - sb.AppendFormat (" standalone=\"{0}\"", standalone); - // "xml" is not allowed PI, but because of nasty - // XmlWriter API design it must pass. - w.WriteProcessingInstruction ("xml", sb.ToString ()); - } - */ - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XDocument.cs b/Saleslogix.SData.Client/LinqToXml/XDocument.cs deleted file mode 100644 index 7a1c52af..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XDocument.cs +++ /dev/null @@ -1,292 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Xml; -using System.Xml.Schema; -using System.Xml.Serialization; - -namespace System.Xml.Linq -{ - internal class XDocument : XContainer - { - XDeclaration xmldecl; - - public XDocument () - { - } - - public XDocument (params object [] content) - { - Add (content); - } - - public XDocument (XDeclaration declaration, params object [] content) - { - Declaration = declaration; - Add (content); - } - - public XDocument (XDocument other) - { - foreach (object o in other.Nodes ()) - Add (XUtil.Clone (o)); - } - - public XDeclaration Declaration { - get { return xmldecl; } - set { xmldecl = value; } - } - - public XDocumentType DocumentType { - get { - foreach (object o in Nodes ()) - if (o is XDocumentType) - return (XDocumentType) o; - return null; - } - } - - public override XmlNodeType NodeType { - get { return XmlNodeType.Document; } - } - - public XElement Root { - get { - foreach (object o in Nodes ()) - if (o is XElement) - return (XElement) o; - return null; - } - } - - public static XDocument Load (string uri) - { - return Load (uri, LoadOptions.None); - } - - public static XDocument Load (string uri, LoadOptions options) - { - XmlReaderSettings s = new XmlReaderSettings (); - s.ProhibitDtd = false; // see XNodeNavigatorTest.MoveToId(). - s.IgnoreWhitespace = (options & LoadOptions.PreserveWhitespace) == 0; - using (XmlReader r = XmlReader.Create (uri, s)) { - return LoadCore (r, options); - } - } - - public static XDocument Load (Stream stream) - { - return Load (new StreamReader (stream), LoadOptions.None); - } - - public static XDocument Load (Stream stream, LoadOptions options) - { - return Load (new StreamReader (stream), options); - } - - public static XDocument Load (TextReader textReader) - { - return Load (textReader, LoadOptions.None); - } - - public static XDocument Load (TextReader textReader, LoadOptions options) - { - XmlReaderSettings s = new XmlReaderSettings (); - s.ProhibitDtd = false; // see XNodeNavigatorTest.MoveToId(). - s.IgnoreWhitespace = (options & LoadOptions.PreserveWhitespace) == 0; - using (XmlReader r = XmlReader.Create (textReader, s)) { - return LoadCore (r, options); - } - } - - public static XDocument Load (XmlReader reader) - { - return Load (reader, LoadOptions.None); - } - - public static XDocument Load (XmlReader reader, LoadOptions options) - { - XmlReaderSettings s = reader.Settings != null ? reader.Settings.Clone () : new XmlReaderSettings (); - s.IgnoreWhitespace = (options & LoadOptions.PreserveWhitespace) == 0; - using (XmlReader r = XmlReader.Create (reader, s)) { - return LoadCore (r, options); - } - } - - static XDocument LoadCore (XmlReader reader, LoadOptions options) - { - XDocument doc = new XDocument (); - doc.ReadContent (reader, options); - return doc; - } - - void ReadContent (XmlReader reader, LoadOptions options) - { - if (reader.ReadState == ReadState.Initial) - reader.Read (); - this.FillLineInfoAndBaseUri (reader, options); - if (reader.NodeType == XmlNodeType.XmlDeclaration) { - Declaration = new XDeclaration ( - reader.GetAttribute ("version"), - reader.GetAttribute ("encoding"), - reader.GetAttribute ("standalone")); - reader.Read (); - } - ReadContentFrom (reader, options); - if (Root == null) - throw new InvalidOperationException ("The document element is missing."); - } - - static void ValidateWhitespace (string s) - { - for (int i = 0; i < s.Length; i++) - switch (s [i]) { - case ' ': case '\t': case '\n': case '\r': - continue; - default: - throw new ArgumentException ("Non-whitespace text appears directly in the document."); - } - } - - public static XDocument Parse (string text) - { - return Parse (text, LoadOptions.None); - } - - public static XDocument Parse (string text, LoadOptions options) - { - return Load (new StringReader (text), options); - } - - public void Save (string fileName) - { - Save (fileName, SaveOptions.None); - } - - public void Save (string fileName, SaveOptions options) - { - XmlWriterSettings s = new XmlWriterSettings (); - if ((options & SaveOptions.DisableFormatting) == SaveOptions.None) - s.Indent = true; -#if NET_4_0 - if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces) - s.NamespaceHandling |= NamespaceHandling.OmitDuplicates; -#endif - - using (XmlWriter w = XmlWriter.Create (fileName, s)) { - Save (w); - } - } - - public void Save (TextWriter textWriter) - { - Save (textWriter, SaveOptions.None); - } - - public void Save (TextWriter textWriter, SaveOptions options) - { - XmlWriterSettings s = new XmlWriterSettings (); - if ((options & SaveOptions.DisableFormatting) == SaveOptions.None) - s.Indent = true; -#if NET_4_0 - if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces) - s.NamespaceHandling |= NamespaceHandling.OmitDuplicates; -#endif - using (XmlWriter w = XmlWriter.Create (textWriter, s)) { - Save (w); - } - } - - public void Save (XmlWriter writer) - { - WriteTo (writer); - } - - public override void WriteTo (XmlWriter writer) - { - if (xmldecl != null && xmldecl.Standalone != null) - writer.WriteStartDocument (xmldecl.Standalone == "yes"); - else - writer.WriteStartDocument (); - foreach (XNode node in Nodes ()) - node.WriteTo (writer); - } - - internal override bool OnAddingObject (object obj, bool rejectAttribute, XNode refNode, bool addFirst) - { - VerifyAddedNode (obj, addFirst); - return false; - } - - void VerifyAddedNode (object node, bool addFirst) - { - if (node == null) - throw new InvalidOperationException ("Only a node is allowed here"); - - if (node is string) - ValidateWhitespace ((string) node); - if (node is XText) - ValidateWhitespace (((XText) node).Value); - else if (node is XDocumentType) { - if (DocumentType != null) - throw new InvalidOperationException ("There already is another document type declaration"); - if (Root != null && !addFirst) - throw new InvalidOperationException ("A document type cannot be added after the document element"); - } - else if (node is XElement) { - if (Root != null) - throw new InvalidOperationException ("There already is another document element"); - if (DocumentType != null && addFirst) - throw new InvalidOperationException ("An element cannot be added before the document type declaration"); - } - } -#if NET_4_0 - public void Save (Stream stream) - { - Save (stream, SaveOptions.None); - } - - public void Save (Stream stream, SaveOptions options) - { - XmlWriterSettings s = new XmlWriterSettings (); - if ((options & SaveOptions.DisableFormatting) == SaveOptions.None) - s.Indent = true; - if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces) - s.NamespaceHandling |= NamespaceHandling.OmitDuplicates; - - using (var writer = XmlWriter.Create (stream, s)){ - Save (writer); - } - } - -#endif - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XDocumentType.cs b/Saleslogix.SData.Client/LinqToXml/XDocumentType.cs deleted file mode 100644 index 0fda050f..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XDocumentType.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Xml; - -namespace System.Xml.Linq -{ - internal class XDocumentType : XNode - { - string name, pubid, sysid, intSubset; - - public XDocumentType (string name, string publicId, string systemId, string internalSubset) - { - this.name = name; - pubid = publicId; - sysid = systemId; - intSubset = internalSubset; - } - - public XDocumentType (XDocumentType other) - { - if (other == null) - throw new ArgumentNullException ("other"); - name = other.name; - pubid = other.pubid; - sysid = other.sysid; - intSubset = other.intSubset; - } - - public string Name { - get { return name; } - set { - if (value == null) - throw new ArgumentNullException ("value"); - name = value; - } - } - - public string PublicId { - get { return pubid; } - set { - if (value == null) - throw new ArgumentNullException ("value"); - pubid = value; - } - } - - public string SystemId { - get { return sysid; } - set { - if (value == null) - throw new ArgumentNullException ("value"); - sysid = value; - } - } - - public string InternalSubset { - get { return intSubset; } - set { - if (value == null) - throw new ArgumentNullException ("value"); - intSubset = value; - } - } - - public override XmlNodeType NodeType { - get { return XmlNodeType.DocumentType; } - } - - public override void WriteTo (XmlWriter writer) - { - XDocument doc = Document; - XElement root = doc.Root; - if (root != null) - writer.WriteDocType (root.Name.LocalName, pubid, sysid, intSubset); - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XElement.cs b/Saleslogix.SData.Client/LinqToXml/XElement.cs deleted file mode 100644 index fe846769..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XElement.cs +++ /dev/null @@ -1,818 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Xml; -using System.Xml.Schema; -using System.Xml.Serialization; - -namespace System.Xml.Linq -{ - [XmlSchemaProvider (null, IsAny = true)] - internal class XElement : XContainer, IXmlSerializable - { - static IEnumerable emptySequence = - new List (); - - public static IEnumerable EmptySequence { - get { return emptySequence; } - } - - XName name; - XAttribute attr_first, attr_last; - bool explicit_is_empty = true; - - public XElement (XName name, object content) - { - if (name == null) - throw new ArgumentNullException ("name"); - this.name = name; - Add (content); - } - - public XElement (XElement other) - { - if (other == null) - throw new ArgumentNullException ("other"); - name = other.name; - Add (other.Attributes ()); - Add (other.Nodes ()); - } - - public XElement (XName name) - { - if (name == null) - throw new ArgumentNullException ("name"); - this.name = name; - } - - public XElement (XName name, params object [] content) - { - if (name == null) - throw new ArgumentNullException ("name"); - this.name = name; - Add (content); - } - - public XElement (XStreamingElement other) - { - if (other == null) - throw new ArgumentNullException ("other"); - this.name = other.Name; - Add (other.Contents); - } - - public static explicit operator bool (XElement element) - { - if (element == null) - throw new ArgumentNullException ("element"); - return XUtil.ConvertToBoolean (element.Value); - } - - public static explicit operator bool? (XElement element) - { - if (element == null) - return null; - - return element.Value == null ? (bool?) null : XUtil.ConvertToBoolean (element.Value); - } - - public static explicit operator DateTime (XElement element) - { - if (element == null) - throw new ArgumentNullException ("element"); - return XUtil.ToDateTime (element.Value); - } - - public static explicit operator DateTime? (XElement element) - { - if (element == null) - return null; - - return element.Value == null ? (DateTime?) null : XUtil.ToDateTime (element.Value); - } - -#if !TARGET_JVM // Same as for System.Xml.XmlConvert.ToDateTimeOffset - - public static explicit operator DateTimeOffset (XElement element) - { - if (element == null) - throw new ArgumentNullException ("element"); - return XmlConvert.ToDateTimeOffset (element.Value); - } - - public static explicit operator DateTimeOffset? (XElement element) - { - if (element == null) - return null; - - return element.Value == null ? (DateTimeOffset?) null : XmlConvert.ToDateTimeOffset (element.Value); - } - -#endif - - public static explicit operator decimal (XElement element) - { - if (element == null) - throw new ArgumentNullException ("element"); - return XmlConvert.ToDecimal (element.Value); - } - - public static explicit operator decimal? (XElement element) - { - if (element == null) - return null; - - return element.Value == null ? (decimal?) null : XmlConvert.ToDecimal (element.Value); - } - - public static explicit operator double (XElement element) - { - if (element == null) - throw new ArgumentNullException ("element"); - return XmlConvert.ToDouble (element.Value); - } - - public static explicit operator double? (XElement element) - { - if (element == null) - return null; - - return element.Value == null ? (double?) null : XmlConvert.ToDouble (element.Value); - } - - public static explicit operator float (XElement element) - { - if (element == null) - throw new ArgumentNullException ("element"); - return XmlConvert.ToSingle (element.Value); - } - - public static explicit operator float? (XElement element) - { - if (element == null) - return null; - - return element.Value == null ? (float?) null : XmlConvert.ToSingle (element.Value); - } - - public static explicit operator Guid (XElement element) - { - if (element == null) - throw new ArgumentNullException ("element"); - return XmlConvert.ToGuid (element.Value); - } - - public static explicit operator Guid? (XElement element) - { - if (element == null) - return null; - - return element.Value == null ? (Guid?) null : XmlConvert.ToGuid (element.Value); - } - - public static explicit operator int (XElement element) - { - if (element == null) - throw new ArgumentNullException ("element"); - return XmlConvert.ToInt32 (element.Value); - } - - public static explicit operator int? (XElement element) - { - if (element == null) - return null; - - return element.Value == null ? (int?) null : XmlConvert.ToInt32 (element.Value); - } - - public static explicit operator long (XElement element) - { - if (element == null) - throw new ArgumentNullException ("element"); - return XmlConvert.ToInt64 (element.Value); - } - - public static explicit operator long? (XElement element) - { - if (element == null) - return null; - - return element.Value == null ? (long?) null : XmlConvert.ToInt64 (element.Value); - } - - public static explicit operator uint (XElement element) - { - if (element == null) - throw new ArgumentNullException ("element"); - return XmlConvert.ToUInt32 (element.Value); - } - - public static explicit operator uint? (XElement element) - { - if (element == null) - return null; - - return element.Value == null ? (uint?) null : XmlConvert.ToUInt32 (element.Value); - } - - public static explicit operator ulong (XElement element) - { - if (element == null) - throw new ArgumentNullException ("element"); - return XmlConvert.ToUInt64 (element.Value); - } - - public static explicit operator ulong? (XElement element) - { - if (element == null) - return null; - - return element.Value == null ? (ulong?) null : XmlConvert.ToUInt64 (element.Value); - } - - public static explicit operator TimeSpan (XElement element) - { - if (element == null) - throw new ArgumentNullException ("element"); - return XmlConvert.ToTimeSpan (element.Value); - } - - public static explicit operator TimeSpan? (XElement element) - { - if (element == null) - return null; - - return element.Value == null ? (TimeSpan?) null : XmlConvert.ToTimeSpan (element.Value); - } - - public static explicit operator string (XElement element) - { - if (element == null) - return null; - - return element.Value; - } - - public XAttribute FirstAttribute { - get { return attr_first; } - internal set { attr_first = value; } - } - - public XAttribute LastAttribute { - get { return attr_last; } - internal set { attr_last = value; } - } - - public bool HasAttributes { - get { return attr_first != null; } - } - - public bool HasElements { - get { - foreach (object o in Nodes ()) - if (o is XElement) - return true; - return false; - } - } - - public bool IsEmpty { - get { return !Nodes ().GetEnumerator ().MoveNext () && explicit_is_empty; } - internal set { explicit_is_empty = value; } - } - - public XName Name { - get { return name; } - set { - if (value == null) - throw new ArgumentNullException ("Name"); - OnNameChanging (this); - name = value; - OnNameChanged (this); - } - } - - public override XmlNodeType NodeType { - get { return XmlNodeType.Element; } - } - - public string Value { - get { - StringBuilder sb = null; - foreach (XNode n in Nodes ()) { - if (sb == null) - sb = new StringBuilder (); - if (n is XText) - sb.Append (((XText) n).Value); - else if (n is XElement) - sb.Append (((XElement) n).Value); - } - return sb == null ? String.Empty : sb.ToString (); - } - set { - RemoveNodes (); - Add (value); - } - } - - IEnumerable GetAncestorList (XName name, bool getMeIn) - { - List list = new List (); - if (getMeIn) - list.Add (this); - for (XElement el = Parent as XElement; el != null; el = el.Parent as XElement) - if (name == null || el.Name == name) - list.Add (el); - return list; - } - - public XAttribute Attribute (XName name) - { - foreach (XAttribute a in Attributes ()) - if (a.Name == name) - return a; - return null; - } - - public IEnumerable Attributes () - { - XAttribute next; - for (XAttribute a = attr_first; a != null; a = next) { - next = a.NextAttribute; - yield return a; - } - } - - // huh? - public IEnumerable Attributes (XName name) - { - foreach (XAttribute a in Attributes ()) - if (a.Name == name) - yield return a; - } - - static void DefineDefaultSettings (XmlReaderSettings settings, LoadOptions options) - { - settings.ProhibitDtd = false; - - settings.IgnoreWhitespace = (options & LoadOptions.PreserveWhitespace) == 0; - } - - static XmlReaderSettings CreateDefaultSettings (LoadOptions options) - { - var settings = new XmlReaderSettings (); - DefineDefaultSettings (settings, options); - return settings; - } - - public static XElement Load (string uri) - { - return Load (uri, LoadOptions.None); - } - - public static XElement Load (string uri, LoadOptions options) - { - XmlReaderSettings s = CreateDefaultSettings (options); - - using (XmlReader r = XmlReader.Create (uri, s)) { - return LoadCore (r, options); - } - } - - public static XElement Load (TextReader textReader) - { - return Load (textReader, LoadOptions.None); - } - - public static XElement Load (TextReader textReader, LoadOptions options) - { - XmlReaderSettings s = CreateDefaultSettings (options); - - using (XmlReader r = XmlReader.Create (textReader, s)) { - return LoadCore (r, options); - } - } - - public static XElement Load (XmlReader reader) - { - return Load (reader, LoadOptions.None); - } - - public static XElement Load (XmlReader reader, LoadOptions options) - { - XmlReaderSettings s = reader.Settings != null ? reader.Settings.Clone () : new XmlReaderSettings (); - DefineDefaultSettings (s, options); - - using (XmlReader r = XmlReader.Create (reader, s)) { - return LoadCore (r, options); - } - } - -#if NET_4_0 - public static XElement Load (Stream stream) - { - return Load (stream, LoadOptions.None); - } - - public static XElement Load (Stream stream, LoadOptions options) - { - XmlReaderSettings s = new XmlReaderSettings (); - DefineDefaultSettings (s, options); - - using (XmlReader r = XmlReader.Create (stream, s)) { - return LoadCore (r, options); - } - } -#endif - - internal static XElement LoadCore (XmlReader r, LoadOptions options) - { - r.MoveToContent (); - if (r.NodeType != XmlNodeType.Element) - throw new InvalidOperationException ("The XmlReader must be positioned at an element"); - XName name = XName.Get (r.LocalName, r.NamespaceURI); - XElement e = new XElement (name); - e.FillLineInfoAndBaseUri (r, options); - - if (r.MoveToFirstAttribute ()) { - do { - // not sure how current Orcas behavior makes sense here though ... - if (r.LocalName == "xmlns" && r.NamespaceURI == XNamespace.Xmlns.NamespaceName) - e.SetAttributeValue (XNamespace.None.GetName ("xmlns"), r.Value); - else - e.SetAttributeValue (XName.Get (r.LocalName, r.NamespaceURI), r.Value); - e.LastAttribute.FillLineInfoAndBaseUri (r, options); - } while (r.MoveToNextAttribute ()); - r.MoveToElement (); - } - if (!r.IsEmptyElement) { - r.Read (); - e.ReadContentFrom (r, options); - r.ReadEndElement (); - e.explicit_is_empty = false; - } else { - e.explicit_is_empty = true; - r.Read (); - } - return e; - } - - public static XElement Parse (string text) - { - return Parse (text, LoadOptions.None); - } - - public static XElement Parse (string text, LoadOptions options) - { - return Load (new StringReader (text), options); - } - - public void RemoveAll () - { - RemoveAttributes (); - RemoveNodes (); - } - - public void RemoveAttributes () - { - while (attr_first != null) - attr_last.Remove (); - } - - public void Save (string fileName) - { - Save (fileName, SaveOptions.None); - } - - public void Save (string fileName, SaveOptions options) - { - XmlWriterSettings s = new XmlWriterSettings (); - - if ((options & SaveOptions.DisableFormatting) == SaveOptions.None) - s.Indent = true; -#if NET_4_0 - if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces) - s.NamespaceHandling |= NamespaceHandling.OmitDuplicates; -#endif - using (XmlWriter w = XmlWriter.Create (fileName, s)) { - Save (w); - } - } - - public void Save (TextWriter textWriter) - { - Save (textWriter, SaveOptions.None); - } - - public void Save (TextWriter textWriter, SaveOptions options) - { - XmlWriterSettings s = new XmlWriterSettings (); - - if ((options & SaveOptions.DisableFormatting) == SaveOptions.None) - s.Indent = true; -#if NET_4_0 - if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces) - s.NamespaceHandling |= NamespaceHandling.OmitDuplicates; -#endif - using (XmlWriter w = XmlWriter.Create (textWriter, s)) { - Save (w); - } - } - - public void Save (XmlWriter writer) - { - WriteTo (writer); - } - -#if NET_4_0 - public void Save (Stream stream) - { - Save (stream, SaveOptions.None); - } - - public void Save (Stream stream, SaveOptions options) - { - XmlWriterSettings s = new XmlWriterSettings (); - if ((options & SaveOptions.DisableFormatting) == SaveOptions.None) - s.Indent = true; - if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces) - s.NamespaceHandling |= NamespaceHandling.OmitDuplicates; - - using (var writer = XmlWriter.Create (stream, s)){ - Save (writer); - } - } -#endif - public IEnumerable AncestorsAndSelf () - { - return GetAncestorList (null, true); - } - - public IEnumerable AncestorsAndSelf (XName name) - { - return GetAncestorList (name, true); - } - - public IEnumerable DescendantsAndSelf () - { - List list = new List (); - list.Add (this); - list.AddRange (Descendants ()); - return list; - } - - public IEnumerable DescendantsAndSelf (XName name) - { - List list = new List (); - if (name == this.name) - list.Add (this); - list.AddRange (Descendants (name)); - return list; - } - - public IEnumerable DescendantNodesAndSelf () - { - yield return this; - foreach (XNode node in DescendantNodes ()) - yield return node; - } - - public void SetAttributeValue (XName name, object value) - { - XAttribute a = Attribute (name); - if (value == null) { - if (a != null) - a.Remove (); - } else { - if (a == null) { - SetAttributeObject (new XAttribute (name, value)); - } - else - a.Value = XUtil.ToString (value); - } - } - - void SetAttributeObject (XAttribute a) - { - OnAddingObject (a); - a = (XAttribute) XUtil.GetDetachedObject (a); - a.SetOwner (this); - if (attr_first == null) { - attr_first = a; - attr_last = a; - } else { - attr_last.NextAttribute = a; - a.PreviousAttribute = attr_last; - attr_last = a; - } - OnAddedObject (a); - } - - string LookupPrefix (string ns, XmlWriter w) - { - string prefix = ns.Length > 0 ? GetPrefixOfNamespace (ns) ?? w.LookupPrefix (ns) : String.Empty; - foreach (XAttribute a in Attributes ()) { - if (a.IsNamespaceDeclaration && a.Value == ns) { - if (a.Name.Namespace == XNamespace.Xmlns) - prefix = a.Name.LocalName; - // otherwise xmlns="..." - break; - } - } - return prefix; - } - - static string CreateDummyNamespace (ref int createdNS, IEnumerable atts, bool isAttr) - { - if (!isAttr && atts.All (a => a.Name.LocalName != "xmlns" || a.Name.NamespaceName == XNamespace.Xmlns.NamespaceName)) - return String.Empty; - string p = null; - do { - p = "p" + (++createdNS); - // check conflict - if (atts.All (a => a.Name.LocalName != p || a.Name.NamespaceName == XNamespace.Xmlns.NamespaceName)) - break; - } while (true); - return p; - } - - public override void WriteTo (XmlWriter writer) - { - // some people expect the same prefix output as in input, - // in the loss of performance... see bug #466423. - string prefix = LookupPrefix (name.NamespaceName, writer); - int createdNS = 0; - if (prefix == null) - prefix = CreateDummyNamespace (ref createdNS, Attributes (), false); - - writer.WriteStartElement (prefix, name.LocalName, name.Namespace.NamespaceName); - - foreach (XAttribute a in Attributes ()) { - if (a.IsNamespaceDeclaration) { - if (a.Name.Namespace == XNamespace.Xmlns) - writer.WriteAttributeString ("xmlns", a.Name.LocalName, XNamespace.Xmlns.NamespaceName, a.Value); - else - writer.WriteAttributeString ("xmlns", a.Value); - } else { - string apfix = LookupPrefix (a.Name.NamespaceName, writer); - if (apfix == null) - apfix = CreateDummyNamespace (ref createdNS, Attributes (), true); - writer.WriteAttributeString (apfix, a.Name.LocalName, a.Name.Namespace.NamespaceName, a.Value); - } - } - - foreach (XNode node in Nodes ()) - node.WriteTo (writer); - - if (explicit_is_empty) - writer.WriteEndElement (); - else - writer.WriteFullEndElement (); - } - - public XNamespace GetDefaultNamespace () - { - for (XElement el = this; el != null; el = el.Parent) - foreach (XAttribute a in el.Attributes ()) - if (a.IsNamespaceDeclaration && a.Name.Namespace == XNamespace.None) - return XNamespace.Get (a.Value); - return XNamespace.None; // nothing is declared. - } - - public XNamespace GetNamespaceOfPrefix (string prefix) - { - for (XElement el = this; el != null; el = el.Parent) - foreach (XAttribute a in el.Attributes ()) - if (a.IsNamespaceDeclaration && (prefix.Length == 0 && a.Name.LocalName == "xmlns" || a.Name.LocalName == prefix)) - return XNamespace.Get (a.Value); - return XNamespace.None; // nothing is declared. - } - - public string GetPrefixOfNamespace (XNamespace ns) - { - foreach (string prefix in GetPrefixOfNamespaceCore (ns)) - if (GetNamespaceOfPrefix (prefix) == ns) - return prefix; - return null; // nothing is declared - } - - IEnumerable GetPrefixOfNamespaceCore (XNamespace ns) - { - for (XElement el = this; el != null; el = el.Parent) - foreach (XAttribute a in el.Attributes ()) - if (a.IsNamespaceDeclaration && a.Value == ns.NamespaceName) - yield return a.Name.Namespace == XNamespace.None ? String.Empty : a.Name.LocalName; - } - - public void ReplaceAll (object content) - { - RemoveNodes (); - Add (content); - } - - public void ReplaceAll (params object [] content) - { - RemoveNodes (); - Add (content); - } - - public void ReplaceAttributes (object content) - { - RemoveAttributes (); - Add (content); - } - - public void ReplaceAttributes (params object [] content) - { - RemoveAttributes (); - Add (content); - } - - public void SetElementValue (XName name, object value) - { - var element = Element (name); - if (element == null && value != null) { - Add (new XElement (name, value)); - } else if (element != null && value == null) { - element.Remove (); - } else - element.SetValue (value); - } - - public void SetValue (object value) - { - if (value == null) - throw new ArgumentNullException ("value"); - if (value is XAttribute || value is XDocument || value is XDeclaration || value is XDocumentType) - throw new ArgumentException (String.Format ("Node type {0} is not allowed as element value", value.GetType ())); - RemoveNodes (); - foreach (object o in XUtil.ExpandArray (value)) - Add (o); - } - - internal override bool OnAddingObject (object o, bool rejectAttribute, XNode refNode, bool addFirst) - { - if (o is XDocument || o is XDocumentType || o is XDeclaration || (rejectAttribute && o is XAttribute)) - throw new ArgumentException (String.Format ("A node of type {0} cannot be added as a content", o.GetType ())); - - XAttribute a = o as XAttribute; - if (a != null) { - foreach (XAttribute ia in Attributes ()) - if (a.Name == ia.Name) - throw new InvalidOperationException (String.Format ("Duplicate attribute: {0}", a.Name)); - SetAttributeObject (a); - return true; - } - else if (o is string && refNode is XText) { - ((XText) refNode).Value += o as string; - return true; - } - else - return false; - } - - void IXmlSerializable.WriteXml (XmlWriter writer) - { - Save (writer); - } - - void IXmlSerializable.ReadXml (XmlReader reader) - { - ReadContentFrom (reader, LoadOptions.None); - } - - XmlSchema IXmlSerializable.GetSchema () - { - return null; - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XIterators.cs b/Saleslogix.SData.Client/LinqToXml/XIterators.cs deleted file mode 100644 index 4749ff0a..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XIterators.cs +++ /dev/null @@ -1,139 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_2_0 - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Xml; - -using XPI = System.Xml.Linq.XProcessingInstruction; - - -namespace System.Xml.Linq -{ - /* - // Iterators - internal class XFilterIterator : IEnumerable - { - IEnumerable source; - XName name; - - public XFilterIterator (IEnumerable source, XName name) - { - this.source = source; - this.name = name; - } - - public IEnumerator GetEnumerator () - { - foreach (object o in source) { - if (! (o is T)) - continue; - if (name != null) { - if (o is XElement) { - if (((XElement) o).Name != name) - continue; - } - else if (o is XAttribute) { - if (((XAttribute) o).Name != name) - continue; - } - } - yield return (T) o; - } - } - - IEnumerator IEnumerable.GetEnumerator () - { - return GetEnumerator (); - } - } - - internal class XDescendantIterator : IEnumerable - { - IEnumerable source; - - public XDescendantIterator (IEnumerable source) - { - this.source = new XFilterIterator (source, null); - } - - public IEnumerator GetEnumerator () - { - foreach (T t1 in source) { - yield return t1; - XContainer xc = t1 as XContainer; - if (xc == null || xc.FirstChild == null) - continue; - foreach (T t2 in new XDescendantIterator (xc.Content ())) - yield return t2; - } - } - - IEnumerator IEnumerable.GetEnumerator () - { - return GetEnumerator (); - } - } - */ - -#if !LIST_BASED - internal class XChildrenIterator : IEnumerable - { - XContainer source; - XNode n; - - public XChildrenIterator (XContainer source) - { - this.source = source; - } - - public IEnumerator GetEnumerator () - { - if (n == null) { - n = source.FirstNode; - if (n == null) - yield break; - } - do { - yield return n; - n = n.NextNode; - } while (n != source.LastNode); - } - - IEnumerator IEnumerable.GetEnumerator () - { - return GetEnumerator (); - } - } -#endif -} - -#endif diff --git a/Saleslogix.SData.Client/LinqToXml/XName.cs b/Saleslogix.SData.Client/LinqToXml/XName.cs deleted file mode 100644 index ef466ade..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XName.cs +++ /dev/null @@ -1,171 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_2_0 - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Runtime.Serialization; -using System.Text; -using System.Xml; - -using XPI = System.Xml.Linq.XProcessingInstruction; - -namespace System.Xml.Linq -{ - [Serializable] - internal sealed class XName : IEquatable, ISerializable - { - string local; - XNamespace ns; - - XName (SerializationInfo info, StreamingContext context) - { - string expandedName = info.GetString ("name"); - string local, ns; - ExpandName (expandedName, out local, out ns); - this.local = local; - this.ns = XNamespace.Get (ns); - } - - internal XName (string local, XNamespace ns) - { - this.local = XmlConvert.VerifyNCName (local); - this.ns = ns; - } - - static Exception ErrorInvalidExpandedName () - { - return new ArgumentException ("Invalid expanded name."); - } - - public string LocalName { - get { return local; } - } - - public XNamespace Namespace { - get { return ns; } - } - - public string NamespaceName { - get { return ns.NamespaceName; } - } - - public override bool Equals (object obj) - { - XName n = obj as XName; - return n != null && this == n; - } - - bool IEquatable.Equals (XName other) - { - return this == other; - } - - public static XName Get (string expandedName) - { - string local, ns; - ExpandName (expandedName, out local, out ns); - return Get (local, ns); - } - - static void ExpandName (string expandedName, out string local, out string ns) - { - if (expandedName == null) - throw new ArgumentNullException ("expandedName"); - ns = null; - local = null; - if (expandedName.Length == 0) - throw ErrorInvalidExpandedName (); - //this.expanded = expandedName; - if (expandedName [0] == '{') { - for (int i = 1; i < expandedName.Length; i++) { - if (expandedName [i] == '}') - ns = expandedName.Substring (1, i - 1); - } - if (String.IsNullOrEmpty (ns)) // {}foo is invalid - throw ErrorInvalidExpandedName (); - if (expandedName.Length == ns.Length + 2) // {foo} is invalid - throw ErrorInvalidExpandedName (); - local = expandedName.Substring (ns.Length + 2); - } - else { - local = expandedName; - ns = String.Empty; - } - } - - public static XName Get (string localName, string namespaceName) - { - return XNamespace.Get (namespaceName).GetName (localName); - } - - public override int GetHashCode () - { - return local.GetHashCode () ^ ns.GetHashCode (); - } - - public static bool operator == (XName left, XName right) - { - if ((object) left == null) - return (object) right == null; - else if ((object) right == null) - return false; - return object.ReferenceEquals (left, right) || - left.local == right.local && left.ns == right.ns; - } - - public static implicit operator XName (string expandedName) - { - return expandedName == null ? null : Get (expandedName); - } - - public static bool operator != (XName left, XName right) - { - return ! (left == right); - } - - public override string ToString () - { - if (ns == XNamespace.None) - return local; - return String.Concat ("{", ns.NamespaceName, "}", local); - } - - // in .NET it is serialized as "NameSerializer". dunno how to create it. - void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context) - { - if (info == null) - throw new ArgumentNullException ("info"); - - info.AddValue ("name", ToString ()); - } - } -} - -#endif diff --git a/Saleslogix.SData.Client/LinqToXml/XNamespace.cs b/Saleslogix.SData.Client/LinqToXml/XNamespace.cs deleted file mode 100644 index d7075e7f..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XNamespace.cs +++ /dev/null @@ -1,139 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Xml; - -namespace System.Xml.Linq -{ - internal sealed class XNamespace - { - static readonly XNamespace blank, xml, xmlns; - static Dictionary nstable; - - static XNamespace () - { - nstable = new Dictionary (); - blank = Get (String.Empty); - xml = Get ("http://www.w3.org/XML/1998/namespace"); - xmlns = Get ("http://www.w3.org/2000/xmlns/"); - } - - public static XNamespace None { - get { return blank; } - } - - public static XNamespace Xml { - get { return xml; } - } - - public static XNamespace Xmlns { - get { return xmlns; } - } - - public static XNamespace Get (string namespaceName) - { - lock (nstable) { - XNamespace ret; - if (!nstable.TryGetValue (namespaceName, out ret)) { - ret = new XNamespace (namespaceName); - nstable [namespaceName] = ret; - } - return ret; - } - } - - public XName GetName (string localName) - { - if (table == null) - table = new Dictionary (); - lock (table) { - XName ret; - if (!table.TryGetValue (localName, out ret)) { - ret = new XName (localName, this); - table [localName] = ret; - } - return ret; - } - } - - string uri; - Dictionary table; - - XNamespace (string namespaceName) - { - if (namespaceName == null) - throw new ArgumentNullException ("namespaceName"); - uri = namespaceName; - } - - public string NamespaceName { - get { return uri; } - } - - public override bool Equals (object obj) - { - if (Object.ReferenceEquals (this, obj)) - return true; - XNamespace ns = obj as XNamespace; - return ns != null && uri == ns.uri; - } - - public static bool operator == (XNamespace left, XNamespace right) - { - return (object) left != null ? left.Equals (right) : (object) right == null; - } - - public static bool operator != (XNamespace left, XNamespace right) - { - return ! (left == right); - } - - public static XName operator + (XNamespace ns, string localName) - { - return new XName (localName, ns); - } - - public static implicit operator XNamespace (string namespaceName) - { - return namespaceName != null ? XNamespace.Get (namespaceName) : null; - } - - public override int GetHashCode () - { - return uri.GetHashCode (); - } - - public override string ToString () - { - return uri; - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XNode.cs b/Saleslogix.SData.Client/LinqToXml/XNode.cs deleted file mode 100644 index 83cd9da8..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XNode.cs +++ /dev/null @@ -1,346 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Xml; - -using XPI = System.Xml.Linq.XProcessingInstruction; - -namespace System.Xml.Linq -{ - internal abstract class XNode : XObject - { - public static int CompareDocumentOrder (XNode n1, XNode n2) - { - return order_comparer.Compare (n1, n2); - } - - public static bool DeepEquals (XNode n1, XNode n2) - { - return eq_comparer.Equals (n1, n2); - } - - static XNodeEqualityComparer eq_comparer = - new XNodeEqualityComparer (); - static XNodeDocumentOrderComparer order_comparer = - new XNodeDocumentOrderComparer (); - - XNode previous; - XNode next; - - internal XNode () - { - } - - public static XNodeDocumentOrderComparer DocumentOrderComparer { - get { return order_comparer; } - } - - public static XNodeEqualityComparer EqualityComparer { - get { return eq_comparer; } - } - - public XNode PreviousNode { - get { return previous; } - internal set { previous = value; } - } - - public XNode NextNode { - get { return next; } - internal set { next = value; } - } - - public string ToString (SaveOptions options) - { - StringWriter sw = new StringWriter (); - XmlWriterSettings s = new XmlWriterSettings (); - s.ConformanceLevel = ConformanceLevel.Auto; - s.Indent = options != SaveOptions.DisableFormatting; - XmlWriter xw = XmlWriter.Create (sw, s); - WriteTo (xw); - xw.Close (); - return sw.ToString (); - } - - public void AddAfterSelf (object content) - { - if (Owner == null) - throw new InvalidOperationException (); - XNode here = this; - XNode orgNext = next; - foreach (object o in XUtil.ExpandArray (content)) { - if (o == null || Owner.OnAddingObject (o, true, here, false)) - continue; - XNode n = XUtil.ToNode (o); - Owner.OnAddingObject (n); - n = (XNode) XUtil.GetDetachedObject (n); - n.SetOwner (Owner); - n.previous = here; - here.next = n; - n.next = orgNext; - if (orgNext != null) - orgNext.previous = n; - else - Owner.LastNode = n; - here = n; - Owner.OnAddedObject (n); - } - } - - public void AddAfterSelf (params object [] content) - { - if (Owner == null) - throw new InvalidOperationException (); - AddAfterSelf ((object) content); - } - - public void AddBeforeSelf (object content) - { - if (Owner == null) - throw new InvalidOperationException (); - foreach (object o in XUtil.ExpandArray (content)) { - if (o == null || Owner.OnAddingObject (o, true, previous, true)) - continue; - - XNode n = XUtil.ToNode (o); - Owner.OnAddingObject (n); - n = (XNode) XUtil.GetDetachedObject (n); - n.SetOwner (Owner); - n.previous = previous; - n.next = this; - if (previous != null) - previous.next = n; - previous = n; - if (Owner.FirstNode == this) - Owner.FirstNode = n; - Owner.OnAddedObject (n); - } - } - - public void AddBeforeSelf (params object [] content) - { - if (Owner == null) - throw new InvalidOperationException (); - AddBeforeSelf ((object) content); - } - - public static XNode ReadFrom (XmlReader reader) - { - return ReadFrom (reader, LoadOptions.None); - } - - internal static XNode ReadFrom (XmlReader r, LoadOptions options) - { - switch (r.NodeType) { - case XmlNodeType.Element: - return XElement.LoadCore (r, options); - case XmlNodeType.Whitespace: - case XmlNodeType.SignificantWhitespace: - case XmlNodeType.Text: - XText t = new XText (r.Value); - t.FillLineInfoAndBaseUri (r, options); - r.Read (); - return t; - case XmlNodeType.CDATA: - XCData c = new XCData (r.Value); - c.FillLineInfoAndBaseUri (r, options); - r.Read (); - return c; - case XmlNodeType.ProcessingInstruction: - XPI pi = new XPI (r.Name, r.Value); - pi.FillLineInfoAndBaseUri (r, options); - r.Read (); - return pi; - case XmlNodeType.Comment: - XComment cm = new XComment (r.Value); - cm.FillLineInfoAndBaseUri (r, options); - r.Read (); - return cm; - case XmlNodeType.DocumentType: - XDocumentType d = new XDocumentType (r.Name, - r.GetAttribute ("PUBLIC"), - r.GetAttribute ("SYSTEM"), - r.Value); - d.FillLineInfoAndBaseUri (r, options); - r.Read (); - return d; - default: - throw new InvalidOperationException (String.Format ("Node type {0} is not supported", r.NodeType)); - } - } - - public void Remove () - { - if (Owner == null) - throw new InvalidOperationException ("Owner is missing"); - - var owner = Owner; - owner.OnRemovingObject (this); - if (Owner.FirstNode == this) - Owner.FirstNode = next; - if (Owner.LastNode == this) - Owner.LastNode = previous; - if (previous != null) - previous.next = next; - if (next != null) - next.previous = previous; - previous = null; - next = null; - SetOwner (null); - owner.OnRemovedObject (this); - } - - public override string ToString () - { - return ToString (SaveOptions.None); - } - - public abstract void WriteTo (XmlWriter writer); - - public IEnumerable Ancestors () - { - for (XElement el = Parent; el != null; el = el.Parent) - yield return el; - } - - public IEnumerable Ancestors (XName name) - { - foreach (XElement el in Ancestors ()) - if (el.Name == name) - yield return el; - } - - public XmlReader CreateReader () - { - return new XNodeReader (this); - } - -#if NET_4_0 - public XmlReader CreateReader (ReaderOptions readerOptions) - { - var r = new XNodeReader (this); - if ((readerOptions & ReaderOptions.OmitDuplicateNamespaces) != 0) - r.OmitDuplicateNamespaces = true; - - return r; - } -#endif - - public IEnumerable ElementsAfterSelf () - { - foreach (XNode n in NodesAfterSelf ()) - if (n is XElement) - yield return (XElement) n; - } - - public IEnumerable ElementsAfterSelf (XName name) - { - foreach (XElement el in ElementsAfterSelf ()) - if (el.Name == name) - yield return el; - } - - public IEnumerable ElementsBeforeSelf () - { - foreach (XNode n in NodesBeforeSelf ()) - if (n is XElement) - yield return (XElement) n; - } - - public IEnumerable ElementsBeforeSelf (XName name) - { - foreach (XElement el in ElementsBeforeSelf ()) - if (el.Name == name) - yield return el; - } - - public bool IsAfter (XNode node) - { - return XNode.DocumentOrderComparer.Compare (this, node) > 0; - } - - public bool IsBefore (XNode node) - { - return XNode.DocumentOrderComparer.Compare (this, node) < 0; - } - - public IEnumerable NodesAfterSelf () - { - if (Owner == null) - yield break; - for (XNode n = NextNode; n != null; n = n.NextNode) - yield return n; - } - - public IEnumerable NodesBeforeSelf () - { - if (Owner == null) - yield break; - for (XNode n = Owner.FirstNode; n != this; n = n.NextNode) - yield return n; - } - - public void ReplaceWith (object content) - { - if (Owner == null) - throw new InvalidOperationException (); - - XNode here = previous; - XNode orgNext = next; - XContainer orgOwner = Owner; - Remove(); - foreach (object o in XUtil.ExpandArray (content)) { - if (o == null || orgOwner.OnAddingObject (o, true, here, false)) - continue; - XNode n = XUtil.ToNode (o); - n = (XNode) XUtil.GetDetachedObject (n); - n.SetOwner (orgOwner); - n.previous = here; - if (here != null) - here.next = n; - else - orgOwner.FirstNode = n; - n.next = orgNext; - if (orgNext != null) - orgNext.previous = n; - else - orgOwner.LastNode = n; - here = n; - } - } - - public void ReplaceWith (params object [] content) - { - if (Owner == null) - throw new InvalidOperationException (); - ReplaceWith ((object) content); - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XNodeDocumentOrderComparer.cs b/Saleslogix.SData.Client/LinqToXml/XNodeDocumentOrderComparer.cs deleted file mode 100644 index c4095524..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XNodeDocumentOrderComparer.cs +++ /dev/null @@ -1,155 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; - -namespace System.Xml.Linq -{ - internal sealed class XNodeDocumentOrderComparer : IComparer, IComparer - { - public XNodeDocumentOrderComparer () - { - } - - enum CompareResult - { - Same, - Random, - Parent, - Child, - Ancestor, - Descendant, - Preceding, - Following - } - - public int Compare (XNode x, XNode y) - { - switch (CompareCore (x,y)) { - case CompareResult.Same: - return 0; - case CompareResult.Random: - return DateTime.Now.Ticks % 2 == 1 ? 1 : -1; - case CompareResult.Parent: - case CompareResult.Ancestor: - case CompareResult.Preceding: - return 1; - default: - return -1; - } - } - - CompareResult CompareCore (XNode n1, XNode n2) - { - if (n1 == n2) - return CompareResult.Same; - if (n1.Owner == null) { - if (n2.Owner == null) - // n1 and n2 do not share the same - // top-level node, so return semi- - // random value. - return CompareResult.Random; - - CompareResult result = CompareCore (n1, n2.Owner); - switch (result) { - case CompareResult.Same: - return CompareResult.Child; - case CompareResult.Child: - case CompareResult.Descendant: - return CompareResult.Descendant; - case CompareResult.Parent: - case CompareResult.Ancestor: - throw new Exception ("INTERNAL ERROR: should not happen"); - default: - return result; - } - } - // else - if (n2.Owner == null) { - // do reverse - CompareResult rev = CompareCore (n2, n1); - switch (rev) { - case CompareResult.Parent: - return CompareResult.Child; - case CompareResult.Child: - return CompareResult.Parent; - case CompareResult.Ancestor: - return CompareResult.Descendant; - case CompareResult.Descendant: - return CompareResult.Ancestor; - case CompareResult.Following: - return CompareResult.Preceding; - case CompareResult.Preceding: - return CompareResult.Following; - case CompareResult.Same: - case CompareResult.Random: - return rev; - } - } - // both have parents - CompareResult ret = CompareCore (n1.Owner, n2.Owner); - switch (ret) { - case CompareResult.Same: - // n1 and n2 are sibling each other. - return CompareSibling (n1, n2, CompareResult.Same); - case CompareResult.Child: - return CompareSibling (n1, n2.Owner, CompareResult.Child); - case CompareResult.Parent: - return CompareSibling (n1.Owner, n2, CompareResult.Parent); - case CompareResult.Descendant: - for (XNode i2 = n2; ; i2 = i2.Owner) - if (i2.Owner == n1.Owner) - return CompareSibling (n1, i2, CompareResult.Descendant); - case CompareResult.Ancestor: - for (XNode i1 = n1; ; i1 = i1.Owner) - if (i1.Owner == n2.Owner) - return CompareSibling (i1, n2, CompareResult.Ancestor); - default: - return ret; - } - } - - // results are returned as following/preceding, as it is also - // used for comparing parents. - CompareResult CompareSibling (XNode n1, XNode n2, CompareResult forSameValue) - { - if (n1 == n2) - return forSameValue; - - for (XNode n = n1.NextNode; n != null; n = n.NextNode) - if (n == n2) - return CompareResult.Following; - return CompareResult.Preceding; - } - - int IComparer.Compare (object n1, object n2) - { - return Compare ((XNode) n1, (XNode) n2); - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XNodeEqualityComparer.cs b/Saleslogix.SData.Client/LinqToXml/XNodeEqualityComparer.cs deleted file mode 100644 index c3fc6ea7..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XNodeEqualityComparer.cs +++ /dev/null @@ -1,187 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; - -using XPI = System.Xml.Linq.XProcessingInstruction; - -namespace System.Xml.Linq -{ - internal sealed class XNodeEqualityComparer : IEqualityComparer, IEqualityComparer - { - public XNodeEqualityComparer () - { - } - - public bool Equals (XNode x, XNode y) - { - if (x == null) - return y == null; - else if (y == null) - return false; - //throw new NotImplementedException (); - if (x.NodeType != y.NodeType) - return false; - switch (x.NodeType) { - case XmlNodeType.Document: - XDocument doc1 = (XDocument) x; - XDocument doc2 = (XDocument) y; - if (!Equals (doc1.Declaration, doc2.Declaration)) - return false; - IEnumerator id2 = doc2.Nodes ().GetEnumerator (); - foreach (XNode n in doc1.Nodes ()) { - if (!id2.MoveNext ()) - return false; - if (!Equals (n, id2.Current)) - return false; - } - return !id2.MoveNext (); - case XmlNodeType.Element: - XElement e1 = (XElement) x; - XElement e2 = (XElement) y; - if (e1.Name != e2.Name) - return false; - IEnumerator ia2 = e2.Attributes ().GetEnumerator (); - foreach (XAttribute n in e1.Attributes ()) { - if (!ia2.MoveNext ()) - return false; - if (!Equals (n, ia2.Current)) - return false; - } - if (ia2.MoveNext ()) - return false; - IEnumerator ie2 = e2.Nodes ().GetEnumerator (); - foreach (XNode n in e1.Nodes ()) { - if (!ie2.MoveNext ()) - return false; - if (!Equals (n, ie2.Current)) - return false; - } - return !ie2.MoveNext (); - case XmlNodeType.Comment: - XComment c1 = (XComment) x; - XComment c2 = (XComment) y; - return c1.Value == c2.Value; - case XmlNodeType.ProcessingInstruction: - XPI p1 = (XPI) x; - XPI p2 = (XPI) y; - return p1.Target == p2.Target && p1.Data == p2.Data; - case XmlNodeType.DocumentType: - XDocumentType d1 = (XDocumentType) x; - XDocumentType d2 = (XDocumentType) y; - return d1.Name == d2.Name && - d1.PublicId == d2.PublicId && - d1.SystemId == d2.SystemId && - d1.InternalSubset == d2.InternalSubset; - case XmlNodeType.Text: - return ((XText) x).Value == ((XText) y).Value; - } - throw new Exception ("INTERNAL ERROR: should not happen"); - } - - bool Equals (XAttribute a1, XAttribute a2) - { - if (a1 == null) - return a2 == null; - else if (a2 == null) - return false; - return a1.Name == a2.Name && a1.Value == a2.Value; - } - - bool Equals (XDeclaration d1, XDeclaration d2) - { - if (d1 == null) - return d2 == null; - else if (d2 == null) - return false; - return d1.Version == d2.Version && - d1.Encoding == d2.Encoding && - d1.Standalone == d2.Standalone; - } - - bool IEqualityComparer.Equals (object n1, object n2) - { - return Equals ((XNode) n1, (XNode) n2); - } - - int GetHashCode (XDeclaration d) - { - if (d == null) - return 0; - return (d.Version.GetHashCode () << 7) ^ - (d.Encoding.GetHashCode () << 6) ^ - d.Standalone.GetHashCode (); - } - - public int GetHashCode (XNode obj) - { - if (obj == null) - return 0; - int h = ((int) obj.NodeType << 6); - switch (obj.NodeType) { - case XmlNodeType.Document: - XDocument doc = (XDocument) obj; - h = h ^ GetHashCode (doc.Declaration); - foreach (XNode n in doc.Nodes ()) - h = h ^ (n.GetHashCode () << 5); - break; - case XmlNodeType.Element: - XElement el = (XElement) obj; - h = h ^ (el.Name.GetHashCode () << 3); - foreach (XAttribute a in el.Attributes ()) - h = h ^ (a.GetHashCode () << 7); - foreach (XNode n in el.Nodes ()) - h = h ^ (n.GetHashCode () << 6); - break; - case XmlNodeType.Comment: - h = h ^ ((XComment) obj).Value.GetHashCode (); - break; - case XmlNodeType.ProcessingInstruction: - XPI pi = (XPI) obj; - h = h ^ ((pi.Target.GetHashCode () << 6) + pi.Data.GetHashCode ()); - break; - case XmlNodeType.DocumentType: - XDocumentType dtd = (XDocumentType) obj; - h = h ^ (dtd.Name.GetHashCode () << 7) ^ - (dtd.PublicId.GetHashCode () << 6) ^ - (dtd.SystemId.GetHashCode () << 5) ^ - (dtd.InternalSubset.GetHashCode () << 4); - break; - case XmlNodeType.Text: - h = h ^ (((XText) obj).GetHashCode ()); - break; - } - return h; - } - - int IEqualityComparer.GetHashCode (object obj) - { - return GetHashCode ((XNode) obj); - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XNodeNavigator.cs b/Saleslogix.SData.Client/LinqToXml/XNodeNavigator.cs deleted file mode 100644 index 55702bd1..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XNodeNavigator.cs +++ /dev/null @@ -1,422 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.IO; -using System.Text; -using System.Xml; -using System.Xml.Schema; -using System.Xml.XPath; - -using XPI = System.Xml.Linq.XProcessingInstruction; - -namespace System.Xml.Linq -{ - internal class XNodeNavigator : XPathNavigator - { - static readonly XAttribute attr_ns_xml = new XAttribute (XNamespace.Xmlns.GetName ("xml"), XNamespace.Xml.NamespaceName); - - XNode node; - XAttribute attr; - XmlNameTable name_table; - - public XNodeNavigator (XNode node, XmlNameTable nameTable) - { - this.node = node; - this.name_table = nameTable; - } - - public XNodeNavigator (XNodeNavigator other) - { - this.node = other.node; - this.attr = other.attr; - this.name_table = other.name_table; - } - - public override string BaseURI { - get { return node.BaseUri ?? String.Empty; } - } - - public override bool CanEdit { - get { return true; } - } - - public override bool HasAttributes { - get { - if (attr != null) - return false; - XElement el = node as XElement; - if (el == null) - return false; - foreach (var at in el.Attributes ()) - if (!at.IsNamespaceDeclaration) - return true; - return false; - } - } - - public override bool HasChildren { - get { - if (attr != null) - return false; - XContainer c = node as XContainer; - return c != null && c.FirstNode != null; - } - } - - public override bool IsEmptyElement { - get { - if (attr != null) - return false; - XElement el = node as XElement; - return el != null && el.IsEmpty; - } - } - - public override string LocalName { - get { - switch (NodeType) { - case XPathNodeType.Namespace: - return attr.Name.Namespace == XNamespace.None ? String.Empty : attr.Name.LocalName; - case XPathNodeType.Attribute: - return attr.Name.LocalName; - case XPathNodeType.Element: - return ((XElement) node).Name.LocalName; - case XPathNodeType.ProcessingInstruction: - return ((XPI) node).Target; - default: - return String.Empty; - } - } - } - - public override string Name { - get { - XName name = null; - switch (NodeType) { - case XPathNodeType.Attribute: - name = attr.Name; - break; - case XPathNodeType.Element: - name = ((XElement) node).Name; - break; - default: - return LocalName; - } - if (name.Namespace == XNamespace.None) - return name.LocalName; - XElement el = (node as XElement) ?? node.Parent; - if (el == null) - return name.LocalName; - string prefix = el.GetPrefixOfNamespace (name.Namespace); - return prefix.Length > 0 ? String.Concat (prefix, ":", name.LocalName) : name.LocalName; - } - } - - public override string NamespaceURI { - get { - switch (NodeType) { - case XPathNodeType.ProcessingInstruction: - case XPathNodeType.Namespace: - return String.Empty; - case XPathNodeType.Attribute: - return attr.Name.NamespaceName; - case XPathNodeType.Element: - return ((XElement) node).Name.NamespaceName; - default: - return String.Empty; - } - } - } - - public override XmlNameTable NameTable { - get { return name_table; } - } - - public override XPathNodeType NodeType { - get { - if (attr != null) - return attr.IsNamespaceDeclaration ? - XPathNodeType.Namespace : - XPathNodeType.Attribute; - switch (node.NodeType) { - case XmlNodeType.Element: - return XPathNodeType.Element; - case XmlNodeType.Document: - return XPathNodeType.Root; - case XmlNodeType.Comment: - return XPathNodeType.Comment; - case XmlNodeType.ProcessingInstruction: - return XPathNodeType.ProcessingInstruction; - default: - return XPathNodeType.Text; - } - } - } - - public override string Prefix { - get { - XName name = null; - switch (NodeType) { - case XPathNodeType.ProcessingInstruction: - case XPathNodeType.Namespace: - return String.Empty; - case XPathNodeType.Attribute: - name = attr.Name; - break; - case XPathNodeType.Element: - name = ((XElement) node).Name; - break; - default: - return LocalName; - } - if (name.Namespace == XNamespace.None) - return String.Empty; - XElement el = (node as XElement) ?? node.Parent; - if (el == null) - return String.Empty; - return el.GetPrefixOfNamespace (name.Namespace); - } - } - - public override IXmlSchemaInfo SchemaInfo { - get { return null; } - } - - public override object UnderlyingObject { - get { return attr != null ? (object) attr : node; } - } - - public override string Value { - get { - if (attr != null) - return attr.Value; - else - switch (NodeType) { - case XPathNodeType.Comment: - return ((XComment) node).Value; - case XPathNodeType.ProcessingInstruction: - return ((XPI) node).Data; - case XPathNodeType.Text: - string s = String.Empty; - for (var xn = node as XText; xn != null; xn = xn.NextNode as XText) - s += xn.Value; - return s; - case XPathNodeType.Element: - case XPathNodeType.Root: - return GetInnerText ((XContainer) node); - } - return String.Empty; - } - } - - string GetInnerText (XContainer node) - { - StringBuilder sb = null; - foreach (XNode n in node.Nodes ()) - GetInnerText (n, ref sb); - return sb != null ? sb.ToString () : String.Empty; - } - - void GetInnerText (XNode n, ref StringBuilder sb) - { - switch (n.NodeType) { - case XmlNodeType.Element: - foreach (XNode c in ((XElement) n).Nodes ()) - GetInnerText (c, ref sb); - break; - case XmlNodeType.Text: - case XmlNodeType.CDATA: - if (sb == null) - sb = new StringBuilder (); - sb.Append (((XText) n).Value); - break; - } - } - - public override XPathNavigator Clone () - { - return new XNodeNavigator (this); - } - - public override bool IsSamePosition (XPathNavigator other) - { - XNodeNavigator nav = other as XNodeNavigator; - if (nav == null || nav.node.Owner != node.Owner) - return false; - return node == nav.node && attr == nav.attr; - } - - public override bool MoveTo (XPathNavigator other) - { - XNodeNavigator nav = other as XNodeNavigator; - if (nav == null || nav.node.Document != node.Document) - return false; - node = nav.node; - attr = nav.attr; - return true; - } - - public override bool MoveToFirstAttribute () - { - if (attr != null) - return false; - XElement el = node as XElement; - if (el == null || !el.HasAttributes) - return false; - foreach (XAttribute a in el.Attributes ()) - if (!a.IsNamespaceDeclaration) { - attr = a; - return true; - } - return false; - } - - public override bool MoveToFirstChild () - { - if (attr != null) - return false; - XContainer c = node as XContainer; - if (c == null || c.FirstNode == null) - return false; - node = c.FirstNode; - attr = null; - return true; - } - - public override bool MoveToFirstNamespace (XPathNamespaceScope scope) - { - if (NodeType != XPathNodeType.Element) - return false; - for (XElement el = node as XElement; el != null; el = el.Parent) { - foreach (XAttribute a in el.Attributes ()) - if (a.IsNamespaceDeclaration) { - attr = a; - return true; - } - if (scope == XPathNamespaceScope.Local) - return false; - } - if (scope != XPathNamespaceScope.All) - return false; - attr = attr_ns_xml; - return true; - } - - public override bool MoveToId (string id) - { - throw new NotSupportedException ("This XPathNavigator does not support IDs"); - } - - public override bool MoveToNext () - { - XNode xn = node.NextNode; - if (xn is XText) - for (; xn != null; xn = xn.NextNode) - if (!(xn.NextNode is XText)) - break; - if (xn == null) - return false; - node = xn; - attr = null; - return true; - } - - public override bool MoveToNextAttribute () - { - if (attr == null) - return false; - if (attr.NextAttribute == null) - return false; - for (XAttribute a = attr.NextAttribute; a != null; a = a.NextAttribute) - if (!a.IsNamespaceDeclaration) { - attr = a; - return true; - } - return false; - } - - public override bool MoveToNextNamespace (XPathNamespaceScope scope) - { - if (attr == null) - return false; - for (XAttribute a = attr.NextAttribute; a != null; a = a.NextAttribute) - if (a.IsNamespaceDeclaration) { - attr = a; - return true; - } - - if (scope == XPathNamespaceScope.Local) - return false; - - if (attr == attr_ns_xml) - return false; // no next attribute - - for (XElement el = ((XElement) attr.Parent).Parent; el != null; el = el.Parent) { - foreach (XAttribute a in el.Attributes ()) - if (a.IsNamespaceDeclaration) { - attr = a; - return true; - } - } - if (scope != XPathNamespaceScope.All) - return false; - attr = attr_ns_xml; - return true; - } - - public override bool MoveToParent () - { - if (attr != null) { - attr = null; - return true; - } - if (node.Owner == null) - return false; - node = node.Owner; - return true; - } - - public override bool MoveToPrevious () - { - if (node.PreviousNode == null) - return false; - node = node.PreviousNode; - attr = null; - return true; - } - - public override void MoveToRoot () - { - attr = null; - if (node.Document != null) - node = node.Document; - else - while (node.Owner != null) - node = node.Owner; - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XNodeReader.cs b/Saleslogix.SData.Client/LinqToXml/XNodeReader.cs deleted file mode 100644 index 95631f1b..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XNodeReader.cs +++ /dev/null @@ -1,547 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// Copyright 2011 Xamarin Inc (http://www.xamarin.com). -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Xml; - -using XPI = System.Xml.Linq.XProcessingInstruction; - -namespace System.Xml.Linq -{ - internal class XNodeReader : XmlReader, IXmlLineInfo - { - ReadState state = ReadState.Initial; - XNode node, start; - int attr = -1; - bool attr_value; - bool end_element; - NameTable name_table = new NameTable (); - - public XNodeReader (XNode node) - { - this.node = node; - start = node; - } - -#if NET_4_0 - internal bool OmitDuplicateNamespaces { get; set; } -#endif - - int IXmlLineInfo.LineNumber { - get { - var o = (XObject) GetCurrentAttribute () ?? node; - return o != null ? o.LineNumber : 0; - } - } - int IXmlLineInfo.LinePosition { - get { - var o = (XObject) GetCurrentAttribute () ?? node; - return o != null ? o.LinePosition : 0; - } - } - bool IXmlLineInfo.HasLineInfo () - { - var o = (XObject) GetCurrentAttribute () ?? node; - return o != null ? ((IXmlLineInfo) o).HasLineInfo () : false; - } - - public override int AttributeCount { - get { - if (state != ReadState.Interactive || end_element) - return 0; - int i = 0; - switch (node.NodeType) { - case XmlNodeType.Document: // this means xmldecl - XDeclaration xd = ((XDocument) node).Declaration; - i = (xd.Version != null ? 1 : 0) + - (xd.Encoding != null ? 1 : 0) + - (xd.Standalone != null ? 1 : 0); - return i; - case XmlNodeType.DocumentType: - XDocumentType dtd = (XDocumentType) node; - i = (dtd.PublicId != null ? 1 : 0) + - (dtd.SystemId != null ? 1 : 0) + - (dtd.InternalSubset != null ? 1 : 0); - return i; - case XmlNodeType.Element: - XElement el = (XElement) node; - for (XAttribute a = el.FirstAttribute; a != null; a = a.NextAttribute) - i++; - return i; - } - return 0; - } - } - - public override string BaseURI { - get { return node.BaseUri ?? String.Empty; } - } - - public override int Depth { - get { - if (EOF) - return 0; - int i = 0; - // document.Depth = 0, root.Depth = 0, others.Depth = they depend - for (XNode n = node.Parent; n != null; n = n.Parent) - i++; - if (attr >= 0) - i++; - if (attr_value) - i++; - return i; - } - } - - public override bool EOF { - get { return state == ReadState.EndOfFile || state == ReadState.Error; } - } - - public override bool HasAttributes { - get { - if (EOF || end_element || node == null) - return false; - - if (node is XElement) - return ((XElement) node).HasAttributes; - return AttributeCount > 0; - } - } - - public override bool HasValue { - get { - if (EOF) - return false; - if (attr >= 0) - return true; - switch (node.NodeType) { - case XmlNodeType.Element: - case XmlNodeType.Document: - case XmlNodeType.EndElement: - return false; - default: - return true; - } - } - } - - public override bool IsEmptyElement { - get { return !EOF && attr < 0 && node is XElement ? ((XElement) node).IsEmpty : false; } - } - - internal XAttribute GetCurrentAttribute () - { - return GetXAttribute (attr); - } - - XAttribute GetXAttribute (int idx) - { - if (EOF) - return null; - XElement el = node as XElement; - if (el == null) - return null; - int i = 0; - foreach (XAttribute a in el.Attributes ()) - if (i++ == idx) - return a; - return null; - } - - // XName for element and attribute, string for xmldecl attributes, doctype attribute, doctype name and PI, null for empty. - object GetCurrentName () - { - if (EOF || attr_value) - return null; - return GetName (attr); - } - - object GetName (int attr) - { - if (attr >= 0) { - switch (node.NodeType) { - case XmlNodeType.Element: - XAttribute a = GetXAttribute (attr); - return a.Name; - case XmlNodeType.DocumentType: - if (attr == 0) - return ((XDocumentType) node).PublicId != null ? "PUBLIC" : "SYSTEM"; - return "SYSTEM"; - case XmlNodeType.Document: - XDeclaration xd = ((XDocument) node).Declaration; - switch (attr) { - case 0: - return xd.Version != null ? "version" : xd.Encoding != null ? "encoding" : "standalone"; - case 1: - return xd.Version != null ? (xd.Encoding != null ? "encoding" : "standalone") : "standalone"; - } - return "standalone"; - } - } else { - switch (node.NodeType) { - case XmlNodeType.Document: - return "xml"; // xmldecl - case XmlNodeType.Element: - return ((XElement) node).Name; - case XmlNodeType.ProcessingInstruction: - return ((XPI) node).Target; - case XmlNodeType.DocumentType: - return ((XDocumentType) node).Name; - } - } - return null; - } - - public override string LocalName { - get { - object name = GetCurrentName (); - if (name == null) - return String.Empty; - if (name is string) - return (string) name; - return ((XName) name).LocalName; - } - } - - public override string NamespaceURI { - get { - XName name = GetCurrentName () as XName; - if (name != null) - // XName for "xmlns" has NamespaceName as "", so we have to return w3c xmlns as a special case. - return name.LocalName == "xmlns" && name.Namespace == XNamespace.None ? - XNamespace.Xmlns.NamespaceName : - name.NamespaceName; - return String.Empty; - } - } - - public override XmlNameTable NameTable { - get { return name_table; } - } - - public override XmlNodeType NodeType { - get { - return state != ReadState.Interactive ? XmlNodeType.None : - end_element ? XmlNodeType.EndElement : - attr_value ? XmlNodeType.Text : - attr >= 0 ? XmlNodeType.Attribute : - node.NodeType == XmlNodeType.Document ? XmlNodeType.XmlDeclaration : - node.NodeType; - } - } - - public override string Prefix { - get { - XName name = GetCurrentName () as XName; - if (name == null || name.Namespace == XNamespace.None) - return String.Empty; - XElement el = (node as XElement) ?? node.Parent; - if (el == null) - return String.Empty; - return el.GetPrefixOfNamespace (name.Namespace) ?? String.Empty; - } - } - - public override ReadState ReadState { - get { return state; } - } - - public override string Value { - get { - if (ReadState != ReadState.Interactive) - return String.Empty; - XAttribute a = GetCurrentAttribute (); - if (a != null) - return a.Value; - switch (node.NodeType) { - case XmlNodeType.Document: - XDeclaration xd = ((XDocument) node).Declaration; - if (attr >= 0) { - switch (LocalName) { - case "version": - return xd.Version; - case "encoding": - return xd.Encoding; - default: - return xd.Standalone; - } - } else { - string s = xd.ToString (); - return s.Substring (6, s.Length - 6 - 2); - } - case XmlNodeType.DocumentType: - XDocumentType dtd = (XDocumentType) node; - switch (LocalName) { - case "PUBLIC": - return dtd.PublicId; - case "SYSTEM": - return dtd.SystemId; - default: - return dtd.InternalSubset; - } - case XmlNodeType.ProcessingInstruction: - return ((XPI) node).Data; - case XmlNodeType.CDATA: - case XmlNodeType.Text: - return ((XText) node).Value; - case XmlNodeType.Comment: - return ((XComment) node).Value; - } - return String.Empty; - } - } - - public override void Close () - { - state = ReadState.Closed; - } - - public override string LookupNamespace (string prefix) - { - if (EOF) - return null; - XElement el = (node as XElement) ?? node.Parent; - if (el == null) - return null; - var xn = el.GetNamespaceOfPrefix (prefix); - return xn != XNamespace.None ? xn.NamespaceName : null; - } - - public override bool MoveToElement () - { - if (attr >= 0) { - attr_value = false; - attr = -1; - return true; - } - return false; - } - - public override bool MoveToFirstAttribute () - { - if (AttributeCount > 0) { - attr = 0; - attr_value = false; - return true; - } - return false; - } - - public override bool MoveToNextAttribute () - { - int c = AttributeCount; - if (attr + 1 < c) { - attr++; - attr_value = false; - return true; - } - return false; - } - - public override bool MoveToAttribute (string name) - { - if (name == null) - throw new ArgumentNullException ("name"); - - int c = AttributeCount; - bool match = false; - for (int i = 0; i < c; i++) { - object o = GetName (i); - if (o == null) - continue; - if ((o as string) == name) - match = true; - XName n = (XName) o; - if (name.EndsWith (n.LocalName, StringComparison.Ordinal) && name == GetPrefixedName ((XName) o)) - match = true; - if (match) { - attr = i; - attr_value = false; - return true; - } - } - return false; - } - - string GetPrefixedName (XName name) - { - XElement el = (node as XElement) ?? node.Parent; - if (el == null || - name.Namespace == XNamespace.None || - el.GetPrefixOfNamespace (name.Namespace) == String.Empty) - return name.LocalName; - return String.Concat (el.GetPrefixOfNamespace (name.Namespace), ":", name.LocalName); - } - - public override bool MoveToAttribute (string local, string ns) - { - if (local == null) - throw new ArgumentNullException ("local"); - if (ns == null) - throw new ArgumentNullException ("ns"); - - int c = AttributeCount; - bool match = false; - for (int i = 0; i < c; i++) { - object o = GetName (i); - if (o == null) - continue; - if ((o as string) == local && ns.Length == 0) - match = true; - XName n = (XName) o; - if (local == n.LocalName && ns == n.NamespaceName) - match = true; - if (match) { - attr = i; - attr_value = false; - return true; - } - } - return false; - } - - public override string GetAttribute (int i) - { - int a_bak = attr; - bool av_bak = attr_value; - try { - MoveToElement (); - MoveToAttribute (i); - return Value; - } finally { - attr = a_bak; - attr_value = av_bak; - } - } - - public override string GetAttribute (string name) - { - int a_bak = attr; - bool av_bak = attr_value; - try { - MoveToElement (); - return MoveToAttribute (name) ? Value : null; - } finally { - attr = a_bak; - attr_value = av_bak; - } - } - - public override string GetAttribute (string local, string ns) - { - int a_bak = attr; - bool av_bak = attr_value; - try { - MoveToElement (); - return MoveToAttribute (local, ns) ? Value : null; - } finally { - attr = a_bak; - attr_value = av_bak; - } - } - - public override bool Read () - { - // clear attribute state on element/xmldecl/dtd. - attr = -1; - attr_value = false; - - switch (state) { - case ReadState.Initial: - state = ReadState.Interactive; - XDocument doc = node as XDocument; - if (doc != null) { - if (doc.Declaration != null) - return true; - } - else - return true; // any other root - break; - case ReadState.Interactive: - break; - default: - return false; - } - - // when positioned on xmldecl, move to children - if (node is XDocument) { - XDocument doc = node as XDocument; - node = doc.FirstNode; - if (node == null) { - state = ReadState.EndOfFile; - return false; - } - node = doc.FirstNode; - return true; - } - - XElement c = node as XElement; - if (c != null && !end_element) { - if (c.FirstNode != null) { - node = c.FirstNode; - return true; - } else if (!c.IsEmpty) { - // empty but full EndElement - end_element = true; - return true; - } - } - end_element = false; - if (node.NextNode != null && node != start) { - node = node.NextNode; - return true; - } - if (node.Parent == null || node == start) { - state = ReadState.EndOfFile; - return false; - } - node = node.Parent; - end_element = true; - return true; - } - - public - override - bool ReadAttributeValue () - { - if (attr < 0 || attr_value) - return false; - attr_value = true; - return true; - } - - public override void ResolveEntity () - { - throw new NotSupportedException (); - } - - // Note that this does not return attribute node. - internal XNode CurrentNode { - get { return node; } - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XNodeWriter.cs b/Saleslogix.SData.Client/LinqToXml/XNodeWriter.cs deleted file mode 100644 index 3ba281f1..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XNodeWriter.cs +++ /dev/null @@ -1,403 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Xml; - -namespace System.Xml.Linq -{ - internal class XNodeWriter : XmlWriter - { - public XNodeWriter (XContainer fragment) - { - root = fragment; - state = XmlNodeType.None; - current = fragment; - } - - XContainer root; - bool is_closed; - // If it is not null, then we are now inside the element. - XContainer current; - // If it is not null, then we are now inside the attribute. - XAttribute attribute; - - // None: started or closed. - // XmlDeclaration: after xmldecl. Never allow xmldecl. - // DocumentType: after doctype. Never allow xmldecl and doctype. - // Element: inside document element. - // - XmlNodeType state; - - // Properties - - public override WriteState WriteState { - get { - if (is_closed) - return WriteState.Closed; - if (attribute != null) - return WriteState.Attribute; - - switch (state) { - case XmlNodeType.None: - return WriteState.Start; - case XmlNodeType.XmlDeclaration: - return WriteState.Prolog; - case XmlNodeType.DocumentType: - return WriteState.Element; - default: - return WriteState.Content; - } - } - } - - /* - public override string XmlLang { - get { - for (XElement n = current as XElement; n != null; n = n.Parent as XElement) - if (n.HasAttribute ("xml:lang")) - return n.GetAttribute ("xml:lang"); - return String.Empty; - } - } - - public override XmlSpace XmlSpace { - get { - for (XElement n = current as XElement; n != null; n = n.Parent as XElement) { - string xs = n.GetAttribute ("xml:space"); - switch (xs) { - case "preserve": - return XmlSpace.Preserve; - case "default": - return XmlSpace.Default; - case "": - continue; - default: - throw new InvalidOperationException (String.Format ("Invalid xml:space {0}.", xs)); - } - } - return XmlSpace.None; - } - } - */ - - // Private Methods - - void CheckState () - { - if (is_closed) - throw new InvalidOperationException (); - - } - - void WritePossiblyTopLevelNode (XNode n, bool possiblyAttribute) - { - CheckState (); - if (!possiblyAttribute && attribute != null) - throw new InvalidOperationException (String.Format ("Current state is not acceptable for {0}.", n.NodeType)); - - if (state != XmlNodeType.Element) - root.Add (n); - else if (attribute != null) - attribute.Value += XUtil.ToString (n); - else - current.Add (n); - if (state == XmlNodeType.None) - state = XmlNodeType.XmlDeclaration; - } - - // unlike other XmlWriters the callers must set xmlns - // attribute to overwrite prefix. - void FillXmlns (XElement el, string prefix, XNamespace xns) - { - if (xns == XNamespace.Xmlns) - // do nothing for xmlns attributes - return; - if (prefix == null) - return; - - if (xns == XNamespace.None) - if (el.GetPrefixOfNamespace (xns) != prefix) - el.SetAttributeValue (prefix == String.Empty ? XNamespace.None.GetName ("xmlns") : XNamespace.Xmlns.GetName (prefix), xns.NamespaceName); - else if (el.GetDefaultNamespace () != XNamespace.None) - el.SetAttributeValue (XNamespace.None.GetName ("xmlns"), xns.NamespaceName); - } - - // Public Methods - - public override void Close () - { - CheckState (); - is_closed = true; - } - - public override void Flush () - { - } - - public override string LookupPrefix (string ns) - { - CheckState (); - if (current == null) - throw new InvalidOperationException (); - XElement el = (current as XElement) ?? current.Parent; - return el != null ? el.GetPrefixOfNamespace (XNamespace.Get (ns)) : null; - } - - // StartDocument - - public override void WriteStartDocument () - { - WriteStartDocument (null); - } - - public override void WriteStartDocument (bool standalone) - { - WriteStartDocument (standalone ? "yes" : "no"); - } - - void WriteStartDocument (string sddecl) - { - CheckState (); - if (state != XmlNodeType.None) - throw new InvalidOperationException ("Current state is not acceptable for xmldecl."); - XDocument doc = current as XDocument; - if (doc == null) - throw new InvalidOperationException ("Only document node can accept xml declaration"); - - doc.Declaration = new XDeclaration ("1.0", null, sddecl); - state = XmlNodeType.XmlDeclaration; - } - - // EndDocument - - public override void WriteEndDocument () - { - CheckState (); - - is_closed = true; - } - - // DocumentType - public override void WriteDocType (string name, string publicId, string systemId, string internalSubset) - { - CheckState (); - switch (state) { - case XmlNodeType.None: - case XmlNodeType.XmlDeclaration: - XDocument doc = current as XDocument; - if (doc == null) - throw new InvalidOperationException ("Only document node can accept doctype declaration"); - doc.Add (new XDocumentType (name, publicId, systemId, internalSubset)); - state = XmlNodeType.DocumentType; - break; - default: - throw new InvalidOperationException ("Current state is not acceptable for doctype."); - } - } - - // StartElement - - public override void WriteStartElement (string prefix, string name, string ns) - { - CheckState (); - - XNamespace xns = XNamespace.Get (ns ?? String.Empty); - XElement el = new XElement (xns.GetName (name)); - if (current == null) { - root.Add (el); - state = XmlNodeType.Element; - } else { - current.Add (el); - state = XmlNodeType.Element; - } - - FillXmlns (el, prefix, xns); - - current = el; - } - - // EndElement - - public override void WriteEndElement () - { - WriteEndElementInternal (false); - } - - public override void WriteFullEndElement () - { - WriteEndElementInternal (true); - } - - void WriteEndElementInternal (bool forceFull) - { - CheckState (); - if (current == null) - throw new InvalidOperationException ("Current state is not acceptable for endElement."); - - XElement el = current as XElement; - if (forceFull) - el.IsEmpty = false; - - current = current.Parent; - } - - // StartAttribute - - public override void WriteStartAttribute (string prefix, string name, string ns) - { - CheckState (); - if (attribute != null) - throw new InvalidOperationException ("There is an open attribute."); - XElement el = current as XElement; - if (el == null) - throw new InvalidOperationException ("Current state is not acceptable for startAttribute."); - if (prefix == null) - prefix = String.Empty; - - // special case: in XmlWriter context, xmlns="blah" is - // passeed as localName = "xmlns", ns = w3c_xmlns. - if (prefix.Length == 0 && name == "xmlns" && ns == XNamespace.Xmlns.NamespaceName) - ns = String.Empty; - - XNamespace xns = ns == null ? XNamespace.None : XNamespace.Get (ns); - el.SetAttributeValue (xns.GetName (name), String.Empty); - attribute = el.LastAttribute; - FillXmlns (el, ns != null ? prefix : null, xns); - } - - public override void WriteEndAttribute () - { - CheckState (); - if (attribute == null) - throw new InvalidOperationException ("Current state is not acceptable for startAttribute."); - - attribute = null; - } - - public override void WriteCData (string data) - { - CheckState (); - if (current == null) - throw new InvalidOperationException ("Current state is not acceptable for CDATAsection."); - - current.Add (new XCData (data)); - } - - public override void WriteComment (string comment) - { - WritePossiblyTopLevelNode (new XComment (comment), false); - } - - public override void WriteProcessingInstruction (string name, string value) - { - WritePossiblyTopLevelNode ( - new XProcessingInstruction (name, value), false); - } - - public override void WriteEntityRef (string name) - { - throw new NotSupportedException (); - } - - public override void WriteCharEntity (char c) - { - throw new NotSupportedException (); - } - - public override void WriteWhitespace (string ws) - { - // FIXME: check whitespace - WritePossiblyTopLevelNode (new XText (ws), true); - } - - public override void WriteString (string data) - { - CheckState (); - if (current == null) - throw new InvalidOperationException ("Current state is not acceptable for Text."); - - if (attribute != null) - attribute.Value += data; - else - current.Add (data); - } - - public override void WriteName (string name) - { - WriteString (name); - } - - public override void WriteNmToken (string nmtoken) - { - WriteString (nmtoken); - } - - public override void WriteQualifiedName (string name, string ns) - { - string prefix = LookupPrefix (ns); - if (prefix == null) - throw new ArgumentException (String.Format ("Invalid namespace {0}", ns)); - if (prefix != String.Empty) - WriteString (name); - else - WriteString (prefix + ":" + name); - } - - public override void WriteChars (char [] chars, int start, int len) - { - WriteString (new string (chars, start, len)); - } - - public override void WriteRaw (string data) - { - // It never supports raw string. - WriteString (data); - } - - public override void WriteRaw (char [] chars, int start, int len) - { - // It never supports raw string. - WriteChars (chars, start, len); - } - - public override void WriteBase64 (byte [] data, int start, int len) - { - // It never supports raw string. - WriteString (Convert.ToBase64String (data, start, len)); - } - - public override void WriteBinHex (byte [] data, int start, int len) - { - throw new NotImplementedException (); - } - - public override void WriteSurrogateCharEntity (char c1, char c2) - { - throw new NotImplementedException (); - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XObject.cs b/Saleslogix.SData.Client/LinqToXml/XObject.cs deleted file mode 100644 index 4a0f8b72..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XObject.cs +++ /dev/null @@ -1,223 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Xml; - -namespace System.Xml.Linq -{ - internal abstract class XObject : IXmlLineInfo - { - internal XObject () - { - } - - XContainer owner; - List annotations; - string baseuri; - int line, column; - - public event EventHandler Changing; - public event EventHandler Changed; - - public string BaseUri { - get { return baseuri; } - internal set { baseuri = value; } - } - - public XDocument Document { - get { - if (this is XDocument) - return (XDocument) this; - - for (XContainer e = owner; e != null; e = e.owner) - if (e is XDocument) - return (XDocument) e; - return null; - } - } - - public abstract XmlNodeType NodeType { get; } - - public XElement Parent { - get { return owner as XElement; } - } - - internal XContainer Owner { - get { return owner; } - } - - internal void SetOwner (XContainer node) - { - owner = node; - } - - public void AddAnnotation (object annotation) - { - if (annotation == null) - throw new ArgumentNullException ("annotation"); - if (annotations == null) - annotations = new List (); - annotations.Add (annotation); - } - - public T Annotation () where T : class - { - return (T) Annotation (typeof (T)); - } - - public object Annotation (Type type) - { - return Annotations (type).FirstOrDefault (); - } - - public IEnumerable Annotations () where T : class - { - foreach (T o in Annotations (typeof (T))) - yield return o; - } - - public IEnumerable Annotations (Type type) - { - if (type == null) - throw new ArgumentNullException ("type"); - if (annotations == null) - yield break; - foreach (object o in annotations) - if (type.IsAssignableFrom (o.GetType ())) - yield return o; - } - - public void RemoveAnnotations () where T : class - { - RemoveAnnotations (typeof (T)); - } - - public void RemoveAnnotations (Type type) - { - if (annotations == null) - return; - for (int i = 0; i < annotations.Count; i++) - if (type.IsAssignableFrom (annotations [i].GetType ())) - annotations.RemoveAt (i); - } - - internal int LineNumber { - get { return line; } - set { line = value; } - } - - internal int LinePosition { - get { return column; } - set { column = value; } - } - - int IXmlLineInfo.LineNumber { - get { return LineNumber; } - } - - int IXmlLineInfo.LinePosition { - get { return LinePosition; } - } - - bool IXmlLineInfo.HasLineInfo () - { - return line > 0; - } - - internal void FillLineInfoAndBaseUri (XmlReader r, LoadOptions options) - { - if ((options & LoadOptions.SetLineInfo) != LoadOptions.None) { - IXmlLineInfo li = r as IXmlLineInfo; - if (li != null && li.HasLineInfo ()) { - LineNumber = li.LineNumber; - LinePosition = li.LinePosition; - } - } - if ((options & LoadOptions.SetBaseUri) != LoadOptions.None) - BaseUri = r.BaseURI; - } - - internal void OnAddingObject (object addedObject) - { - OnChanging (addedObject, new XObjectChangeEventArgs (XObjectChange.Add)); - } - - internal void OnAddedObject (object addedObject) - { - OnChanged (addedObject, new XObjectChangeEventArgs (XObjectChange.Add)); - } - - internal void OnNameChanging (object renamedObject) - { - OnChanging (renamedObject, new XObjectChangeEventArgs (System.Xml.Linq.XObjectChange.Name)); - } - - internal void OnNameChanged (object renamedObject) - { - OnChanged (renamedObject, new XObjectChangeEventArgs (System.Xml.Linq.XObjectChange.Name)); - } - - internal void OnRemovingObject (object removedObject) - { - OnChanging (removedObject, new XObjectChangeEventArgs (XObjectChange.Remove)); - } - - internal void OnRemovedObject (object removedObject) - { - OnChanged (removedObject, new XObjectChangeEventArgs (XObjectChange.Remove)); - } - - internal void OnValueChanging (object changedObject) - { - OnChanging (changedObject, new XObjectChangeEventArgs (XObjectChange.Value)); - } - - internal void OnValueChanged (object changedObject) - { - OnChanged (changedObject, new XObjectChangeEventArgs (XObjectChange.Value)); - } - - - void OnChanging (object sender, XObjectChangeEventArgs args) - { - if (Changing != null) - Changing (sender, args); - if (Parent != null) - Parent.OnChanging (sender, args); - } - - void OnChanged (object sender, XObjectChangeEventArgs args) - { - if (Changed != null) - Changed (sender, args); - if (Parent != null) - Parent.OnChanged (sender, args); - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XObjectChange.cs b/Saleslogix.SData.Client/LinqToXml/XObjectChange.cs deleted file mode 100644 index 57de02c7..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XObjectChange.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Xml.Linq -{ - internal enum XObjectChange - { - Add, - Remove, - Name, - Value - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XObjectChangeEventArgs.cs b/Saleslogix.SData.Client/LinqToXml/XObjectChangeEventArgs.cs deleted file mode 100644 index cf19fa00..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XObjectChangeEventArgs.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Xml; - -namespace System.Xml.Linq -{ - internal class XObjectChangeEventArgs : EventArgs - { - public XObjectChangeEventArgs (XObjectChange objectChange) - { - this.type = objectChange; - } - - // Note that those fields cannot be directly referenced in - // any object comparisons, as there could be other instances. - public static readonly XObjectChangeEventArgs Add = - new XObjectChangeEventArgs (XObjectChange.Add); - public static readonly XObjectChangeEventArgs Name = - new XObjectChangeEventArgs (XObjectChange.Name); - public static readonly XObjectChangeEventArgs Remove = - new XObjectChangeEventArgs (XObjectChange.Remove); - public static readonly XObjectChangeEventArgs Value = - new XObjectChangeEventArgs (XObjectChange.Value); - - public XObjectChange ObjectChange { - get { return type; } - } - - XObjectChange type; - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XProcessingInstruction.cs b/Saleslogix.SData.Client/LinqToXml/XProcessingInstruction.cs deleted file mode 100644 index fce48081..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XProcessingInstruction.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Xml; - -namespace System.Xml.Linq -{ - internal class XProcessingInstruction : XNode - { - string name; - string data; - - public XProcessingInstruction (string target, string data) - { - if (target == null) - throw new ArgumentNullException ("target"); - if (data == null) - throw new ArgumentNullException ("data"); - this.name = target; - this.data = data; - } - - public XProcessingInstruction (XProcessingInstruction other) - { - if (other == null) - throw new ArgumentNullException ("other"); - this.name = other.name; - this.data = other.data; - } - - public string Data { - get { return data; } - set { - if (value == null) - throw new ArgumentNullException ("value"); - this.data = value; - } - } - - public override XmlNodeType NodeType { - get { return XmlNodeType.ProcessingInstruction; } - } - - public string Target { - get { return name; } - set { - if (value == null) - throw new ArgumentNullException ("value"); - name = value; - } - } - - public override void WriteTo (XmlWriter writer) - { - writer.WriteProcessingInstruction (name, data); - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XStreamingElement.cs b/Saleslogix.SData.Client/LinqToXml/XStreamingElement.cs deleted file mode 100644 index 88d07792..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XStreamingElement.cs +++ /dev/null @@ -1,184 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.IO; -using System.Collections.Generic; - -namespace System.Xml.Linq -{ - internal class XStreamingElement - { - public XStreamingElement (XName name) - { - Name = name; - } - - public XStreamingElement (XName name, object content) - : this (name) - { - Add (content); - } - - public XStreamingElement (XName name, params object [] content) - : this (name) - { - Add (content); - } - - XName name; - List contents; - - public XName Name { - get { return name; } - set { name = value; } - } - - internal IEnumerable Contents { - get { return contents; } - } - - public void Add (object content) - { - if (contents == null) - contents = new List (); - contents.Add (content); - } - - public void Add (params object [] content) - { - if (contents == null) - contents = new List (); - contents.Add (content); - } - - public void Save (string fileName) - { - using (TextWriter w = File.CreateText (fileName)) - Save (w, SaveOptions.None); - } - - public void Save (TextWriter textWriter) - { - Save (textWriter, SaveOptions.None); - } - - public void Save (XmlWriter writer) - { - WriteTo (writer); - } - - public void Save (string fileName, SaveOptions options) - { - using (TextWriter w = File.CreateText (fileName)) - Save (w, options); - } - - public void Save (TextWriter textWriter, SaveOptions options) - { - XmlWriterSettings s = new XmlWriterSettings (); - s.OmitXmlDeclaration = true; - - if ((options & SaveOptions.DisableFormatting) == SaveOptions.None) - s.Indent = true; -#if NET_4_0 - if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces) - s.NamespaceHandling |= NamespaceHandling.OmitDuplicates; -#endif - using (XmlWriter w = XmlWriter.Create (textWriter, s)) - WriteTo (w); - } - -#if NET_4_0 - public void Save (Stream stream) - { - Save (stream, SaveOptions.None); - } - - public void Save (Stream stream, SaveOptions options) - { - XmlWriterSettings s = new XmlWriterSettings (); - if ((options & SaveOptions.DisableFormatting) == SaveOptions.None) - s.Indent = true; - if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces) - s.NamespaceHandling |= NamespaceHandling.OmitDuplicates; - - using (var writer = XmlWriter.Create (stream, s)){ - WriteTo (writer); - } - } -#endif - - public override string ToString () - { - return ToString (SaveOptions.None); - } - - public string ToString (SaveOptions options) - { - StringWriter sw = new StringWriter (); - Save (sw, options); - return sw.ToString (); - } - - public void WriteTo (XmlWriter writer) - { - writer.WriteStartElement (name.LocalName, name.Namespace.NamespaceName); - WriteContents (contents, writer); - writer.WriteEndElement (); - } - - void WriteContents (IEnumerable items, XmlWriter w) - { - foreach (object o in XUtil.ExpandArray (items)) { - if (o == null) - continue; - else if (o is XStreamingElement) - ((XStreamingElement) o).WriteTo (w); - else if (o is XNode) - ((XNode) o).WriteTo (w); - else if (o is object []) - WriteContents ((object []) o, w); - else if (o is XAttribute) - WriteAttribute ((XAttribute) o, w); - else - new XText (o.ToString ()).WriteTo (w); - } - } - - void WriteAttribute (XAttribute a, XmlWriter w) - { - if (a.IsNamespaceDeclaration) { - if (a.Name.Namespace == XNamespace.Xmlns) - w.WriteAttributeString ("xmlns", a.Name.LocalName, XNamespace.Xmlns.NamespaceName, a.Value); - else - w.WriteAttributeString ("xmlns", a.Value); - } - else - w.WriteAttributeString (a.Name.LocalName, a.Name.Namespace.NamespaceName, a.Value); - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XText.cs b/Saleslogix.SData.Client/LinqToXml/XText.cs deleted file mode 100644 index 63981424..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XText.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.IO; -using System.Linq; -using System.Text; -using System.Xml; - -namespace System.Xml.Linq -{ - internal class XText : XNode - { - string value; - - public XText (string value) - { - this.value = value; - } - - public XText (XText other) - { - value = other.value; - } - - public override XmlNodeType NodeType { - get { return XmlNodeType.Text; } - } - - public string Value { - get { return value; } - set { - if (value == null) - throw new ArgumentNullException ("value"); - this.value = value; - } - } - - public override void WriteTo (XmlWriter writer) - { - if (Value.Length > 0 && Value.All (c => c == ' ' || c == '\t' || c == '\r' || c == '\n')) - writer.WriteWhitespace (value); - else - writer.WriteString (value); - } - } -} diff --git a/Saleslogix.SData.Client/LinqToXml/XUtil.cs b/Saleslogix.SData.Client/LinqToXml/XUtil.cs deleted file mode 100644 index 69cb484b..00000000 --- a/Saleslogix.SData.Client/LinqToXml/XUtil.cs +++ /dev/null @@ -1,152 +0,0 @@ -// -// Authors: -// Atsushi Enomoto -// -// Copyright 2007 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Text; -using System.Xml; - -using XPI = System.Xml.Linq.XProcessingInstruction; - -namespace System.Xml.Linq -{ - internal static class XUtil - { - public const string XmlnsNamespace = - "http://www.w3.org/2000/xmlns/"; - - public static bool ConvertToBoolean (string s) - { - return XmlConvert.ToBoolean (s.ToLower (CultureInfo.InvariantCulture)); - } - - public static DateTime ToDateTime (string s) - { - try { - return XmlConvert.ToDateTime (s, XmlDateTimeSerializationMode.RoundtripKind); - } catch { - return DateTime.Parse (s); - } - } - - public static string ToString (object o) - { - if (o == null) - throw new InvalidOperationException ("Attempt to get string from null"); - - switch (Type.GetTypeCode (o.GetType ())) { - case TypeCode.String: - return (string) o; - case TypeCode.DateTime: - return XmlConvert.ToString ((DateTime) o, XmlDateTimeSerializationMode.RoundtripKind); - case TypeCode.Decimal: - return ((decimal) o).ToString (CultureInfo.InvariantCulture); - case TypeCode.Double: - return ((double) o).ToString ("r", CultureInfo.InvariantCulture); - case TypeCode.Single: - return ((float) o).ToString ("r", CultureInfo.InvariantCulture); - case TypeCode.Boolean: - // Valid XML values are `true' and `false', not `True' and `False' that boolean returns - return o.ToString().ToLower(); - default: - if (o is TimeSpan) - return XmlConvert.ToString ((TimeSpan) o); - if (o is DateTimeOffset) - return XmlConvert.ToString ((DateTimeOffset) o); - return o.ToString (); - } - } - - public static bool ToBoolean (object o) - { - throw new NotImplementedException (); - } - - public static Nullable ToNullableBoolean (object o) - { - throw new NotImplementedException (); - } - - public static IEnumerable ExpandArray (object o) - { - XNode n = o as XNode; - if (n != null) - yield return n; - else if (o is string) - yield return o; - else if (o is IEnumerable) - foreach (object obj in (IEnumerable) o) - foreach (object oo in ExpandArray (obj)) - yield return oo; - else - yield return o; - } - - public static XNode ToNode (object o) - { - if (o is XAttribute) - throw new ArgumentException ("Attribute node is not allowed as argument"); - XNode n = o as XNode; - if (n != null) - return n; - else if (o is string) - return new XText ((string) o); - else - return new XText (ToString (o)); - } - - public static object GetDetachedObject (XObject child) - { - return child.Owner != null ? Clone (child) : child; - } - - public static object Clone (object o) - { - if (o is string) - return (string) o; - if (o is XAttribute) - return new XAttribute ((XAttribute) o); - if (o is XElement) - return new XElement ((XElement) o); - if (o is XCData) - return new XCData ((XCData) o); - if (o is XComment) - return new XComment ((XComment) o); - if (o is XPI) - return new XPI ((XPI) o); - if (o is XDeclaration) - return new XDeclaration ((XDeclaration) o); - if (o is XDocumentType) - return new XDocumentType ((XDocumentType) o); - if (o is XText) - return new XText ((XText) o); - throw new ArgumentException (); - } - } -} diff --git a/Saleslogix.SData.Client/Properties/AssemblyInfo.cs b/Saleslogix.SData.Client/Properties/AssemblyInfo.cs index 4b213312..001ff6e9 100644 --- a/Saleslogix.SData.Client/Properties/AssemblyInfo.cs +++ b/Saleslogix.SData.Client/Properties/AssemblyInfo.cs @@ -9,9 +9,9 @@ [assembly: AssemblyTitle("Saleslogix.SData.Client")] [assembly: AssemblyDescription("Saleslogix SData client library for .NET")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("SalesLogix NA, LLC")] +[assembly: AssemblyCompany("Infor")] [assembly: AssemblyProduct("Saleslogix.SData.Client")] -[assembly: AssemblyCopyright("Copyright (c) 1997-2014, SalesLogix NA, LLC. All rights reserved.")] +[assembly: AssemblyCopyright("Copyright 2026 Infor. All rights reserved. www.infor.com")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -25,10 +25,10 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("2.1.0.0")] -[assembly: AssemblyFileVersion("2.1.0.0")] +[assembly: AssemblyVersion("2.0")] +[assembly: AssemblyFileVersion("2.0.3.1565")] [assembly: NeutralResourcesLanguage("en-US")] -[assembly: AssemblyInformationalVersion("2.1.0.0")] +[assembly: AssemblyInformationalVersion("2.0")] [assembly: InternalsVisibleTo("Saleslogix.SData.Client.Test, PublicKey=" + "00240000048000009400000006020000002400005253413100040000010001004f6d7cc2aca5bfa8" + "d454d328b17b843b6e660947a1b16f179307ff46cba02baef4670c51eba6a98e724b95e43719ba64" + diff --git a/Saleslogix.SData.Client/SDataClient.cs b/Saleslogix.SData.Client/SDataClient.cs index 1050a0c3..5f67a75a 100644 --- a/Saleslogix.SData.Client/SDataClient.cs +++ b/Saleslogix.SData.Client/SDataClient.cs @@ -51,7 +51,14 @@ internal SDataClient(string uri, Func requestFactory) public string Uri { get; set; } public string UserName { get; set; } public string Password { get; set; } - public string UserAgent { get; set; } + + private string _userAgent = SDataConstants.UserAgent; + public string UserAgent + { + get => _userAgent; + set => _userAgent = value; + } + public int? Timeout { get; set; } public int? TimeoutRetryAttempts { get; set; } public bool UseHttpMethodOverride { get; set; } @@ -462,7 +469,7 @@ private SDataRequest CreateRequest(SDataUri uri, HttpMethod method, object conte request.Proxy = Proxy; #endif #if !PCL && !NETFX_CORE && !SILVERLIGHT - request.UserAgent = UserAgent; + request.UserAgent = !string.IsNullOrWhiteSpace(UserAgent) ? UserAgent : SDataConstants.UserAgent; if (Timeout != null) { request.Timeout = Timeout.Value; diff --git a/Saleslogix.SData.Client/SDataConstants.cs b/Saleslogix.SData.Client/SDataConstants.cs new file mode 100644 index 00000000..a013e383 --- /dev/null +++ b/Saleslogix.SData.Client/SDataConstants.cs @@ -0,0 +1,7 @@ +namespace Saleslogix.SData.Client +{ + public static class SDataConstants + { + public const string UserAgent = "DotNetSDataClient"; + } +} \ No newline at end of file diff --git a/Saleslogix.SData.Client/Saleslogix.SData.Client_452.csproj b/Saleslogix.SData.Client/Saleslogix.SData.Client_452.csproj index 02293f3a..e39b684a 100644 --- a/Saleslogix.SData.Client/Saleslogix.SData.Client_452.csproj +++ b/Saleslogix.SData.Client/Saleslogix.SData.Client_452.csproj @@ -350,6 +350,7 @@ + diff --git a/Saleslogix.SData.Client/Saleslogix.SData.Client_472.csproj b/Saleslogix.SData.Client/Saleslogix.SData.Client_472.csproj index ee7fbe37..c5a08055 100644 --- a/Saleslogix.SData.Client/Saleslogix.SData.Client_472.csproj +++ b/Saleslogix.SData.Client/Saleslogix.SData.Client_472.csproj @@ -350,6 +350,7 @@ + diff --git a/Saleslogix.SData.Client/Saleslogix.SData.Client_48.csproj b/Saleslogix.SData.Client/Saleslogix.SData.Client_48.csproj index 9c7a8cda..1eed29dd 100644 --- a/Saleslogix.SData.Client/Saleslogix.SData.Client_48.csproj +++ b/Saleslogix.SData.Client/Saleslogix.SData.Client_48.csproj @@ -350,6 +350,7 @@ + diff --git a/Saleslogix.SData.Client/Saleslogix.SData.Client_4_0.csproj b/Saleslogix.SData.Client/Saleslogix.SData.Client_4_0.csproj index 5a50894a..1498a3c4 100644 --- a/Saleslogix.SData.Client/Saleslogix.SData.Client_4_0.csproj +++ b/Saleslogix.SData.Client/Saleslogix.SData.Client_4_0.csproj @@ -349,6 +349,7 @@ + @@ -370,6 +371,10 @@ + + + + T> zJQfxX1Cv7Ba1O>dUo&tuB$gSdNmwqUYCq^YmU+Vwx`m>H@oLn=!LQZMHJ~pTRxW#f zhcqeHhSK+eO6Hq1>#mrNLY?A{NAu2!TbQr5>lV{g^v6iNl^$A zs^tmuoKI9seaWVPRo%n1Qna%VU@mkhAl+9i25)2z+6x-DbOU19`IJxU-bihQg_jPP z7GL(ojHzHYvMsMs$P@)Gu;<|-?FhJq6zVrw&qLdff^sBrotPv`!7%z+FxWIo39+)W z5GeHd6`E!MB><&@bS@fvI~mJNN3~#dS@%o^yo4mCDfJ?4Mphu*A0n2pG-4t}tDk!} zUx%pV>r2-_i1qXqUrjCjX7F)tfm3`icgSYMn`Gkvd1k6^q!eX2EvozL-j{5~YUYS_ z??YPkg6YP$pptVdVN8>VjYlZ738a)y{l1onyekbZ;lag{J!xe0`Bk zzDVd4NkY`IRZ)K)O_Uz1k5}#fn6p=>(!B#Lv6fr96W=n^je$cI@Ee^z!?_FLnCd{S zD9HQyb?;_e3{eS~?mfexdxt?kB{a_Y89%z7v2EBdDl9Mw%?_=>}sY?PtGe^h@X_>ukool(H^^!(u@J zGA3cMAdr;-PylJ!xo>C=?gqqSmrHiK%k=}kOLiCthGk;FEF)ijjec6fJtbr-&KE$A zc9jI7aZD{T5#tzQF^(}u8^?@{Hwf`-J}KTRqnPz(qIjC#PHd3x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na Date: Thu, 7 May 2026 21:14:08 -0500 Subject: [PATCH 2/8] INFORCRM-34691: CS1286371 Google calendar not syncing (SData Sync Config) Fix required for Windows Update KB5068861 where a web request can lead to a 403 Forbidden error if the User-Agent is missing. Unloaded the .NET 4.0 project and changed references to 452 where appropriate. --- .github/workflows/build-and-test.yml | 2 +- DotNetSDataClient.Framework.sln | 2 +- ...> Saleslogix.SData.Client.Test_452.csproj} | 15 ++++---- .../Properties/Settings.Designer.cs | 4 +-- demos/SDataClientApp/SDataClientApp.csproj | 15 ++++---- demos/SDataClientApp/app.config | 34 +++++++++---------- .../Properties/Settings.Designer.cs | 4 +-- demos/SlxFileBrowser/SlxFileBrowser.csproj | 15 ++++---- demos/SlxFileBrowser/app.config | 6 ++-- .../Properties/Settings.Designer.cs | 4 +-- demos/SlxJobScheduler/SlxJobScheduler.csproj | 21 +++++++----- demos/SlxJobScheduler/app.config | 6 ++-- 12 files changed, 70 insertions(+), 58 deletions(-) rename Saleslogix.SData.Client.Test/{Saleslogix.SData.Client.Test_4_0.csproj => Saleslogix.SData.Client.Test_452.csproj} (93%) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index f9c947da..a92fba36 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -29,7 +29,7 @@ jobs: run: nuget install NUnit.Runners -Version 2.7.1 -OutputDirectory packages -Source https://api.nuget.org/v3/index.json - name: Run tests - run: packages/NUnit.Runners.2.7.1/tools/nunit-console.exe dist/Debug/Net40/Saleslogix.SData.Client.Test.dll /nologo /result=test-results.xml + run: packages/NUnit.Runners.2.7.1/tools/nunit-console.exe dist/Debug/Net452/Saleslogix.SData.Client.Test.dll /nologo /result=test-results.xml - name: Upload test results if: always() diff --git a/DotNetSDataClient.Framework.sln b/DotNetSDataClient.Framework.sln index 9a234dbf..4efb3b41 100644 --- a/DotNetSDataClient.Framework.sln +++ b/DotNetSDataClient.Framework.sln @@ -10,7 +10,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SlxFileBrowser", "demos\Slx EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SlxJobScheduler", "demos\SlxJobScheduler\SlxJobScheduler.csproj", "{5CC2002C-8D4A-47F3-847C-3C8EAF485C36}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Saleslogix.SData.Client.Test_4_0", "Saleslogix.SData.Client.Test\Saleslogix.SData.Client.Test_4_0.csproj", "{92C27580-82D9-46FC-8E4A-9B75E6FF6C2B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Saleslogix.SData.Client.Test_452", "Saleslogix.SData.Client.Test\Saleslogix.SData.Client.Test_452.csproj", "{92C27580-82D9-46FC-8E4A-9B75E6FF6C2B}" ProjectSection(ProjectDependencies) = postProject {FEECA9B9-980E-470F-81BA-C56ABD8D520E} = {FEECA9B9-980E-470F-81BA-C56ABD8D520E} EndProjectSection diff --git a/Saleslogix.SData.Client.Test/Saleslogix.SData.Client.Test_4_0.csproj b/Saleslogix.SData.Client.Test/Saleslogix.SData.Client.Test_452.csproj similarity index 93% rename from Saleslogix.SData.Client.Test/Saleslogix.SData.Client.Test_4_0.csproj rename to Saleslogix.SData.Client.Test/Saleslogix.SData.Client.Test_452.csproj index 6ad985b9..70576c22 100644 --- a/Saleslogix.SData.Client.Test/Saleslogix.SData.Client.Test_4_0.csproj +++ b/Saleslogix.SData.Client.Test/Saleslogix.SData.Client.Test_452.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -10,10 +10,11 @@ Properties Saleslogix.SData.Client.Test Saleslogix.SData.Client.Test - v4.0 + v4.5.2 512 true ..\DotNetSDataClient.snk + true @@ -23,6 +24,7 @@ DEBUG;TRACE;NET_4_0 prompt 4 + false pdbonly @@ -31,6 +33,7 @@ TRACE;NET_4_0 prompt 4 + false @@ -126,10 +129,10 @@ - - {FEECA9B9-980E-470F-81BA-C56ABD8D520E} - Saleslogix.SData.Client_4_0 + + {e6cfd34d-762d-47bc-af2d-b47ed6020d2a} + Saleslogix.SData.Client_452 - + \ No newline at end of file diff --git a/demos/SDataClientApp/Properties/Settings.Designer.cs b/demos/SDataClientApp/Properties/Settings.Designer.cs index e9378793..355ffd7c 100644 --- a/demos/SDataClientApp/Properties/Settings.Designer.cs +++ b/demos/SDataClientApp/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3074 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ namespace SDataClientApp.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/demos/SDataClientApp/SDataClientApp.csproj b/demos/SDataClientApp/SDataClientApp.csproj index b59a2697..aafba2c9 100644 --- a/demos/SDataClientApp/SDataClientApp.csproj +++ b/demos/SDataClientApp/SDataClientApp.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -8,9 +8,10 @@ Properties SDataClientApp SDataClientApp - v4.0 + v4.5.2 512 - Client + + AnyCPU @@ -21,6 +22,7 @@ DEBUG;TRACE prompt 4 + true AnyCPU @@ -30,6 +32,7 @@ TRACE prompt 4 + true @@ -124,9 +127,9 @@ - - {feeca9b9-980e-470f-81ba-c56abd8d520e} - Saleslogix.SData.Client_4_0 + + {e6cfd34d-762d-47bc-af2d-b47ed6020d2a} + Saleslogix.SData.Client_452 diff --git a/demos/SDataClientApp/app.config b/demos/SDataClientApp/app.config index 1f5b1378..a33947a0 100644 --- a/demos/SDataClientApp/app.config +++ b/demos/SDataClientApp/app.config @@ -1,38 +1,38 @@ - + -
+
- + - + - + - + - + - + - + - + - + 10 @@ -41,20 +41,20 @@ 1 - + - + - + - + - + - \ No newline at end of file + diff --git a/demos/SlxFileBrowser/Properties/Settings.Designer.cs b/demos/SlxFileBrowser/Properties/Settings.Designer.cs index be710720..76392131 100644 --- a/demos/SlxFileBrowser/Properties/Settings.Designer.cs +++ b/demos/SlxFileBrowser/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34014 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ namespace SlxFileBrowser.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/demos/SlxFileBrowser/SlxFileBrowser.csproj b/demos/SlxFileBrowser/SlxFileBrowser.csproj index ec0a02dc..cbd4fd1f 100644 --- a/demos/SlxFileBrowser/SlxFileBrowser.csproj +++ b/demos/SlxFileBrowser/SlxFileBrowser.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -8,9 +8,10 @@ Properties SlxFileBrowser SlxFileBrowser - v4.0 + v4.5.2 512 - Client + + AnyCPU @@ -21,6 +22,7 @@ DEBUG;TRACE prompt 4 + true AnyCPU @@ -30,6 +32,7 @@ TRACE prompt 4 + true @@ -107,9 +110,9 @@ - - {feeca9b9-980e-470f-81ba-c56abd8d520e} - Saleslogix.SData.Client_4_0 + + {e6cfd34d-762d-47bc-af2d-b47ed6020d2a} + Saleslogix.SData.Client_452 diff --git a/demos/SlxFileBrowser/app.config b/demos/SlxFileBrowser/app.config index 4f7c3d2e..92d22c93 100644 --- a/demos/SlxFileBrowser/app.config +++ b/demos/SlxFileBrowser/app.config @@ -1,8 +1,8 @@ - -
+ +
@@ -18,4 +18,4 @@ - + diff --git a/demos/SlxJobScheduler/Properties/Settings.Designer.cs b/demos/SlxJobScheduler/Properties/Settings.Designer.cs index 523b3ae2..e76c415f 100644 --- a/demos/SlxJobScheduler/Properties/Settings.Designer.cs +++ b/demos/SlxJobScheduler/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34014 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ namespace SlxJobScheduler.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/demos/SlxJobScheduler/SlxJobScheduler.csproj b/demos/SlxJobScheduler/SlxJobScheduler.csproj index 49a40e3e..918da6cb 100644 --- a/demos/SlxJobScheduler/SlxJobScheduler.csproj +++ b/demos/SlxJobScheduler/SlxJobScheduler.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -8,9 +8,10 @@ Properties SlxJobScheduler SlxJobScheduler - v4.0 + v4.5.2 512 - Client + + AnyCPU @@ -21,6 +22,7 @@ DEBUG;TRACE prompt 4 + true AnyCPU @@ -30,6 +32,7 @@ TRACE prompt 4 + true @@ -86,12 +89,6 @@ EditForm.cs - - - {feeca9b9-980e-470f-81ba-c56abd8d520e} - Saleslogix.SData.Client_4_0 - - Designer @@ -101,5 +98,11 @@ Settings.Designer.cs + + + {e6cfd34d-762d-47bc-af2d-b47ed6020d2a} + Saleslogix.SData.Client_452 + + \ No newline at end of file diff --git a/demos/SlxJobScheduler/app.config b/demos/SlxJobScheduler/app.config index 9dd1db3d..39e6de42 100644 --- a/demos/SlxJobScheduler/app.config +++ b/demos/SlxJobScheduler/app.config @@ -1,8 +1,8 @@ - -
+ +
@@ -15,4 +15,4 @@ - + From b1e5e90450f3eaa64729b40ce0a76afc044f41d6 Mon Sep 17 00:00:00 2001 From: Michael Cessna Date: Thu, 7 May 2026 21:18:38 -0500 Subject: [PATCH 3/8] INFORCRM-34691: CS1286371 Google calendar not syncing (SData Sync Config) Fix required for Windows Update KB5068861 where a web request can lead to a 403 Forbidden error if the User-Agent is missing. Unloaded the .NET 4.0 project and changed references to 452 where appropriate. --- .github/workflows/build-and-test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a92fba36..0b7fe617 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -22,6 +22,9 @@ jobs: - name: Setup NuGet uses: NuGet/setup-nuget@v2 + - name: Install .NET Framework 4.5.2 targeting pack + run: choco install netfx-4.5.2-devpack -y --no-progress + - name: Build Framework solution run: msbuild DotNetSDataClient.Framework.sln /t:Rebuild /p:Configuration=Debug /verbosity:minimal From a93c7232d8044ce145995dc15a281eae5baac350 Mon Sep 17 00:00:00 2001 From: Michael Cessna Date: Thu, 7 May 2026 21:24:45 -0500 Subject: [PATCH 4/8] INFORCRM-34691: CS1286371 Google calendar not syncing (SData Sync Config) Fix required for Windows Update KB5068861 where a web request can lead to a 403 Forbidden error if the User-Agent is missing. Unloaded the .NET 4.0 project and changed references to 452 where appropriate. --- DotNetSDataClient.Framework.sln | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/DotNetSDataClient.Framework.sln b/DotNetSDataClient.Framework.sln index 4efb3b41..1255286c 100644 --- a/DotNetSDataClient.Framework.sln +++ b/DotNetSDataClient.Framework.sln @@ -11,11 +11,6 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SlxJobScheduler", "demos\SlxJobScheduler\SlxJobScheduler.csproj", "{5CC2002C-8D4A-47F3-847C-3C8EAF485C36}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Saleslogix.SData.Client.Test_452", "Saleslogix.SData.Client.Test\Saleslogix.SData.Client.Test_452.csproj", "{92C27580-82D9-46FC-8E4A-9B75E6FF6C2B}" - ProjectSection(ProjectDependencies) = postProject - {FEECA9B9-980E-470F-81BA-C56ABD8D520E} = {FEECA9B9-980E-470F-81BA-C56ABD8D520E} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Saleslogix.SData.Client_4_0", "Saleslogix.SData.Client\Saleslogix.SData.Client_4_0.csproj", "{FEECA9B9-980E-470F-81BA-C56ABD8D520E}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Saleslogix.SData.Client_48", "Saleslogix.SData.Client\Saleslogix.SData.Client_48.csproj", "{A1A43E15-7A71-4E99-B287-04ED341860D4}" ProjectSection(ProjectDependencies) = postProject @@ -25,9 +20,6 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{11DC44D8-8C25-468D-9F91-8922B9BB5D42}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Saleslogix.SData.Client_452", "Saleslogix.SData.Client\Saleslogix.SData.Client_452.csproj", "{E6CFD34D-762D-47BC-AF2D-B47ED6020D2A}" - ProjectSection(ProjectDependencies) = postProject - {FEECA9B9-980E-470F-81BA-C56ABD8D520E} = {FEECA9B9-980E-470F-81BA-C56ABD8D520E} - EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Saleslogix.SData.Client_472", "Saleslogix.SData.Client\Saleslogix.SData.Client_472.csproj", "{17BDC943-9A2F-4E9C-B605-63491448D50F}" ProjectSection(ProjectDependencies) = postProject @@ -82,16 +74,6 @@ Global {92C27580-82D9-46FC-8E4A-9B75E6FF6C2B}.Release|ARM.ActiveCfg = Release|Any CPU {92C27580-82D9-46FC-8E4A-9B75E6FF6C2B}.Release|x64.ActiveCfg = Release|Any CPU {92C27580-82D9-46FC-8E4A-9B75E6FF6C2B}.Release|x86.ActiveCfg = Release|Any CPU - {FEECA9B9-980E-470F-81BA-C56ABD8D520E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FEECA9B9-980E-470F-81BA-C56ABD8D520E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FEECA9B9-980E-470F-81BA-C56ABD8D520E}.Debug|ARM.ActiveCfg = Debug|Any CPU - {FEECA9B9-980E-470F-81BA-C56ABD8D520E}.Debug|x64.ActiveCfg = Debug|Any CPU - {FEECA9B9-980E-470F-81BA-C56ABD8D520E}.Debug|x86.ActiveCfg = Debug|Any CPU - {FEECA9B9-980E-470F-81BA-C56ABD8D520E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FEECA9B9-980E-470F-81BA-C56ABD8D520E}.Release|Any CPU.Build.0 = Release|Any CPU - {FEECA9B9-980E-470F-81BA-C56ABD8D520E}.Release|ARM.ActiveCfg = Release|Any CPU - {FEECA9B9-980E-470F-81BA-C56ABD8D520E}.Release|x64.ActiveCfg = Release|Any CPU - {FEECA9B9-980E-470F-81BA-C56ABD8D520E}.Release|x86.ActiveCfg = Release|Any CPU {A1A43E15-7A71-4E99-B287-04ED341860D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A1A43E15-7A71-4E99-B287-04ED341860D4}.Debug|Any CPU.Build.0 = Debug|Any CPU {A1A43E15-7A71-4E99-B287-04ED341860D4}.Debug|ARM.ActiveCfg = Debug|Any CPU From 28c7e983411894bd520f109e2e3b5db6d0e00c30 Mon Sep 17 00:00:00 2001 From: Michael Cessna Date: Thu, 7 May 2026 21:35:48 -0500 Subject: [PATCH 5/8] Correct build path. --- .../Saleslogix.SData.Client.Test_452.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Saleslogix.SData.Client.Test/Saleslogix.SData.Client.Test_452.csproj b/Saleslogix.SData.Client.Test/Saleslogix.SData.Client.Test_452.csproj index 70576c22..71c47c80 100644 --- a/Saleslogix.SData.Client.Test/Saleslogix.SData.Client.Test_452.csproj +++ b/Saleslogix.SData.Client.Test/Saleslogix.SData.Client.Test_452.csproj @@ -20,7 +20,7 @@ true full false - ..\dist\Debug\Net40\ + ..\dist\Debug\Net452\ DEBUG;TRACE;NET_4_0 prompt 4 From 420f6ca407c4f19dfc90e082418af6150821df69 Mon Sep 17 00:00:00 2001 From: Michael Cessna Date: Fri, 8 May 2026 08:24:31 -0500 Subject: [PATCH 6/8] Remove nuget.config and modify the build to use the existing one. --- .github/workflows/build-and-test.yml | 39 +++++++++------------------- nuget.config | 11 -------- 2 files changed, 12 insertions(+), 38 deletions(-) delete mode 100644 nuget.config diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0b7fe617..b4a21086 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -8,25 +8,26 @@ on: workflow_dispatch: jobs: - build-framework: - name: Build .NET Framework & Run Tests - runs-on: windows-latest + build: + uses: ./.github/workflows/compile.yml + + test: + name: Run Tests + needs: build + runs-on: windows-2019 steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v2 - - name: Setup NuGet uses: NuGet/setup-nuget@v2 - - name: Install .NET Framework 4.5.2 targeting pack - run: choco install netfx-4.5.2-devpack -y --no-progress - - - name: Build Framework solution - run: msbuild DotNetSDataClient.Framework.sln /t:Rebuild /p:Configuration=Debug /verbosity:minimal + - name: Download debug build artifacts + uses: actions/download-artifact@v4 + with: + name: debug + path: dist/Debug - name: Install NUnit console runner run: nuget install NUnit.Runners -Version 2.7.1 -OutputDirectory packages -Source https://api.nuget.org/v3/index.json @@ -40,19 +41,3 @@ jobs: with: name: test-results path: test-results.xml - - build-standard: - name: Build .NET Standard/8 - runs-on: windows-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 8.0.x - - - name: Build Standard solution - run: dotnet build DotNetSDataClient.Standard.sln -c Debug --verbosity minimal diff --git a/nuget.config b/nuget.config deleted file mode 100644 index 7c5be3f0..00000000 --- a/nuget.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - From 55acc79eb45cfabb07c5219783d2a10310b2b132 Mon Sep 17 00:00:00 2001 From: Michael Cessna Date: Fri, 8 May 2026 12:41:57 -0500 Subject: [PATCH 7/8] Update the runner info. --- .github/workflows/build-and-test.yml | 2 +- .github/workflows/compile.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index b4a21086..86120424 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -14,7 +14,7 @@ jobs: test: name: Run Tests needs: build - runs-on: windows-2019 + runs-on: windows-latest steps: - name: Checkout diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index f056ad23..212a4328 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -5,7 +5,7 @@ on: jobs: build: - runs-on: windows-2019 + runs-on: windows-latest steps: - uses: actions/checkout@v4 - uses: microsoft/setup-msbuild@v1.3.3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a9f7e6b..b509ef28 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: uses: ./.github/workflows/compile.yml nuget_job: needs: build_job - runs-on: windows-2019 + runs-on: windows-latest steps: - uses: actions/checkout@v4 - uses: nuget/setup-nuget@v1 From 0306cddab38a3ad6773090026f687f4f0e1ddef7 Mon Sep 17 00:00:00 2001 From: Michael Cessna Date: Fri, 8 May 2026 12:53:27 -0500 Subject: [PATCH 8/8] Fix build issue. --- .github/workflows/compile.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 212a4328..8355920b 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -13,6 +13,9 @@ jobs: with: dotnet-version: "8.0.x" + - name: Install .NET Framework 4.5.2 targeting pack + run: choco install netfx-4.5.2-devpack -y --no-progress + - name: debug build shell: pwsh run: |