diff --git a/Android-Libtester/Android-Libtester.csproj b/Android-Libtester/Android-Libtester.csproj index df3c38db..cf24296b 100644 --- a/Android-Libtester/Android-Libtester.csproj +++ b/Android-Libtester/Android-Libtester.csproj @@ -46,9 +46,6 @@ ..\packages\Newtonsoft.Json.6.0.8\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll - - ..\packages\Remotion.Linq.2.0.0-alpha-003\lib\portable-net45+win+wpa81+wp80\Remotion.Linq.dll - @@ -82,5 +79,9 @@ {6644D98D-026B-48E9-95A3-61C4D98D82E7} Kinvey-Xamarin + + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0} + Core + \ No newline at end of file diff --git a/Android-Libtester/packages.config b/Android-Libtester/packages.config index 52806e9e..b7b06e3f 100644 --- a/Android-Libtester/packages.config +++ b/Android-Libtester/packages.config @@ -2,5 +2,4 @@ - \ No newline at end of file diff --git a/Kinvey-Xamarin-Android/Kinvey-Xamarin-Android.nuspec b/Kinvey-Xamarin-Android/Kinvey-Xamarin-Android.nuspec index a2013743..0651d511 100644 --- a/Kinvey-Xamarin-Android/Kinvey-Xamarin-Android.nuspec +++ b/Kinvey-Xamarin-Android/Kinvey-Xamarin-Android.nuspec @@ -1,15 +1,18 @@ - + - Kinvey-Android - 1.2.0 - Kinvey-Xamarin-Android - Kinvey - Kinvey + $id$ + $version$ + $title$ + $author$ + $author$ + http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE + http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE + http://ICON_URL_HERE_OR_DELETE_THIS_LINE false - Build Xamarin Android apps which leverage the power of Kinvey's BaaS, with support for users, data, and files, with caching and offline. Check out http://devcenter.kinvey.com/xamarin for guides, tutorials, and sample apps. - Initial Release with support for Push Notifications through GCM + $description$ + Summary of changes made in this release of the package. Copyright 2015 - Kinvey BaaS + Tag1 Tag2 \ No newline at end of file diff --git a/Kinvey-Xamarin-iOS/Kinvey-Xamarin-iOS.nuspec b/Kinvey-Xamarin-iOS/Kinvey-Xamarin-iOS.nuspec new file mode 100644 index 00000000..0651d511 --- /dev/null +++ b/Kinvey-Xamarin-iOS/Kinvey-Xamarin-iOS.nuspec @@ -0,0 +1,18 @@ + + + + $id$ + $version$ + $title$ + $author$ + $author$ + http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE + http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE + http://ICON_URL_HERE_OR_DELETE_THIS_LINE + false + $description$ + Summary of changes made in this release of the package. + Copyright 2015 + Tag1 Tag2 + + \ No newline at end of file diff --git a/Kinvey-Xamarin.sln b/Kinvey-Xamarin.sln index f1504fd7..6642701b 100644 --- a/Kinvey-Xamarin.sln +++ b/Kinvey-Xamarin.sln @@ -21,6 +21,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iOS-TestDrive", "..\..\ksam EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kinvey-Xamarin-iOS", "Kinvey-Xamarin-iOS\Kinvey-Xamarin-iOS.csproj", "{77548067-6F95-461C-A4D1-A051E20D30C5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "..\..\thirdparty\csharp\Relinq\Core\Core.csproj", "{028E7899-0D5F-49C8-9EB6-8B051E02F1E0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -34,6 +36,24 @@ Global AppStore|iPhone = AppStore|iPhone EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.AppStore|Any CPU.ActiveCfg = Release|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.AppStore|Any CPU.Build.0 = Release|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.AppStore|iPhone.ActiveCfg = Release|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.AppStore|iPhone.Build.0 = Release|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.Debug|iPhone.Build.0 = Debug|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.Release|Any CPU.Build.0 = Release|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.Release|iPhone.ActiveCfg = Release|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.Release|iPhone.Build.0 = Release|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0}.Release|iPhoneSimulator.Build.0 = Release|Any CPU {444456B1-5B55-48D6-9637-00ADCA92B7C9}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU {444456B1-5B55-48D6-9637-00ADCA92B7C9}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU {444456B1-5B55-48D6-9637-00ADCA92B7C9}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU diff --git a/Kinvey-Xamarin/AppData.cs b/Kinvey-Xamarin/AppData.cs index bdb7bfd3..13ffc32d 100644 --- a/Kinvey-Xamarin/AppData.cs +++ b/Kinvey-Xamarin/AppData.cs @@ -21,8 +21,6 @@ using System.IO; using System.Linq.Expressions; using System.Collections; -using LinqExtender; -using Ast = LinqExtender.Ast; using Newtonsoft.Json.Linq; using Remotion.Linq.Parsing.Structure; using KinveyUtils; diff --git a/Kinvey-Xamarin/Auth/KinveyAuthRequest.cs b/Kinvey-Xamarin/Auth/KinveyAuthRequest.cs index 8b94fcad..301495e1 100644 --- a/Kinvey-Xamarin/Auth/KinveyAuthRequest.cs +++ b/Kinvey-Xamarin/Auth/KinveyAuthRequest.cs @@ -304,8 +304,12 @@ public Builder(AbstractKinveyClient transport, string appKey, string appSecret, public Builder(AbstractKinveyClient transport, string appKey, string appSecret, string username, string password, User user) : this(transport, appKey, appSecret, user) { + this.client = transport; + this.appKeyAuthentication = new HttpBasicAuthenticator(appKey, appSecret); + this.appKey = appKey; this.username = username; this.password = password; + this.user = user; } diff --git a/Kinvey-Xamarin/DefaultContext.cs b/Kinvey-Xamarin/DefaultContext.cs deleted file mode 100644 index 3a21724d..00000000 --- a/Kinvey-Xamarin/DefaultContext.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using LinqExtender; -using Ast = LinqExtender.Ast; - -namespace KinveyXamarin -{ - /// - /// Default context to be queried. - /// - /// Target type - public class DefaultContext : ExpressionVisitor, IQueryContext - { - /// - /// Invoked during execution of the query , with the - /// pre populated expression tree. - /// - /// Target expression block - /// Expected result - public IEnumerable Execute(Ast.Expression expression) - { - //TODO: Visit the extender expression to build your meta - - this.Visit(expression); - - ///TOOD: return your result. - return null; - } - } -} diff --git a/Kinvey-Xamarin/Kinvey-Xamarin.csproj b/Kinvey-Xamarin/Kinvey-Xamarin.csproj index c0c4c5fc..dd431c28 100644 --- a/Kinvey-Xamarin/Kinvey-Xamarin.csproj +++ b/Kinvey-Xamarin/Kinvey-Xamarin.csproj @@ -68,8 +68,6 @@ - - @@ -89,7 +87,6 @@ - @@ -117,9 +114,6 @@ ..\packages\Newtonsoft.Json.6.0.8\lib\portable-net45+wp80+win8+wpa81+aspnetcore50\Newtonsoft.Json.dll - - ..\packages\LinqExtender.3.0.1\lib\LinqExtender.dll - ..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.dll @@ -129,11 +123,14 @@ ..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Extensions.dll - - ..\packages\Remotion.Linq.2.0.0-alpha-003\lib\portable-net45+win+wpa81+wp80\Remotion.Linq.dll + + ..\packages\Microsoft.Bcl.Async.1.0.168\lib\portable-net45+win8+wp8+wpa81\Microsoft.Threading.Tasks.dll + + + ..\packages\Microsoft.Bcl.Async.1.0.168\lib\portable-net45+win8+wp8+wpa81\Microsoft.Threading.Tasks.Extensions.dll - ..\packages\modernhttpclient.2.4.1\lib\Portable-Net45+WinRT45+WP8+WPA81\ModernHttpClient.dll + ..\packages\modernhttpclient.2.4.2\lib\Portable-Net45+WinRT45+WP8+WPA81\ModernHttpClient.dll @@ -145,5 +142,9 @@ {444456B1-5B55-48D6-9637-00ADCA92B7C9} Kinvey-Utils + + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0} + Core + \ No newline at end of file diff --git a/Kinvey-Xamarin/Kinvey-Xamarin.nuspec b/Kinvey-Xamarin/Kinvey-Xamarin.nuspec index 9caa8aa1..a029095f 100644 --- a/Kinvey-Xamarin/Kinvey-Xamarin.nuspec +++ b/Kinvey-Xamarin/Kinvey-Xamarin.nuspec @@ -1,24 +1,27 @@ - + Kinvey - //TODO + 1.5.0 + * Full support for iOS, with release of Kinvey-Xamarin-ios library * Refactoring LINQ implementation * Updating SQLite dependencies Kinvey-Xamarin Kinvey Kinvey false Build Xamarin apps which leverage the power of Kinvey's BaaS, with support for users, data, and files, with caching and offline. Check out http://devcenter.kinvey.com/xamarin for guides, tutorials, and sample apps. - //TODO Copyright 2015 http://devcenter.kinvey.com/xamarin/ Kinvey BaaS - + + - - - + + + + + diff --git a/Kinvey-Xamarin/Query/ExpressionVisitor.cs b/Kinvey-Xamarin/Query/ExpressionVisitor.cs deleted file mode 100644 index 6cc17418..00000000 --- a/Kinvey-Xamarin/Query/ExpressionVisitor.cs +++ /dev/null @@ -1,156 +0,0 @@ -/* -Copyright (c) 2007- 2010 LinqExtender Toolkit Project. - -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 LinqExtender; -using Ast = LinqExtender.Ast; - - -namespace KinveyXamarin -{ - /// - /// This class is used by the LINQ implementation to visit expressions. - /// - public class ExpressionVisitor - { - - /// - /// This method determines the behaivor dependant on the current expression - /// - /// Expression. - internal Ast.Expression Visit(Ast.Expression expression) - { - switch (expression.CodeType) - { - case CodeType.BlockExpression: - return VisitBlockExpression((Ast.BlockExpression)expression); - case CodeType.TypeExpression: - return VisitTypeExpression((Ast.TypeExpression)expression); - case CodeType.LambdaExpresion: - return VisitLambdaExpression((Ast.LambdaExpression)expression); - case CodeType.LogicalExpression: - return VisitLogicalExpression((Ast.LogicalExpression)expression); - case CodeType.BinaryExpression: - return VisitBinaryExpression((Ast.BinaryExpression)expression); - case CodeType.LiteralExpression: - return VisitLiteralExpression((Ast.LiteralExpression)expression); - case CodeType.MemberExpression: - return VisitMemberExpression((Ast.MemberExpression)expression); - case CodeType.OrderbyExpression: - return VisitOrderbyExpression((Ast.OrderbyExpression)expression); - } - - throw new ArgumentException("Expression type is not supported"); - } - - /// - /// Visits the type expression. - /// - /// The type expression. - /// Type expression. - public virtual Ast.Expression VisitTypeExpression(Ast.TypeExpression typeExpression) - { - return typeExpression; - } - - /// - /// Visits the block expression. - /// - /// The block expression. - /// Block expression. - public virtual Ast.Expression VisitBlockExpression(Ast.BlockExpression blockExpression) - { - foreach (var expression in blockExpression.Expressions) - this.Visit(expression); - - return blockExpression; - } - - /// - /// Visits the logical expression. - /// - /// The logical expression. - /// Expression. - public virtual Ast.Expression VisitLogicalExpression(Ast.LogicalExpression expression) - { - this.Visit(expression.Left); - this.Visit(expression.Right); - return expression; - } - - /// - /// Visits the lambda expression. - /// - /// The lambda expression. - /// Expression. - public virtual Ast.Expression VisitLambdaExpression(Ast.LambdaExpression expression) - { - if (expression.Body != null) - return this.Visit(expression.Body); - return expression; - } - - /// - /// Visits the binary expression. - /// - /// The binary expression. - /// Expression. - public virtual Ast.Expression VisitBinaryExpression(Ast.BinaryExpression expression) - { - this.Visit(expression.Left); - this.Visit(expression.Right); - - return expression; - } - - /// - /// Visits the member expression. - /// - /// The member expression. - /// Expression. - public virtual Ast.Expression VisitMemberExpression(Ast.MemberExpression expression) - { - return expression; - } - - /// - /// Visits the literal expression. - /// - /// The literal expression. - /// Expression. - public virtual Ast.Expression VisitLiteralExpression(Ast.LiteralExpression expression) - { - return expression; - } - - /// - /// Visits the orderby expression. - /// - /// The orderby expression. - /// Expression. - public virtual Ast.Expression VisitOrderbyExpression(Ast.OrderbyExpression expression) - { - return expression; - } - - } -} diff --git a/Kinvey-Xamarin/Query/KinveyQueryContext.cs b/Kinvey-Xamarin/Query/KinveyQueryContext.cs deleted file mode 100644 index 1f05945e..00000000 --- a/Kinvey-Xamarin/Query/KinveyQueryContext.cs +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright (c) 2015, Kinvey, Inc. All rights reserved. -// -// This software is licensed to you under the Kinvey terms of service located at -// http://www.kinvey.com/terms-of-use. By downloading, accessing and/or using this -// software, you hereby accept such terms of service (and any agreement referenced -// therein) and agree that you have read, understand and agree to be bound by such -// terms of service and are of legal age to agree to such terms with Kinvey. -// -// This software contains valuable confidential and proprietary information of -// KINVEY, INC and is subject to applicable licensing agreements. -// Unauthorized reproduction, transmission or distribution of this file and its -// contents is a violation of applicable laws. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Linq; -using Ast = LinqExtender.Ast; -using LinqExtender; - -namespace KinveyXamarin -{ - - /// - /// Kinvey query context, providing support for LINQ queries. - /// - public abstract class KinveyQueryContext : ExpressionVisitor, IQueryContext - { - /// - /// The client. - /// - protected AbstractClient client; - - /// - /// Initializes a new instance of the class. - /// - /// Client. - public KinveyQueryContext(AbstractClient client){ - this.client = client; - } - - /// - /// Initializes a new instance of the class. - /// - /// Client. - /// Writer. - public KinveyQueryContext (AbstractClient client, IQueryBuilder writer) - { - this.writer = writer; - this.client = client; - } - - /// - /// Executes the current Linq query. - /// - /// - /// - /// Expression. - public IEnumerable Execute(Ast.Expression expression) - { - writer.Write ("{"); - this.Visit(expression); - writer.Write ("}"); - - T[] ret = executeQuery (writer.GetFullString()); - writer.Reset (); - - return ret; - - } - - /// - /// Visits the type expression. - /// - /// The type expression. - /// Type expression. - /// Expression. - public override Ast.Expression VisitTypeExpression(Ast.TypeExpression expression) - { - //this one is a no-op because we don't support typing, (one type per collection and no joins) - - return expression; - } - - /// - /// Visits the lambda expression. - /// - /// The lambda expression. - /// Expression. - public override Ast.Expression VisitLambdaExpression(Ast.LambdaExpression expression) - { - //another no-op, `where` clause is implicit in Mongo - this.Visit(expression.Body); - return expression; - } - - /// - /// Visits the binary expression. - /// - /// The binary expression. - /// Expression. - public override Ast.Expression VisitBinaryExpression(Ast.BinaryExpression expression) - { - //gte, lte, lt, gt, eq, ne, contains are binary expressions - this.Visit(expression.Left); - writer.Write(GetBinaryOperator(expression.Operator)); - this.Visit(expression.Right); - - return expression; - } - - /// - /// Visits the logical expression. - /// - /// The logical expression. - /// Expression. - public override Ast.Expression VisitLogicalExpression(Ast.LogicalExpression expression) - { - //And, Or are logical expressions - - if (expression.Operator == LogicalOperator.And) { - - this.Visit (expression.Left); - - writer.Write (","); - - this.Visit (expression.Right); - - } else { - //it's an OR - writer.Write ("$or:"); - writer.Write("["); - writer.Write ("{"); - this.Visit (expression.Left); - writer.Write ("},"); - writer.Write ("{"); - this.Visit (expression.Right); - writer.Write ("}"); - writer.Write ("]"); - } - - return expression; - } - - /// - /// Visits the member expression. - /// - /// The member expression. - /// Expression. - public override Ast.Expression VisitMemberExpression(Ast.MemberExpression expression) - { - - - //expression.FullName returns `MyClass.MyField`, need to remove `MyClass.` - //so find the first index of the . and then substring from one character after it. - string withoutClassDec = expression.FullName.Substring (expression.FullName.IndexOf (".") + 1); - - writer.Write(String.Format("\"{0}\"", withoutClassDec)); - return expression; - } - - /// - /// Visits the literal expression. - /// - /// The literal expression. - /// Expression. - public override Ast.Expression VisitLiteralExpression(Ast.LiteralExpression expression) - { - //TODO literal expression is where type is implied by a constant's inline declaration -> string, "hey" or float, 10f - WriteValue(expression.Type, expression.Value); - return expression; - } - - /// - /// Visits the orderby expression. - /// - /// The orderby expression. - /// Expression. - public override Ast.Expression VisitOrderbyExpression(Ast.OrderbyExpression expression) - { - - //ascending, descending - string sort = "&sort={\"" + expression.Member.Name + "\":" + (expression.Ascending ? "1" : "-1") + "}"; - writer.Dangle (sort); - - return expression; - } - - /// - /// Gets the binary operator. - /// - /// The binary operator. - /// Operator. - private static string GetBinaryOperator(BinaryOperator @operator) - { - switch (@operator) - { - case BinaryOperator.Equal: - return ":"; - } - throw new ArgumentException("Invalid binary operator"); - } - - /// - /// Writes the logical operator. - /// - /// Logical operator. - private void WriteLogicalOperator(LogicalOperator logicalOperator) - { - WriteSpace(); - - writer.Write(logicalOperator.ToString().ToUpper()); - - - WriteSpace(); - } - - /// - /// Writes a space. - /// - private void WriteSpace() - { - writer.Write(" "); - } - - /// - /// Writes a new line. - /// - private void WriteNewLine() - { - writer.Write(Environment.NewLine); - } - - /// - /// Writes the token if reqiured by the expression. - /// - /// Expression. - /// Token. - private void WriteTokenIfReq(Ast.LogicalExpression expression, Token token) - { - if (expression.IsChild) - { - WriteToken(token); - } - } - - /// - /// Writes the token. - /// - /// Token. - private void WriteToken(Token token) - { - switch (token) - { - case Token.LeftParenthesis: - writer.Write("("); - break; - case Token.RightParentThesis: - writer.Write(")"); - break; - } - } - - /// - /// Available tokens to write - /// - public enum Token - { - LeftParenthesis, - RightParentThesis - } - - /// - /// Writes the value. - /// - /// Type. - /// Value. - private void WriteValue(TypeReference type, object value) - { - if (type.UnderlyingType == typeof(string)) - writer.Write(String.Format("\"{0}\"", value)); - else - writer.Write(value); - } - - /// - /// Write the specified value. - /// - /// Value. - private void Write(string value) - { - writer.Write(value); - } - - /// - /// The query builder. - /// - public IQueryBuilder writer; - - /// - /// The parameter. - /// - public bool parameter; - - /// - /// Executes the query. - /// - /// The query. - /// Query. - protected abstract T[] executeQuery(string query); - } - - -} diff --git a/Kinvey-Xamarin/Query/KinveyQueryExecutor.cs b/Kinvey-Xamarin/Query/KinveyQueryExecutor.cs index f806ec11..4cb7b018 100644 --- a/Kinvey-Xamarin/Query/KinveyQueryExecutor.cs +++ b/Kinvey-Xamarin/Query/KinveyQueryExecutor.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq.Expressions; using Remotion.Linq.Clauses; -using Remotion.Linq.Clauses.ExpressionTreeVisitors; +//using Remotion.Linq.Clauses.ExpressionTreeVisitors; using System.Linq; using Remotion.Linq.Parsing.Structure; using System.Collections.ObjectModel; diff --git a/Kinvey-Xamarin/lib/Kinvey-Utils.dll b/Kinvey-Xamarin/lib/Kinvey-Utils.dll new file mode 100755 index 00000000..cd894d03 Binary files /dev/null and b/Kinvey-Xamarin/lib/Kinvey-Utils.dll differ diff --git a/Kinvey-Xamarin/lib/Kinvey-Xamarin.dll b/Kinvey-Xamarin/lib/Kinvey-Xamarin.dll new file mode 100755 index 00000000..39fbb660 Binary files /dev/null and b/Kinvey-Xamarin/lib/Kinvey-Xamarin.dll differ diff --git a/Kinvey-Xamarin/lib/RestSharp.Portable.dll b/Kinvey-Xamarin/lib/RestSharp.Portable.dll new file mode 100755 index 00000000..08eda47c Binary files /dev/null and b/Kinvey-Xamarin/lib/RestSharp.Portable.dll differ diff --git a/Kinvey-Xamarin/packages.config b/Kinvey-Xamarin/packages.config index cd871f24..bd88fd81 100644 --- a/Kinvey-Xamarin/packages.config +++ b/Kinvey-Xamarin/packages.config @@ -1,12 +1,11 @@  - + - + - \ No newline at end of file diff --git a/LibTester/LibTester.csproj b/LibTester/LibTester.csproj index f1914502..2f065255 100644 --- a/LibTester/LibTester.csproj +++ b/LibTester/LibTester.csproj @@ -32,9 +32,6 @@ ..\packages\NUnit.2.6.4\lib\nunit.framework.dll - - ..\packages\Remotion.Linq.2.0.0-alpha-003\lib\net40\Remotion.Linq.dll - @@ -59,5 +56,9 @@ {BA2352E1-CB07-4795-A2EB-F70720B2BBC9} RestSharp.Portable + + {028E7899-0D5F-49C8-9EB6-8B051E02F1E0} + Core + \ No newline at end of file diff --git a/LibTester/packages.config b/LibTester/packages.config index 65acf8ab..2dd2f820 100644 --- a/LibTester/packages.config +++ b/LibTester/packages.config @@ -2,5 +2,4 @@ - \ No newline at end of file diff --git a/LinqExtender/Abstraction/IBucket.cs b/LinqExtender/Abstraction/IBucket.cs deleted file mode 100644 index 9becbb99..00000000 --- a/LinqExtender/Abstraction/IBucket.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Collections.Generic; - -namespace LinqExtender.Abstraction -{ - /// - /// Interfae defining Bucket object and its accesible proeprties. - /// - internal interface IBucket - { - /// - /// Gets the name of the object, either the class name or value of OriginalEntityName, if used. - /// - string Name { get;} - - /// - /// Gets/Sets true if an where is clause used. - /// - bool IsDirty { get; } - - /// - /// Gets/Sets Items to Take from collection. - /// - int? ItemsToTake { get;} - - /// - /// Gets/ Sets items to skip from start. - /// - int ItemsToSkip { get; } - - /// - /// Gets for property. - /// - IDictionary Items { get;} - - /// - /// Gets a list of methods executed on the query. - /// - IList Methods { get; } - - /// - /// Gets the order by information set in query. - /// - IList OrderByItems { get; } - - /// - /// Returns property name for which the UniqueIdentifierAttribute is defined. - /// - string[] UniqueItems { get; } - } -} diff --git a/LinqExtender/Abstraction/IClassGenerator.cs b/LinqExtender/Abstraction/IClassGenerator.cs deleted file mode 100644 index 6ad1f8db..00000000 --- a/LinqExtender/Abstraction/IClassGenerator.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; - -namespace LinqExtender.Abstraction -{ - /// - /// Entry point interface for - /// - public interface IClassGenerator - { - /// - /// Builds the dynamic assembly. - /// - /// - IClassGenerator BuildDynamicAssembly(); - /// - /// Builds a type in the dynamic assembly, if already the type is not created. - /// - /// type of object or interfae to implement - /// parent interface type. - /// - IClassGenerator CreateType(Type parentType, Type interfaceType); - /// - /// Adds properties to the dynamic type. - /// - /// - /// - /// - IClassGenerator AddProperty(string name, object value); - /// - /// Creates a new instance of the dynamically generated type. - /// - /// - /// source object from where to copy the properties. - /// - T CreateInstance(object source); - } -} \ No newline at end of file diff --git a/LinqExtender/Abstraction/IContainer.cs b/LinqExtender/Abstraction/IContainer.cs deleted file mode 100644 index 5535762d..00000000 --- a/LinqExtender/Abstraction/IContainer.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace LinqExtender.Abstraction -{ - /// - /// Defaines common propeties for accessing or . - /// - public interface IContainer - { - /// - /// Gets the current container. - /// - IContainer Container { get;} - /// - /// Gets the name of the current container. - /// - string Name { get; } - } -} diff --git a/LinqExtender/Abstraction/IMethodCall.cs b/LinqExtender/Abstraction/IMethodCall.cs deleted file mode 100644 index d7f99749..00000000 --- a/LinqExtender/Abstraction/IMethodCall.cs +++ /dev/null @@ -1,57 +0,0 @@ -namespace LinqExtender.Abstraction -{ - /// - /// Query item interface for direct calls on collection. - /// - /// - public interface IMethodCall - { - /// - /// Returns a single item from the collection. - /// - /// - T Single(); - /// - /// Returns a single item or default value if empty. - /// - /// - T SingleOrDefault(); - /// - /// Returns the first item from the collection. - /// - /// - T First(); - /// - /// Returns first item or default value if empty. - /// - /// - T FirstOrDefault(); - /// - /// Returns the last item from the collection. - /// - /// - T Last(); - /// - /// Returns last item or default value if empty. - /// - /// - T LastOrDefault(); - } - - /// - /// Non generic query call interface. - /// - public interface IMethodCall - { - /// - /// Return true if there is any item in collection. - /// - /// - bool Any(); - /// - /// Returns the count of items in the collection. - /// - /// - object Count(); - } -} \ No newline at end of file diff --git a/LinqExtender/Abstraction/IModifiableCollection.cs b/LinqExtender/Abstraction/IModifiableCollection.cs deleted file mode 100644 index e6765664..00000000 --- a/LinqExtender/Abstraction/IModifiableCollection.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace LinqExtender.Abstraction -{ - /// - /// Generic inteface for modifying collecion. - /// - public interface IModifiableCollection - { - /// - /// Clears out items from collection. - /// - void Clear(); - /// - /// Sorts the collection, using the orderby clause used in query. - /// - void Sort(); - } - - /// - /// Non generic interface for modifying colleciton items. - /// - /// - public interface IModifiableCollection : IMethodCall, IMethodCall, IModifiableCollection - { - /// - /// Marks an item to be removed. - /// - /// query object. - void Remove(T value); - /// - /// Addes a range of items to the collection. - /// - /// - void AddRange(IEnumerable items); - /// - /// Adds items to the main collection and does a sort operation if any orderby is used in query. - /// - /// - /// - void AddRange(IEnumerable items, bool inMemorySort); - /// - /// Adds a new item to the collection - /// - /// - void Add(T item); - } -} \ No newline at end of file diff --git a/LinqExtender/Abstraction/IQueryContextImpl.cs b/LinqExtender/Abstraction/IQueryContextImpl.cs deleted file mode 100644 index 9bef75f4..00000000 --- a/LinqExtender/Abstraction/IQueryContextImpl.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace LinqExtender.Abstraction -{ - internal interface IQueryContextImpl : IQueryContext - { - IModifiableCollection Collection { get; } - } -} diff --git a/LinqExtender/Abstraction/IQueryObject.cs b/LinqExtender/Abstraction/IQueryObject.cs deleted file mode 100644 index 52a92e1a..00000000 --- a/LinqExtender/Abstraction/IQueryObject.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace LinqExtender.Abstraction -{ - /// - /// Interface for making an object queryable. - /// - public interface IQueryObject - { - } -} \ No newline at end of file diff --git a/LinqExtender/Abstraction/IQueryObjectImpl.cs b/LinqExtender/Abstraction/IQueryObjectImpl.cs deleted file mode 100644 index 6b66a2ce..00000000 --- a/LinqExtender/Abstraction/IQueryObjectImpl.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace LinqExtender.Abstraction -{ - /// - /// Internal class for query object. - /// - public interface IQueryObjectImpl : IQueryObject - { - /// - /// Get/Sets if an item is delted from the collection. - /// - bool IsDeleted { get; set; } - /// - /// Gets/Sets if an item is newly added to the collection. - /// - bool IsNewlyAdded { get; } - /// - /// Gets/Sets if an item is updated. - /// - bool IsAltered { get; } - - /// - /// fills up the bucket from current object. - /// - /// - /// - Bucket FillBucket(Bucket bucket); - /// - /// fills the object from working bucket. - /// - /// - void FillObject(Bucket source); - /// - /// fills up the property of current object. - /// - /// - /// - /// - void FillProperty(string name, object value, Type returnType); - } -} \ No newline at end of file diff --git a/LinqExtender/Abstraction/IVersionItem.cs b/LinqExtender/Abstraction/IVersionItem.cs deleted file mode 100644 index d9974d91..00000000 --- a/LinqExtender/Abstraction/IVersionItem.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace LinqExtender.Abstraction -{ - interface IVersionItem - { - void Commit(); - void Revert(); - object Item { get; } - } -} \ No newline at end of file diff --git a/LinqExtender/Ast/BinaryExpression.cs b/LinqExtender/Ast/BinaryExpression.cs deleted file mode 100755 index 783a7793..00000000 --- a/LinqExtender/Ast/BinaryExpression.cs +++ /dev/null @@ -1,70 +0,0 @@ -namespace LinqExtender.Ast -{ - /// - /// Represents the binary operation. - /// - public class BinaryExpression : Expression - { - private BinaryOperator @operator; - private Expression left; - private Expression right; - - /// - /// Initalizes a new instance of the class. - /// - /// Target operator - internal BinaryExpression(BinaryOperator @operator) - { - this.@operator = @operator; - } - - /// - /// Gets the left expression. - /// - public Expression Left - { - get - { - return left; - } - internal set - { - left = value; - } - } - - /// - /// Gets the right expression - /// - public Expression Right - { - get - { - return right; - } - internal set - { - right = value; - } - } - - /// - /// Gets the binary operator. - /// - public BinaryOperator Operator - { - get - { - return @operator; - } - } - - /// - /// Gets a value indicating the type of expression. - /// - public override CodeType CodeType - { - get { return CodeType.BinaryExpression; } - } - } -} diff --git a/LinqExtender/Ast/BlockExpression.cs b/LinqExtender/Ast/BlockExpression.cs deleted file mode 100755 index 9ad920dd..00000000 --- a/LinqExtender/Ast/BlockExpression.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace LinqExtender.Ast -{ - /// - /// Combines a number expressions sequentially - /// - public class BlockExpression : Ast.Expression - { - internal BlockExpression() - { - expressions = new List(); - } - - /// - /// Gets the list of expression associated with the current query. - /// - public IList Expressions - { - get - { - return expressions; - } - } - - /// - /// Gets a value indicating the type of expression. - /// - public override CodeType CodeType - { - get { return CodeType.BlockExpression; } - } - - private IList expressions; - } -} diff --git a/LinqExtender/Ast/Expression.cs b/LinqExtender/Ast/Expression.cs deleted file mode 100755 index c9777379..00000000 --- a/LinqExtender/Ast/Expression.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace LinqExtender.Ast -{ - /// - /// Abstract expression base that represents the LINQ query. - /// - public abstract class Expression - { - /// - /// Gets a value indicating the type of expression. - /// - public abstract CodeType CodeType { get; } - } -} diff --git a/LinqExtender/Ast/LambdaExpression.cs b/LinqExtender/Ast/LambdaExpression.cs deleted file mode 100755 index 3944cc16..00000000 --- a/LinqExtender/Ast/LambdaExpression.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; - -namespace LinqExtender.Ast -{ - /// - /// Defines lambda expression. - /// - public class LambdaExpression : Expression - { - /// - /// Initailizes a new instance of the class. - /// - /// Target object type. - public LambdaExpression(Type type) - { - this.type = type; - } - - /// - /// Gets the underlying type of the expression. - /// - public Type Type - { - get - { - return type; - } - } - - /// - /// Gets the body of the expression. - /// - public Expression Body - { - get - { - return body; - } - internal set - { - body = value; - } - } - - /// - /// Gets the type of the expression. - /// - public override CodeType CodeType - { - get { return CodeType.LambdaExpresion; } - } - - Type type; - Expression body; - - } -} diff --git a/LinqExtender/Ast/LiteralExpression.cs b/LinqExtender/Ast/LiteralExpression.cs deleted file mode 100755 index 304540b0..00000000 --- a/LinqExtender/Ast/LiteralExpression.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace LinqExtender.Ast -{ - /// - /// Represents the extracted value of a query item. - /// - public class LiteralExpression : Expression - { - - internal LiteralExpression(Type type, object value) - { - this.type = new TypeReference(type); - this.value = value; - } - - /// - /// Gets the target type. - /// - public TypeReference Type - { - get - { - return type; - } - } - - /// - /// Gets the value that is evaulated from linq query. - /// - public object Value - { - get - { - return value; - } - } - - /// - /// Gets the type of the expression. - /// - public override CodeType CodeType - { - get { return CodeType.LiteralExpression; } - } - - private object value; - private TypeReference type; - } -} diff --git a/LinqExtender/Ast/LogicalExpression.cs b/LinqExtender/Ast/LogicalExpression.cs deleted file mode 100755 index 90b55900..00000000 --- a/LinqExtender/Ast/LogicalExpression.cs +++ /dev/null @@ -1,87 +0,0 @@ - -namespace LinqExtender.Ast -{ - /// - /// Reprensents Logical blocks. - /// - public class LogicalExpression : Expression - { - /// - /// Intializes a new instance of the class. - /// - /// Logical operator - internal LogicalExpression(LogicalOperator @operator) - { - this.@operator = @operator; - } - - /// - /// Gets the left expression. - /// - public Expression Left - { - get - { - return left; - } - internal set - { - left = value; - } - } - - /// - /// Gets the right exprssison. - /// - public Expression Right - { - get - { - return right; - } - internal set - { - right = value; - } - } - - /// - /// Gets value that indicates that the current is a child expression. - /// - public bool IsChild - { - get - { - return isChild; - } - internal set - { - isChild = value; - } - } - - /// - /// Gets the operator joining the left and right expression. - /// - public LogicalOperator Operator - { - get - { - return @operator; - } - } - - /// - /// Gets the type of the expression. - /// - public override CodeType CodeType - { - get { return CodeType.LogicalExpression; } - } - - private readonly LogicalOperator @operator; - private bool isChild; - private Expression left; - private Expression right; - } -} diff --git a/LinqExtender/Ast/MemberExpression.cs b/LinqExtender/Ast/MemberExpression.cs deleted file mode 100755 index f44a227f..00000000 --- a/LinqExtender/Ast/MemberExpression.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Reflection; - -namespace LinqExtender.Ast -{ - /// - /// Represents query members - /// - public class MemberExpression : Expression - { - /// - /// Initializes a new instance of the class. - /// - /// Target - internal MemberExpression(BucketItem item) - { - this.item = item; - this.member = new MemberReference(item.MemberInfo); - } - - /// - /// Gets the member reference. - /// - public MemberReference Member - { - get - { - return member; - } - } - - /// - /// Gets the name of the member. - /// - public string Name - { - get - { - return member.Name; - } - } - - /// - /// Gets the full name of the member. - /// - public string FullName - { - get - { - return this.item.FullName; - } - } - - /// - /// Gets the declaring type for the member. - /// - public Type DeclaringType - { - get - { - return this.item.DeclaringType; - } - } - - /// - /// Finds the target custom attribute for the member. - /// - public T FindAttribute() - { - return (T)item.FindAttribute(typeof(T)); - } - - /// - /// Gets the type of the expression. - /// - public override CodeType CodeType - { - get { return CodeType.MemberExpression; } - } - - private BucketItem item; - private MemberReference member; - } -} diff --git a/LinqExtender/Ast/MethodCallExpression.cs b/LinqExtender/Ast/MethodCallExpression.cs deleted file mode 100644 index 889a4462..00000000 --- a/LinqExtender/Ast/MethodCallExpression.cs +++ /dev/null @@ -1,78 +0,0 @@ - -using System.Reflection; - -namespace LinqExtender.Ast -{ - /// - /// Defines method calls on the query - /// - public class MethodCallExpression : Expression - { - internal MethodCallExpression(MethodCall methodCall) - { - this.methodCall = methodCall; - } - - /// - /// Gets the target - /// - public object Target - { - get - { - return methodCall.Target; - } - } - - /// - /// Gets the underlying method info. - /// - public MethodInfo Method - { - get - { - return methodCall.Method; - } - } - - /// - /// Gets a value indicating that it is a take call. - /// - public bool IsTake - { - get - { - return methodCall.Method.Name == MethodNames.Take; - } - } - - /// - /// Gets a value indicating that it is a skip method. - /// - public bool IsSkip - { - get - { - return methodCall.Method.Name == MethodNames.Skip; - } - } - - /// - /// Gets the method parameters. - /// - public MethodCall.Parameter [] Paramters - { - get - { - return methodCall.Parameters; - } - } - - public override CodeType CodeType - { - get { return CodeType.MethodCallExpression; } - } - - private readonly MethodCall methodCall; - } -} diff --git a/LinqExtender/Ast/OrderbyExpression.cs b/LinqExtender/Ast/OrderbyExpression.cs deleted file mode 100755 index 1ed0e66a..00000000 --- a/LinqExtender/Ast/OrderbyExpression.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace LinqExtender.Ast -{ - /// - /// Represents order by query. - /// - public class OrderbyExpression : Ast.Expression - { - /// - /// Intializes a new instance of the class. - /// - /// Target memberReference - /// Sort order - internal OrderbyExpression(MemberReference memberReference, bool ascending) - { - this.memberReference = memberReference; - this.ascending = ascending; - } - - /// - /// Gets the associated member. - /// - public MemberReference Member - { - get - { - return memberReference; - } - } - - /// - /// Gets a value indicating if the order should be made in ascending order. - /// - public bool Ascending - { - get - { - return ascending; - } - } - - /// - /// Gets the type of the expression. - /// - public override CodeType CodeType - { - get { return CodeType.OrderbyExpression; } - } - - private MemberReference memberReference; - private bool ascending; - } -} diff --git a/LinqExtender/Ast/TypeExpression.cs b/LinqExtender/Ast/TypeExpression.cs deleted file mode 100755 index f43ff6bc..00000000 --- a/LinqExtender/Ast/TypeExpression.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace LinqExtender.Ast -{ - /// - /// Represents the target type. - /// - public class TypeExpression : Expression - { - /// - /// Initalizes a new instance of the class. - /// - /// Target type - internal TypeExpression(Type type) - { - this.type = type; - } - - /// - /// Gets the underlying type. - /// - public TypeReference Type - { - get - { - return new TypeReference(this.type); - } - } - - /// - /// Gets the type of the expression. - /// - public override CodeType CodeType - { - get { return CodeType.TypeExpression; } - } - - private Type type; - - } -} diff --git a/LinqExtender/Attributes/IgnoreAttribute.cs b/LinqExtender/Attributes/IgnoreAttribute.cs deleted file mode 100644 index f8e30ecc..00000000 --- a/LinqExtender/Attributes/IgnoreAttribute.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace LinqExtender.Attributes -{ - /// - /// Under this attribute present, property will be ignored by extender. - /// - [AttributeUsage(AttributeTargets.Property)] - public class IgnoreAttribute : System.Attribute - { - - } -} \ No newline at end of file diff --git a/LinqExtender/Attributes/NameAttribute.cs b/LinqExtender/Attributes/NameAttribute.cs deleted file mode 100644 index 175940a5..00000000 --- a/LinqExtender/Attributes/NameAttribute.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; - -namespace LinqExtender.Attributes -{ - /// - /// Marks a class property or class with special name - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] - public sealed class NameAttribute : Attribute - { - /// - /// Initalizes a new instance of the class. - /// - /// Name of the reflected object. - public NameAttribute(string targetName) - { - this.targetName = targetName; - } - - /// - /// maps to the name of the original enity name. - /// - public string Name - { - get - { - return targetName; - } - } - - private readonly string targetName = string.Empty; - } -} \ No newline at end of file diff --git a/LinqExtender/Attributes/UniqueIdentifierAttribute.cs b/LinqExtender/Attributes/UniqueIdentifierAttribute.cs deleted file mode 100644 index 23fba4a9..00000000 --- a/LinqExtender/Attributes/UniqueIdentifierAttribute.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace LinqExtender.Attributes -{ - /// - /// Defines a property to be unique. - /// - [AttributeUsage(AttributeTargets.Property)] - public class UniqueIdentifierAttribute : System.Attribute - { - - } -} \ No newline at end of file diff --git a/LinqExtender/BinaryOperator.cs b/LinqExtender/BinaryOperator.cs deleted file mode 100644 index 81bb1399..00000000 --- a/LinqExtender/BinaryOperator.cs +++ /dev/null @@ -1,42 +0,0 @@ -namespace LinqExtender -{ - /// - /// Represents the relational query operator equavalent. - /// - public enum BinaryOperator - { - /// - /// Eqavalent of "==" - /// - Equal = 0, - /// - /// Eqavalent of ">" - /// - GreaterThan, - /// - /// Eqavalent of - /// - LessThan, - /// - /// Eqavalent of ">=" - /// - GreaterThanEqual, - /// - /// Eqavalent of - /// - LessThanEqual, - /// - /// Eqavalent of "!=" - /// - NotEqual, - /// - /// Defines the Contains operation in expression. - /// - Contains, - /// - /// Default value for first where clause item - /// - NotApplicable - - } -} \ No newline at end of file diff --git a/LinqExtender/Bucket.cs b/LinqExtender/Bucket.cs deleted file mode 100644 index 4ca78a1f..00000000 --- a/LinqExtender/Bucket.cs +++ /dev/null @@ -1,227 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using LinqExtender.Abstraction; -using System; -using System.Reflection; -using System.Linq.Expressions; - -namespace LinqExtender -{ - /// - /// Bucket is stuctured representation of the orignal query object. - /// - public class Bucket : IBucket, IContainer - { - /// - /// Gets/ sets the name of the container. - /// - public IContainer Container { get; internal set; } - - /// - /// Gets the name of the object, either the class name or value of OriginalEntityName, if used. - /// - public string Name - { - get - { - return name; - } - internal set - { - name = value; - } - } - - /// - /// Gets/Sets true if an where is clause used. - /// - public bool IsDirty { get; internal set; } - /// - /// Gets/Sets Items to Take from collection. - /// - public int? ItemsToTake { get; internal set; } - /// - /// Gets/ Sets items to skip from start. - /// - public int ItemsToSkip { get; internal set; } - - /// - /// Returns property name for which the UniqueIdentifierAttribute is defined. - /// - public string[] UniqueItems - { - get - { - if (uniqueItemNames == null) - { - var query = from prop in items - where prop.Value.Unique - select prop.Value.Name; - - uniqueItemNames = query.ToArray(); - } - return uniqueItemNames; - } - } - /// - /// Contains property items for current bucket. - /// - public IDictionary Items - { - get - { - if (items == null) - items = new Dictionary(); - return items; - } - internal set - { - items = value; - } - } - - /// - /// Gets the first tree node fro simplied expression tree. - /// - internal TreeNode CurrentNode - { - get - { - if (node == null) - node = new TreeNode(); - return node; - } - set - { - node = value; - } - } - /// - /// Gets/Sets the current - /// - internal TreeNode CurrentTreeNode - { - get; set; - } - - /// - /// Gets a list of methods executed on the query. - /// - public IList Methods - { - get - { - if (methods == null) - methods = new List(); - - return methods; - } - } - - /// - /// The Filled up with query order by information. - /// - public class OrderByInfo - { - /// - /// Gets the member associated with the current orderby call. - /// - public MemberReference Member - { - get - { - return memberReference; - } - } - /// - /// Gets true if the order by is ascending. - /// - public bool IsAscending - { - get - { - return asc; - } - } - - internal OrderByInfo(MemberReference memberReference, bool asc) - { - this.memberReference = memberReference; - this.asc = asc; - } - - private readonly bool asc; - private readonly MemberReference memberReference; - } - - /// - /// Contains the group by detail. - /// - public class GroupByContainer - { - /// - /// Gets or set the key by which group by will be made. - /// - public string Key { get; set; } - } - - /// - /// Holds order by information. - /// - public IList OrderByItems - { - get - { - if (orderByItems == null) - orderByItems = new List(); - return orderByItems; - } - } - - /// - /// Gets or set the group container. - /// - public GroupByContainer Group { get; set; } - - - /// - /// Gets unique identifier properties. - /// - internal string[] UniqueProperties - { - get - { - if (uniquePropertyNames == null) - { - var query = from prop in items - where prop.Value.Unique - select prop.Value.ProperyName; - - uniquePropertyNames = query.ToArray(); - } - return uniquePropertyNames; - } - } - - /// - /// Clears out any used properties. - /// - protected void Clear() - { - ItemsToSkip = 0; - ItemsToTake = null; - OrderByItems.Clear(); - IsDirty = false; - } - - private string name = string.Empty; - private IList methods; - private string[] uniqueItemNames; - private string[] uniquePropertyNames; - private IDictionary items; - private IList orderByItems; - private TreeNode node; - - - } -} diff --git a/LinqExtender/BucketImpl.cs b/LinqExtender/BucketImpl.cs deleted file mode 100644 index a86a6bfa..00000000 --- a/LinqExtender/BucketImpl.cs +++ /dev/null @@ -1,224 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Reflection; -using LinqExtender.Attributes; - -namespace LinqExtender -{ - internal class BucketImpl : Bucket - { - /// - /// Initializes a new instance of the class. - /// - /// - public BucketImpl(Type targetType) - { - this.targetType = targetType; - } - - static internal BucketImpl NewInstance(Type targetType) - { - return new BucketImpl(targetType); - } - - /// - /// marks if the bucket is already prepared or not. - /// - internal bool Processed { get; set; } - - /// - /// internal use : to check if the bucket object should be sorted in asc or dsc - /// - internal bool IsAsc { get; set; } - - /// - /// Defines the current expression node. - /// - internal ExpressionType CurrentExpessionType { get; set; } - - /// - /// number of items queried in Where caluse - /// - internal int ClauseItemCount { get; set; } - - /// - /// gets the Level of the clause item - /// - internal int Level { get; set; } - - - internal BucketImpl Init() - { - object[] attr = targetType.GetCustomAttributes(typeof(NameAttribute), true); - if (attr.Length > 0) - { - var originalEntityNameAtt = attr[0] as NameAttribute; - if (originalEntityNameAtt != null) this.Name = originalEntityNameAtt.Name; - } - else - { - Name = targetType.Name; - } - // clear out; - Clear(); - - // create new items - Items = CreateItems(targetType); - - return this; - } - - - public Stack SyntaxStack - { - get - { - if (syntaxStack == null) - syntaxStack = new Stack(); - - return syntaxStack; - } - } - - internal class TreeNodeInfo - { - public int Level - { - get; - set; - } - public LogicalOperator CompoundOperator { get; set; } - /// - /// identifier - /// - public Guid Id { get; set; } - public Guid ParentId { get; set; } - } - - internal BinaryOperator Relation - { - get - { - BinaryOperator relType = BinaryOperator.Equal; - - switch (CurrentExpessionType) - { - case ExpressionType.Equal: - relType = BinaryOperator.Equal; - break; - case ExpressionType.GreaterThan: - relType = BinaryOperator.GreaterThan; - break; - case ExpressionType.LessThan: - relType = BinaryOperator.LessThan; - break; - case ExpressionType.NotEqual: - relType = BinaryOperator.NotEqual; - break; - case ExpressionType.LessThanOrEqual: - relType = BinaryOperator.LessThanEqual; - break; - case ExpressionType.GreaterThanOrEqual: - relType = BinaryOperator.GreaterThanEqual; - break; - } - return relType; - } - - } - - /// - /// clear outs the data. - /// - protected new void Clear() - { - base.Clear(); - - ClauseItemCount = 0; - CurrentExpessionType = ExpressionType.Equal; - Processed = false; - } - - - public BucketImpl InstanceImpl - { - get - { - return this; - } - } - - private IDictionary CreateItems(Type target) - { - PropertyInfo[] infos = target.GetProperties(); - - IDictionary list = new Dictionary(); - - foreach (PropertyInfo info in infos) - { - if (info.CanRead && info.CanWrite) - { - - string fieldName = string.Empty; - - object[] arg = info.GetCustomAttributes(typeof (IgnoreAttribute), false); - - if (arg.Length == 0) - { - const bool visible = true; - - arg = info.GetCustomAttributes(typeof (NameAttribute), false); - - if (arg.Length > 0) - { - var fieldNameAttr = arg[0] as NameAttribute; - - if (fieldNameAttr != null) - fieldName = fieldNameAttr.Name; - } - else - { - fieldName = info.Name; - } - - arg = info.GetCustomAttributes(typeof (UniqueIdentifierAttribute), true); - - bool isUnique = arg.Length > 0; - - // only if not already added. - if (!list.ContainsKey(info.Name)) - { - var newItem = new BucketItem(target, fieldName, info.Name, info.PropertyType, null, isUnique, - BinaryOperator.Equal, visible) {Container = this}; - list.Add(info.Name, newItem); - } - } - } - } - return list; - } - - private Stack syntaxStack; - private Type targetType; - } - /// - /// internal implementation of bucket object - /// - internal class BucketImpl : BucketImpl - { - public BucketImpl(): base(typeof(T)) {} - - #region Fluent BucketImpl - - static new internal BucketImpl NewInstance - { - get - { - return new BucketImpl(); - } - } - - #endregion - } -} \ No newline at end of file diff --git a/LinqExtender/BucketItem.cs b/LinqExtender/BucketItem.cs deleted file mode 100644 index 384546f6..00000000 --- a/LinqExtender/BucketItem.cs +++ /dev/null @@ -1,487 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Reflection; -using LinqExtender.Abstraction; - -namespace LinqExtender -{ - /// - /// Contains the detail for quried or valued items. - /// - public class BucketItem : IContainer - { - /// - /// Initializes a new instance of the class. - /// - public BucketItem() - { - // intentionally left blank. - } - - /// - /// Gets or sets the container. - /// - public IContainer Container { get; set; } - - /// - /// Get or sets the child. - /// - public Bucket Child { get; set; } - - /// - /// Represents the conditioal operators and its compared values for where clause. - /// - public class QueryCondition - { - /// - /// Creates a new instance of the - /// - /// value - /// type of operation - public QueryCondition(object value, BinaryOperator type) - { - Value = value; - QueryOperator = type; - } - - /// - /// Gets the query item value. - /// - public object Value - { - get - { - return value; - } - set - { - // not a first time visit and , value altered. - if (this.value != null && this.value.Equals(value)) - { - changed = false; - } - else - { - changed = true; - this.value = value; - } - } - } - /// - /// Represents the comparison operators like !=, >=, etc - /// - public BinaryOperator QueryOperator { get; set; } - - internal bool Changed - { - get - { - return changed; - } - } - - private object value = null; - private bool changed = false; - } - - - /// - /// Creates a new bucket object. - /// - /// Type of the bucket object - /// Name of the item that maps with source - /// Name of property regardless of OriginalFieldNameAttribute - /// Type of the underlying property. - /// Value of the item - /// if unique attriube is defined for item - /// Eelation type , defines what type of expression, equal, lessthan or other. - /// Marks that it is to be used in query expression - internal BucketItem(Type underlyingType, string name, string propertyName, Type propertyType, object value, bool unique, BinaryOperator queryOperator, bool queryVisible) - { - this.declaringType = underlyingType; - // new condtions - Values.Clear(); - - // if value is provided. - if (value != null) - { - Values.Add(new QueryCondition(value, queryOperator)); - } - - // set values. - this.unique = unique; - Name = name; - ProperyName = propertyName; - Visible = queryVisible; - this.propertyType = propertyType; - } - - private IList _conditions; - /// - /// Return multiple values if item quried with different values in same where clause. - /// - public IList Values - { - get - { - if (_conditions == null) - _conditions = new List(); - return _conditions; - } - } - - /// - /// Return values for quried item in where clause. - /// Optionally, tries to combine the value for nested class queries. - /// Optionally, creates object[] for system and abstract types. - /// Return values in raw format regardless of its releation type. - /// - public object Value - { - get - { - if (Values.Count > 1) - { - Type targetType = Values[0].Value.GetType(); - - if (targetType.IsAbstract - || targetType.IsEnum - || targetType.IsPrimitive - || targetType.FullName.IndexOf("System") >= 0) - { - - Array array = Array.CreateInstance(targetType, Values.Count); - - int index = 0; - - foreach (QueryCondition value in Values) - { - array.SetValue(value.Value, index); - index++; - } - return array; - } - - if (targetType.IsClass) - { - return Values.Combine(targetType); - } - } - - if (Values.Count > 0) - return Values[0].Value; - return null; - } - set - { - if (Values.Count == 1) - { - Values[0].Value = value; - Values[0].QueryOperator = BinaryOperator.Equal; - } - else if (Values.Count == 0) - { - Values.Add(new QueryCondition(value, BinaryOperator.Equal)); - } - } - } - - /// - /// Determines if the item is used multiple times in where clause. - /// - public bool HasMultipleValues - { - get - { - return Values.Count > 1; - } - } - - /// - /// Return RelationType enum for the quried item. - /// - public BinaryOperator Operator - { - get - { - if (Values.Count > 0) - return Values[0].QueryOperator; - return LinqExtender.BinaryOperator.NotApplicable; - } - } - - /// - /// Name of the property or value of OriginalFieldNameAttribute if used. - /// - public string Name - { - get - { - // if its a method call. - if (this.Method != null) - name = Convert.ToString(this.Method.DynamicInvoke()); - return name; - } - set - { - name = value; - } - } - - /// - /// Gets the fully qualified name of the . - /// - public string FullName - { - get - { - if (this.Method != null) - { - return (string) this.Method.DynamicInvoke(); - } - return GetFullContainerName(this.Container) + "." + this.Name; - } - } - /// - /// Name of property that bucketItem represents. - /// - public string ProperyName { get; internal set; } - /// - /// Gets or sets the method used in query. - /// - public ExtenderMethod Method { get; internal set; } - - /// - /// Gets or sets the member info. - /// - public MemberInfo MemberInfo { get; internal set; } - - /// - /// Type of the property that bucketItem represents. - /// - public Type PropertyType - { - get - { - return this.propertyType; - } - set - { - this.propertyType = value; - } - } - /// - /// Gets if a property is unique. - /// - public bool Unique - { - get - { - return unique; - } - set - { - unique = value; - } - } - - /// - /// true if user updatas the property value manually. - /// - public bool IsModified - { - get; internal set; - } - - /// - /// Determines if the item is not maked to be Ignored by IgnoreAttribute - /// - internal bool Visible { get; set; } - - /// - /// Gets or sets a value indicating if an item is already visited. - /// - internal bool IsVisited { get; set; } - - /// - /// Gets the underlying object type. - /// - public Type DeclaringType - { - get - { - return declaringType; - } - internal set - { - declaringType = value; - } - } - - /// - /// Sets the value to target object. - /// - /// - /// - /// - public void SetValue(object target, object value) - { - var info = target.GetType().GetProperty(ProperyName, this.propertyType); - if (info != null) info.SetValue(target, value, null); - } - - /// - /// Gets the value for a target object. - /// - /// - public object GetValue(object target) - { - var info = target.GetType().GetProperty(ProperyName, this.propertyType); - return info.GetValue(target, null); - } - - /// - /// finds the attribute, within property - /// - /// - /// - public object FindAttribute(Type type) - { - var info = declaringType.GetProperty(ProperyName, this.propertyType); - - if (info != null) - { - object[] args = info.GetCustomAttributes(type, true); - - if (args.Length == 0) - { - return null; - } - return args[0]; - } - - return null; - } - - /// - /// Validates and finds the active item with value. - /// - /// - public BucketItem GetActiveItem() - { - // no child return what is there. - if (this.Child == null) - return this; - return ProcessNestedBucket(this.Child); - } - - private BucketItem ProcessNestedBucket(Bucket bucket) - { - foreach (string key in bucket.Items.Keys) - { - BucketItem childItem = bucket.Items[key]; - - if (childItem.Value != null && !childItem.IsVisited) - { - childItem.IsVisited = true; - return childItem; - } - - if (childItem.Child != null) - { - return ProcessNestedBucket(childItem.Child); - } - } - - return null; - } - - internal IDictionary Children - { - get - { - if (children == null) - children = new Dictionary(); - return children; - } - } - - private string GetFullContainerName(IContainer container) - { - string containerName= string.Empty; - - if (container.Container != null) - { - containerName = GetFullContainerName(container.Container); - if (container is Bucket) - { - // move on. - } - else - { - containerName = String.Format("{0}.{1}", containerName.TrimEnd(new[] { '.' }), container.Name); - } - } - else - { - if (container is BucketItem || container.Container == null) - containerName = container.Name; - } - - return containerName; - } - - /// - /// Cotains the detail of the method used in query. - /// - public class ExtenderMethod - { - /// - /// Gets Name of the method. - /// - public string Name { get; internal set; } - /// - /// Gets / Sets the arguments - /// - internal MethodInfo Method{ get; set;} - internal IList Arguments { get; set; } - - /// - /// Gets the return type. - /// - public object ReturnType - { - get - { - return Method.ReturnType; - } - } - /// - /// Dynamically invokes the method. - /// - /// - public object DynamicInvoke() - { - var args = new object[Arguments.Count]; - - int index = 0; - foreach (Expression @argument in Arguments) - { - args[index++] = Expression.Lambda(@argument).Compile().DynamicInvoke(); - } - - object target = Activator.CreateInstance(Method.DeclaringType); - - return Method.Invoke(target, args); - } - } - - - private bool unique; - private Type declaringType; - private Type propertyType; - private IDictionary children; - private string name; - } -} diff --git a/LinqExtender/Buckets.cs b/LinqExtender/Buckets.cs deleted file mode 100644 index 4e7e0395..00000000 --- a/LinqExtender/Buckets.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace LinqExtender -{ - internal class Buckets : Dictionary - { - public BucketImpl Current - { - get - { - Ensure(typeof(T)); - return current; - } - set - { - this[typeof (T)] = value; - } - } - - private void Ensure(Type targetType) - { - if (this.ContainsKey(targetType)) - { - // set the current object. - current = this[targetType].InstanceImpl; - } - } - - private BucketImpl current = null; - - } -} \ No newline at end of file diff --git a/LinqExtender/ClassGenerator.cs b/LinqExtender/ClassGenerator.cs deleted file mode 100644 index 3386aa17..00000000 --- a/LinqExtender/ClassGenerator.cs +++ /dev/null @@ -1,214 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Reflection.Emit; -using LinqExtender.Abstraction; - -namespace LinqExtender -{ - /// - /// Generates a new object from existing one using the user's setup. - /// - internal class ClassGenerator : IClassGenerator - { - /// - /// Creates and gets a new instance class. - /// - public static ClassGenerator Instance - { - get - { - return new ClassGenerator(); - } - } - /// - /// Builds dynamic assembly. - /// - /// - public IClassGenerator BuildDynamicAssembly() - { - AssemblyName assemblyName = new AssemblyName("ExtenderProxy"); - AssemblyBuilder createdAssembly = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); - // define module - this.moduleBuilder = createdAssembly.DefineDynamicModule(assemblyName.Name); - - this.isTypeCreated = false; - - return this; - } - - /// - /// Builds a type in the dynamic assembly, if already the type is not created. - /// - /// type of object or interfae to implement - /// parent interface type. - /// - public IClassGenerator CreateType(Type parent, Type interfaceType) - { - // create the list. - properties = new Dictionary(); - - // define a type only if it is not previously defined. - if (parent != null && this.moduleBuilder.GetType(parent.FullName) == null) - { - if (parent.IsInterface) - { - this.typeBuilder = this.moduleBuilder.DefineType(parent.FullName, TypeAttributes.Class | TypeAttributes.Public); - this.typeBuilder.AddInterfaceImplementation(parent); - } - else - { - this.typeBuilder = this.moduleBuilder.DefineType(parent.FullName, TypeAttributes.Class | TypeAttributes.Public, parent); - } - - if (interfaceType != null) - { - this.typeBuilder.AddInterfaceImplementation(interfaceType); - } - - ConstructorBuilder constructorBuilder = this.typeBuilder.DefineConstructor(MethodAttributes.Public, - CallingConventions.Standard, - Type.EmptyTypes); - - ILGenerator ilGenerator = constructorBuilder.GetILGenerator(); - - ConstructorInfo baseConstructor = null; - ConstructorInfo[] constructorInfos = parent.GetConstructors(); - - bool containsDefaultConstructor = false; - - foreach (ConstructorInfo info in constructorInfos) - { - if (info.GetParameters().Length == 0) - { - baseConstructor = info; - containsDefaultConstructor = true; - break; - } - } - - if (!containsDefaultConstructor) - throw new Exception(Messages.MustHaveADefaultConstructor); - - ilGenerator.Emit(OpCodes.Ldarg_0); - ilGenerator.Emit(OpCodes.Call, baseConstructor); - ilGenerator.Emit(OpCodes.Ret); - } - - return this; - } - - /// - /// Adds a property dynamically to the type, with specific type. - /// - /// name of the property - /// value of the property - /// - public IClassGenerator AddProperty(string name, object value) - { - if (this.typeBuilder != null && !this.isTypeCreated) - { - Type propertyType = GetTypeFromValue(value); - - PropertyBuilder builder = typeBuilder.DefineProperty(name, PropertyAttributes.HasDefault, propertyType, null); - - FieldBuilder backingField = typeBuilder.DefineField(name.ToLower(), value.GetType(), - FieldAttributes.Private); - - // The property "set" and property "get" methods require a special - // set of attributes. - const MethodAttributes methodAttributes = MethodAttributes.Public | MethodAttributes.NewSlot| - MethodAttributes.SpecialName | MethodAttributes.HideBySig | MethodAttributes.Virtual; - - // Define the "get" accessor. - MethodBuilder getAccessor = typeBuilder.DefineMethod( - "get_" + name, - methodAttributes, - propertyType, - Type.EmptyTypes); - - ILGenerator getILGenerator = getAccessor.GetILGenerator(); - - getILGenerator.Emit(OpCodes.Ldarg_0); - getILGenerator.Emit(OpCodes.Ldfld, backingField); - getILGenerator.Emit(OpCodes.Ret); - - // Define the "set" accessor. - MethodBuilder setAccessor = typeBuilder.DefineMethod( - "set_" + name, - methodAttributes, - null, - new Type[] { propertyType }); - - ILGenerator setILGenerator = setAccessor.GetILGenerator(); - - setILGenerator.Emit(OpCodes.Ldarg_0); - setILGenerator.Emit(OpCodes.Ldarg_1); - setILGenerator.Emit(OpCodes.Stfld, backingField); - setILGenerator.Emit(OpCodes.Ret); - - // Last, map the "get" and "set" accessor methods to the - // PropertyBuilder. The property is now complete. - builder.SetGetMethod(getAccessor); - builder.SetSetMethod(setAccessor); - } - properties.Add(name, value); - - return this; - } - /// - /// Creates a new instance of the dynamically generated type. - /// - /// - /// source object from where to copy the properties. - /// - public T CreateInstance(object source) - { - Type reflectedType; - - if (isTypeCreated && this.moduleBuilder.GetType(typeof(T).FullName) != null) - { - reflectedType = this.moduleBuilder.GetType(typeof(T).FullName); - } - else - { - reflectedType = this.typeBuilder.CreateType(); - isTypeCreated = true; - } - - object obj = Activator.CreateInstance(reflectedType); - - foreach (string key in properties.Keys) - { - PropertyInfo pi = reflectedType.GetProperty(key); - pi.SetValue(obj, properties[key], null); - } - - // fill from existing object. - foreach (var property in obj.GetType().GetBaseProperties()) - { - if (property.CanWrite) - { - property.SetValue(obj, property.GetValue(source, null), null); - } - } - - return (T)obj; - } - - /// - /// Gets a from provided value - /// - /// - /// - private static Type GetTypeFromValue(object value) - { - return value.GetType(); - } - - //private TypeBuilder typeBuilder; - //private ModuleBuilder moduleBuilder; - private IDictionary properties; - private bool isTypeCreated; - } -} \ No newline at end of file diff --git a/LinqExtender/CodeType.cs b/LinqExtender/CodeType.cs deleted file mode 100644 index b1f64f42..00000000 --- a/LinqExtender/CodeType.cs +++ /dev/null @@ -1,54 +0,0 @@ - -namespace LinqExtender -{ - /// - /// Defines Different types of code entries - /// - public enum CodeType - { - /// - /// Binary expression. - /// - BinaryExpression, - - /// - /// Logical expression - /// - LogicalExpression, - - /// - /// Simple expression - /// - TypeExpression, - - /// - /// Member expression - /// - MemberExpression, - - /// - /// Literal expression - /// - LiteralExpression, - - /// - /// Lambda expression - /// - LambdaExpresion, - - /// - /// Block expression - /// - BlockExpression, - - /// - /// Orderby expression. - /// - OrderbyExpression, - - /// - /// MethodCall Expression - /// - MethodCallExpression - } -} diff --git a/LinqExtender/Collection/QueryCollection.cs b/LinqExtender/Collection/QueryCollection.cs deleted file mode 100644 index 0c07b8de..00000000 --- a/LinqExtender/Collection/QueryCollection.cs +++ /dev/null @@ -1,239 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using LinqExtender.Abstraction; - -namespace LinqExtender.Collection -{ - /// - /// Contains query objects. - /// - public class QueryCollection : IModifiableCollection - { - /// - /// Creates a new instance of class and initialized teh classgenerator. - /// - public QueryCollection() - { - this.generator = new ClassGenerator().BuildDynamicAssembly(); - } - - #region IItemList Members - - /// - /// Gets/Sets a query object implementation for an index. - /// - /// - /// - public QueryObject this[int index] - { - get - { - return list[index]; - } - set - { - list[index] = value; - } - } - /// - /// returnts true if the sequece contains any element. - /// - /// - public bool Any() - { - return list.Count > 0; - } - /// - /// returns only element of the sequece , throws exception if there is no element in - /// the sequece - /// - /// - public T Single() - { - try - { - if (list.Count == 0) - { - throw new ProviderException(Messages.EmptyCollection); - } - - return list.Single().ReferringObject; - } - catch - { - throw new ProviderException(Messages.MultipleElementInColleciton); - } - } - - /// - /// Returns a single item or default value if empty. - /// - /// - public T SingleOrDefault() - { - if (list.Count == 1) - return list.Single().ReferringObject; - if (list.Count > 1) - throw new ProviderException(Messages.MultipleElementInColleciton); - return default(T); - } - /// - /// returns the count of the sequence - /// - /// - public object Count() - { - return list.Count; - } - /// - /// returns the first item of the sequence - /// - /// - public T First() - { - return list.First().ReferringObject; - } - - /// - /// Returns first item or default value if empty. - /// - /// - public T FirstOrDefault() - { - if (list.Count > 0) - return list.First().ReferringObject; - return default(T); - } - /// - /// returns the last item of the sequence. - /// - /// - public T Last() - { - return list.Last().ReferringObject; - } - /// - /// Returns the last item or a default value. - /// - /// - public T LastOrDefault() - { - if (list.Count > 0) - return list.Last().ReferringObject; - return default(T); - } - /// - /// Marks a item to be removed from the colleciton. - /// - /// - public void Remove(T value) - { - foreach (QueryObject item in list) - { - if (Utility.IsEqual(item.ReferringObject, value)) - { - //item. - (item as IQueryObjectImpl).IsDeleted = true; - } - } - } - /// - /// Clears out the collection. - /// - public void Clear() - { - list.Clear(); - } - /// - /// Adds a new item to the collection. - /// - /// - public void Add(T item) - { - var queryObject = new QueryObject(item) { ReferringObject = ProcessItem(item) }; - - if (!queryObject.IsNewlyAdded) - { - (queryObject as IVersionItem).Commit(); - } - list.Add(queryObject); - } - /// - /// Adds a range of items to the collection. - /// - /// - public void AddRange(IEnumerable items) - { - foreach (T item in items) - { - // add the ref object. - Add(item); - } - } - /// - /// Adds items to the main collection and does a sort operation if any orderby is used in query. - /// - /// - /// - public virtual void AddRange(IEnumerable items, bool inMemorySort) - { - //impletmented by child class. - } - - /// - /// Sorts the collection, using the orderby clause used in query. - /// - public virtual void Sort() - { - - } - - #endregion - /// - /// Gets a list of query item. - /// - public List Items - { - get - { - return list.Select(item => item.ReferringObject).ToList(); - } - } - /// - /// Gets a list of query object implementation. - /// - internal List> Objects - { - get - { - return list; - } - } - /// - /// Sorts the collection with the provided comparer. - /// - /// - public void Sort(IComparer> comparer) - { - list.Sort(comparer); - } - - private T ProcessItem(T item) - { - // only if the interface is not implemented. - if (!(item is IQueryObject)) - { - // build a proxy with current type. - return generator.CreateType(typeof (T), typeof (IQueryObject)).CreateInstance(item); - } - - return item; - } - - - private readonly IClassGenerator generator; - private readonly List> list = new List>(); - - } -} diff --git a/LinqExtender/Collection/ReadOnlyQueryCollection.cs b/LinqExtender/Collection/ReadOnlyQueryCollection.cs deleted file mode 100644 index 29014f0f..00000000 --- a/LinqExtender/Collection/ReadOnlyQueryCollection.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using LinqExtender.Abstraction; - -namespace LinqExtender.Collection -{ - /// - /// Contains projected read-only query objects. - /// - public abstract class ReadOnlyQueryCollection : ExpressionVisitor, IMethodCall, IMethodCall - { - /// - /// collection items - /// - protected List Items = new List(); - - #region IQueryReadOnly Members - - /// - /// Returns a single item from the collection. - /// - /// - T IMethodCall.Single() - { - return Items.Single(); - } - - /// - /// Returns a single item or default value if empty. - /// - /// - public T SingleOrDefault() - { - if (Items.Count == 1) - return Items.Single(); - if (Items.Count > 1) - throw new ProviderException(Messages.MultipleElementInColleciton); - return default(T); - } - - /// - /// Return true if there is any item in collection. - /// - /// - public bool Any() - { - return Items.Count > 0; - } - - /// - /// Returns the count of items in the collection. - /// - /// - public object Count() - { - return Items.Count; - } - - /// - /// Returns the first item from the collection. - /// - /// - T IMethodCall.First() - { - return Items.First(); - } - - /// - /// Returns first item or default value if empty. - /// - /// - public T FirstOrDefault() - { - if (Items.Count > 0) - return Items.First(); - return default(T); - } - - /// - /// Returns the last item from the collection. - /// - /// - T IMethodCall.Last() - { - return Items.Last(); - } - - /// - /// Returns last item or default value if empty. - /// - /// - public T LastOrDefault() - { - if (Items.Count > 0) - return Items.Last(); - return default(T); - } - - #endregion - } -} diff --git a/LinqExtender/ExpressionVisitor.cs b/LinqExtender/ExpressionVisitor.cs deleted file mode 100644 index 98c5ddc9..00000000 --- a/LinqExtender/ExpressionVisitor.cs +++ /dev/null @@ -1,159 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading; - -namespace LinqExtender -{ - /// - /// Expression visitor - /// - public class ExpressionVisitor - { - /// - /// Visits expression and delegates call to different to branch. - /// - /// - /// - public virtual Expression Visit(Expression expression) - { - if (expression == null) - return null; - - switch (expression.NodeType) - { - case ExpressionType.Lambda: - return VisitLamda((LambdaExpression) expression); - case ExpressionType.ArrayLength: - case ExpressionType.Convert: - case ExpressionType.ConvertChecked: - case ExpressionType.Negate: - case ExpressionType.UnaryPlus: - case ExpressionType.NegateChecked: - case ExpressionType.Not: - case ExpressionType.Quote: - case ExpressionType.TypeAs: - return this.VisitUnary((UnaryExpression)expression); - case ExpressionType.Add: - case ExpressionType.AddChecked: - case ExpressionType.And: - case ExpressionType.AndAlso: - case ExpressionType.ArrayIndex: - case ExpressionType.Coalesce: - case ExpressionType.Divide: - case ExpressionType.Equal: - case ExpressionType.ExclusiveOr: - case ExpressionType.GreaterThan: - case ExpressionType.GreaterThanOrEqual: - case ExpressionType.LeftShift: - case ExpressionType.LessThan: - case ExpressionType.LessThanOrEqual: - case ExpressionType.Modulo: - case ExpressionType.Multiply: - case ExpressionType.MultiplyChecked: - case ExpressionType.NotEqual: - case ExpressionType.Or: - case ExpressionType.OrElse: - case ExpressionType.Power: - case ExpressionType.RightShift: - case ExpressionType.Subtract: - case ExpressionType.SubtractChecked: - return this.VisitBinary((BinaryExpression)expression); - case ExpressionType.Call: - return this.VisitMethodCall((MethodCallExpression)expression); - case ExpressionType.Constant: - return this.VisitConstant((ConstantExpression)expression); - case ExpressionType.MemberAccess: - return this.VisitMemberAccess((MemberExpression)expression); - case ExpressionType.Parameter: - return this.VisitParameter((ParameterExpression)expression); - case ExpressionType.New: - return this.VisitNew((NewExpression)expression); - - } - throw new ArgumentOutOfRangeException("expression", expression.NodeType.ToString()); - } - - /// - /// Visits the constance expression. To be implemented by user. - /// - /// - /// - public virtual Expression VisitConstant(ConstantExpression expression) - { - return expression; - } - - /// - /// Visits the memeber access expression. To be implemented by user. - /// - /// - /// - public virtual Expression VisitMemberAccess(MemberExpression expression) - { - return expression; - } - - /// - /// Visits the method call expression. - /// - /// - /// - public virtual Expression VisitMethodCall(MethodCallExpression expression) - { - return expression; - } - - /// - /// Visits the binary expression. - /// - /// - /// - public virtual Expression VisitBinary(BinaryExpression expression) - { - this.Visit(expression.Left); - this.Visit(expression.Right); - return expression; - } - - /// - /// Visits the unary expression. - /// - /// - /// - public virtual Expression VisitUnary(UnaryExpression expression) - { - this.Visit(expression.Operand); - return expression; - } - - /// - /// Visits the lambda expression. - /// - /// - /// - public virtual Expression VisitLamda(LambdaExpression lambdaExpression) - { - this.Visit(lambdaExpression.Body); - return lambdaExpression; - } - - /// - /// Visits the parameter - /// - private Expression VisitParameter(ParameterExpression expression) - { - return expression; - } - - /// - /// Visits the new type expression. - /// - public virtual Expression VisitNew(NewExpression expression) - { - return expression; - } - } -} diff --git a/LinqExtender/Fluent/FluentBucket.cs b/LinqExtender/Fluent/FluentBucket.cs deleted file mode 100644 index 3e89b137..00000000 --- a/LinqExtender/Fluent/FluentBucket.cs +++ /dev/null @@ -1,98 +0,0 @@ -using LinqExtender.Abstraction; -using System; - -namespace LinqExtender.Fluent -{ - /// - /// Fluent implementation for the bucket object. - /// - internal class FluentBucket - { - /// - /// Create a new instance of for a - /// - /// - public FluentBucket(IBucket bucket) - { - this.bucket = bucket; - } - - /// - /// Creates a fluent wrapper of the original bucket object. - /// - /// - /// - public static FluentBucket As(IBucket bucket) - { - return new FluentBucket(bucket); - } - - /// - /// Creates and gets a new fluent entity object. - /// - public FluentEntity Entity - { - get - { - if (entity == null) - { - entity = new FluentEntity(bucket); - } - return entity; - } - } - - - public FluentMethod Method - { - get - { - if (method == null) - { - method = new FluentMethod(bucket); - } - - return method; - } - } - - - /// - /// Gets true if any where clause is used. - /// - public bool IsDirty - { - get - { - return bucket.IsDirty; - } - } - - - /// - /// Gets the node representing and their relational info. - /// - public FluentExpressionTree ExpressionTree - { - get - { - return new FluentExpressionTree((bucket as Bucket).CurrentNode); - } - } - - /// - /// enables BucketItem - /// - public FluentIterator For - { - get - { - return new FluentIterator(bucket); - } - } - - private IBucket bucket; - private FluentEntity entity; - private FluentMethod method; - } -} \ No newline at end of file diff --git a/LinqExtender/Fluent/FluentEntity.cs b/LinqExtender/Fluent/FluentEntity.cs deleted file mode 100644 index 4919e786..00000000 --- a/LinqExtender/Fluent/FluentEntity.cs +++ /dev/null @@ -1,151 +0,0 @@ -using System; -using LinqExtender.Abstraction; - -namespace LinqExtender.Fluent -{ - /// - /// Contains Entity Info. - /// - public class FluentEntity - { - /// - /// Creates a new instance of - /// - /// - internal FluentEntity(IBucket bucket) - { - this.bucket = bucket; - } - /// - /// Name of the entity, can be overriden by OriginalEntityNameAttribute - /// - public string Name - { - get - { - return bucket.Name; - } - } - /// - /// Gets items to fetch from source. - /// - public int? ItemsToFetch - { - get - { - return bucket.ItemsToTake; - } - } - /// - /// Default 0, number of items to skip from start. - /// - public int ItemsToSkipFromStart - { - get - { - return bucket.ItemsToSkip; - } - } - /// - /// List of unique column name. - /// - public string UniqueAttribte - { - get - { - return bucket.UniqueItems[0]; - } - } - /// - /// Defines a fluent implentation for order by query. - /// - public class FluentOrderBy - { - /// - /// Creates a new instance of - /// - /// - internal FluentOrderBy(IBucket bucket) - { - this.bucket = bucket; - } - - /// - /// Checks if orderby is used in query and calls action delegate to - /// execute user's code and internally marks true for ifUsed field - /// to be used by iterator. - /// - /// - /// - public FluentOrderBy IfUsed(Action action) - { - ifUsed = bucket.OrderByItems.Count > 0; - - if (ifUsed && action != null) - action.DynamicInvoke(); - return this; - } - /// - /// Iterator for order by items. - /// - public FluentOrderByItem ForEach - { - get - { - return new FluentOrderByItem(bucket); - } - } - - private bool ifUsed = false; - /// - /// Callback handler for - /// - /// Target member - /// bool for sort order - public delegate void Callback(MemberReference member, bool ascending); - private readonly IBucket bucket; - - /// - /// Order by iterator. - /// - public class FluentOrderByItem - { - /// - /// Creates a new instance of - /// - /// - internal FluentOrderByItem(IBucket bucket) - { - this.bucket = bucket; - } - - /// - /// Does a callback to process the order by used in where clause. - /// - /// - public void Process(Callback callback) - { - foreach (Bucket.OrderByInfo info in bucket.OrderByItems) - { - callback.Invoke(info.Member, info.IsAscending); - } - } - - private readonly IBucket bucket; - } - } - - /// - /// Gets an intance for the - /// - public FluentOrderBy OrderBy - { - get - { - return new FluentOrderBy(bucket); - } - } - - private readonly IBucket bucket; - } -} \ No newline at end of file diff --git a/LinqExtender/Fluent/FluentExpressionTree.cs b/LinqExtender/Fluent/FluentExpressionTree.cs deleted file mode 100644 index a6208aa6..00000000 --- a/LinqExtender/Fluent/FluentExpressionTree.cs +++ /dev/null @@ -1,191 +0,0 @@ -using System.Diagnostics; - -namespace LinqExtender.Fluent -{ - /// - /// Fluent implementation for the simplified expression tree. - /// - internal class FluentExpressionTree - { - /// - /// Initializes a new instance of the class. - /// - /// - public FluentExpressionTree(TreeNode node) - { - this.node = node; - } - /// - /// Gets the tree node. - /// - public TreeNode Node - { - get - { - return node; - } - } - /// - /// Describes the container for which the expression tree will be evaluated. - /// - /// Type of the reference. - /// Target container - /// - public FluentExpressionTree DescribeContainerAs(T container) - { - return new FluentExpressionTree(this.Node, container); - } - - private readonly TreeNode node; - } - /// - /// Fluent expression tree. - /// - /// - internal class FluentExpressionTree : FluentExpressionTree - { - /// - /// Initalizes a new instance of the class. - /// - /// - public FluentExpressionTree(TreeNode node) - : base(node) - { - } - /// - /// Initalizes a new instance of the class. - /// - /// - /// - public FluentExpressionTree(TreeNode node, T reference) - : base(node) - { - this.reference = reference; - } - - /// - /// Invoked for starting - /// - /// - /// - public FluentExpressionTree Begin(BeginHandler beginHandler) - { - begin = beginHandler; - return this; - } - - /// - /// Invoked for closing the - /// - /// - /// - public FluentExpressionTree End(EndHandler endHandler) - { - end = endHandler; - return this; - } - /// - /// Invoked for root - /// - /// - /// - public FluentExpressionTree Root(RootHandler rootHandler) - { - root = rootHandler; - return this; - } - /// - /// Invoked foreach Leaf - /// - /// - /// - public FluentExpressionTree EachLeaf(ItemHandler itemHandler) - { - this.itemHandler = itemHandler; - return this; - } - /// - /// Begin handler. - /// - /// - public delegate void BeginHandler(T sender); - /// - /// Closing handler. - /// - /// - public delegate void EndHandler(T sender); - /// - /// Root handler - /// - /// - /// - public delegate void RootHandler(T sender, LogicalOperator compoundOperator); - /// - /// Leaf node handler. - /// - /// - /// - public delegate void ItemHandler(T sender, BucketItem item); - - private BeginHandler begin; - private EndHandler end; - private RootHandler root; - private ItemHandler itemHandler; - - - [DebuggerStepThrough] - private void BuildNode(TreeNode tNode) - { - if (begin != null) - begin(reference); - - if (tNode.Left != null) - { - BuildItem(tNode.Left); - } - - if (tNode.Root != LogicalOperator.None) - { - if (root != null) - root(reference, tNode.Root); - } - - if (tNode.Right != null) - { - BuildItem(tNode.Right); - } - - if (end != null) - end(reference); - } - - private void BuildItem(TreeNode.Node leaf) - { - if (leaf.Value is TreeNode) - { - BuildNode((TreeNode)leaf.Value); - } - else if (leaf.Value is BucketItem) - { - BucketItem item = (BucketItem)leaf.Value; - - if (itemHandler != null) - { - itemHandler(reference, item); - } - } - } - /// - /// Builds the logical tree for the expression. - /// - public void Execute() - { - if (Node == null) - throw new ProviderException(Messages.MustDefineAContainer); - - BuildNode(Node); - } - - private readonly T reference; - } -} \ No newline at end of file diff --git a/LinqExtender/Fluent/FluentIterator.cs b/LinqExtender/Fluent/FluentIterator.cs deleted file mode 100644 index 0f81b2d3..00000000 --- a/LinqExtender/Fluent/FluentIterator.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System; -using System.Linq.Expressions; -using System.Reflection; -using LinqExtender.Abstraction; - -namespace LinqExtender.Fluent -{ - /// - /// Fluent iterator entry point. - /// - public class FluentIterator : ExpressionVisitor - { - /// - /// Create a new instance of for - /// - /// - internal FluentIterator(IBucket bucket) - { - this.bucket = bucket; - } - /// - /// Fluent Item collection implementation. - /// - public class ItemCollection - { - /// - /// Create a new instance of fluent bucket item. - /// - /// - internal ItemCollection(IBucket bucket) - { - this.bucket = bucket; - } - /// - /// Matches an for a predicate. - /// - /// - /// - public ItemCollection Match(Predicate m) - { - this.match = m; - return this; - } - /// - /// Raises a callback. - /// - /// - public ItemCollection Process(Callback callback) - { - if (callback == null) - { - throw new ProviderException(Messages.MustProvideACallback); - } - - foreach (string key in bucket.Items.Keys) - { - BucketItem item = bucket.Items[key]; - - if (match != null) - { - if (match.Invoke(item)) - { - callback.Invoke(item); - } - } - else - { - callback.Invoke(item); - } - } - // tear down - match = null; - - return this; - } - - private readonly IBucket bucket; - private Predicate match; - /// - /// Callback delegate from - /// - /// - public delegate void Callback(BucketItem item); - - } - /// - /// Gets fluent collection. - /// - public ItemCollection EachItem - { - get - { - if (collecton == null) - { - collecton = new ItemCollection(bucket); - } - return collecton; - } - } - - /// - /// Gets a for name - /// - /// - /// - public BucketItem Item(string itemName) - { - if (bucket.Items.ContainsKey(itemName)) - { - return bucket.Items[itemName]; - } - return new BucketItem(); - } - - /// - /// Gets for a property. - /// - /// - /// - /// - public BucketItem Item(Expression> expression) - { - if (this.memberInfo != null) - { - return Item(memberInfo.Name); - } - return null; - } - - public override Expression VisitMemberAccess(MemberExpression expression) - { - this.memberInfo = expression.Member; - return expression; - } - - private MemberInfo memberInfo; - private ItemCollection collecton; - private readonly IBucket bucket; - } -} \ No newline at end of file diff --git a/LinqExtender/Fluent/FluentMethod.cs b/LinqExtender/Fluent/FluentMethod.cs deleted file mode 100644 index d1427bad..00000000 --- a/LinqExtender/Fluent/FluentMethod.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using LinqExtender.Abstraction; -using System.Linq; - -namespace LinqExtender.Fluent -{ - internal class FluentMethod - { - /// - /// Initializes the instance of class. - /// - /// Target bucket - public FluentMethod(IBucket bucket) - { - this.bucket = bucket; - } - - internal void ForEach(Action action) - { - for (int index = 0; index < bucket.Methods.Count; index++) - { - action(bucket.Methods[index]); - } - } - - private readonly IBucket bucket; - } -} diff --git a/LinqExtender/IQueryContext.cs b/LinqExtender/IQueryContext.cs deleted file mode 100644 index 19119880..00000000 --- a/LinqExtender/IQueryContext.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Collections.Generic; - -namespace LinqExtender -{ - /// - /// Entry point interface for defining a custom provider. - /// - /// - public interface IQueryContext - { - /// - /// Executes the current Linq query. - /// - /// - /// - IEnumerable Execute(Ast.Expression exprssion); - } -} diff --git a/LinqExtender/LinqExtender.PackLib/Content/DefaultContext.cs.pp b/LinqExtender/LinqExtender.PackLib/Content/DefaultContext.cs.pp deleted file mode 100755 index 407e0e72..00000000 --- a/LinqExtender/LinqExtender.PackLib/Content/DefaultContext.cs.pp +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using LinqExtender; -using Ast = LinqExtender.Ast; - -namespace $rootnamespace$ -{ - /// - /// Default context to be queried. - /// - /// Target type - public class DefaultContext : ExpressionVisitor, IQueryContext - { - /// - /// Invoked during execution of the query , with the - /// pre populated expression tree. - /// - /// Target expression block - /// Expected result - public IEnumerable Execute(Ast.Expression expression) - { - //TODO: Visit the extender expression to build your meta - - this.Visit(expression); - - ///TOOD: return your result. - return null; - } - } -} diff --git a/LinqExtender/LinqExtender.PackLib/Content/ExpressionVisitor.cs.pp b/LinqExtender/LinqExtender.PackLib/Content/ExpressionVisitor.cs.pp deleted file mode 100755 index 9974c080..00000000 --- a/LinqExtender/LinqExtender.PackLib/Content/ExpressionVisitor.cs.pp +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using LinqExtender; -using Ast = LinqExtender.Ast; - - -namespace $rootnamespace$ -{ - public class ExpressionVisitor - { - internal Ast.Expression Visit(Ast.Expression expression) - { - switch (expression.CodeType) - { - case CodeType.BlockExpression: - return VisitBlockExpression((Ast.BlockExpression)expression); - case CodeType.TypeExpression: - return VisitTypeExpression((Ast.TypeExpression)expression); - case CodeType.LambdaExpresion: - return VisitLambdaExpression((Ast.LambdaExpression)expression); - case CodeType.LogicalExpression: - return VisitLogicalExpression((Ast.LogicalExpression)expression); - case CodeType.BinaryExpression: - return VisitBinaryExpression((Ast.BinaryExpression)expression); - case CodeType.LiteralExpression: - return VisitLiteralExpression((Ast.LiteralExpression)expression); - case CodeType.MemberExpression: - return VisitMemberExpression((Ast.MemberExpression)expression); - case CodeType.OrderbyExpression: - return VisitOrderbyExpression((Ast.OrderbyExpression)expression); - } - - throw new ArgumentException("Expression type is not supported"); - } - - public virtual Ast.Expression VisitTypeExpression(Ast.TypeExpression typeExpression) - { - return typeExpression; - } - - public virtual Ast.Expression VisitBlockExpression(Ast.BlockExpression blockExpression) - { - foreach (var expression in blockExpression.Expressions) - this.Visit(expression); - - return blockExpression; - } - - public virtual Ast.Expression VisitLogicalExpression(Ast.LogicalExpression expression) - { - this.Visit(expression.Left); - this.Visit(expression.Right); - return expression; - } - - public virtual Ast.Expression VisitLambdaExpression(Ast.LambdaExpression expression) - { - if (expression.Body != null) - return this.Visit(expression.Body); - return expression; - } - - public virtual Ast.Expression VisitBinaryExpression(Ast.BinaryExpression expression) - { - this.Visit(expression.Left); - this.Visit(expression.Right); - - return expression; - } - - public virtual Ast.Expression VisitMemberExpression(Ast.MemberExpression expression) - { - return expression; - } - - public virtual Ast.Expression VisitLiteralExpression(Ast.LiteralExpression expression) - { - return expression; - } - - public virtual Ast.Expression VisitOrderbyExpression(Ast.OrderbyExpression expression) - { - return expression; - } - - } -} diff --git a/LinqExtender/LinqExtender.PackLib/LinqExtender.PackLib.csproj b/LinqExtender/LinqExtender.PackLib/LinqExtender.PackLib.csproj deleted file mode 100755 index 1b9cd4fe..00000000 --- a/LinqExtender/LinqExtender.PackLib/LinqExtender.PackLib.csproj +++ /dev/null @@ -1,71 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {8A5B4179-FAAC-40B9-B844-CCA926165327} - Library - Properties - LinqExtender.PackLib - LinqExtender.PackLib - v4.0 - 512 - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - {A2171F32-6AB4-4BA4-920B-EB1D28F5F7F2} - LinqExtender - - - - - Always - Designer - - - - - - "$(SolutionDir)Tools\NuGet.exe" pack "LinqExtender.nuspec" - - - \ No newline at end of file diff --git a/LinqExtender/LinqExtender.PackLib/LinqExtender.PackLib.csproj.user b/LinqExtender/LinqExtender.PackLib/LinqExtender.PackLib.csproj.user deleted file mode 100755 index 566c009a..00000000 --- a/LinqExtender/LinqExtender.PackLib/LinqExtender.PackLib.csproj.user +++ /dev/null @@ -1,6 +0,0 @@ - - - - ShowAllFiles - - \ No newline at end of file diff --git a/LinqExtender/LinqExtender.PackLib/LinqExtender.nuspec b/LinqExtender/LinqExtender.PackLib/LinqExtender.nuspec deleted file mode 100755 index ffe384cc..00000000 --- a/LinqExtender/LinqExtender.PackLib/LinqExtender.nuspec +++ /dev/null @@ -1,23 +0,0 @@ - - - - LinqExtender - 3.0.1 - Mehfuz Hossain - A toolkit for building custom LINQ providers. - en-US - http://mehfuzh.github.com/LinqExtender/ - http://www.opensource.org/licenses/mit-license.php - LINQ LinqExtender custom-provider - - - - - - - - - - - - \ No newline at end of file diff --git a/LinqExtender/LinqExtender.PackLib/Properties/AssemblyInfo.cs b/LinqExtender/LinqExtender.PackLib/Properties/AssemblyInfo.cs deleted file mode 100755 index 6c3a1f0d..00000000 --- a/LinqExtender/LinqExtender.PackLib/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("LinqExtender.PackLib")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("LinqExtender.PackLib")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("542ab0fe-002c-46be-9ec3-edb307690888")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/LinqExtender/LinqExtender.Silverlight/LinqExtender.Silverlight.csproj b/LinqExtender/LinqExtender.Silverlight/LinqExtender.Silverlight.csproj deleted file mode 100755 index f898c172..00000000 --- a/LinqExtender/LinqExtender.Silverlight/LinqExtender.Silverlight.csproj +++ /dev/null @@ -1,245 +0,0 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {C3EA3FA4-C790-413D-A2D9-F59E8767CD9B} - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - LinqExtender.Silverlight - LinqExtender.Silverlight - Silverlight - v3.0 - $(TargetFrameworkVersion) - false - true - true - - - - v3.5 - - - true - full - false - ..\bin\Debug\SL4\ - DEBUG;TRACE;SILVERLIGHT - true - true - prompt - 4 - ..\bin\Debug\SL4\LinqExtender.Silverlight.XML - - - pdbonly - true - Bin\Release\SL4\ - TRACE;SILVERLIGHT - true - true - prompt - 4 - Bin\Release\SL4\LinqExtender.Silverlight.XML - - - - - - - - - - - - - Abstraction\IBucket.cs - - - Abstraction\IClassGenerator.cs - - - Abstraction\IContainer.cs - - - Abstraction\IMethodCall.cs - - - Abstraction\IModifiableCollection.cs - - - Abstraction\IQueryContextImpl.cs - - - Abstraction\IQueryObject.cs - - - Abstraction\IQueryObjectImpl.cs - - - Abstraction\IVersionItem.cs - - - Ast\BinaryExpression.cs - - - Ast\BlockExpression.cs - - - Ast\Expression.cs - - - Ast\LambdaExpression.cs - - - Ast\LiteralExpression.cs - - - Ast\LogicalExpression.cs - - - Ast\MemberExpression.cs - - - Ast\MethodCallExpression.cs - - - Ast\OrderbyExpression.cs - - - Ast\TypeExpression.cs - - - Attributes\IgnoreAttribute.cs - - - Attributes\NameAttribute.cs - - - Attributes\UniqueIdentifierAttribute.cs - - - BinaryOperator.cs - - - Bucket.cs - - - BucketImpl.cs - - - BucketItem.cs - - - Buckets.cs - - - ClassGenerator.cs - - - CodeType.cs - - - Collection\QueryCollection.cs - - - Collection\ReadOnlyQueryCollection.cs - - - ExpressionVisitor.cs - - - Fluent\FluentBucket.cs - - - Fluent\FluentEntity.cs - - - Fluent\FluentExpressionTree.cs - - - Fluent\FluentIterator.cs - - - Fluent\FluentMethod.cs - - - IQueryContext.cs - - - LogicalOperator.cs - - - MemberReference.cs - - - Messages.Designer.cs - - - MethodCall.cs - - - MethodNames.cs - - - ProjectedQuery.cs - - - ProviderException.cs - - - Query.cs - - - Queryable.cs - - - QueryContextImpl.cs - - - QueryItemComparer.cs - - - QueryObject.cs - - - QueryProvider.cs - - - TreeNode.cs - - - TypeReference.cs - - - Utility.cs - - - - - - - Messages.resx - - - - - - - - - - - - \ No newline at end of file diff --git a/LinqExtender/LinqExtender.Silverlight/Properties/AssemblyInfo.cs b/LinqExtender/LinqExtender.Silverlight/Properties/AssemblyInfo.cs deleted file mode 100644 index c54b470b..00000000 --- a/LinqExtender/LinqExtender.Silverlight/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("LinqExtender.Silverlight")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("LinqExtender.Silverlight")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("cf451b51-20ef-40d5-9b66-6dff6d7c3e2e")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/LinqExtender/LinqExtender.Tests/BaseFixture.cs b/LinqExtender/LinqExtender.Tests/BaseFixture.cs deleted file mode 100644 index c82bc7cc..00000000 --- a/LinqExtender/LinqExtender.Tests/BaseFixture.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Diagnostics; -using System.Reflection; -using System.IO; -using NUnit.Framework; -using System.Text.RegularExpressions; - -namespace LinqExtender.Tests -{ - public class BaseFixture - { - protected string Expected() - { - var frame = new StackTrace(1).GetFrame(0); - - // get the target test method. - var targetMethod = frame.GetMethod(); - - var expected = ReadResult(targetMethod.Name); - return expected; - } - - protected string Source(StringBuilder builder) - { - string content = builder.ToString(); - return Regex.Replace(content, "[\r\n\t]", string.Empty); - } - - private string ReadResult(string testname) - { - Assembly assembly = Assembly.GetExecutingAssembly(); - - using (Stream stream = assembly.GetManifestResourceStream(String.Format("LinqExtender.Tests.Cases.{0}.txt", testname))) - { - using (StreamReader reader = new StreamReader(stream)) - { - string content = reader.ReadToEnd(); - return Regex.Replace(content, "[\r\n\t]", string.Empty); - } - } - } - } -} diff --git a/LinqExtender/LinqExtender.Tests/Book.cs b/LinqExtender/LinqExtender.Tests/Book.cs deleted file mode 100644 index dc5028c1..00000000 --- a/LinqExtender/LinqExtender.Tests/Book.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace LinqExtender.Tests -{ - public class Book - { - public string Author { get; set; } - - public string Title { get; set; } - - public string ISBN { get; set; } - - public DateTime? LastUpdated { get; set; } - - /// - /// Identity inherits Unique Attribute, these will be useful for update query. - /// - public int Id { get; set; } - public bool IsAvailable { get; set; } - } -} diff --git a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertObjectNameAsSpecifiedInNameAttribute.txt b/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertObjectNameAsSpecifiedInNameAttribute.txt deleted file mode 100644 index 4e774231..00000000 --- a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertObjectNameAsSpecifiedInNameAttribute.txt +++ /dev/null @@ -1 +0,0 @@ -select * from ext_library \ No newline at end of file diff --git a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertOrderByDescending.txt b/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertOrderByDescending.txt deleted file mode 100644 index f870a2a2..00000000 --- a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertOrderByDescending.txt +++ /dev/null @@ -1,2 +0,0 @@ -select * from Book -order by Book.Author desc diff --git a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertPropertyNameAsSpeficiedInNameAttribute.txt b/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertPropertyNameAsSpeficiedInNameAttribute.txt deleted file mode 100644 index 29cae0fe..00000000 --- a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertPropertyNameAsSpeficiedInNameAttribute.txt +++ /dev/null @@ -1,3 +0,0 @@ -select * from ext_library -where -ext_library.lb_Id = 2 \ No newline at end of file diff --git a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertSimpleOrderBySelect.txt b/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertSimpleOrderBySelect.txt deleted file mode 100644 index f875e742..00000000 --- a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertSimpleOrderBySelect.txt +++ /dev/null @@ -1,2 +0,0 @@ -select * from Book -order by Book.Author asc diff --git a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertSimpleSelect.txt b/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertSimpleSelect.txt deleted file mode 100644 index 2936e225..00000000 --- a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertSimpleSelect.txt +++ /dev/null @@ -1 +0,0 @@ -select * from Book \ No newline at end of file diff --git a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertSimpleWhereClause.txt b/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertSimpleWhereClause.txt deleted file mode 100644 index 9ba3e407..00000000 --- a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertSimpleWhereClause.txt +++ /dev/null @@ -1,3 +0,0 @@ -select * from Book -where -Book.Id = 1 \ No newline at end of file diff --git a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertSimpleWhereThatHasMethodCall.txt b/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertSimpleWhereThatHasMethodCall.txt deleted file mode 100644 index 01b9c150..00000000 --- a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertSimpleWhereThatHasMethodCall.txt +++ /dev/null @@ -1,3 +0,0 @@ -select * from Book -where -Book.Author = "Tom" \ No newline at end of file diff --git a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertSimpleWhereWithLogicalExpression.txt b/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertSimpleWhereWithLogicalExpression.txt deleted file mode 100644 index 5f1cd8aa..00000000 --- a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertSimpleWhereWithLogicalExpression.txt +++ /dev/null @@ -1,3 +0,0 @@ -select * from Book -where -Book.Id = 1 AND Book.Author = "Charlie" \ No newline at end of file diff --git a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertWhereWithNestedLeftAndRightLogicaExpression.txt b/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertWhereWithNestedLeftAndRightLogicaExpression.txt deleted file mode 100644 index 249f0713..00000000 --- a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertWhereWithNestedLeftAndRightLogicaExpression.txt +++ /dev/null @@ -1,3 +0,0 @@ -select * from Book -where -(Book.Id = 10 AND Book.Author = "Plarosi") OR (Book.Id = 1 AND Book.Author = "Charlie") \ No newline at end of file diff --git a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertWhereWithNestedLeftLogicalExpression.txt b/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertWhereWithNestedLeftLogicalExpression.txt deleted file mode 100644 index 10f8408f..00000000 --- a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertWhereWithNestedLeftLogicalExpression.txt +++ /dev/null @@ -1,3 +0,0 @@ -select * from Book -where -(Book.Id = 1 AND Book.Author = "Charlie") OR Book.Id = 10 \ No newline at end of file diff --git a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertWhereWithtNestedRightLogicalExpression.txt b/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertWhereWithtNestedRightLogicalExpression.txt deleted file mode 100644 index a87dbaa1..00000000 --- a/LinqExtender/LinqExtender.Tests/Cases/ShouldAssertWhereWithtNestedRightLogicalExpression.txt +++ /dev/null @@ -1,3 +0,0 @@ -select * from Book -where -Book.Id = 10 OR (Book.Id = 1 AND Book.Author = "Charlie") \ No newline at end of file diff --git a/LinqExtender/LinqExtender.Tests/Cases/ShouldConcatMultipleWhereCallsWithLogicalAnd.txt b/LinqExtender/LinqExtender.Tests/Cases/ShouldConcatMultipleWhereCallsWithLogicalAnd.txt deleted file mode 100644 index f6822f0a..00000000 --- a/LinqExtender/LinqExtender.Tests/Cases/ShouldConcatMultipleWhereCallsWithLogicalAnd.txt +++ /dev/null @@ -1,3 +0,0 @@ -select * from Book -where -Book.Id = 1 AND Book.Author = "Scott" \ No newline at end of file diff --git a/LinqExtender/LinqExtender.Tests/Cases/ShouldJoinWhereUsingAndWhenNextCallHavingLogicalExpr.txt b/LinqExtender/LinqExtender.Tests/Cases/ShouldJoinWhereUsingAndWhenNextCallHavingLogicalExpr.txt deleted file mode 100644 index 6b7ab387..00000000 --- a/LinqExtender/LinqExtender.Tests/Cases/ShouldJoinWhereUsingAndWhenNextCallHavingLogicalExpr.txt +++ /dev/null @@ -1,3 +0,0 @@ -select * from Book -where -Book.ISBN = "111" AND ((Book.Id = 1 OR Book.Author = "Scott") OR Book.IsAvailable = True) \ No newline at end of file diff --git a/LinqExtender/LinqExtender.Tests/CustomAttributeTest.cs b/LinqExtender/LinqExtender.Tests/CustomAttributeTest.cs deleted file mode 100644 index bc4a3e72..00000000 --- a/LinqExtender/LinqExtender.Tests/CustomAttributeTest.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NUnit.Framework; - -namespace LinqExtender.Tests -{ - [TestFixture] - public class CustomAttributeTest : BaseFixture - { - [Test] - public void ShouldAssertObjectNameAsSpecifiedInNameAttribute() - { - var builder = new StringBuilder(); - var context = new TextContext(new StringWriter(builder)); - - var query = from libary in context - select libary; - - query.Count(); - - Assert.AreEqual(Expected(), Source(builder)); - } - - [Test] - public void ShouldAssertPropertyNameAsSpeficiedInNameAttribute() - { - var builder = new StringBuilder(); - var context = new TextContext(new StringWriter(builder)); - - var query = from libary in context - where libary.Id == 2 - select libary; - - query.Count(); - - Assert.AreEqual(Expected(), Source(builder)); - } - } -} diff --git a/LinqExtender/LinqExtender.Tests/ExecutionFixture.cs b/LinqExtender/LinqExtender.Tests/ExecutionFixture.cs deleted file mode 100755 index 3b1d2148..00000000 --- a/LinqExtender/LinqExtender.Tests/ExecutionFixture.cs +++ /dev/null @@ -1,147 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework; -using System.Linq.Expressions; - -namespace LinqExtender.Tests -{ - [TestFixture] - public class ExecutionFixture - { - [Test] - public void ShouldAssertExpectedResultFromGivenContext() - { - var query = from book in new FakeContext(GetBooks()) - where book.Id == 2 - select book; - - Assert.AreEqual(2, query.First().Id); - } - - [Test] - public void ShouldAssertProjectionSelect() - { - var query = new FakeContext(GetBooks()) - .Where(book => book.Id == 2) - .Select(r => new { r.Id, r.Title }); - - Assert.AreEqual(2, query.First().Id); - } - - [Test] - public void ShouldAssertTakeAndSkip() - { - var query = (from book in new FakeContext(GetBooks()) - where book.Id == 2 - select book).Take(1).Skip(0); - - Assert.AreEqual(2, query.First().Id); - } - - [Test] - public void ShouldNotCacheTakeOrSkipFromPreviousContext() - { - var expected = (from book in new FakeContext(GetBooks())select book).Skip(1).Take(1).ToArray(); - var actual = (from book in new FakeContext(GetBooks()) select book).ToArray(); - - Assert.AreNotEqual(expected.Count(), actual.Count()); - } - - internal class FakeContext : ExpressionVisitor, IQueryContext - { - internal FakeContext(IList source) - { - this.source = source; - this.methodCalls = new List(); - } - - public IEnumerable Execute(Ast.Expression expression) - { - this.Visit(expression); - - var result = source.AsQueryable(); - - if (this.expression != null) - { - var lambda = Expression.Lambda(this.expression, new[] { parameter }); - var func = (Func)lambda.Compile(); - result = source.Where(func).AsQueryable(); - } - - foreach (var methodCall in methodCalls) - { - var parameters = new Expression[methodCall.Paramters.Length + 1]; - - parameters[0] = Expression.Constant(result); - - for (int index = 0; index < methodCall.Paramters.Length; index++) - { - parameters[index + 1] = Expression.Constant(methodCall.Paramters[index].Value, methodCall.Paramters[index].Type); - } - - var exp = Expression.Call(methodCall.Method, parameters); - - result = (IQueryable)Expression.Lambda(exp).Compile().DynamicInvoke(); - } - return result.AsEnumerable(); - } - - public override Ast.Expression VisitTypeExpression(Ast.TypeExpression expression) - { - parameter = Expression.Parameter(expression.Type.UnderlyingType, "x"); - return expression; - } - - public override Ast.Expression VisitBinaryExpression(Ast.BinaryExpression expression) - { - this.Visit(expression.Left); - - var left = this.expression; - - this.Visit(expression.Right); - - var right = this.expression; - - this.expression = Expression.MakeBinary(ExpressionType.Equal, left, right); - - return expression; - } - - public override Ast.Expression VisitMemberExpression(Ast.MemberExpression expression) - { - this.expression = Expression.MakeMemberAccess(parameter, expression.Member.MemberInfo); - return expression; - } - - public override Ast.Expression VisitLiteralExpression(Ast.LiteralExpression expression) - { - this.expression = Expression.Constant(expression.Value, expression.Type.UnderlyingType); - return expression; - } - - public override Ast.Expression VisitMethodCallExpression(Ast.MethodCallExpression expression) - { - methodCalls.Add(expression); - return expression; - } - - private readonly IList source; - private Expression expression; - private IList methodCalls; - private ParameterExpression parameter; - } - - public IList GetBooks() - { - IList books = new List(); - - books.Add(new Book { Id = 1, Author = "Scott" }); - books.Add(new Book { Id = 2, Author = "John" }); - - return books; - - } - } - -} diff --git a/LinqExtender/LinqExtender.Tests/ExpressionVisitor.cs b/LinqExtender/LinqExtender.Tests/ExpressionVisitor.cs deleted file mode 100644 index ad4713db..00000000 --- a/LinqExtender/LinqExtender.Tests/ExpressionVisitor.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; - -namespace LinqExtender.Tests -{ - public class ExpressionVisitor - { - internal Ast.Expression Visit(Ast.Expression expression) - { - switch (expression.CodeType) - { - case CodeType.BlockExpression: - return VisitBlockExpression((Ast.BlockExpression)expression); - case CodeType.TypeExpression: - return VisitTypeExpression((Ast.TypeExpression)expression); - case CodeType.LambdaExpresion: - return VisitLambdaExpression((Ast.LambdaExpression)expression); - case CodeType.LogicalExpression: - return VisitLogicalExpression((Ast.LogicalExpression)expression); - case CodeType.BinaryExpression: - return VisitBinaryExpression((Ast.BinaryExpression)expression); - case CodeType.LiteralExpression: - return VisitLiteralExpression((Ast.LiteralExpression)expression); - case CodeType.MemberExpression: - return VisitMemberExpression((Ast.MemberExpression)expression); - case CodeType.OrderbyExpression: - return VisitOrderbyExpression((Ast.OrderbyExpression)expression); - case CodeType.MethodCallExpression: - return VisitMethodCallExpression((Ast.MethodCallExpression)expression); - } - - throw new ArgumentException("Expression type is not supported"); - } - - public virtual Ast.Expression VisitTypeExpression(Ast.TypeExpression typeExpression) - { - return typeExpression; - } - - public virtual Ast.Expression VisitBlockExpression(Ast.BlockExpression blockExpression) - { - foreach (var expression in blockExpression.Expressions) - this.Visit(expression); - - return blockExpression; - } - - public virtual Ast.Expression VisitMethodCallExpression(Ast.MethodCallExpression methodCallExpression) - { - return methodCallExpression; - } - - public virtual Ast.Expression VisitLogicalExpression(Ast.LogicalExpression expression) - { - this.Visit(expression.Left); - this.Visit(expression.Right); - return expression; - } - - public virtual Ast.Expression VisitLambdaExpression(Ast.LambdaExpression expression) - { - if (expression.Body != null) - return this.Visit(expression.Body); - return expression; - } - - public virtual Ast.Expression VisitBinaryExpression(Ast.BinaryExpression expression) - { - this.Visit(expression.Left); - this.Visit(expression.Right); - - return expression; - } - - public virtual Ast.Expression VisitMemberExpression(Ast.MemberExpression expression) - { - return expression; - } - - public virtual Ast.Expression VisitLiteralExpression(Ast.LiteralExpression expression) - { - return expression; - } - - public virtual Ast.Expression VisitOrderbyExpression(Ast.OrderbyExpression expression) - { - return expression; - } - - } -} diff --git a/LinqExtender/LinqExtender.Tests/ITextWriter.cs b/LinqExtender/LinqExtender.Tests/ITextWriter.cs deleted file mode 100644 index a4a61f24..00000000 --- a/LinqExtender/LinqExtender.Tests/ITextWriter.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace LinqExtender.Tests -{ - public interface ITextWriter - { - void Write(object value); - } -} diff --git a/LinqExtender/LinqExtender.Tests/Library.cs b/LinqExtender/LinqExtender.Tests/Library.cs deleted file mode 100644 index b5e3ff46..00000000 --- a/LinqExtender/LinqExtender.Tests/Library.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using LinqExtender.Attributes; - -namespace LinqExtender.Tests -{ - [Name("ext_library")] - public class Library - { - [Name("lb_Id")] - public int Id { get; set; } - public string Name { get; set; } - } -} diff --git a/LinqExtender/LinqExtender.Tests/LinqExtender.Tests.csproj b/LinqExtender/LinqExtender.Tests/LinqExtender.Tests.csproj deleted file mode 100644 index ccdad814..00000000 --- a/LinqExtender/LinqExtender.Tests/LinqExtender.Tests.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {BA30AD53-4E10-4610-BDD2-BB823DF0325B} - Library - Properties - LinqExtender.Tests - LinqExtender.Tests - v3.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\ThirdParty\nunit.framework.dll - - - - - - - - - - - - - - - - - - - - - - - - {A2171F32-6AB4-4BA4-920B-EB1D28F5F7F2} - LinqExtender - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/LinqExtender/LinqExtender.Tests/LinqExtender.Tests.pidb b/LinqExtender/LinqExtender.Tests/LinqExtender.Tests.pidb deleted file mode 100644 index 330031db..00000000 Binary files a/LinqExtender/LinqExtender.Tests/LinqExtender.Tests.pidb and /dev/null differ diff --git a/LinqExtender/LinqExtender.Tests/LinqQueryTest.cs b/LinqExtender/LinqExtender.Tests/LinqQueryTest.cs deleted file mode 100644 index 3ce98b91..00000000 --- a/LinqExtender/LinqExtender.Tests/LinqQueryTest.cs +++ /dev/null @@ -1,190 +0,0 @@ -using System.Linq; -using System.Text; -using NUnit.Framework; -using System; - -namespace LinqExtender.Tests -{ - [TestFixture] - public class LinqQueryTest : BaseFixture - { - [Test] - public void ShouldAssertSimpleSelect() - { - var builder = new StringBuilder(); - var context = new TextContext(new StringWriter(builder)); - - var query = from book in context - select book; - - query.Count(); - - Assert.AreEqual(Expected(), Source(builder)); - } - - [Test] - public void ShouldAssertSimpleWhereClause() - { - var builder = new StringBuilder(); - var context = new TextContext(new StringWriter(builder)); - - var query = from book in context - where book.Id == 1 - select book; - - query.Count(); - - Assert.AreEqual(Expected(), Source(builder)); - } - - [Test] - public void ShouldAssertSimpleWhereWithLogicalExpression() - { - var builder = new StringBuilder(); - var context = new TextContext(new StringWriter(builder)); - - var query = from book in context - where book.Id == 1 && book.Author == "Charlie" - select book; - - - query.Count(); - - Assert.AreEqual(Expected(), Source(builder)); - - } - - [Test] - public void ShouldAssertWhereWithNestedLeftLogicalExpression() - { - var builder = new StringBuilder(); - var context = new TextContext(new StringWriter(builder)); - - var query = from book in context - where (book.Id == 1 && book.Author == "Charlie") - || book.Id == 10 - select book; - - - query.Count(); - - Assert.AreEqual(Expected(), Source(builder)); - } - - [Test] - public void ShouldAssertWhereWithtNestedRightLogicalExpression() - { - var builder = new StringBuilder(); - var context = new TextContext(new StringWriter(builder)); - - var query = from book in context - where book.Id == 10 || (book.Id == 1 && book.Author == "Charlie") - select book; - - - query.Count(); - - Assert.AreEqual(Expected(), Source(builder)); - } - - [Test] - public void ShouldAssertWhereWithNestedLeftAndRightLogicaExpression() - { - var builder = new StringBuilder(); - var context = new TextContext(new StringWriter(builder)); - - var query = from book in context - where (book.Id == 10 && book.Author == "Plarosi") || (book.Id == 1 && book.Author == "Charlie") - select book; - - - query.Count(); - - Assert.AreEqual(Expected(), Source(builder)); - } - - [Test] - public void ShouldAssertSimpleOrderBySelect() - { - var builder = new StringBuilder(); - var context = new TextContext(new StringWriter(builder)); - - var query = from book in context - orderby book.Author - select book; - - query.Count(); - - Assert.AreEqual(Expected(), Source(builder)); - } - - [Test] - public void ShouldAssertOrderByDescending() - { - var builder = new StringBuilder(); - var context = new TextContext(new StringWriter(builder)); - - var query = from book in context - orderby book.Author descending - select book; - - query.Count(); - - Assert.AreEqual(Expected(), Source(builder)); - } - - [Test] - public void ShouldAssertSimpleWhereThatHasMethodCall() - { - var builder = new StringBuilder(); - var context = new TextContext(new StringWriter(builder)); - - var query = from book in context - where book.Author == GetAuthor(1) - select book; - - query.Count(); - - Assert.AreEqual(Expected(), Source(builder)); - } - - [Test] - public void ShouldConcatMultipleWhereCallsWithLogicalAnd() - { - var builder = new StringBuilder(); - var context = new TextContext(new StringWriter(builder)); - - var query = context.Where(x => x.Id == 1).Where(x => x.Author == "Scott"); - - query.FirstOrDefault(); - - Assert.AreEqual(Expected(), Source(builder)); - } - - [Test] - public void ShouldJoinWhereUsingAndWhenNextCallHavingLogicalExpr() - { - var builder = new StringBuilder(); - var context = new TextContext(new StringWriter(builder)); - - var query = context - .Where(x => x.ISBN == "111") - .Where(x => x.Id == 1 || x.Author == "Scott" || x.IsAvailable); - - - query.FirstOrDefault(); - - Assert.AreEqual(Expected(), Source(builder)); - } - - // Fake method to test the capability of using - // method call in the query. - private string GetAuthor(int bookId) - { - if (bookId > 0) - return "Tom"; - - throw new ArgumentException("Not a valid book id"); - } - } -} diff --git a/LinqExtender/LinqExtender.Tests/Properties/AssemblyInfo.cs b/LinqExtender/LinqExtender.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index ec0d0b3b..00000000 --- a/LinqExtender/LinqExtender.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("LinqExtender.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("LinqExtender.Tests")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("dcc38c75-2fab-4727-858a-751817daeb49")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/LinqExtender/LinqExtender.Tests/StringWriter.cs b/LinqExtender/LinqExtender.Tests/StringWriter.cs deleted file mode 100644 index 009033c4..00000000 --- a/LinqExtender/LinqExtender.Tests/StringWriter.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace LinqExtender.Tests -{ - public class StringWriter : ITextWriter - { - public StringWriter(StringBuilder builder) - { - this.builder = builder; - } - - public void Write(object value) - { - builder.Append(value); - } - - private StringBuilder builder; - } -} diff --git a/LinqExtender/LinqExtender.Tests/TextContext.cs b/LinqExtender/LinqExtender.Tests/TextContext.cs deleted file mode 100755 index 12f10f8f..00000000 --- a/LinqExtender/LinqExtender.Tests/TextContext.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Linq; - -namespace LinqExtender.Tests -{ - public class TextContext : ExpressionVisitor, IQueryContext - { - public TextContext(ITextWriter writer) - { - this.writer = writer; - } - - public IEnumerable Execute(Ast.Expression expression) - { - this.Visit(expression); - return new List().AsEnumerable(); - } - - public override Ast.Expression VisitTypeExpression(Ast.TypeExpression expression) - { - writer.Write(string.Format("select * from {0}", expression.Type.Name)); - return expression; - } - - public override Ast.Expression VisitLambdaExpression(Ast.LambdaExpression expression) - { - WriteNewLine(); - writer.Write("where"); - WriteNewLine(); - - this.Visit(expression.Body); - - return expression; - } - - public override Ast.Expression VisitBinaryExpression(Ast.BinaryExpression expression) - { - this.Visit(expression.Left); - writer.Write(GetBinaryOperator(expression.Operator)); - this.Visit(expression.Right); - - return expression; - } - - public override Ast.Expression VisitLogicalExpression(Ast.LogicalExpression expression) - { - WriteTokenIfReq(expression, Token.LeftParenthesis); - - this.Visit(expression.Left); - - WriteLogicalOperator(expression.Operator); - - this.Visit(expression.Right); - - WriteTokenIfReq(expression, Token.RightParentThesis); - - return expression; - } - - public override Ast.Expression VisitMemberExpression(Ast.MemberExpression expression) - { - writer.Write(expression.FullName); - return expression; - } - - public override Ast.Expression VisitLiteralExpression(Ast.LiteralExpression expression) - { - WriteValue(expression.Type, expression.Value); - return expression; - } - - public override Ast.Expression VisitOrderbyExpression(Ast.OrderbyExpression expression) - { - WriteNewLine(); - Write(string.Format("order by {0}.{1} {2}", - expression.Member.DeclaringType.Name, - expression.Member.Name, - expression.Ascending ? "asc" : "desc")); - WriteNewLine(); - - return expression; - } - - private static string GetBinaryOperator(BinaryOperator @operator) - { - switch (@operator) - { - case BinaryOperator.Equal: - return " = "; - } - throw new ArgumentException("Invalid binary operator"); - } - - private void WriteLogicalOperator(LogicalOperator logicalOperator) - { - WriteSpace(); - - writer.Write(logicalOperator.ToString().ToUpper()); - - WriteSpace(); - } - - private void WriteSpace() - { - writer.Write(" "); - } - - private void WriteNewLine() - { - writer.Write(Environment.NewLine); - } - - private void WriteTokenIfReq(Ast.LogicalExpression expression, Token token) - { - if (expression.IsChild) - { - WriteToken(token); - } - } - - private void WriteToken(Token token) - { - switch (token) - { - case Token.LeftParenthesis: - writer.Write("("); - break; - case Token.RightParentThesis: - writer.Write(")"); - break; - } - } - - public enum Token - { - LeftParenthesis, - RightParentThesis - } - - private void WriteValue(TypeReference type, object value) - { - if (type.UnderlyingType == typeof(string)) - writer.Write(String.Format("\"{0}\"", value)); - else - writer.Write(value); - } - - private void Write(string value) - { - writer.Write(value); - } - - public ITextWriter writer; - public bool parameter; - } -} diff --git a/LinqExtender/LinqExtender.csproj b/LinqExtender/LinqExtender.csproj deleted file mode 100644 index 79351f5f..00000000 --- a/LinqExtender/LinqExtender.csproj +++ /dev/null @@ -1,152 +0,0 @@ - - - - Debug - AnyCPU - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - {2A308072-1B8C-44F6-B4C7-4FB8D4D9A949} - Library - LinqExtender - LinqExtender - Profile78 - v4.5 - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - false - - - full - true - bin\Release - prompt - 4 - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll - - - \ No newline at end of file diff --git a/LinqExtender/LinqExtender.pidb b/LinqExtender/LinqExtender.pidb deleted file mode 100644 index 4d1e9cf1..00000000 Binary files a/LinqExtender/LinqExtender.pidb and /dev/null differ diff --git a/LinqExtender/LogicalOperator.cs b/LinqExtender/LogicalOperator.cs deleted file mode 100644 index e3e7122b..00000000 --- a/LinqExtender/LogicalOperator.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace LinqExtender -{ - /// - /// Type of operator used in where clause. - /// - public enum LogicalOperator - { - /// - /// Used for first item in where entry - /// - None, - /// - /// Used for - /// - And, - /// - /// Used for || - /// - Or - } -} \ No newline at end of file diff --git a/LinqExtender/MemberReference.cs b/LinqExtender/MemberReference.cs deleted file mode 100644 index 8fd2062e..00000000 --- a/LinqExtender/MemberReference.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Reflection; -using LinqExtender.Attributes; - -namespace LinqExtender -{ - /// - /// Wraps and extends the instance. - /// - public class MemberReference - { - internal MemberReference(MemberInfo memberInfo) - { - this.memberInfo = memberInfo; - } - - /// - /// Get the decalaring type. - /// - public TypeReference DeclaringType - { - get - { - return new TypeReference(memberInfo.DeclaringType); - } - } - - /// - /// Gets the name of the member, applies first. - /// - public string Name - { - get - { - var nameAtt = FindAttribute(); - - if ((nameAtt != null)) - { - return nameAtt.Name; - } - return this.memberInfo.Name; - } - } - - /// - /// Gets the associated with the reference. - /// - public MemberInfo MemberInfo - { - get - { - return memberInfo; - } - } - - /// - /// Finds the specific attribute from the member. - /// - /// Attribute to find - /// Target attribute reference - public T FindAttribute() - { - return (T)Utility.FindAttribute(typeof(T), memberInfo); - } - - private readonly MemberInfo memberInfo; - } -} diff --git a/LinqExtender/Messages.Designer.cs b/LinqExtender/Messages.Designer.cs deleted file mode 100644 index b16b3714..00000000 --- a/LinqExtender/Messages.Designer.cs +++ /dev/null @@ -1,180 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.1 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace LinqExtender { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Messages { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Messages() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LinqExtender.Messages", typeof(Messages).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Bucket translation failed during {0} call.. - /// - internal static string BucketTranslationFailed { - get { - return ResourceManager.GetString("BucketTranslationFailed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Could not find the nested property. - /// - internal static string CouldNotFindTheNestedProperty { - get { - return ResourceManager.GetString("CouldNotFindTheNestedProperty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Direct join expression is not supported yet.. - /// - internal static string DirectJoinNotSupported { - get { - return ResourceManager.GetString("DirectJoinNotSupported", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to There is no item in the collection.. - /// - internal static string EmptyCollection { - get { - return ResourceManager.GetString("EmptyCollection", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Opps... Some error occured while executing the query. Please check the stack trace for more detail.. - /// - internal static string ErrorWhileExecutingTheQuery { - get { - return ResourceManager.GetString("ErrorWhileExecutingTheQuery", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to There are multiple element in the collection, use First instead.. - /// - internal static string MultipleElementInColleciton { - get { - return ResourceManager.GetString("MultipleElementInColleciton", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to There can only be one unique property under {0}.. - /// - internal static string MustbeOneUniqueField { - get { - return ResourceManager.GetString("MustbeOneUniqueField", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Must contains valid settings information to process.. - /// - internal static string MustContainValidSettingsXml { - get { - return ResourceManager.GetString("MustContainValidSettingsXml", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Must deifne a cotnainer and behavior of each node.. - /// - internal static string MustDefineAContainer { - get { - return ResourceManager.GetString("MustDefineAContainer", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Entity class must have a default constructor.. - /// - internal static string MustHaveADefaultConstructor { - get { - return ResourceManager.GetString("MustHaveADefaultConstructor", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Must provide a valid callback method.. - /// - internal static string MustProvideACallback { - get { - return ResourceManager.GetString("MustProvideACallback", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Expression with multiple argumetns is not implemented. Ex. Join.. - /// - internal static string NotImplemetedExpressionWithMultipleArguments { - get { - return ResourceManager.GetString("NotImplemetedExpressionWithMultipleArguments", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unknown expression node type. - /// - internal static string UnknowNodeType { - get { - return ResourceManager.GetString("UnknowNodeType", resourceCulture); - } - } - } -} diff --git a/LinqExtender/Messages.resources b/LinqExtender/Messages.resources deleted file mode 100644 index fd173828..00000000 Binary files a/LinqExtender/Messages.resources and /dev/null differ diff --git a/LinqExtender/Messages.resx b/LinqExtender/Messages.resx deleted file mode 100644 index fc0ca63e..00000000 --- a/LinqExtender/Messages.resx +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Direct join expression is not supported yet. - - - There is no item in the collection. - - - There are multiple element in the collection, use First instead. - - - There can only be one unique property under {0}. - - - Must deifne a cotnainer and behavior of each node. - - - Bucket translation failed during {0} call. - - - Must provide a valid callback method. - - - Must contains valid settings information to process. - - - Entity class must have a default constructor. - - - Unknown expression node type - - - Expression with multiple argumetns is not implemented. Ex. Join. - - - Opps... Some error occured while executing the query. Please check the stack trace for more detail. - - - Could not find the nested property - CouldNotFindTheNestedProperty description - - \ No newline at end of file diff --git a/LinqExtender/MethodCall.cs b/LinqExtender/MethodCall.cs deleted file mode 100644 index 6c829f14..00000000 --- a/LinqExtender/MethodCall.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Reflection; -using System.Linq.Expressions; - -namespace LinqExtender -{ - public class MethodCall - { - /// - /// Initalizes the instance of class. - /// - /// Name of the method - /// Method arguments. - internal MethodCall(object target, MethodInfo methodInfo, Parameter[] parameters) - { - this.target = target; - this.methodInfo = methodInfo; - this.parameters = parameters; - } - - /// - /// Gets the target expression. - /// - public object Target - { - get - { - return target; - } - } - - /// - /// Gets the underlying method info. - /// - public MethodInfo Method - { - get - { - return methodInfo; - } - } - - /// - /// Gets the array of parameter. - /// - public Parameter[] Parameters - { - get - { - return parameters; - } - } - - public class Parameter - { - /// - /// Initalizes the new instance of class. - /// - /// Type of the argument - /// Value of the argument - internal Parameter(Type type, object value) - { - this.type = type; - this.value = value; - } - - /// - /// Gets the parameter value - /// - public object Value - { - get - { - return value; - } - } - - /// - /// Gets the underlying type. - /// - public Type Type - { - get - { - return type; - } - } - - - private readonly Type type; - private readonly object value; - } - - - private readonly object target; - private readonly MethodInfo methodInfo; - private readonly Parameter[] parameters; - } -} diff --git a/LinqExtender/MethodNames.cs b/LinqExtender/MethodNames.cs deleted file mode 100644 index 925b7bfa..00000000 --- a/LinqExtender/MethodNames.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace LinqExtender -{ - internal class MethodNames - { - public static string Group = "GroupBy"; - internal const string Join = "Join"; - internal const string Take = "Take"; - internal const string Skip = "Skip"; - internal const string Where = "Where"; - internal const string Select = "Select"; - internal const string Orderby = "OrderBy"; - internal const string ThenBy = "ThenBy"; - internal const string Orderbydesc = "OrderByDescending"; - } -} \ No newline at end of file diff --git a/LinqExtender/MyClass.cs b/LinqExtender/MyClass.cs deleted file mode 100644 index 1929bb5e..00000000 --- a/LinqExtender/MyClass.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace LinqExtender -{ - public class MyClass - { - public MyClass () - { - } - } -} - diff --git a/LinqExtender/ProjectedQuery.cs b/LinqExtender/ProjectedQuery.cs deleted file mode 100644 index 90407ff2..00000000 --- a/LinqExtender/ProjectedQuery.cs +++ /dev/null @@ -1,176 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Collections; -using LinqExtender.Collection; -using LinqExtender.Abstraction; - -namespace LinqExtender -{ - internal class ProjectedQuery : ReadOnlyQueryCollection, IQueryProvider, IQueryable - { - /// - /// Initializes a new instance of the class. - /// - /// The expression. - /// The query. - public ProjectedQuery(Expression expression, Query parent) - { - this.expression = expression; - this.parent = parent; - } - - #region IEnumerable Members - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// - /// A that can be used to iterate through the collection. - /// - public IEnumerator GetEnumerator() - { - this.ExectuteParent(); - return Items.GetEnumerator(); - } - - public override Expression VisitMethodCall(MethodCallExpression expression) - { - foreach (var exp in expression.Arguments) - this.Visit(exp); - - return expression; - } - - public override Expression VisitLamda(LambdaExpression lambdaExpression) - { - lambda = lambdaExpression; - - return expression; - } - - private void ExectuteParent() - { - Items.Clear(); - - this.Visit(this.expression); - - try - { - ((Expression>)lambda).Compile(); - } - catch - { - // do nothing for now. - } - - var result = parent.Select(((Expression>)lambda).Compile()); - - Items.AddRange(result); - } - - #endregion - - #region IEnumerable Members - - IEnumerator IEnumerable.GetEnumerator() - { - return (this as IEnumerable).GetEnumerator(); - } - - - #endregion - - #region IQueryable Members - - /// - /// Gets the type of the element(s) that are returned when the expression tree associated with this instance of is executed. - /// - /// - /// A that represents the type of the element(s) that are returned when the expression tree associated with this object is executed. - public Type ElementType - { - get { return typeof(S); } - } - - /// - /// Gets the expression tree that is associated with the instance of . - /// - /// - /// The that is associated with this instance of . - public Expression Expression - { - get { return expression; } - } - - /// - /// Gets the query provider that is associated with this data source. - /// - /// - /// The that is associated with this data source. - public IQueryProvider Provider - { - get { return this; } - } - - #endregion - - #region IQueryProvider Members - - public IQueryable CreateQuery(Expression expression) - { - return parent.CreateQuery(expression); - } - - public IQueryable CreateQuery(Expression expression) - { - return parent.CreateQuery(expression); - } - - public TResult Execute(Expression expression) - { - return (TResult)this.ExecuteNonGeneric(expression); - } - - public object Execute(Expression expression) - { - return (S)this.ExecuteNonGeneric(expression); - } - - public object ExecuteNonGeneric(Expression expression) - { - ExectuteParent(); - - if (expression is MethodCallExpression) - { - var mCallExp = (MethodCallExpression)expression; - // when first , last or single is called - string methodName = mCallExp.Method.Name; - - /* Try for Generics Results */ - Type itemType = typeof(IMethodCall); - - object obj = Utility.InvokeMethod(methodName, itemType, this); - - /* Try for Non Generics Result */ - if (obj == null) - { - itemType = typeof(IMethodCall); - obj = Utility.InvokeMethod(methodName, itemType, this); - } - return obj; - - } - return null; - } - - - #endregion - - private readonly Query parent; - private LambdaExpression lambda; - private readonly Expression expression; - } -} - diff --git a/LinqExtender/Properties/AssemblyInfo.cs b/LinqExtender/Properties/AssemblyInfo.cs deleted file mode 100644 index 3c4a2408..00000000 --- a/LinqExtender/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle ("LinqExtender")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("edward")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion ("1.0.*")] - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - diff --git a/LinqExtender/ProviderException.cs b/LinqExtender/ProviderException.cs deleted file mode 100644 index 990d4ebb..00000000 --- a/LinqExtender/ProviderException.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace LinqExtender -{ - /// - /// Custom extender expection class. - /// - public class ProviderException : Exception - { - /// - /// Parametrized constructor for the expection. - /// - /// - /// - public ProviderException(string message, Exception ex) : base(message, ex) { } - /// - /// Defautl constructor for the expection. - /// - /// - public ProviderException(string message) : base(message) { } - } -} diff --git a/LinqExtender/Query.cs b/LinqExtender/Query.cs deleted file mode 100644 index f59ab333..00000000 --- a/LinqExtender/Query.cs +++ /dev/null @@ -1,1170 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using LinqExtender.Attributes; -using LinqExtender.Collection; -using LinqExtender.Abstraction; - -namespace LinqExtender -{ - /// - /// Entry class for LINQ provider. Containter of the virtual methods that will be invoked on select, intsert, update, remove or get calls. - /// - public class Query : ExpressionVisitor, IModifiableCollection, IOrderedQueryable, IDisposable, IQueryProvider - { - /// - /// Creates a new instance of class. - /// - public Query(IQueryContext context) - { - this.context = new QueryContextImpl(context); - } - - /// - /// Gets the current context associated with the provider. - /// - internal IQueryContextImpl Context - { - get - { - return context; - } - } - - /// - /// Gets the collection item for an index - /// - /// index - /// - public T this[int index] - { - get - { - return ((QueryCollection)context.Collection).Items[index]; - } - } - - #region IEnumerable Members - - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { - return (this as IQueryable).Provider.Execute>(currentExpression).GetEnumerator(); - } - - #endregion - - #region IQueryable Members - /// - /// Gets element type for the expression. - /// - public Type ElementType - { - get { return typeof(T); } - } - /// - /// Gets the expression tree. - /// - public Expression Expression - { - get - { - return Expression.Constant(this); - } - } - /// - /// Gets a query provider the LINQ query. - /// - public IQueryProvider Provider - { - get - { - return this; - } - } - - #endregion - - #region IEnumerable Members - - /// - /// Executes the query and gets a iterator for it. - /// - /// - public IEnumerator GetEnumerator() - { - return (this as IQueryable).Provider.Execute>(currentExpression).GetEnumerator(); - } - - #endregion - - #region IQueryProvider Members - - /// - /// Creates the query for type and current expression. - /// - /// currenty type passed by frameowrk - /// - /// - public IQueryable CreateQuery(Expression expression) - { - // make sure there are no previous items left in the collection. - if ((int)this.Count() > 0) this.Clear(); - - this.currentExpression = expression; - var curentMethodcall = currentExpression as MethodCallExpression; - - if (curentMethodcall != null) - { - string methodName = curentMethodcall.Method.Name; - if (methodName == MethodNames.Join) - { - throw new ProviderException(Messages.DirectJoinNotSupported); - } - - if (IsOnQueryMethodCall(curentMethodcall.Method)) - { - var args = new MethodCall.Parameter[curentMethodcall.Arguments.Count - 1]; - - int index = 0; - - foreach (var arg in args) - { - var argument = curentMethodcall.Arguments[index + 1]; - - this.Visit(argument); - args[index] = new MethodCall.Parameter(argument.Type, this.value); - - index++; - } - - var target = (curentMethodcall.Arguments[0] as ConstantExpression).Value; - // just append the method here. - Buckets.Current.Methods.Add(new MethodCall(target, curentMethodcall.Method, args)); - } - else - { - // Create a new bucket when Query.Execute is called or it is empty for current type. - if ((!Buckets.ContainsKey(typeof(T))) || Buckets.Current.Processed) - { - Buckets.Current = BucketImpl.NewInstance.Init(); - } - - this.Visit(curentMethodcall); - } - } - - if (typeof(T) != typeof(TS)) - { - projectedQuery = new ProjectedQuery(expression, this); - - return (IQueryable)projectedQuery; - } - - return (IQueryable)this; - } - - private bool IsOnQueryMethodCall(MethodInfo methodInfo) - { - bool result = methodInfo.Name == MethodNames.Take; - - result |= methodInfo.Name == MethodNames.Skip; - - return result; - } - - /// - /// Creates the query for current expression. - /// - /// - /// ref to IQueryable instance - public IQueryable CreateQuery(Expression expression) - { - return (this as IQueryProvider).CreateQuery(expression); - } - - /// - /// Executes the query for current type and expression - /// - /// Current type - /// - /// typed result - public TResult Execute(Expression expression) - { - return (TResult)(this as IQueryProvider).Execute(expression); - } - - /// - /// Executes the query for current expression. - /// - /// - /// object/collection - public object Execute(Expression expression) - { - if (expression == null) - { - // do a generic select; - //expression = (this as IEnumerable).Select(x=> x).Expression; - } - - ProcessItem(Buckets.Current); - - if (expression is MethodCallExpression) - { - var mCallExp = (MethodCallExpression)expression; - - // when first , last or single is called - string methodName = mCallExp.Method.Name; - - Type itemGenericType = typeof(IMethodCall); - Type itemNonGenericType = typeof(IMethodCall); - - if (mCallExp.Method.ReturnType == typeof(T)) - { - return Utility.InvokeMethod(methodName, itemGenericType, this); - } - - /* Try for Non Generics Result */ - object obj = Utility.InvokeMethod(methodName, itemNonGenericType, this); - - if (obj != null) - { - return obj; - } - - } - - return ((QueryCollection)context.Collection).Items; - } - - #endregion - - - #region Implementation of IQuery - - /// - /// Returns a single item from the collection. - /// - /// - public T Single() - { - return context.Collection.Single(); - } - - /// - /// Returns a single item or default value if empty. - /// - /// - public T SingleOrDefault() - { - return context.Collection.SingleOrDefault(); - } - - /// - /// Returns the first item from the collection. - /// - /// - public T First() - { - return context.Collection.First(); - } - - /// - /// Returns first item or default value if empty. - /// - /// - public T FirstOrDefault() - { - return context.Collection.FirstOrDefault(); - } - - /// - /// Returns the last item from the collection. - /// - /// - public T Last() - { - return context.Collection.Last(); - } - - /// - /// Returns last item or default value if empty. - /// - /// - public T LastOrDefault() - { - return context.Collection.LastOrDefault(); - } - - #endregion - - #region Implementation of IQuery - - /// - /// Return true if there is any item in collection. - /// - /// - public bool Any() - { - return context.Collection.Any(); - } - - /// - /// Returns the count of items in the collection. - /// - /// - public object Count() - { - return context.Collection.Count(); - } - - #endregion - - #region IDisposable Members - - void IDisposable.Dispose() - { - // clean up expression object from memory. - if (this.currentExpression != null) - { - currentExpression = null; - } - Buckets.Clear(); - - Clear(); - } - - #endregion - - /// - /// Clears out items from collection. - /// - public void Clear() - { - context.Collection.Clear(); - } - - /// - /// internally tries to sort , if the query contains orderby statement. - /// - public void Sort() - { - if (Buckets.Current.OrderByItems != null) - { - foreach (var orderByInfo in Buckets.Current.OrderByItems) - { - ((QueryCollection)context.Collection) - .Sort(new QueryItemComparer>(orderByInfo.Member.MemberInfo.Name, orderByInfo.IsAscending)); - } - } - } - - /// - /// Marks an item to be removed. - /// - /// query object. - public void Remove(T value) - { - context.Collection.Remove(value); - } - - /// - /// Addes a range of items to the collection. - /// - /// - public void AddRange(IEnumerable items) - { - context.Collection.AddRange(items); - } - - /// - /// Adds list of items to the collection , optionally calls in memory sort. Used in Query.SelectItem - /// - /// collection - /// true/false - public void AddRange(IEnumerable items, bool inMemorySort) - { - context.Collection.AddRange(items); - - if (inMemorySort) - { - context.Collection.Sort(); - } - } - - /// - /// Adds a new item to the collection - /// - /// - public void Add(T item) - { - context.Collection.Add(item); - } - - #region Tobe overriden methods - /// - /// Invoked after SubmitChanges(), if there is new item in the colleciton. - /// - internal virtual bool AddItem(IBucket bucket) - { - // do nothing. - return false; - } - /// - /// Invoked after SubmitChanges(), if there are delted items in the collection. - /// - internal virtual bool RemoveItem(IBucket bucket) - { - // do nothing. - return false; - } - /// - /// Invoked after SubmitChanges(), if any of the object value is altered. - /// - internal virtual bool UpdateItem(IBucket bucket) - { - // do nothing. - return false; - } - - /// - /// Called by the extender for select queries. - /// - /// bucekt interface. - /// - internal virtual void ExecuteQuery(IBucket bucket, IModifiableCollection items) - { - // does nothing. - } - - #endregion - - /// - /// When called, it invokes the appropiate Query method to finalize the collection changes. - /// - public void SubmitChanges() - { - var queryColleciton = (QueryCollection)context.Collection; - - var bucket = BucketImpl.NewInstance.Init(); - - var deletedItems = new List>(); - - foreach (var item in queryColleciton.Objects) - { - try - { - if (item.IsNewlyAdded) - { - bool added = PerformChange(bucket, item, this.AddItem); - - if (added) - { - // cache the item to track for update. - (item as IVersionItem).Commit(); - } - else - { - RaiseError(String.Format("{0} add failed", bucket.Name)); - } - - } - else if (item.IsDeleted) - { - if (PerformChange(bucket, item, this.RemoveItem)) - { - deletedItems.Add(item); - } - else - { - RaiseError(String.Format("{0} delete failed", bucket.Name)); - } - } - else if (item.IsAltered) - { - if (PerformChange(bucket, item, this.UpdateItem)) - { - (item as IVersionItem).Commit(); - } - else - { - (item as IVersionItem).Revert(); - RaiseError(String.Format("{0} update failed", bucket.Name)); - } - } - } - catch (Exception ex) - { - throw new ProviderException(ex.Message, ex); - } - } - // delete the removed items. - foreach (var queryObject in deletedItems) - { - queryColleciton.Objects.Remove(queryObject); - } - } - - /// - /// Visits the binary expression. - /// - /// Target expression - /// Result expression - public override Expression VisitBinary(BinaryExpression expression) - { - - if (expression.NodeType == ExpressionType.AndAlso - || expression.NodeType == ExpressionType.And - || expression.NodeType == ExpressionType.Or - || expression.NodeType == ExpressionType.OrElse) - { - var op = expression.NodeType == ExpressionType.AndAlso - || expression.NodeType == ExpressionType.And ? LogicalOperator.And - : LogicalOperator.Or; - - var temp = GetCurrentNode(parent, op); - - parent = temp; - - ++level; - - this.Visit(expression.Left); - - parent = temp; - - ++level; - - this.Visit(expression.Right); - - Buckets.Current.SyntaxStack.Pop(); - - return expression; - } - - bool singleOrExtensionCall = false; - - // for extension and single item call. - if (Buckets.Current.SyntaxStack.Count == 0) - { - parent = GetCurrentNode(parent, LogicalOperator.And); - singleOrExtensionCall = true; - } - - Buckets.Current.Level = level; - Buckets.Current.CurrentExpessionType = expression.NodeType; - Buckets.Current.SyntaxStack.Peek().Level = level; - - Buckets.Current.SyntaxStack.Push(new BucketImpl.TreeNodeInfo - { - CompoundOperator = LogicalOperator.None, - Id = Guid.NewGuid(), - ParentId = Buckets.Current.SyntaxStack.Peek().Id, - }); - - Buckets.Current.CurrentTreeNode = parent; - - // push the state. - this.ProcessBinaryResult(expression); - - if (singleOrExtensionCall) - { - Buckets.Current.SyntaxStack.Pop(); - } - - return expression; - } - - public override Expression VisitConstant(ConstantExpression expression) - { - this.value = expression.Value; - return expression; - } - - public override Expression VisitUnary(UnaryExpression expression) - { - if (expression.NodeType == ExpressionType.Not) - { - this.Visit(Expression.MakeBinary( - ExpressionType.NotEqual, - expression.Operand, - Expression.Constant(true))); - } - else - { - Visit(expression.Operand); - } - - return expression; - } - - public override Expression VisitMemberAccess(MemberExpression expression) - { - if (this.currentExpression is MethodCallExpression) - { - var mCall = this.currentExpression as MethodCallExpression; - - if (mCall.Method.Name == MethodNames.Group) - { - this.Visit(mCall); - - string key = Convert.ToString(this.value); - - if (!string.IsNullOrEmpty(key)) - { - Buckets.Current.Group = new Bucket.GroupByContainer { Key = key }; - } - } - else if (mCall.Method.Name == MethodNames.Where) - { - // Handle where clause with just a boolean member type - // Interpret Where(a => a.Member) as Where(a => a.Member == true) - if (expression.NodeType == ExpressionType.MemberAccess && expression.Type == typeof(bool)) - { - Visit(Expression.MakeBinary(ExpressionType.Equal, expression, Expression.Constant(true))); - } - } - } - - return expression; - } - - /// - /// Visits the method call expression - /// - /// Target expression - /// Result expression - public override Expression VisitMethodCall(MethodCallExpression expression) - { - string methodName = expression.Method.Name; - - if (methodName != MethodNames.Where) - { - parent = null; - level = 0; - } - - if (methodName == MethodNames.Orderby || methodName == MethodNames.Orderbydesc || methodName == MethodNames.ThenBy) - { - Buckets.Current.IsAsc = methodName == MethodNames.Orderbydesc ? false : true; - - var orderbyVisitor = new OrderbyVisitor(); - - orderbyVisitor.Visit(expression); - - Buckets.Current.OrderByItems.Add(new Bucket.OrderByInfo(orderbyVisitor.Member, Buckets.Current.IsAsc)); - - return expression; - } - else - { - if (expression.Arguments.Count == 2) - return this.Visit(expression.Arguments[1]); - } - - throw new NotImplementedException(Messages.NotImplemetedExpressionWithMultipleArguments); - } - - //private void FillOptionalBucketItems(Expression expression) - //{ - // if (expression is MethodCallExpression) - // { - // var mCall = this.currentExpression as MethodCallExpression; - - // if (mCall.Method.Name == MethodNames.Take) - // { - // Buckets.Current.ItemsToTake = (int)value; - // } - // else if (mCall.Method.Name == MethodNames.Skip) - // { - // Buckets.Current.ItemsToSkip = (int)value; - // } - // } - //} - - private TreeNode GetCurrentNode(TreeNode parentNode, LogicalOperator op) - { - Buckets.Current.SyntaxStack.Push(new BucketImpl.TreeNodeInfo - { - CompoundOperator = op, - Id = Guid.NewGuid(), - ParentId = Buckets.Current.SyntaxStack.Count > 0 ? Buckets.Current.SyntaxStack.Peek().Id : Guid.Empty, - }); - - - Bucket bucket = Buckets.Current; - TreeNode currentNode = null; - - var child = new TreeNode(); - - if (parentNode == null && bucket.CurrentNode.Nodes.Count == 2) - { - parentNode = bucket.CurrentNode; - // child becomes parent. - child.Id = Guid.NewGuid(); - parentNode.ParentId = child.Id; - child.RootImpl = op; - child.Nodes.Add(new TreeNode.Node { Value = parentNode }); - bucket.CurrentNode = child; - currentNode = child; - } - else if (parentNode != null) - { - child.Id = Buckets.Current.SyntaxStack.Peek().Id; - child.RootImpl = op; - child.ParentId = parentNode.Id; - // make it a child. - parentNode.Nodes.Add(new TreeNode.Node { Value = child }); - currentNode = child; - } - else - { - bucket.CurrentNode.Id = Buckets.Current.SyntaxStack.Peek().Id; - bucket.CurrentNode.RootImpl = op; - currentNode = bucket.CurrentNode; - } - return currentNode; - } - - - private Buckets Buckets - { - get - { - if (queryObjects == null) - queryObjects = new Buckets(); - return queryObjects; - } - } - - internal void ProcessBinaryResult(Expression expression) - { - var binaryExpression = expression as BinaryExpression; - - if (binaryExpression != null) - { - if (binaryExpression.Left is MemberExpression) - { - ExtractDataFromExpression(Buckets.Current, binaryExpression.Left, binaryExpression.Right); - } - else - { - // For enumeration comparison, parse the additional Covert(ph.something) call - if (binaryExpression.Left is UnaryExpression) - { - var uExp = (UnaryExpression)binaryExpression.Left; - - if (uExp.Operand is MethodCallExpression) - { - var methodCallExpression = (MethodCallExpression)uExp.Operand; - - FillBucketFromMethodCall(binaryExpression, methodCallExpression); - } - else - { - ExtractDataFromExpression(Buckets.Current, uExp.Operand, binaryExpression.Right); - } - - } - else if (binaryExpression.Left is MethodCallExpression) - { - var methodCallExpression = (MethodCallExpression)binaryExpression.Left; - // if there are two arguments for name and value. - if (methodCallExpression.Arguments.Count > 1) - { - ExtractDataFromExpression(Buckets.Current, methodCallExpression.Arguments[0], - methodCallExpression.Arguments[1]); - } - else - { - FillBucketFromMethodCall(binaryExpression, methodCallExpression); - } - } - } - } - else - { - var methodCallExpression = expression as MethodCallExpression; - - if (methodCallExpression != null) - { - FillBucketFromMethodCall(binaryExpression, methodCallExpression); - } - } - } - - private void FillBucketFromMethodCall(BinaryExpression expression, MethodCallExpression methodCallExpression) - { - var bucketImpl = Buckets.Current; - bucketImpl.IsDirty = true; - bucketImpl.ClauseItemCount = bucketImpl.ClauseItemCount + 1; - Buckets.Current.SyntaxStack.Pop(); - - if (expression != null) - { - object value = Expression.Lambda(expression.Right).Compile().DynamicInvoke(); - - var leafItem = new BucketItem - { - Name = methodCallExpression.Method.Name, - Method = new BucketItem.ExtenderMethod - { - Name = methodCallExpression.Method.Name, - Arguments = methodCallExpression.Arguments, - Method = methodCallExpression.Method - } - }; - - leafItem.Values.Add(new BucketItem.QueryCondition(value, bucketImpl.Relation)); - bucketImpl.CurrentTreeNode.Nodes.Add(new TreeNode.Node() { Value = leafItem }); - } - else - { - var value = Expression.Lambda(methodCallExpression.Object).Compile().DynamicInvoke() as IEnumerable; - - if (value != null) - { - - var memberExpression = methodCallExpression.Arguments[0] as MemberExpression; - - if (memberExpression != null) - { - string memberName = memberExpression.Member.Name; - - if (bucketImpl.Items.ContainsKey(memberName)) - { - var leafItem = new BucketItem - { - DeclaringType = memberExpression.Member.DeclaringType, - Name = bucketImpl.Items[memberName].Name, - ProperyName = bucketImpl.Items[memberName].ProperyName, - PropertyType = bucketImpl.Items[memberName].PropertyType, - Unique = bucketImpl.Items[memberName].Unique, - Child = bucketImpl.Items[memberName].Child, - Container = bucketImpl.Items[memberName].Container - }; - - foreach (object item in value) - { - leafItem.Values.Add(new BucketItem.QueryCondition(item, BinaryOperator.Contains)); - } - - - bucketImpl.CurrentTreeNode.Nodes.Add(new TreeNode.Node { Value = leafItem }); - } - } - } - } - } - - private void ExtractDataFromExpression(BucketImpl bucket, Expression left, Expression right) - { - object value = Expression.Lambda(right).Compile().DynamicInvoke(); - - MemberExpression memberExpression = (MemberExpression)left; - string originalMembername = memberExpression.Member.Name; - - PropertyInfo targetProperty = null; - // for nested types. - if (memberExpression.Member.DeclaringType != typeof(T) && - memberExpression.Member.DeclaringType != typeof(T).BaseType && - !memberExpression.Member.DeclaringType.IsInterface && - !memberExpression.Member.DeclaringType.IsAbstract) - { - Type targetType = memberExpression.Member.DeclaringType; - - while (true) - { - if (targetType.DeclaringType == null || targetType.DeclaringType == typeof(T)) - break; - targetType = targetType.DeclaringType; - } - - PropertyInfo[] infos = typeof(T).GetProperties(); - - targetProperty = FindTargetPropertyWhereUsed(infos, targetType); - - object nestedObj = Activator.CreateInstance(targetType); - - if (targetProperty.CanWrite) - { - var property = nestedObj.GetType().GetProperty(memberExpression.Member.Name); - - if (property == null) - { - // go deep find n. - object nestedChildObject = FindDeepObject(nestedObj, targetType, memberExpression.Member.Name); - - nestedChildObject.GetType() - .GetProperty(memberExpression.Member.Name) - .SetValue(nestedChildObject, value, null); - - } - else - { - property.SetValue(nestedObj, value, null); - } - - // reset the value. - value = nestedObj; - } - } - else - { - targetProperty = typeof(T).GetProperty(originalMembername); - } - - object[] attr = targetProperty.GetCustomAttributes(typeof(IgnoreAttribute), true); - - if (attr.Length == 0) - { - if (targetProperty.CanRead) - { - bucket.IsDirty = true; - FillBucket(bucket, targetProperty, value, memberExpression); - } - } - - } - - private PropertyInfo FindTargetPropertyWhereUsed(PropertyInfo[] infos, Type targetType) - { - IList compositeProperties = new List(); - - foreach (PropertyInfo property in infos) - { - if (!property.PropertyType.IsPrimitive && property.PropertyType.FullName.IndexOf("System") == -1 && !property.PropertyType.IsEnum) - { - compositeProperties.Add(property); - } - - if (property.PropertyType == targetType) - { - return property; - } - } - // try only if no properties found on the first step. - foreach (PropertyInfo info in compositeProperties) - { - return FindTargetPropertyWhereUsed(info.PropertyType.GetProperties(), targetType); - } - - return null; - } - - private static object FindDeepObject(object nestedObject, Type baseType, string propName) - { - PropertyInfo[] infos = baseType.GetProperties(); - - foreach (var info in infos) - { - if (info.Name == propName) - { - return nestedObject; - } - else - { - if (info.PropertyType.GetProperties().Count() > 0) - { - try - { - object tobeNested = info.GetValue(nestedObject, null); - - if (tobeNested == null) - { - tobeNested = Activator.CreateInstance(info.PropertyType); - if (info.CanWrite) - { - info.SetValue(nestedObject, tobeNested, null); - } - } - return FindDeepObject(tobeNested, info.PropertyType, propName); - } - catch - { - throw new ProviderException(Messages.CouldNotFindTheNestedProperty); - } - } - } - } - return null; - } - - private void FillBucket(BucketImpl bucket, PropertyInfo info, object value, MemberExpression memberExpression) - { - bucket.ClauseItemCount = bucket.ClauseItemCount + 1; - - var expression = memberExpression.Expression; - - Buckets.Current.SyntaxStack.Pop(); - - string[] parts = expression.ToString().Split(new char[] { '.' }, StringSplitOptions.RemoveEmptyEntries); - - Bucket current = bucket; - bool nested = false; - - for (int index = 1; index < parts.Length; index++) - { - Type propertyType = current.Items[parts[index]].PropertyType; - - if (!propertyType.IsPrimitive - && propertyType.FullName.IndexOf("System") == -1 - && !propertyType.IsEnum) - { - if (current.Items[parts[index]].Child == null) - { - current.Items[parts[index]].Child = BucketImpl.NewInstance(propertyType).Init(); - current.Items[parts[index]].Child.Container = current.Items[parts[index]]; - } - // move on. - current = current.Items[parts[index]].Child; - nested = true; - } - } - - BucketItem item = null; - - if (current != null && nested) - foreach (PropertyInfo property in info.PropertyType.GetProperties()) - { - object targetValue = property.GetValue(value, null); - - if (targetValue != null && !targetValue.EqualsDefault(property.Name, value)) - { - current.Items[property.Name].Values.Add(new BucketItem.QueryCondition(targetValue, bucket.Relation)); - } - } - - item = parts.Length > 1 ? bucket.Items[parts[1]] : bucket.Items[info.Name]; - - BucketItem leafItem; - - if (item.Child != null) - { - BucketItem i = item.GetActiveItem(); - - leafItem = new BucketItem - { - DeclaringType = i.DeclaringType, - Name = i.Name, - ProperyName = i.ProperyName, - PropertyType = info.PropertyType, - Unique = i.Unique, - Child = i.Child, - Container = i.Container - }; - - leafItem.Values.Add(new BucketItem.QueryCondition(i.Value, bucket.Relation)); - } - else - { - // for getting the values directly. - // add it to the bucket condition list. - item.Values.Add(new BucketItem.QueryCondition(value, bucket.Relation)); - - leafItem = new BucketItem - { - DeclaringType = item.DeclaringType, - Name = item.Name, - ProperyName = item.ProperyName, - PropertyType = info.PropertyType, - MemberInfo = memberExpression.Member, - Unique = item.Unique, - Container = item.Container - }; - - leafItem.Values.Add(new BucketItem.QueryCondition(value, bucket.Relation)); - } - bucket.CurrentTreeNode.Nodes.Add(new TreeNode.Node() { Value = leafItem }); - } - - private static bool PerformChange(Bucket bucket, IQueryObjectImpl item, ActualMethodHandler callback) - { - bool success; - // copy item - bucket = item.FillBucket(bucket); - - if (callback != null) - success = callback(bucket); - else - success = true; - - if (success && !item.IsDeleted) - item.FillObject(bucket); - - return success; - } - - private static void RaiseError(string message) - { - new ProviderException(message); - } - - private void ProcessItem(BucketImpl item) - { - if (!item.Processed) - { - try - { - ExecuteQuery(item, context.Collection); - } - catch (Exception ex) - { - throw new ProviderException(Messages.ErrorWhileExecutingTheQuery, ex); - } - - item.Processed = true; - } - } - - internal class OrderbyVisitor : ExpressionVisitor - { - public override Expression VisitMemberAccess(MemberExpression expression) - { - if (expression.Expression.NodeType == ExpressionType.Constant) - this.value = Expression.Lambda(expression).Compile().DynamicInvoke(); - else - this.member = new MemberReference(expression.Member); - - return expression; - } - - public override Expression VisitConstant(ConstantExpression expression) - { - value = expression.Value; - return expression; - } - - public override Expression VisitMethodCall(MethodCallExpression expression) - { - if (expression.Arguments.Count == 2) - return this.Visit(expression.Arguments[1]); - - return expression; - } - - public MemberReference Member - { - get - { - return member; - } - } - - - private MemberReference member; - private object value; - } - - - private object value; - private TreeNode parent; - private int level; - private Expression currentExpression; - private Buckets queryObjects; - private object projectedQuery; - private IQueryContextImpl context; - - private delegate bool ActualMethodHandler(Bucket bucket); - } -} diff --git a/LinqExtender/QueryContextImpl.cs b/LinqExtender/QueryContextImpl.cs deleted file mode 100644 index be0abbb2..00000000 --- a/LinqExtender/QueryContextImpl.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using LinqExtender.Abstraction; -using LinqExtender.Collection; - -namespace LinqExtender -{ - internal class QueryContextImpl : IQueryContextImpl - { - public QueryContextImpl(IQueryContext queryContext) - { - this.queryContext = queryContext; - collection = new QueryCollection(); - } - - public IModifiableCollection Collection - { - get - { - return collection; - } - } - - IEnumerable IQueryContext.Execute(Ast.Expression exprssion) - { - return queryContext.Execute(exprssion); - } - - private readonly IModifiableCollection collection; - private readonly IQueryContext queryContext; - } -} diff --git a/LinqExtender/QueryItemComparer.cs b/LinqExtender/QueryItemComparer.cs deleted file mode 100644 index 7a3f1265..00000000 --- a/LinqExtender/QueryItemComparer.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; - -namespace LinqExtender -{ - /// - /// Compares two query object - /// - /// QueryObject - public class QueryItemComparer : IComparer where T : QueryObject - { - /// - /// Creates a new instance of the with specific order by field name and soring. - /// - /// - /// - public QueryItemComparer(string orderByField, bool asc) - { - this.orderByField = orderByField; - ascending = asc; - } - - private readonly string orderByField = string.Empty; - private readonly bool ascending = true; - - int IComparer.Compare(T x, T y) - { - PropertyInfo prop1 = x.ReferringObject.GetType().GetProperty(orderByField); - PropertyInfo prop2 = y.ReferringObject.GetType().GetProperty(orderByField); - - if (prop1 != null && prop2 != null) - { - int result = 0; - - object obj1 = prop1.GetValue(x.ReferringObject, null); - object obj2 = prop2.GetValue(y.ReferringObject, null); - - if (ascending) - { - result = GetComparisonResult(obj1, obj2); - } - else - { - result = GetComparisonResult(obj2, obj1); - } - - return result; - } - return 0; - } - - private static int GetComparisonResult(object obj1, object obj2) - { - int result = 0; - string type = obj1.GetType().FullName; - - switch (type) - { - case "System.DateTime": - result = ((DateTime)obj1).CompareTo((DateTime)obj2); - break; - case "System.String": - result = ((String)obj1).CompareTo((String)obj2); - break; - case "System.Int32": - result = ((int)obj1).CompareTo((int)obj2); - break; - case "System.Double": - result = ((double)obj1).CompareTo((double)obj2); - break; - default: - result = ((string)obj1).CompareTo((string)obj2); - break; - } - return result; - } - - - } -} diff --git a/LinqExtender/QueryObject.cs b/LinqExtender/QueryObject.cs deleted file mode 100644 index 891e8efe..00000000 --- a/LinqExtender/QueryObject.cs +++ /dev/null @@ -1,283 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using LinqExtender.Attributes; -using LinqExtender.Abstraction; - -namespace LinqExtender -{ - /// - /// Defines a query object. - /// - public class QueryObject - { - /// - /// Contains the reference to the current query object. - /// - internal object ReferringObject { get; set; } - } - /// - /// Query object implemenatation. - /// - /// - public sealed class QueryObject : QueryObject, IVersionItem, IQueryObjectImpl - { - /// - /// Creates a new instance of the for its underlying object. - /// - /// - public QueryObject(T baseObject) - { - this.baseObject = baseObject; - } - - #region Tracking properties - - /// - /// determines if an item is removed from collection. - /// - public bool IsDeleted { get; set; } - - /// - /// deternmines if the object is altered , thus call UpdateItemFormat. - /// - public bool IsAltered - { - get - { - try - { - Type runningType = baseObject.GetType(); - PropertyInfo[] infos = runningType.GetProperties(); - - object item = (this as IVersionItem).Item; - - int index = 0; - - foreach (PropertyInfo info in infos) - { - if (info.CanWrite) - { - object source = info.GetValue(baseObject, null); - - PropertyInfo[] targetInfo = item.GetType().BaseType.GetProperties(); - - object target = index < targetInfo.Length ? targetInfo[index].GetValue(item, null) : null; - - if (source == null) - { - if (target != null) - return true; - } - else if (!source.Equals(target)) - { - return true; - } - } - index++; - } - } - catch - { - return false; - } - return false; - } - } - /// - /// determines if an item is newly added in the collection. - /// - - public bool IsNewlyAdded - { - get - { - // Loads the uniqueKey mapping from extention method. - IDictionary uniqueDefaultValues = (ReferringObject as IQueryObject).GetUniqueItemDefaultDetail(); - - foreach (string key in uniqueDefaultValues.Keys) - { - PropertyInfo[] infos = typeof(T).GetProperties(); - // create a hollow anonymous type and cast with result. - var item = Utility.Cast(uniqueDefaultValues[key], new { Index = 0, Value = default(object) }); - - object obj = infos[item.Index].GetValue(baseObject, null); - - if (obj != null) - { - // the property is not nullable, check for the default value. - isNew = obj.Equals(item.Value); - } - } - return isNew; - } - } - - - #endregion - /// - /// Gets/Sets the underlying ref object for the query object implementation. - /// - public new T ReferringObject - { - get { return (T)base.ReferringObject; } - set - { - base.ReferringObject = value; - } - } - - #region IDisposable Members - - /// - /// Disposes the query object. - /// - public void Dispose() - { - ReferringObject = default(T); - } - - - #endregion - - - #region IVersionItem Members - - /// - /// updates the cached object with update object - /// - void IVersionItem.Commit() - { - //First we create an instance of this specific type. - CopyObjectTo(ReferringObject, baseObject); - } - /// - /// converts the current object to cachedObject. - /// - void IVersionItem.Revert() - { - CopyObjectTo(ReferringObject, baseObject); - } - - /// - /// Copies the source object to one or more destinaton object. - /// - /// single object to be copied. - /// array of objects - private static void CopyObjectTo(object sourceObject , params object[] targets) - { - Type sourceType = sourceObject.GetType(); - - IEnumerable infos = sourceType.GetBaseProperties(); - - foreach (PropertyInfo info in infos) - { - if (info.CanRead && info.CanWrite) - { - foreach (object target in targets) - { - info.SetValue(target, info.GetValue(sourceObject, null), null); - } - } - } - } - - object IVersionItem.Item - { - get - { - return ReferringObject; - } - } - - #endregion - - - #region Bucket Fill ups - /// - /// Takes bucket reference and fills it up with new values. - /// - /// - /// - public Bucket FillBucket(Bucket bucket) - { - IEnumerable infos = baseObject.GetType().GetProperties(); - - foreach (PropertyInfo info in infos) - { - object[] arg = info.GetCustomAttributes(typeof(IgnoreAttribute), true); - - if (arg.Length == 0) - { - if (info.CanRead) - { - try - { - object oldValue = info.GetValue(baseObject, null); - object value = (ReferringObject != null) ? info.GetValue(ReferringObject, null) : null; - - if (value != null) - { - if (!value.Equals(oldValue)) - bucket.Items[info.Name].IsModified = true; - - if (bucket.Items[info.Name].PropertyType == info.PropertyType) - { - bucket.Items[info.Name].Values.Clear(); - bucket.Items[info.Name].Values.Add(new BucketItem.QueryCondition(value, BinaryOperator.Equal)); - } - } - } - catch - { - // skip, failed to parse, this happens for some null reference properties. - } - } - } - } - return bucket; - } - - /// - /// Fill value for a property name. - /// - /// Name of the property, accepts original property or Modified by OriginalFieldNameAttribute - /// the value of the property , retrived from property get accessor. - /// Return type of the underlying property. - public void FillProperty(string name, object value, Type returnType) - { - PropertyInfo info = ReferringObject.GetType().GetProperty(name, returnType); - - if (info.CanWrite) - { - info.SetValue(ReferringObject, value, null); - } - } - /// - /// Fills object from its underlying bucket. - /// - /// - public void FillObject(Bucket source) - { - foreach (string property in source.Items.Keys) - { - BucketItem item = source.Items[property]; - // first make sure it is not turned off by user. - if (item.Visible) - { - // people can set only once condition from Query.SelectItemFormat - // check if the propety has some value, if so then proceed. - if (item.Values.Count > 0 && item.Values[0].Changed) - { - // change the item. - FillProperty(property, item.Value, item.PropertyType); - } - } - } - } - #endregion - - private bool isNew = true; - private readonly T baseObject; - } -} diff --git a/LinqExtender/QueryProvider.cs b/LinqExtender/QueryProvider.cs deleted file mode 100644 index 4cc260ec..00000000 --- a/LinqExtender/QueryProvider.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System.Collections.Generic; -using LinqExtender.Abstraction; -using LinqExtender.Fluent; - -namespace LinqExtender -{ - internal class QueryProvider : Query - { - public QueryProvider(IQueryContext context) : base(context) - { - // intentionally left blank - } - - internal override void ExecuteQuery(IBucket bucket, IModifiableCollection items) - { - var fluentBucket = FluentBucket.As(bucket); - var expressionStack = new Stack(); - - var blockExpression = new Ast.BlockExpression(); - - blockExpression.Expressions.Add(new Ast.TypeExpression(typeof(T))); - - if (fluentBucket.IsDirty) - { - var lambda = new Ast.LambdaExpression(typeof(T)); - - fluentBucket.ExpressionTree - .DescribeContainerAs(expressionStack) - .Root((stack, operatorType) => - { - var logical = new Ast.LogicalExpression(operatorType); - - var left = stack.Pop(); - - MarkAsChild(left); - - logical.Left = left; - stack.Push(logical); - }) - .EachLeaf((stack, item) => - { - var binary = new Ast.BinaryExpression(item.Operator) - { - Left = new Ast.MemberExpression(item), - Right = new Ast.LiteralExpression(item.PropertyType, item.Value) - }; - - stack.Push(binary); - - }) - .End(stack => - { - var binary = stack.Pop(); - - if (stack.Count > 0 - && stack.Peek().CodeType == CodeType.LogicalExpression) - { - var logical = stack.Pop() as Ast.LogicalExpression; - logical.Right = binary; - - // nested. - if (Peek(stack) as Ast.LogicalExpression != null) - { - MarkAsChild(logical); - } - - stack.Push(logical); - } - else - { - stack.Push(binary); - } - - }) - .Execute(); - - lambda.Body = expressionStack.Pop(); - blockExpression.Expressions.Add(lambda); - } - - fluentBucket.Entity.OrderBy.IfUsed(() => - fluentBucket.Entity.OrderBy.ForEach.Process((member, asending) => { - blockExpression.Expressions.Add(new Ast.OrderbyExpression(member, asending)); - })); - - fluentBucket.Method.ForEach((method) => - { - blockExpression.Expressions.Add(new Ast.MethodCallExpression(method)); - }); - - items.AddRange(Context.Execute(blockExpression)); - } - - private void MarkAsChild(Ast.Expression childExpression) - { - if (childExpression.CodeType == CodeType.LogicalExpression) - { - ((Ast.LogicalExpression)childExpression).IsChild = true; - } - } - - public Ast.Expression Peek(Stack expressionStack) - { - return expressionStack.Count > 0 ? expressionStack.Peek() : null; - } - } -} diff --git a/LinqExtender/Queryable.cs b/LinqExtender/Queryable.cs deleted file mode 100644 index 2e03ea09..00000000 --- a/LinqExtender/Queryable.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; - -namespace LinqExtender -{ - /// - /// Defines various operations that extend the LINQ query. - /// - public static class Queryable - { - public static IQueryable Where(this IQueryContext source, Expression> predicate) - { - MethodInfo currentMethod = (MethodInfo)MethodInfo.GetCurrentMethod(); - var args = new[] { typeof(TSource) }; - return CreateQuery>(source, currentMethod, predicate, args); - } - - public static IQueryable OrderBy(this IQueryContext source, Expression> keySelector) - { - MethodInfo currentMethod = (MethodInfo)MethodInfo.GetCurrentMethod(); - var args = new[] { typeof(TSource), typeof(TKey) }; - return CreateQuery>(source, currentMethod, keySelector, args); - } - - public static IQueryable OrderByDescending(this IQueryContext source, Expression> keySelector) - { - var currentMethod = (MethodInfo)MethodInfo.GetCurrentMethod(); - var args = new[] { typeof(TSource), typeof(TKey) }; - return CreateQuery>(source, currentMethod, keySelector, args); - } - - - public static IEnumerable Join(this IQueryContext outer, - IQueryContext inner, - Expression> outerKeySelector, - Expression> innerKeySelector, - Expression> resultSelector) - { - - throw new NotImplementedException("Not yet implemented"); - } - - - private static IQueryable CreateQuery(IQueryContext source, - MethodInfo methodInfo, - Expression expression, - Type[] genArgs) - { - BindingFlags flags = BindingFlags.Static | BindingFlags.Public; - - var methodGenArgs = methodInfo.GetGenericArguments(); - - var targetMethod = typeof(Enumerable).GetMethods(flags) - .Where(x => x.Name == methodInfo.Name) - .Where(x => x.GetGenericArguments().All(arg => - { - return methodGenArgs.Any(y => y.Name == arg.Name); - })) - .First(); - - targetMethod = targetMethod.MakeGenericMethod(genArgs); - - IList list = new List(); - Expression constant = Expression.Constant(list.AsQueryable(), typeof(IQueryable)); - Expression call = Expression.Call(targetMethod, constant, expression); - - return new QueryProvider(source).CreateQuery(call); - } - - public static IQueryable Select(this IQueryContext source, Expression> selector) - { - MethodInfo currentMethod = (MethodInfo)MethodInfo.GetCurrentMethod(); - var args = new[] { typeof(TSource), typeof(TResult) }; - return CreateQuery>(source, currentMethod, selector, args) as IQueryable; - } - } -} diff --git a/LinqExtender/Solution/LinqExtenderSolution.sln b/LinqExtender/Solution/LinqExtenderSolution.sln deleted file mode 100755 index 448c1405..00000000 --- a/LinqExtender/Solution/LinqExtenderSolution.sln +++ /dev/null @@ -1,70 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinqExtender", "..\LinqExtender.csproj", "{A2171F32-6AB4-4BA4-920B-EB1D28F5F7F2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinqExtender.Silverlight", "..\LinqExtender.Silverlight\LinqExtender.Silverlight.csproj", "{C3EA3FA4-C790-413D-A2D9-F59E8767CD9B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinqExtender.Tests", "..\LinqExtender.Tests\LinqExtender.Tests.csproj", "{BA30AD53-4E10-4610-BDD2-BB823DF0325B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Install", "Install", "{EB5980B4-B1BB-4855-BB31-A8BD40473824}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinqExtender.PackLib", "..\LinqExtender.PackLib\LinqExtender.PackLib.csproj", "{8A5B4179-FAAC-40B9-B844-CCA926165327}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A2171F32-6AB4-4BA4-920B-EB1D28F5F7F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A2171F32-6AB4-4BA4-920B-EB1D28F5F7F2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A2171F32-6AB4-4BA4-920B-EB1D28F5F7F2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {A2171F32-6AB4-4BA4-920B-EB1D28F5F7F2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {A2171F32-6AB4-4BA4-920B-EB1D28F5F7F2}.Debug|x86.ActiveCfg = Debug|Any CPU - {A2171F32-6AB4-4BA4-920B-EB1D28F5F7F2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A2171F32-6AB4-4BA4-920B-EB1D28F5F7F2}.Release|Any CPU.Build.0 = Release|Any CPU - {A2171F32-6AB4-4BA4-920B-EB1D28F5F7F2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {A2171F32-6AB4-4BA4-920B-EB1D28F5F7F2}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {A2171F32-6AB4-4BA4-920B-EB1D28F5F7F2}.Release|x86.ActiveCfg = Release|Any CPU - {C3EA3FA4-C790-413D-A2D9-F59E8767CD9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C3EA3FA4-C790-413D-A2D9-F59E8767CD9B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C3EA3FA4-C790-413D-A2D9-F59E8767CD9B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C3EA3FA4-C790-413D-A2D9-F59E8767CD9B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {C3EA3FA4-C790-413D-A2D9-F59E8767CD9B}.Debug|x86.ActiveCfg = Debug|Any CPU - {C3EA3FA4-C790-413D-A2D9-F59E8767CD9B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C3EA3FA4-C790-413D-A2D9-F59E8767CD9B}.Release|Any CPU.Build.0 = Release|Any CPU - {C3EA3FA4-C790-413D-A2D9-F59E8767CD9B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {C3EA3FA4-C790-413D-A2D9-F59E8767CD9B}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {C3EA3FA4-C790-413D-A2D9-F59E8767CD9B}.Release|x86.ActiveCfg = Release|Any CPU - {BA30AD53-4E10-4610-BDD2-BB823DF0325B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BA30AD53-4E10-4610-BDD2-BB823DF0325B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BA30AD53-4E10-4610-BDD2-BB823DF0325B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {BA30AD53-4E10-4610-BDD2-BB823DF0325B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {BA30AD53-4E10-4610-BDD2-BB823DF0325B}.Debug|x86.ActiveCfg = Debug|Any CPU - {BA30AD53-4E10-4610-BDD2-BB823DF0325B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BA30AD53-4E10-4610-BDD2-BB823DF0325B}.Release|Any CPU.Build.0 = Release|Any CPU - {BA30AD53-4E10-4610-BDD2-BB823DF0325B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {BA30AD53-4E10-4610-BDD2-BB823DF0325B}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {BA30AD53-4E10-4610-BDD2-BB823DF0325B}.Release|x86.ActiveCfg = Release|Any CPU - {8A5B4179-FAAC-40B9-B844-CCA926165327}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8A5B4179-FAAC-40B9-B844-CCA926165327}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {8A5B4179-FAAC-40B9-B844-CCA926165327}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {8A5B4179-FAAC-40B9-B844-CCA926165327}.Debug|x86.ActiveCfg = Debug|Any CPU - {8A5B4179-FAAC-40B9-B844-CCA926165327}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8A5B4179-FAAC-40B9-B844-CCA926165327}.Release|Any CPU.Build.0 = Release|Any CPU - {8A5B4179-FAAC-40B9-B844-CCA926165327}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {8A5B4179-FAAC-40B9-B844-CCA926165327}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {8A5B4179-FAAC-40B9-B844-CCA926165327}.Release|x86.ActiveCfg = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {8A5B4179-FAAC-40B9-B844-CCA926165327} = {EB5980B4-B1BB-4855-BB31-A8BD40473824} - EndGlobalSection -EndGlobal diff --git a/LinqExtender/Solution/Tools/NuGet.exe b/LinqExtender/Solution/Tools/NuGet.exe deleted file mode 100755 index f34420ee..00000000 Binary files a/LinqExtender/Solution/Tools/NuGet.exe and /dev/null differ diff --git a/LinqExtender/ThirdParty/nunit.framework.dll b/LinqExtender/ThirdParty/nunit.framework.dll deleted file mode 100644 index 96e31f9e..00000000 Binary files a/LinqExtender/ThirdParty/nunit.framework.dll and /dev/null differ diff --git a/LinqExtender/TreeNode.cs b/LinqExtender/TreeNode.cs deleted file mode 100644 index 2cc1100d..00000000 --- a/LinqExtender/TreeNode.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; - -namespace LinqExtender -{ - /// - /// Represents the query conditions in a tree logical tree form. - /// - [DebuggerStepThrough] - internal class TreeNode - { - /// - /// Defines a tree node. - /// - public class Node - { - /// - /// Gets a value for the tree node. - /// - public object Value { get; set; } - } - /// - /// Id of the current node. - /// - public Guid Id { get; set; } - /// - /// parent Id of the current node. - /// - public Guid ParentId { get; set; } - - /// - /// list of nodes under each expression. - /// - internal IList Nodes - { - get - { - if (nodes == null) - { - nodes = new List(); - } - return nodes; - } - set - { - nodes = value; - } - } - /// - /// left leaf of the current root, can contain bucketItem or a CurrentNode - /// - public Node Left - { - get - { - if (Nodes.Count > 0) - { - return Nodes[0]; - } - return null; - } - } - /// - /// right leaf of the current root, can contain bucketItem or a CurrentNode - /// - /// - public Node Right - { - get - { - if (Nodes.Count > 1) - { - return Nodes[1]; - } - return null; - } - } - - internal LogicalOperator RootImpl { get; set; } - - /// - /// Root which the left and right item follows. - /// - public LogicalOperator Root - { - get - { - if (Right != null) - return RootImpl; - // for single item should return NONE. - return LogicalOperator.None; - } - } - /// - /// Clones the tree node. - /// - /// clonned - public TreeNode Clone() - { - var clonned = Activator.CreateInstance(); - - foreach (var node in this.GetType().GetProperties()) - { - if (node.CanWrite) - { - node.SetValue(clonned, node.GetValue(this, null), null); - } - } - return clonned; - } - - private IList nodes; - - } -} \ No newline at end of file diff --git a/LinqExtender/TypeReference.cs b/LinqExtender/TypeReference.cs deleted file mode 100644 index b1e3f225..00000000 --- a/LinqExtender/TypeReference.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using LinqExtender.Attributes; - -namespace LinqExtender -{ - /// - /// Wrapper over a system type. - /// - public class TypeReference - { - internal TypeReference(Type targetType) - { - this.targetType = targetType; - } - - /// - /// Gets the name of the type, applies first. - /// - public string Name - { - get - { - var nameAtt = FindAttribute(); - - if ((nameAtt != null)) - { - return nameAtt.Name; - } - return targetType.Name; - } - } - - /// - /// Gets the underlying type - /// - public Type UnderlyingType - { - get - { - return targetType; - } - } - - /// - /// Finds the specific attribute from the type. - /// - /// Attribute to find - /// Target attribute reference - public T FindAttribute() - { - return (T)Utility.FindAttribute(typeof(T), targetType); - } - - private readonly Type targetType; - } -} diff --git a/LinqExtender/Utility.cs b/LinqExtender/Utility.cs deleted file mode 100644 index f6509649..00000000 --- a/LinqExtender/Utility.cs +++ /dev/null @@ -1,225 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Linq; -using LinqExtender.Attributes; -using LinqExtender.Abstraction; - -namespace LinqExtender -{ - /// - /// Defines various helper method used throughout the project. - /// - public static class Utility - { - internal static IDictionary GetUniqueItemDefaultDetail(this IQueryObject obj) - { - Type runningType = obj.GetType(); - - if (!uniqueDefaultValueMap.ContainsKey(runningType.Name)) - { - IDictionary uniqueDefaultValues = new Dictionary(); - //clone the result. - object runningObject = Activator.CreateInstance(runningType); - - PropertyInfo[] infos = runningType.GetProperties(); - - int index = 0; - - foreach (PropertyInfo info in infos) - { - object[] arg = info.GetCustomAttributes(typeof (UniqueIdentifierAttribute), true); - - if (arg.Length > 0) - { - object value = info.GetValue(runningObject, null); - - if (!uniqueDefaultValues.ContainsKey(info.Name)) - { - uniqueDefaultValues.Add(info.Name, new {Index = index, Value = value}); - break; - } - } - index++; - } - uniqueDefaultValueMap.Add(runningType.Name, uniqueDefaultValues); - } - return uniqueDefaultValueMap[runningType.Name]; - } - - - internal static bool EqualsDefault(this object targetValue, string propertyName, object source) - { - if (targetValue != null && (targetValue.GetType().IsPrimitive || targetValue.GetType().IsEnum)) - { - object @default = Activator.CreateInstance(source.GetType()); - return @default.GetType().GetProperty(propertyName).GetValue(@default, null).Equals(targetValue); - } - return false; - } - - internal static T Cast(object obj, T type) - { - return (T)obj; - } - - /// - /// tries to combine the values for a give a type . Ex User defined clasee - /// and its properties. - /// - /// - /// - /// - public static object Combine(this IList list, Type type) - { - object combinedObject = Activator.CreateInstance(type); - foreach (var condition in list) - { - condition.Value.CopyRecursive(combinedObject); - } - return combinedObject; - } - - /// - /// recursively copies object properties to destination. - /// - /// - /// - public static void CopyRecursive(this object source , object destination) - { - PropertyInfo[] sourceProperties = source.GetType().GetProperties(); - - Type destType = destination.GetType(); - - foreach (PropertyInfo prop in sourceProperties) - { - if (prop.PropertyType.FullName != null) - if (prop.PropertyType.IsClass && !(prop.PropertyType.FullName.IndexOf("System") >= 0)) - { - object value = prop.GetValue(source, null); - - var destProp = destType.GetProperty(prop.Name); - - object destValue = destProp.GetValue(destination, null); - - if (value != null) - { - try - { - if (destValue == null) - { - destValue = Activator.CreateInstance(destProp.PropertyType); - } - // copy - value.CopyRecursive(destValue); - - if (destProp.CanWrite) - { - destProp.SetValue(destination, destValue, null); - } - } - catch(Exception ex) - { - #if DEBUG - System.Diagnostics.Debug.WriteLine(ex.StackTrace); - #endif - } - } - } - else - { - bool isDefault = false; - - object destValue = destType.GetProperty(prop.Name).GetValue(destination, null); - - if (destValue != null) - { - object tempObject = Activator.CreateInstance(destType); - object tempValue = tempObject.GetType().GetProperty(prop.Name).GetValue(tempObject, null); - isDefault = tempValue.Equals(destValue); - } - - if (destValue == null || isDefault) - { - destType.GetProperty(prop.Name).SetValue(destination, prop.GetValue(source, null), null); - } - } - } - } - - internal static IEnumerable GetBaseProperties(this Type target) - { - foreach (PropertyInfo propertyInfo in target.GetProperties()) - { - yield return propertyInfo; - } - } - - internal static IQueryProvider GetQueryProvider(this T objectBase) where T : IQueryProvider - { - string key = objectBase.GetType().FullName; - - if (!queryProviders.ContainsKey(key)) - { - queryProviders.Add(key, objectBase); - } - return queryProviders[key] as IQueryProvider; - } - - /// - /// Invokes the specific method on the target - /// - /// Name of the method to invoke. - /// Type of the target - /// Target object - /// - public static object InvokeMethod(string methodName, Type targetType, object obj) - { - MethodInfo[] mInfos = targetType.GetMethods(); - if (mInfos.Any(mInfo => string.Compare(methodName, mInfo.Name) == 0)) - { - return targetType.InvokeMember(methodName, BindingFlags.InvokeMethod, null, obj, null); - } - return null; - } - - internal static bool IsEqual(object obj1, object obj2) - { - bool equal = true; - - IEnumerable infos = obj1.GetType().GetBaseProperties(); - - foreach (PropertyInfo info in infos) - { - var queryAttribute = FindAttribute(typeof(IgnoreAttribute), info) as IgnoreAttribute; - - if (queryAttribute == null) - { - object value1 = info.GetValue(obj1, null); - object value2 = info.GetValue(obj2, null); - - if (Convert.ToString(value2) != Convert.ToString(value1)) - { - equal = false; - } - } - } - return equal; - } - - -// internal static object FindAttribute(Type type, ICustomAttributeProvider info) -// { -// object[] arg = info.GetCustomAttributes(type, true); -// -// if (arg != null && arg.Length > 0) -// { -// return arg[0]; -// } -// return null; -// } - - private static IDictionary queryProviders = new Dictionary(); - private static readonly IDictionary> uniqueDefaultValueMap = new Dictionary>(); - } -} diff --git a/LinqExtender/packages.config b/LinqExtender/packages.config deleted file mode 100644 index 87ff2d31..00000000 --- a/LinqExtender/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index 4d507166..d3165823 100644 --- a/README.md +++ b/README.md @@ -19,4 +19,31 @@ This is a Public Class Library (PCL) for various supported Xamarin runtimes. 11. Edit the file `Kinvey-Xamarin.nuspec` to up the version number and changelog (this is an xml file) 12. run `nuget push Kinvey-Xamarin.nupkg` 13. pull the devcenter -14. modify the changelog and download.json, and deploy. \ No newline at end of file +14. modify the changelog and download.json, and deploy. + + + +##new release process +###Kinvey +2. Update the version number in `Kinvey-Xamarin/core/KinveyHeaders.cs` +3. Set target to `Release`, and kick off a build. +4. Open up the __Kinvey-Xamarin__ project in finder +5. Copy __Kinvey-Utils/obj/Release/Kinvey-Utils.dll__, __Kinvey-Xamarin/obj/Release/Kinvey-Xamarin.dll__, and __Restsharp.Portable/obj/Release/RestSharp.portable.dll__ into the __libs__ directory +6. Open up `Kinvey-Xamarin.nuspec` +7. Modify version and release notes +8. nuget pack kinvey-xamarin + +###Android +1. Open up the __Kinvey-Xamarin-Android__ project in finder +2. Copy __/obj/release/Kinvey-Xamarin-Android.dll__ into the __libs__ directory +3. Open up `Kinvey-Xamarin-Android.nuspec` +4. Modify version and release notes +5. nuget pack kinvey-xamarin-android + +###iOS +1. Open up the __Kinvey-Xamarin-iOS project in finder +2. Copy __/obj/release/Kinvey-Xamarin-iOS.dll into the __libs__ directory +3. Open up `Kinvey-Xamarin-iOS.nuspec` +4. Modify version and release notes +5. nuget pack kinvey-xamarin-ios + diff --git a/RestSharp.Portable/Http.cs b/RestSharp.Portable/Http.cs index 3f161214..0e55a066 100644 --- a/RestSharp.Portable/Http.cs +++ b/RestSharp.Portable/Http.cs @@ -150,6 +150,8 @@ private async Task MakeRequestAsync(HttpMethod method, Cancellatio Logger.Log ("------------------------END REQUEST"); + + try { var responseMessage = await this._client.Instance.SendAsync(this._message.Instance, token); diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/Remotion.JetBrains.Annotations.Sources.1.15.23.0.nupkg b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/Remotion.JetBrains.Annotations.Sources.1.15.23.0.nupkg new file mode 100644 index 00000000..f71020bc Binary files /dev/null and b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/Remotion.JetBrains.Annotations.Sources.1.15.23.0.nupkg differ diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/AssertionConditionAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/AssertionConditionAttribute.cs new file mode 100644 index 00000000..3b74404d --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/AssertionConditionAttribute.cs @@ -0,0 +1,79 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Indicates the condition parameter of the assertion method. + /// The method itself should be marked by attribute. + /// The mandatory argument of the attribute is the assertion type. + /// + /// + [AttributeUsage (AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)] + sealed partial class AssertionConditionAttribute : Attribute + { + private readonly AssertionConditionType myConditionType; + + /// + /// Initializes new instance of AssertionConditionAttribute + /// + /// Specifies condition type + public AssertionConditionAttribute (AssertionConditionType conditionType) + { + myConditionType = conditionType; + } + + /// + /// Gets condition type + /// + public AssertionConditionType ConditionType + { + get { return myConditionType; } + } + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/AssertionConditionType.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/AssertionConditionType.cs new file mode 100644 index 00000000..092b13cb --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/AssertionConditionType.cs @@ -0,0 +1,77 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Specifies assertion type. If the assertion method argument satisifes the condition, then the execution continues. + /// Otherwise, execution is assumed to be halted + /// + enum AssertionConditionType + { + /// + /// Indicates that the marked parameter should be evaluated to true + /// + IS_TRUE = 0, + + /// + /// Indicates that the marked parameter should be evaluated to false + /// + IS_FALSE = 1, + + /// + /// Indicates that the marked parameter should be evaluated to null value + /// + IS_NULL = 2, + + /// + /// Indicates that the marked parameter should be evaluated to not null value + /// + IS_NOT_NULL = 3, + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/AssertionMethodAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/AssertionMethodAttribute.cs new file mode 100644 index 00000000..d9804557 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/AssertionMethodAttribute.cs @@ -0,0 +1,60 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Indicates that the marked method is assertion method, i.e. it halts control flow if one of the conditions is satisfied. + /// To set the condition, mark one of the parameters with attribute + /// + /// + [AttributeUsage (AttributeTargets.Method, AllowMultiple = false, Inherited = true)] + sealed partial class AssertionMethodAttribute : Attribute + { + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/BaseTypeRequiredAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/BaseTypeRequiredAttribute.cs new file mode 100644 index 00000000..67eae3e4 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/BaseTypeRequiredAttribute.cs @@ -0,0 +1,84 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// When applied to target attribute, specifies a requirement for any type which is marked with + /// target attribute to implement or inherit specific type or types + /// + /// + /// + /// [BaseTypeRequired(typeof(IComponent)] // Specify requirement + /// public class ComponentAttribute : Attribute + /// {} + /// + /// [Component] // ComponentAttribute requires implementing IComponent interface + /// public class MyComponent : IComponent + /// {} + /// + /// + [AttributeUsage (AttributeTargets.Class, AllowMultiple = true, Inherited = true)] + [BaseTypeRequired (typeof (Attribute))] + sealed partial class BaseTypeRequiredAttribute : Attribute + { + /// + /// Initializes new instance of BaseTypeRequiredAttribute + /// + /// Specifies which types are required + public BaseTypeRequiredAttribute (Type baseType) + { + BaseTypes = new[] { baseType }; + } + + /// + /// Gets enumerations of specified base types + /// + public Type[] BaseTypes { get; private set; } + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/CanBeNullAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/CanBeNullAttribute.cs new file mode 100644 index 00000000..c698b299 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/CanBeNullAttribute.cs @@ -0,0 +1,56 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Indicates that the value of marked element could be null sometimes, so the check for null is necessary before its usage + /// + [AttributeUsage (AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Delegate | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + sealed partial class CanBeNullAttribute : Attribute { } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/CannotApplyEqualityOperatorAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/CannotApplyEqualityOperatorAttribute.cs new file mode 100644 index 00000000..1830572d --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/CannotApplyEqualityOperatorAttribute.cs @@ -0,0 +1,57 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Indicates that the value of marked type (or its derivatives) cannot be compared using '==' or '!=' operators. + /// There is only exception to compare with null, it is permitted + /// + [AttributeUsage (AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = true)] + sealed partial class CannotApplyEqualityOperatorAttribute : Attribute { } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/ContractAnnotationAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/ContractAnnotationAttribute.cs new file mode 100644 index 00000000..68fa03ac --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/ContractAnnotationAttribute.cs @@ -0,0 +1,94 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Describes dependency between method input and output + /// + /// + ///

Function definition table syntax:

+ /// + /// FDT ::= FDTRow [;FDTRow]* + /// FDTRow ::= Input => Output | Output <= Input + /// Input ::= ParameterName: Value [, Input]* + /// Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value} + /// Value ::= true | false | null | notnull | canbenull + /// + /// If method has single input parameter, it's name could be omitted.
+ /// Using "halt" (or "void"/"nothing", which is the same) for method output means that methos doesn't return normally.
+ /// "canbenull" annotation is only applicable for output parameters.
+ /// You can use multiple [ContractAnnotation] for each FDT row, or use single attribute with rows separated by semicolon.
+ ///
+ /// + /// + /// [ContractAnnotation("=> halt")] public void TerminationMethod() + /// [ContractAnnotation("halt <= condition: false")] public void Assert(bool condition, string text) // Regular Assertion method + /// [ContractAnnotation("s:null => true")] public bool IsNullOrEmpty(string s) // String.IsNullOrEmpty + /// [ContractAnnotation("null => null; notnull => notnull")] public object Transform(object data) // Method which returns null if parameter is null, and not null if parameter is not null + /// [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")] public bool TryParse(string s, out Person result) + /// + /// + [AttributeUsage (AttributeTargets.Method, AllowMultiple = true, Inherited = true)] + sealed partial class ContractAnnotationAttribute : Attribute + { + public ContractAnnotationAttribute ([NotNull] string fdt) + : this (fdt, false) + { + } + + public ContractAnnotationAttribute ([NotNull] string fdt, bool forceFullStates) + { + FDT = fdt; + ForceFullStates = forceFullStates; + } + + public string FDT { get; private set; } + public bool ForceFullStates { get; private set; } + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/ImplicitUseKindFlags.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/ImplicitUseKindFlags.cs new file mode 100644 index 00000000..d617dc07 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/ImplicitUseKindFlags.cs @@ -0,0 +1,77 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + [Flags] + enum ImplicitUseKindFlags + { + Default = Access | Assign | InstantiatedWithFixedConstructorSignature, + + /// + /// Only entity marked with attribute considered used + /// + Access = 1, + + /// + /// Indicates implicit assignment to a member + /// + Assign = 2, + + /// + /// Indicates implicit instantiation of a type with fixed constructor signature. + /// That means any unused constructor parameters won't be reported as such. + /// + InstantiatedWithFixedConstructorSignature = 4, + + /// + /// Indicates implicit instantiation of a type + /// + InstantiatedNoFixedConstructorSignature = 8, + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/ImplicitUseTargetFlags.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/ImplicitUseTargetFlags.cs new file mode 100644 index 00000000..b4f730c0 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/ImplicitUseTargetFlags.cs @@ -0,0 +1,71 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Specify what is considered used implicitly when marked with or + /// + [Flags] + enum ImplicitUseTargetFlags + { + Default = Itself, + + Itself = 1, + + /// + /// Members of entity marked with attribute are considered used + /// + Members = 2, + + /// + /// Entity marked with attribute and all its members considered used + /// + WithMembers = Itself | Members + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/InstantHandleAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/InstantHandleAttribute.cs new file mode 100644 index 00000000..d02e3ca1 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/InstantHandleAttribute.cs @@ -0,0 +1,58 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Tells code analysis engine if the parameter is completely handled when the invoked method is on stack. + /// If the parameter is delegate, indicates that delegate is executed while the method is executed. + /// If the parameter is enumerable, indicates that it is enumerated while the method is executed. + /// + [AttributeUsage (AttributeTargets.Parameter, Inherited = true)] + sealed partial class InstantHandleAttribute : Attribute { } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/InvokerParameterNameAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/InvokerParameterNameAttribute.cs new file mode 100644 index 00000000..566e8a87 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/InvokerParameterNameAttribute.cs @@ -0,0 +1,57 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Indicates that the function argument should be string literal and match one of the parameters of the caller function. + /// For example, has such parameter. + /// + [AttributeUsage (AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)] + sealed partial class InvokerParameterNameAttribute : Attribute { } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/LinqTunnelAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/LinqTunnelAttribute.cs new file mode 100644 index 00000000..850e4cd1 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/LinqTunnelAttribute.cs @@ -0,0 +1,58 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Indicates that method is *pure* linq method, with postponed enumeration. C# iterator methods (yield ...) are always LinqTunnel. + /// + [AttributeUsage (AttributeTargets.Method)] + sealed partial class LinqTunnelAttribute : Attribute + { + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/LocalizationRequiredAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/LocalizationRequiredAttribute.cs new file mode 100644 index 00000000..1e324260 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/LocalizationRequiredAttribute.cs @@ -0,0 +1,103 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Indicates that marked element should be localized or not. + /// + [AttributeUsage (AttributeTargets.All, AllowMultiple = false, Inherited = true)] + sealed partial class LocalizationRequiredAttribute : Attribute + { + /// + /// Initializes a new instance of the class with + /// set to . + /// + public LocalizationRequiredAttribute () + : this (true) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// true if a element should be localized; otherwise, false. + public LocalizationRequiredAttribute (bool required) + { + Required = required; + } + + /// + /// Gets a value indicating whether a element should be localized. + /// true if a element should be localized; otherwise, false. + /// + public bool Required { get; private set; } + + /// + /// Returns whether the value of the given object is equal to the current . + /// + /// The object to test the value equality of. + /// + /// true if the value of the given object is equal to that of the current; otherwise, false. + /// + public override bool Equals (object obj) + { + var attribute = obj as LocalizationRequiredAttribute; + return attribute != null && attribute.Required == Required; + } + + /// + /// Returns the hash code for this instance. + /// + /// A hash code for the current . + public override int GetHashCode () + { + return base.GetHashCode (); + } + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/MeansImplicitUseAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/MeansImplicitUseAttribute.cs new file mode 100644 index 00000000..370efb7a --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/MeansImplicitUseAttribute.cs @@ -0,0 +1,81 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Should be used on attributes and causes ReSharper to not mark symbols marked with such attributes as unused (as well as by other usage inspections) + /// + [AttributeUsage (AttributeTargets.Class, AllowMultiple = false, Inherited = true)] + sealed partial class MeansImplicitUseAttribute : Attribute + { + public MeansImplicitUseAttribute () + : this (ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { } + + public MeansImplicitUseAttribute (ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) + { + UseKindFlags = useKindFlags; + TargetFlags = targetFlags; + } + + public MeansImplicitUseAttribute (ImplicitUseKindFlags useKindFlags) + : this (useKindFlags, ImplicitUseTargetFlags.Default) + { + } + + public MeansImplicitUseAttribute (ImplicitUseTargetFlags targetFlags) + : this (ImplicitUseKindFlags.Default, targetFlags) { } + + public ImplicitUseKindFlags UseKindFlags { get; private set; } + + /// + /// Gets value indicating what is meant to be used + /// + public ImplicitUseTargetFlags TargetFlags { get; private set; } + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/NoEnumerationAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/NoEnumerationAttribute.cs new file mode 100644 index 00000000..a6024669 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/NoEnumerationAttribute.cs @@ -0,0 +1,59 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Indicates that IEnumarable, passed as parameter, is not enumerated. + /// + /// + [AttributeUsage(AttributeTargets.Parameter)] + sealed partial class NoEnumerationAttribute : Attribute + { + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/NotNullAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/NotNullAttribute.cs new file mode 100644 index 00000000..c70b5b8a --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/NotNullAttribute.cs @@ -0,0 +1,56 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Indicates that the value of marked element could never be null + /// + [AttributeUsage (AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Delegate | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] + sealed partial class NotNullAttribute : Attribute { } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/NotifyPropertyChangedInvocatorAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/NotifyPropertyChangedInvocatorAttribute.cs new file mode 100644 index 00000000..90a27549 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/NotifyPropertyChangedInvocatorAttribute.cs @@ -0,0 +1,65 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Indicates that the function is used to notify class type property value is changed. + /// + [AttributeUsage (AttributeTargets.Method, AllowMultiple = false, Inherited = true)] + sealed partial class NotifyPropertyChangedInvocatorAttribute : Attribute + { + public NotifyPropertyChangedInvocatorAttribute () { } + public NotifyPropertyChangedInvocatorAttribute (string parameterName) + { + ParameterName = parameterName; + } + + public string ParameterName { get; private set; } + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/PathReferenceAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/PathReferenceAttribute.cs new file mode 100644 index 00000000..ab66efa0 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/PathReferenceAttribute.cs @@ -0,0 +1,63 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + [AttributeUsage (AttributeTargets.Parameter)] + sealed partial class PathReferenceAttribute : Attribute + { + public PathReferenceAttribute () { } + + public PathReferenceAttribute ([PathReference] string basePath) + { + BasePath = basePath; + } + + public string BasePath { get; private set; } + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/PublicAPIAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/PublicAPIAttribute.cs new file mode 100644 index 00000000..0f7e0667 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/PublicAPIAttribute.cs @@ -0,0 +1,60 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// This attribute is intended to mark publicly available API which should not be removed and so is treated as used. + /// + [MeansImplicitUse] + sealed partial class PublicAPIAttribute : Attribute + { + public PublicAPIAttribute () { } + public PublicAPIAttribute (string comment) { } + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/PureAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/PureAttribute.cs new file mode 100644 index 00000000..05d25014 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/PureAttribute.cs @@ -0,0 +1,57 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Indicates that method doesn't contain observable side effects. + /// + // The same as + [AttributeUsage (AttributeTargets.Method, Inherited = true)] + sealed partial class PureAttribute : Attribute { } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/ReSharperAnnotations Apache-2.0.licenseheader b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/ReSharperAnnotations Apache-2.0.licenseheader new file mode 100644 index 00000000..e9a5fafb --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/ReSharperAnnotations Apache-2.0.licenseheader @@ -0,0 +1,37 @@ +extensions: .cs +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/StringFormatMethodAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/StringFormatMethodAttribute.cs new file mode 100644 index 00000000..176d43dd --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/StringFormatMethodAttribute.cs @@ -0,0 +1,73 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Indicates that marked method builds string by format pattern and (optional) arguments. + /// Parameter, which contains format string, should be given in constructor. + /// The format string should be in -like form + /// + [AttributeUsage (AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] + sealed partial class StringFormatMethodAttribute : Attribute + { + /// + /// Initializes new instance of StringFormatMethodAttribute + /// + /// Specifies which parameter of an annotated method should be treated as format-string + public StringFormatMethodAttribute (string formatParameterName) + { + FormatParameterName = formatParameterName; + } + + /// + /// Gets format parameter name + /// + public string FormatParameterName { get; private set; } + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/TerminatesProgramAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/TerminatesProgramAttribute.cs new file mode 100644 index 00000000..505209e7 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/TerminatesProgramAttribute.cs @@ -0,0 +1,59 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Indicates that the marked method unconditionally terminates control flow execution. + /// For example, it could unconditionally throw exception + /// + [AttributeUsage (AttributeTargets.Method, AllowMultiple = false, Inherited = true)] + sealed partial class TerminatesProgramAttribute : Attribute + { + } +} \ No newline at end of file diff --git a/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/UsedImplicitlyAttribute.cs b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/UsedImplicitlyAttribute.cs new file mode 100644 index 00000000..38c5cfd3 --- /dev/null +++ b/packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/content/App_Packages/Remotion.JetBrains.Annotations.Sources.1.15.23.0/UsedImplicitlyAttribute.cs @@ -0,0 +1,86 @@ +// NOTE: This file was originally generated via JetBrains ReSharper +// and is part of the JetBrains.Annoations for ReSharper. +// It has since been modified for use in the re-motion framework development. +// +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Orignal license header by JetBrains: +// +// Copyright 2007-2012 JetBrains s.r.o. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; + +#pragma warning disable 1591 +// ReSharper disable UnusedMember.Global +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable IntroduceOptionalParameters.Global +// ReSharper disable MemberCanBeProtected.Global +// ReSharper disable InconsistentNaming +// ReSharper disable once CheckNamespace + +namespace JetBrains.Annotations +{ + /// + /// Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library), + /// so this symbol will not be marked as unused (as well as by other usage inspections) + /// + [AttributeUsage (AttributeTargets.All, AllowMultiple = false, Inherited = true)] + sealed partial class UsedImplicitlyAttribute : Attribute + { + [UsedImplicitly] + public UsedImplicitlyAttribute () + : this (ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { } + + [UsedImplicitly] + public UsedImplicitlyAttribute (ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) + { + UseKindFlags = useKindFlags; + TargetFlags = targetFlags; + } + + [UsedImplicitly] + public UsedImplicitlyAttribute (ImplicitUseKindFlags useKindFlags) + : this (useKindFlags, ImplicitUseTargetFlags.Default) { } + + [UsedImplicitly] + public UsedImplicitlyAttribute (ImplicitUseTargetFlags targetFlags) + : this (ImplicitUseKindFlags.Default, targetFlags) { } + + [UsedImplicitly] + public ImplicitUseKindFlags UseKindFlags { get; private set; } + + /// + /// Gets value indicating what is meant to be used + /// + [UsedImplicitly] + public ImplicitUseTargetFlags TargetFlags { get; private set; } + } +} \ No newline at end of file diff --git a/packages/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0.nupkg b/packages/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0.nupkg new file mode 100644 index 00000000..406e953e Binary files /dev/null and b/packages/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0.nupkg differ diff --git a/packages/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0/ArgumentUtility.cs b/packages/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0/ArgumentUtility.cs new file mode 100644 index 00000000..ad3bce85 --- /dev/null +++ b/packages/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0/ArgumentUtility.cs @@ -0,0 +1,447 @@ +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +using System; +using System.Collections; +using System.Diagnostics; +using System.Reflection; +using JetBrains.Annotations; + +// ReSharper disable once CheckNamespace +namespace Remotion.Utilities +{ + /// + /// This utility class provides methods for checking arguments. + /// + /// + /// Some methods of this class return the value of the parameter. In some cases, this is useful because the value will be converted to another + /// type: + /// ("o", o); + /// } + /// ]]> + /// In some other cases, the input value is returned unmodified. This makes it easier to use the argument checks in calls to base class constructors + /// or property setters: + /// + /// + static partial class ArgumentUtility + { + [AssertionMethod] + public static T CheckNotNull ( + [InvokerParameterName] string argumentName, + [AssertionCondition (AssertionConditionType.IS_NOT_NULL)] [NoEnumeration] T actualValue) + { + // ReSharper disable CompareNonConstrainedGenericWithNull + if (actualValue == null) + // ReSharper restore CompareNonConstrainedGenericWithNull + throw new ArgumentNullException (argumentName); + + return actualValue; + } + + [Conditional ("DEBUG")] + [AssertionMethod] + public static void DebugCheckNotNull ( + [InvokerParameterName] string argumentName, + [AssertionCondition (AssertionConditionType.IS_NOT_NULL)] [NoEnumeration] T actualValue) + { + CheckNotNull (argumentName, actualValue); + } + + [AssertionMethod] + public static string CheckNotNullOrEmpty ( + [InvokerParameterName] string argumentName, + [AssertionCondition (AssertionConditionType.IS_NOT_NULL)] string actualValue) + { + CheckNotNull (argumentName, actualValue); + if (actualValue.Length == 0) + throw CreateArgumentEmptyException (argumentName); + + return actualValue; + } + + [Conditional ("DEBUG")] + [AssertionMethod] + public static void DebugCheckNotNullOrEmpty ( + [InvokerParameterName] string argumentName, + [AssertionCondition (AssertionConditionType.IS_NOT_NULL)] string actualValue) + { + CheckNotNullOrEmpty (argumentName, actualValue); + } + + [AssertionMethod] + public static T CheckNotNullOrEmpty ( + [InvokerParameterName] string argumentName, + [AssertionCondition (AssertionConditionType.IS_NOT_NULL)] T enumerable) + where T: IEnumerable + { + CheckNotNull (argumentName, enumerable); + CheckNotEmpty (argumentName, enumerable); + + return enumerable; + } + + [Conditional ("DEBUG")] + [AssertionMethod] + public static void DebugCheckNotNullOrEmpty ( + [InvokerParameterName] string argumentName, + [AssertionCondition (AssertionConditionType.IS_NOT_NULL)] T enumerable) + where T: IEnumerable + { + CheckNotNullOrEmpty (argumentName, enumerable); + } + + [AssertionMethod] + public static T CheckNotNullOrItemsNull ( + [InvokerParameterName] string argumentName, + [AssertionCondition (AssertionConditionType.IS_NOT_NULL)] T enumerable) + where T: IEnumerable + { + CheckNotNull (argumentName, enumerable); + + int i = 0; + foreach (object item in enumerable) + { + if (item == null) + throw CreateArgumentItemNullException (argumentName, i); + ++i; + } + + return enumerable; + } + + [AssertionMethod] + public static T CheckNotNullOrEmptyOrItemsNull ( + [InvokerParameterName] string argumentName, + [AssertionCondition (AssertionConditionType.IS_NOT_NULL)] T enumerable) + where T: IEnumerable + { + CheckNotNullOrItemsNull (argumentName, enumerable); + CheckNotEmpty (argumentName, enumerable); + + return enumerable; + } + + [AssertionMethod] + public static string CheckNotEmpty ([InvokerParameterName] string argumentName, string actualValue) + { + if (actualValue != null && actualValue.Length == 0) + throw CreateArgumentEmptyException (argumentName); + + return actualValue; + } + + [AssertionMethod] + public static T CheckNotEmpty ([InvokerParameterName] string argumentName, T enumerable) + where T: IEnumerable + { + // ReSharper disable CompareNonConstrainedGenericWithNull + if (enumerable != null) + // ReSharper restore CompareNonConstrainedGenericWithNull + { + var collection = enumerable as ICollection; + if (collection != null) + { + if (collection.Count == 0) + throw CreateArgumentEmptyException (argumentName); + else + return enumerable; + } + + IEnumerator enumerator = enumerable.GetEnumerator(); + var disposableEnumerator = enumerator as IDisposable; + using (disposableEnumerator) // using (null) is allowed in C# + { + if (!enumerator.MoveNext()) + throw CreateArgumentEmptyException (argumentName); + } + } + + return enumerable; + } + + [AssertionMethod] + public static Guid CheckNotEmpty ([InvokerParameterName] string argumentName, Guid actualValue) + { + if (actualValue == Guid.Empty) + throw CreateArgumentEmptyException (argumentName); + + return actualValue; + } + + public static object CheckNotNullAndType ( + [InvokerParameterName] string argumentName, + [AssertionCondition (AssertionConditionType.IS_NOT_NULL)] [NoEnumeration] object actualValue, + Type expectedType) + { + if (actualValue == null) + throw new ArgumentNullException (argumentName); + + // ReSharper disable UseMethodIsInstanceOfType + if (!expectedType.GetTypeInfo().IsAssignableFrom (actualValue.GetType().GetTypeInfo())) + throw CreateArgumentTypeException (argumentName, actualValue.GetType(), expectedType); + // ReSharper restore UseMethodIsInstanceOfType + + return actualValue; + } + + ///// Returns the value itself if it is not and of the specified value type. + ///// The type that must have. + ///// is . + ///// is an instance of another type (which is not a subclass of ). + //public static TExpected CheckNotNullAndType (string argumentName, object actualValue) + // where TExpected: class + //{ + // if (actualValue == null) + // throw new ArgumentNullException (argumentName); + // return CheckType (argumentName, actualValue); + //} + + /// Returns the value itself if it is not and of the specified value type. + /// The type that must have. + /// The is a . + /// The is an instance of another type. + public static TExpected CheckNotNullAndType ( + [InvokerParameterName] string argumentName, + [AssertionCondition (AssertionConditionType.IS_NOT_NULL)] [NoEnumeration] object actualValue) + // where TExpected: struct + { + if (actualValue == null) + throw new ArgumentNullException (argumentName); + + if (! (actualValue is TExpected)) + throw CreateArgumentTypeException (argumentName, actualValue.GetType(), typeof (TExpected)); + return (TExpected) actualValue; + } + + /// Checks of the is of the . + /// The is a . + /// The is an instance of another type. + [Conditional ("DEBUG")] + [AssertionMethod] + public static void DebugCheckNotNullAndType ( + [InvokerParameterName] string argumentName, + [AssertionCondition (AssertionConditionType.IS_NOT_NULL)] [NoEnumeration] object actualValue, + Type expectedType) + { + CheckNotNullAndType (argumentName, actualValue, expectedType); + } + + public static object CheckType ([InvokerParameterName] string argumentName, [NoEnumeration] object actualValue, Type expectedType) + { + if (actualValue == null) + { + if (NullableTypeUtility.IsNullableType_NoArgumentCheck (expectedType)) + return null; + else + throw CreateArgumentTypeException (argumentName, null, expectedType); + } + + // ReSharper disable UseMethodIsInstanceOfType + if (!expectedType.GetTypeInfo().IsAssignableFrom (actualValue.GetType().GetTypeInfo())) + throw CreateArgumentTypeException (argumentName, actualValue.GetType(), expectedType); + // ReSharper restore UseMethodIsInstanceOfType + + return actualValue; + } + + /// Returns the value itself if it is of the specified type. + /// The type that must have. + /// + /// is an instance of another type (which is not a subtype of ). + /// + /// is null and cannot be null. + /// + /// For non-nullable value types, you should use either or pass the type + /// instead. + /// + public static TExpected CheckType ([InvokerParameterName] string argumentName, [NoEnumeration] object actualValue) + { + if (actualValue == null) + { + try + { + return (TExpected) actualValue; + } + catch (NullReferenceException) + { + throw new ArgumentNullException (argumentName); + } + } + + if (!(actualValue is TExpected)) + throw CreateArgumentTypeException (argumentName, actualValue.GetType(), typeof (TExpected)); + + return (TExpected) actualValue; + } + + + /// Checks whether is not and can be assigned to . + /// The is . + /// The cannot be assigned to . + public static Type CheckNotNullAndTypeIsAssignableFrom ( + [InvokerParameterName] string argumentName, + [AssertionCondition (AssertionConditionType.IS_NOT_NULL)] Type actualType, + [AssertionCondition (AssertionConditionType.IS_NOT_NULL)] Type expectedType) + { + if (actualType == null) + throw new ArgumentNullException (argumentName); + return CheckTypeIsAssignableFrom (argumentName, actualType, expectedType); + } + + /// Checks whether can be assigned to . + /// The cannot be assigned to . + public static Type CheckTypeIsAssignableFrom ( + [InvokerParameterName] string argumentName, + Type actualType, + [AssertionCondition (AssertionConditionType.IS_NOT_NULL)] Type expectedType) + { + CheckNotNull ("expectedType", expectedType); + if (actualType != null) + { + if (!expectedType.GetTypeInfo().IsAssignableFrom (actualType.GetTypeInfo())) + { + string message = string.Format ( + "Parameter '{0}' is a '{2}', which cannot be assigned to type '{1}'.", + argumentName, + expectedType, + actualType); + throw new ArgumentException (message, argumentName); + } + } + + return actualType; + } + + /// Checks whether can be assigned to . + /// The cannot be assigned to . + [Conditional ("DEBUG")] + [AssertionMethod] + public static void DebugCheckTypeIsAssignableFrom ( + [InvokerParameterName] string argumentName, + Type actualType, + [AssertionCondition (AssertionConditionType.IS_NOT_NULL)] Type expectedType) + { + CheckTypeIsAssignableFrom (argumentName, actualType, expectedType); + } + + /// Checks whether all items in are of type or a null reference. + /// If at least one element is not of the specified type or a derived type. + public static T CheckItemsType ([InvokerParameterName] string argumentName, T collection, Type itemType) + where T: ICollection + { + // ReSharper disable CompareNonConstrainedGenericWithNull + if (collection != null) + // ReSharper restore CompareNonConstrainedGenericWithNull + { + int index = 0; + foreach (object item in collection) + { + // ReSharper disable UseMethodIsInstanceOfType + if (item != null && !itemType.GetTypeInfo().IsAssignableFrom (item.GetType().GetTypeInfo())) + throw CreateArgumentItemTypeException (argumentName, index, itemType, item.GetType()); + // ReSharper restore UseMethodIsInstanceOfType + + ++index; + } + } + + return collection; + } + + /// Checks whether all items in are of type and not null references. + /// If at least one element is not of the specified type or a derived type. + /// If at least one element is a null reference. + public static T CheckItemsNotNullAndType ([InvokerParameterName] string argumentName, T collection, Type itemType) + where T: ICollection + { + // ReSharper disable CompareNonConstrainedGenericWithNull + if (collection != null) + // ReSharper restore CompareNonConstrainedGenericWithNull + { + int index = 0; + foreach (object item in collection) + { + if (item == null) + throw CreateArgumentItemNullException (argumentName, index); + // ReSharper disable UseMethodIsInstanceOfType + if (!itemType.GetTypeInfo().IsAssignableFrom (item.GetType().GetTypeInfo())) + throw CreateArgumentItemTypeException (argumentName, index, itemType, item.GetType()); + // ReSharper restore UseMethodIsInstanceOfType + + ++index; + } + } + + return collection; + } + + public static ArgumentException CreateArgumentEmptyException ([InvokerParameterName] string argumentName) + { + return new ArgumentException (string.Format("Parameter '{0}' cannot be empty.", argumentName), argumentName); + } + + public static ArgumentException CreateArgumentTypeException ([InvokerParameterName] string argumentName, Type actualType, Type expectedType) + { + string actualTypeName = actualType != null ? actualType.ToString() : ""; + if (expectedType == null) + { + return new ArgumentException (string.Format ("Parameter '{0}' has unexpected type '{1}'.", argumentName, actualTypeName), argumentName); + } + else + { + return new ArgumentException ( + string.Format ("Parameter '{0}' has type '{2}' when type '{1}' was expected.", argumentName, expectedType, actualTypeName), + argumentName); + } + } + + public static ArgumentException CreateArgumentItemTypeException ( + [InvokerParameterName] string argumentName, + int index, + Type expectedType, + Type actualType) + { + return new ArgumentException ( + string.Format ( + "Item {0} of parameter '{1}' has the type '{2}' instead of '{3}'.", + index, + argumentName, + actualType, + expectedType), + argumentName); + } + + public static ArgumentNullException CreateArgumentItemNullException ([InvokerParameterName] string argumentName, int index) + { + return new ArgumentNullException (argumentName, string.Format ("Item {0} of parameter '{1}' is null.", index, argumentName)); + } + } +} \ No newline at end of file diff --git a/packages/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0/SharedSource Apache-2.0.licenseheader b/packages/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0/SharedSource Apache-2.0.licenseheader new file mode 100644 index 00000000..905c4d0b --- /dev/null +++ b/packages/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.ArgumentUtility.Sources.1.15.23.0/SharedSource Apache-2.0.licenseheader @@ -0,0 +1,52 @@ +extensions: designer.cs +extensions: .cs +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +extensions: .xml + +extensions: .vb +' Copyright (c) rubicon IT GmbH, www.rubicon.eu +' +' See the NOTICE file distributed with this work for additional information +' regarding copyright ownership. rubicon licenses this file to you under +' the Apache License, Version 2.0 (the "License"); you may not use this +' file except in compliance with the License. You may obtain a copy of the +' License at +' +' http://www.apache.org/licenses/LICENSE-2.0 +' +' Unless required by applicable law or agreed to in writing, software +' distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +' WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +' License for the specific language governing permissions and limitations +' under the License. +' \ No newline at end of file diff --git a/packages/Remotion.Utilities.Assertion.Sources.1.15.23.0/Remotion.Utilities.Assertion.Sources.1.15.23.0.nupkg b/packages/Remotion.Utilities.Assertion.Sources.1.15.23.0/Remotion.Utilities.Assertion.Sources.1.15.23.0.nupkg new file mode 100644 index 00000000..3f7eea04 Binary files /dev/null and b/packages/Remotion.Utilities.Assertion.Sources.1.15.23.0/Remotion.Utilities.Assertion.Sources.1.15.23.0.nupkg differ diff --git a/packages/Remotion.Utilities.Assertion.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.Assertion.Sources.1.15.23.0/Assertion.cs b/packages/Remotion.Utilities.Assertion.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.Assertion.Sources.1.15.23.0/Assertion.cs new file mode 100644 index 00000000..f56a39a8 --- /dev/null +++ b/packages/Remotion.Utilities.Assertion.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.Assertion.Sources.1.15.23.0/Assertion.cs @@ -0,0 +1,175 @@ +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +using System; +using System.Diagnostics; +using JetBrains.Annotations; + +// ReSharper disable once CheckNamespace +namespace Remotion.Utilities +{ + /// + /// Provides methods that throw an if an assertion fails. + /// + /// + /// + /// This class contains methods that are conditional to the DEBUG and TRACE attributes ( and ). + /// + /// Note that assertion expressions passed to these methods are not evaluated (read: executed) if the respective symbol are not defined during + /// compilation, nor are the methods called. This increases performance for production builds, but make sure that your assertion expressions do + /// not cause any side effects! See or and the for more information + /// about conditional compilation. + /// + /// Assertions are no replacement for checking input parameters of public methods (see ). + /// + /// + static partial class Assertion + { + private const string c_msgIsTrue = "Assertion failed: Expression evaluates to true."; + private const string c_msgIsFalse = "Assertion failed: Expression evaluates to false."; + private const string c_msgIsNull = "Assertion failed: Expression evaluates to a null reference."; + private const string c_msgIsNotNull = "Assertion failed: Expression does not evaluate to a null reference."; + private static readonly object[] s_emptyArguments = new object[0]; + + [Conditional ("DEBUG")] + [AssertionMethod] + public static void DebugAssert ([AssertionCondition (AssertionConditionType.IS_TRUE)] bool assertion, string message) + { + IsTrue (assertion, message); + } + + [Conditional ("DEBUG")] + [AssertionMethod] + [StringFormatMethod("message")] + public static void DebugAssert ([AssertionCondition (AssertionConditionType.IS_TRUE)] bool assertion, string message, params object[] arguments) + { + IsTrue (assertion, message, arguments); + } + + [Conditional ("DEBUG")] + [AssertionMethod] + public static void DebugAssert ([AssertionCondition (AssertionConditionType.IS_TRUE)] bool assertion) + { + IsTrue (assertion); + } + + [Conditional ("TRACE")] + [AssertionMethod] + public static void TraceAssert ([AssertionCondition (AssertionConditionType.IS_TRUE)] bool assertion, string message) + { + IsTrue (assertion, message); + } + + [Conditional ("TRACE")] + [AssertionMethod] + [StringFormatMethod ("message")] + public static void TraceAssert ([AssertionCondition (AssertionConditionType.IS_TRUE)] bool assertion, string message, params object[] arguments) + { + IsTrue (assertion, message, arguments); + } + + [Conditional ("TRACE")] + [AssertionMethod] + public static void TraceAssert ([AssertionCondition (AssertionConditionType.IS_TRUE)] bool assertion) + { + IsTrue (assertion); + } + + [AssertionMethod] + public static void IsTrue ([AssertionCondition (AssertionConditionType.IS_TRUE)] bool assertion, string message) + { + IsTrue (assertion, message, s_emptyArguments); + } + + [AssertionMethod] + [StringFormatMethod("message")] + public static void IsTrue ([AssertionCondition (AssertionConditionType.IS_TRUE)] bool assertion, string message, params object[] arguments) + { + if (!assertion) + throw new InvalidOperationException (string.Format (message, arguments)); + } + + [AssertionMethod] + public static void IsTrue ([AssertionCondition (AssertionConditionType.IS_TRUE)] bool assertion) + { + IsTrue (assertion, c_msgIsFalse); + } + + [AssertionMethod] + public static void IsFalse ([AssertionCondition (AssertionConditionType.IS_FALSE)] bool expression, string message) + { + IsFalse (expression, message, s_emptyArguments); + } + + [AssertionMethod] + public static void IsFalse ([AssertionCondition (AssertionConditionType.IS_FALSE)] bool expression) + { + IsFalse (expression, c_msgIsTrue); + } + + [AssertionMethod] + [StringFormatMethod ("message")] + public static void IsFalse ([AssertionCondition (AssertionConditionType.IS_FALSE)] bool expression, string message, params object[] arguments) + { + if (expression) + throw new InvalidOperationException (string.Format (message, arguments)); + } + + [AssertionMethod] + public static T IsNotNull ([AssertionCondition (AssertionConditionType.IS_NOT_NULL)] T obj, string message) + { + return IsNotNull (obj, message, s_emptyArguments); + } + + [AssertionMethod] + public static T IsNotNull ([AssertionCondition (AssertionConditionType.IS_NOT_NULL)] T obj) + { + return IsNotNull (obj, c_msgIsNull); + } + + [AssertionMethod] + [StringFormatMethod ("message")] + public static T IsNotNull ([AssertionCondition (AssertionConditionType.IS_NOT_NULL)] T obj, string message, params object[] arguments) + { + // ReSharper disable CompareNonConstrainedGenericWithNull + if (obj == null) + // ReSharper restore CompareNonConstrainedGenericWithNull + throw new InvalidOperationException (string.Format (message, arguments)); + + return obj; + } + + [AssertionMethod] + public static void IsNull ([AssertionCondition (AssertionConditionType.IS_NULL)] object obj, string message) + { + IsNull (obj, message, s_emptyArguments); + } + + [AssertionMethod] + public static void IsNull ([AssertionCondition (AssertionConditionType.IS_NULL)] object obj) + { + IsNull (obj, c_msgIsNotNull); + } + + [AssertionMethod] + [StringFormatMethod("message")] + public static void IsNull ([AssertionCondition (AssertionConditionType.IS_NULL)] object obj, string message, params object[] arguments) + { + if (obj != null) + throw new InvalidOperationException (string.Format (message, arguments)); + } + } +} diff --git a/packages/Remotion.Utilities.Assertion.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.Assertion.Sources.1.15.23.0/SharedSource Apache-2.0.licenseheader b/packages/Remotion.Utilities.Assertion.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.Assertion.Sources.1.15.23.0/SharedSource Apache-2.0.licenseheader new file mode 100644 index 00000000..98e5ae2c Binary files /dev/null and b/packages/Remotion.Utilities.Assertion.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.Assertion.Sources.1.15.23.0/SharedSource Apache-2.0.licenseheader differ diff --git a/packages/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0.nupkg b/packages/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0.nupkg new file mode 100644 index 00000000..e36a4a71 Binary files /dev/null and b/packages/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0.nupkg differ diff --git a/packages/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0/NullableTypeUtility.cs b/packages/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0/NullableTypeUtility.cs new file mode 100644 index 00000000..516c047e --- /dev/null +++ b/packages/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0/NullableTypeUtility.cs @@ -0,0 +1,67 @@ +// Copyright (c) rubicon IT GmbH, www.rubicon.eu +// +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. rubicon licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may not use this +// file except in compliance with the License. You may obtain a copy of the +// License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +using System; +using System.Reflection; + +// ReSharper disable once CheckNamespace +namespace Remotion.Utilities +{ + static partial class NullableTypeUtility + { + /// + /// Determines whether a type is nullable, ie. whether variables of it can be assigned . + /// + /// The type to check. + /// + /// true if is nullable; otherwise, false. + /// + /// + /// A type is nullable if it is a reference type or a nullable value type. This method returns false only for non-nullable value types. + /// + public static bool IsNullableType (Type type) + { + if (type == null) + throw new ArgumentNullException ("type"); + + return IsNullableType_NoArgumentCheck (type); + } + + internal static bool IsNullableType_NoArgumentCheck (Type expectedType) + { + return !expectedType.GetTypeInfo().IsValueType || Nullable.GetUnderlyingType (expectedType) != null; + } + + public static Type GetNullableType (Type type) + { + if (type == null) + throw new ArgumentNullException ("type"); + + if (IsNullableType (type)) + return type; + else + return typeof (Nullable<>).MakeGenericType (type); + } + + public static Type GetBasicType (Type type) + { + if (type == null) + throw new ArgumentNullException ("type"); + + return Nullable.GetUnderlyingType (type) ?? type; + } + } +} diff --git a/packages/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0/SharedSource Apache-2.0.licenseheader b/packages/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0/SharedSource Apache-2.0.licenseheader new file mode 100644 index 00000000..98e5ae2c Binary files /dev/null and b/packages/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0/content/App_Packages/Remotion.Utilities.NullableTypeUtility.Sources.1.15.23.0/SharedSource Apache-2.0.licenseheader differ diff --git a/packages/modernhttpclient.2.4.2/lib/ModernHttpClient-2.4.1.zip b/packages/modernhttpclient.2.4.2/lib/ModernHttpClient-2.4.1.zip new file mode 100644 index 00000000..ed863e15 Binary files /dev/null and b/packages/modernhttpclient.2.4.2/lib/ModernHttpClient-2.4.1.zip differ diff --git a/packages/modernhttpclient.2.4.2/lib/MonoAndroid/ModernHttpClient.dll b/packages/modernhttpclient.2.4.2/lib/MonoAndroid/ModernHttpClient.dll new file mode 100644 index 00000000..f0dbb25c Binary files /dev/null and b/packages/modernhttpclient.2.4.2/lib/MonoAndroid/ModernHttpClient.dll differ diff --git a/packages/modernhttpclient.2.4.2/lib/MonoAndroid/ModernHttpClient.dll.mdb b/packages/modernhttpclient.2.4.2/lib/MonoAndroid/ModernHttpClient.dll.mdb new file mode 100644 index 00000000..0775e31a Binary files /dev/null and b/packages/modernhttpclient.2.4.2/lib/MonoAndroid/ModernHttpClient.dll.mdb differ diff --git a/packages/modernhttpclient.2.4.2/lib/MonoAndroid/OkHttp.dll b/packages/modernhttpclient.2.4.2/lib/MonoAndroid/OkHttp.dll new file mode 100644 index 00000000..caf00baa Binary files /dev/null and b/packages/modernhttpclient.2.4.2/lib/MonoAndroid/OkHttp.dll differ diff --git a/packages/modernhttpclient.2.4.2/lib/MonoTouch/ModernHttpClient.dll b/packages/modernhttpclient.2.4.2/lib/MonoTouch/ModernHttpClient.dll new file mode 100644 index 00000000..5e4ad120 Binary files /dev/null and b/packages/modernhttpclient.2.4.2/lib/MonoTouch/ModernHttpClient.dll differ diff --git a/packages/modernhttpclient.2.4.2/lib/MonoTouch/ModernHttpClient.dll.mdb b/packages/modernhttpclient.2.4.2/lib/MonoTouch/ModernHttpClient.dll.mdb new file mode 100644 index 00000000..032b8873 Binary files /dev/null and b/packages/modernhttpclient.2.4.2/lib/MonoTouch/ModernHttpClient.dll.mdb differ diff --git a/packages/modernhttpclient.2.4.2/lib/Portable-Net45+WinRT45+WP8+WPA81/ModernHttpClient.dll b/packages/modernhttpclient.2.4.2/lib/Portable-Net45+WinRT45+WP8+WPA81/ModernHttpClient.dll new file mode 100644 index 00000000..e6d3bcbd Binary files /dev/null and b/packages/modernhttpclient.2.4.2/lib/Portable-Net45+WinRT45+WP8+WPA81/ModernHttpClient.dll differ diff --git a/packages/modernhttpclient.2.4.2/lib/Portable-Net45+WinRT45+WP8+WPA81/ModernHttpClient.dll.mdb b/packages/modernhttpclient.2.4.2/lib/Portable-Net45+WinRT45+WP8+WPA81/ModernHttpClient.dll.mdb new file mode 100644 index 00000000..bfe9b312 Binary files /dev/null and b/packages/modernhttpclient.2.4.2/lib/Portable-Net45+WinRT45+WP8+WPA81/ModernHttpClient.dll.mdb differ diff --git a/packages/modernhttpclient.2.4.2/lib/Xamarin.iOS10/ModernHttpClient.dll b/packages/modernhttpclient.2.4.2/lib/Xamarin.iOS10/ModernHttpClient.dll new file mode 100644 index 00000000..14d65e41 Binary files /dev/null and b/packages/modernhttpclient.2.4.2/lib/Xamarin.iOS10/ModernHttpClient.dll differ diff --git a/packages/modernhttpclient.2.4.2/lib/Xamarin.iOS10/ModernHttpClient.dll.mdb b/packages/modernhttpclient.2.4.2/lib/Xamarin.iOS10/ModernHttpClient.dll.mdb new file mode 100644 index 00000000..306edb39 Binary files /dev/null and b/packages/modernhttpclient.2.4.2/lib/Xamarin.iOS10/ModernHttpClient.dll.mdb differ diff --git a/packages/modernhttpclient.2.4.2/lib/modernhttpclient.2.4.1.nupkg b/packages/modernhttpclient.2.4.2/lib/modernhttpclient.2.4.1.nupkg new file mode 100644 index 00000000..51412bde Binary files /dev/null and b/packages/modernhttpclient.2.4.2/lib/modernhttpclient.2.4.1.nupkg differ diff --git a/packages/modernhttpclient.2.4.2/modernhttpclient.2.4.2.nupkg b/packages/modernhttpclient.2.4.2/modernhttpclient.2.4.2.nupkg new file mode 100644 index 00000000..d444fdf1 Binary files /dev/null and b/packages/modernhttpclient.2.4.2/modernhttpclient.2.4.2.nupkg differ diff --git a/packages/repositories.config b/packages/repositories.config index 5b6507b8..b23b9124 100644 --- a/packages/repositories.config +++ b/packages/repositories.config @@ -3,11 +3,11 @@ + - \ No newline at end of file