Author: antonello Date: 2007-03-24 11:50:57 -0500 (Sat, 24 Mar 2007) New Revision: 74939
Added: trunk/olive/class/System.Data.Linq/Assembly/ trunk/olive/class/System.Data.Linq/Assembly/AssemblyInfo.cs trunk/olive/class/System.Data.Linq/Assembly/ChangeLog trunk/olive/class/System.Data.Linq/ChangeLog trunk/olive/class/System.Data.Linq/System.Data.Linq.Provider/ trunk/olive/class/System.Data.Linq/System.Data.Linq.Provider/MetaModel.cs trunk/olive/class/System.Data.Linq/System.Data.Linq/ trunk/olive/class/System.Data.Linq/System.Data.Linq/AssociationAttribute.cs trunk/olive/class/System.Data.Linq/System.Data.Linq/AttributeMappingSource .cs trunk/olive/class/System.Data.Linq/System.Data.Linq/AutoSync.cs trunk/olive/class/System.Data.Linq/System.Data.Linq/Binary.cs trunk/olive/class/System.Data.Linq/System.Data.Linq/ColumnAttribute.cs trunk/olive/class/System.Data.Linq/System.Data.Linq/ConflictMode.cs trunk/olive/class/System.Data.Linq/System.Data.Linq/DataAttribute.cs trunk/olive/class/System.Data.Linq/System.Data.Linq/DatabaseAttribute.cs trunk/olive/class/System.Data.Linq/System.Data.Linq/DuplicateKeyException.cs trunk/olive/class/System.Data.Linq/System.Data.Linq/Link_T.cs trunk/olive/class/System.Data.Linq/System.Data.Linq/MappingSource.cs trunk/olive/class/System.Data.Linq/System.Data.Linq/RefreshMode.cs trunk/olive/class/System.Data.Linq/System.Data.Linq/UpdateCheck.cs Modified: trunk/olive/class/System.Data.Linq/ Log: Initial commit of System.Data.Linq on Olive Property changes on: trunk/olive/class/System.Data.Linq ___________________________________________________________________ Name: svn:ignore + System.Data.Linq.suo System.Data.Linq.csproj System.Data.Linq.sln Added: trunk/olive/class/System.Data.Linq/Assembly/AssemblyInfo.cs =================================================================== --- trunk/olive/class/System.Data.Linq/Assembly/AssemblyInfo.cs 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/Assembly/AssemblyInfo.cs 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,54 @@ +// +// AssemblyInfo.cs +// +// Authors: +// Antonello Provenzano <[EMAIL PROTECTED]> +// +// Copyright (C) 2007 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.Reflection; +using System.Security; +using System.Security.Permissions; +using System.Resources; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("System.Data.Linq.dll")] +[assembly: AssemblyDescription("System.Data.Linq.dll")] +[assembly: AssemblyCompany("Mono Development Team")] +[assembly: AssemblyProduct("System.Query")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyCulture("")] +[assembly: AssemblyFileVersion ("2.0.0.0")] +[assembly: NeutralResourcesLanguage ("en-US")] + +[assembly: CLSCompliant(true)] +[assembly: ComVisible (false)] + +[assembly: AssemblyVersion(Consts.FxVersion)] +[assembly: SatelliteContractVersion (Consts.FxVersion)] + +[assembly: AssemblyDelaySign (true)] +[assembly: AssemblyKeyFile ("../mono.pub")] +[assembly: SecurityPermission (SecurityAction.RequestMinimum, SkipVerification=true)] +[assembly: AllowPartiallyTrustedCallers] Added: trunk/olive/class/System.Data.Linq/Assembly/ChangeLog =================================================================== --- trunk/olive/class/System.Data.Linq/Assembly/ChangeLog 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/Assembly/ChangeLog 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,3 @@ +2007-03-23 Antonello Provenzano <[EMAIL PROTECTED]> + + * ChangeLog: Added Added: trunk/olive/class/System.Data.Linq/ChangeLog =================================================================== --- trunk/olive/class/System.Data.Linq/ChangeLog 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/ChangeLog 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,27 @@ +2007-02-04 Marek Safar <[EMAIL PROTECTED]> + + * System.Core.dll.sources: Added common constants. + + * Makefile: An assembly is 2.0 only. + +2007-02-03 Atsushi Enomoto <[EMAIL PROTECTED]> + + * System.Core.dll.sources : added LambdaExpression.cs. + +2006-11-01 Alejandro Serrano "Serras" <[EMAIL PROTECTED]> + + * Add IOrderedSequence, IQueryable + * Change Sequence.Join and Sequence.GroupJoin to use Lookup<K, T> + as stated on the Standard Query Operators paper + +2006-06-05 Alejandro Serrano "Serras" <[EMAIL PROTECTED]> + + * Updates as of LINQ May 2006 release + +2006-01-31 Alejandro Serrano "Serras" <[EMAIL PROTECTED]> + + * Fix bug in SkipWhile<T>, where the first element was never yielded + +2006-01-30 Alejandro Serrano "Serras" <[EMAIL PROTECTED]> + + * Initial commit Added: trunk/olive/class/System.Data.Linq/System.Data.Linq/AssociationAttribute.cs =================================================================== --- trunk/olive/class/System.Data.Linq/System.Data.Linq/AssociationAttribute.cs 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/System.Data.Linq/AssociationAttribute.cs 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,54 @@ +using System; + +namespace System.Data.Linq +{ + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] + public sealed class AssociationAttribute : DataAttribute + { + #region .ctor + public AssociationAttribute() + { + } + #endregion + + #region Fields + private string deleteRule; + private bool fkey; + private bool unique; + private string otherKey; + private string thisKey; + #endregion + + #region Properties + public string DeleteRule + { + get { return deleteRule; } + set { deleteRule = value; } + } + + public bool IsForeignKey + { + get { return fkey; } + set { fkey = value; } + } + + public bool IsUnique + { + get { return this.unique; } + set { unique = value; } + } + + public string OtherKey + { + get { return this.otherKey; } + set { otherKey = value; } + } + + public string ThisKey + { + get { return thisKey; } + set { thisKey = value; } + } + #endregion + } +} Added: trunk/olive/class/System.Data.Linq/System.Data.Linq/AttributeMappingSource .cs =================================================================== --- trunk/olive/class/System.Data.Linq/System.Data.Linq/AttributeMappingSource .cs 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/System.Data.Linq/AttributeMappingSource .cs 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,13 @@ +using System.Data.Linq.Provider; + +namespace System.Data.Linq +{ + public sealed class AttributeMappingSource : MappingSource + { + protected internal override MetaModel CreateModel(Type contextType) + { + //TODO: + return null; + } + } +} \ No newline at end of file Added: trunk/olive/class/System.Data.Linq/System.Data.Linq/AutoSync.cs =================================================================== --- trunk/olive/class/System.Data.Linq/System.Data.Linq/AutoSync.cs 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/System.Data.Linq/AutoSync.cs 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,10 @@ +namespace System.Data.Linq +{ + public enum AutoSync + { + Never, + OnInsert, + OnUpdate, + Always + } +} \ No newline at end of file Added: trunk/olive/class/System.Data.Linq/System.Data.Linq/Binary.cs =================================================================== --- trunk/olive/class/System.Data.Linq/System.Data.Linq/Binary.cs 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/System.Data.Linq/Binary.cs 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,119 @@ +using System.IO; + +namespace System.Data.Linq +{ + public sealed class Binary : IEquatable<Binary> + { + #region .ctor + public Binary(byte[] bytes, int offset, int length) + { + } + + public Binary(byte[] bytes, bool copy) + { + if (bytes == null) + throw ArgumentNullException("bytes"); + + if (copy) + { + this.bytes = new byte[bytes.Length]; + Array.Copy(bytes, this.bytes, bytes.Length); + } + else + { + this.bytes = bytes; + } + } + #endregion + + #region Fields + private byte[] bytes; + + private static Binary emptyBin; + #endregion + + #region Properties + public int Length + { + get { return bytes.Length; } + } + + public byte this[int index] + { + get { return bytes[index]; } + } + + public static Binary Empty + { + get + { + if (emptyBin == null) + emptyBin = new Binary(new byte[0], 0, 0); + return emptyBin; + } + } + #endregion + + #region Operators + public static bool operator ==(Binary binary1, Binary binary2) + { + if (binary1 == null && binary2 == null) + return true; + if (binary1 == null && binary2 != null) + return false; + return binary1.Equals(binary2); + } + + public static bool operator !=(Binary binary1, Binary binary2) + { + return !(binary1 == binary2); + } + + public static implicit operator Binary(byte[] bytes) + { + return new Binary(bytes); + } + #endregion + + #region Public Methods + + public bool Equals(Binary other) + { + return Equals(other); + } + + public override bool Equals(object obj) + { + //TODO: + return base.Equals(obj); + } + + public override int GetHashCode() + { + //TODO: + return base.GetHashCode(); + } + + public void CopyTo(int position, byte[] buffer, int offset, int length) + { + Array.Copy(this.bytes, position, buffer, offset, length); + } + + public byte[] ToArray() + { + return (byte[])bytes.Clone(); + } + + public Stream ToStream() + { + return new MemoryStream(bytes, false); + } + + public override string ToString() + { + //TODO: + return base.ToString(); + } + #endregion + } +} \ No newline at end of file Added: trunk/olive/class/System.Data.Linq/System.Data.Linq/ColumnAttribute.cs =================================================================== --- trunk/olive/class/System.Data.Linq/System.Data.Linq/ColumnAttribute.cs 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/System.Data.Linq/ColumnAttribute.cs 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,90 @@ +namespace System.Data.Linq +{ + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] + public sealed class ColumnAttribute : DataAttribute + { + #region .ctor + public ColumnAttribute() + { + } + #endregion + + #region Fields + private AutoSync autoSync = ~AutoSync.Never; + private bool canBeNull = true; + private bool canBeNullSet; + private UpdateCheck check = UpdateCheck.Always; + private string dbtype; + private string expression; + private bool dbGen; + private bool discrim; + private bool pkey; + private bool version; + #endregion + + #region Properties + public AutoSync AutoSync + { + get { return autoSync; } + set { autoSync = value; } + } + + public bool CanBeNull + { + get { return canBeNull; } + set + { + canBeNullSet = true; + canBeNull = value; + } + } + + internal bool CanBeNullSet + { + get { return canBeNullSet; } + } + + public string DBType + { + get { return dbtype; } + set { dbtype = value; } + } + + public string Expression + { + get { return expression; } + set { expression = value; } + } + + public bool IsDBGenerated + { + get { return dbGen; } + set { dbGen = value; } + } + + public bool IsDiscriminator + { + get { return discrim; } + set { discrim = value; } + } + + public bool IsPrimaryKey + { + get { return pkey; } + set { pkey = value; } + } + + public bool IsVersion + { + get { return version; } + set { version = value; } + } + + public UpdateCheck UpdateCheck + { + get { return check; } + set { check = value; } + } + #endregion + } +} \ No newline at end of file Added: trunk/olive/class/System.Data.Linq/System.Data.Linq/ConflictMode.cs =================================================================== --- trunk/olive/class/System.Data.Linq/System.Data.Linq/ConflictMode.cs 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/System.Data.Linq/ConflictMode.cs 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,8 @@ +namespace System.Data.Linq +{ + public enum ConflictMode + { + FailOnFirstConflict, + ContinueOnConflict + } +} \ No newline at end of file Added: trunk/olive/class/System.Data.Linq/System.Data.Linq/DataAttribute.cs =================================================================== --- trunk/olive/class/System.Data.Linq/System.Data.Linq/DataAttribute.cs 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/System.Data.Linq/DataAttribute.cs 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,30 @@ +namespace System.Data.Linq +{ + public abstract class DataAttribute : Attribute + { + #region .ctor + protected DataAttribute() + { + } + #endregion + + #region Fields + private string name; + private string storage; + #endregion + + #region Properties + public string Name + { + get { return name; } + set { name = value; } + } + + public string Storage + { + get { return storage; } + set { storage = value; } + } + #endregion + } +} \ No newline at end of file Added: trunk/olive/class/System.Data.Linq/System.Data.Linq/DatabaseAttribute.cs =================================================================== --- trunk/olive/class/System.Data.Linq/System.Data.Linq/DatabaseAttribute.cs 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/System.Data.Linq/DatabaseAttribute.cs 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,24 @@ +namespace System.Data.Linq +{ + [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] + public sealed class DatabaseAttribute : Attribute + { + #region .ctor + public DatabaseAttribute() + { + } + #endregion + + #region Fields + private string name; + #endregion + + #region Properties + public string Name + { + get { return name; } + set { name = value; } + } + #endregion + } +} \ No newline at end of file Added: trunk/olive/class/System.Data.Linq/System.Data.Linq/DuplicateKeyException.cs =================================================================== --- trunk/olive/class/System.Data.Linq/System.Data.Linq/DuplicateKeyException.cs 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/System.Data.Linq/DuplicateKeyException.cs 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,21 @@ +namespace System.Data.Linq +{ + public class DuplicateKeyException : InvalidOperationException + { + #region .ctor + public DuplicateKeyException() + { + } + + public DuplicateKeyException(string message) + : base(message) + { + } + + public DuplicateKeyException(string message, Exception innerException) + : base(message, innerException) + { + } + #endregion + } +} \ No newline at end of file Added: trunk/olive/class/System.Data.Linq/System.Data.Linq/Link_T.cs =================================================================== --- trunk/olive/class/System.Data.Linq/System.Data.Linq/Link_T.cs 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/System.Data.Linq/Link_T.cs 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,72 @@ +using System.Collections.Generic; + +namespace System.Data.Linq +{ + public struct Link<T> + { + #region .ctor + public Link(T value) + { + this.value = value; + source = null; + } + + internal Link(IEnumerable<T> source) + { + this.source = source; + this.value = default(T); + } + + internal Link(Link<T> link) + { + value = link.value; + source = link.source; + } + #endregion + + #region Fields + private T value; + private IEnumerable<T> source; + #endregion + + #region Properties + //TODO: + public bool HasValue + { + get { return true; } + } + + public T Value + { + get { return value; } + set { this.value = value; } + } + + internal bool HasLoadedValue + { + get { return false; } + } + + internal bool HasAssignedValue + { + get { return false; } + } + + internal T UnderlyingValue + { + get { return value; } + } + + internal IEnumerable<T> Source + { + get { return source; } + } + + //TODO: + internal bool HasSource + { + get { return false; } + } + #endregion + } +} \ No newline at end of file Added: trunk/olive/class/System.Data.Linq/System.Data.Linq/MappingSource.cs =================================================================== --- trunk/olive/class/System.Data.Linq/System.Data.Linq/MappingSource.cs 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/System.Data.Linq/MappingSource.cs 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,17 @@ +using System.Data.Linq.Provider; + +namespace System.Data.Linq +{ + public abstract class MappingSource + { + #region .ctor + protected MappingSource() + { + } + #endregion + + #region Protected Methods + protected internal abstract MetaModel CreateModel(Type contextType); + #endregion + } +} Added: trunk/olive/class/System.Data.Linq/System.Data.Linq/RefreshMode.cs =================================================================== --- trunk/olive/class/System.Data.Linq/System.Data.Linq/RefreshMode.cs 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/System.Data.Linq/RefreshMode.cs 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,9 @@ +namespace System.Data.Linq +{ + public enum RefreshMode + { + KeepCurrentValues, + KeepChanges, + OverwriteCurrentValues + } +} \ No newline at end of file Added: trunk/olive/class/System.Data.Linq/System.Data.Linq/UpdateCheck.cs =================================================================== --- trunk/olive/class/System.Data.Linq/System.Data.Linq/UpdateCheck.cs 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/System.Data.Linq/UpdateCheck.cs 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,9 @@ +namespace System.Data.Linq +{ + public enum UpdateCheck + { + Always, + Never, + WhenChanged + } +} \ No newline at end of file Added: trunk/olive/class/System.Data.Linq/System.Data.Linq.Provider/MetaModel.cs =================================================================== --- trunk/olive/class/System.Data.Linq/System.Data.Linq.Provider/MetaModel.cs 2007-03-24 16:32:41 UTC (rev 74938) +++ trunk/olive/class/System.Data.Linq/System.Data.Linq.Provider/MetaModel.cs 2007-03-24 16:50:57 UTC (rev 74939) @@ -0,0 +1,33 @@ +using System.Collections.Generic; +using System.Reflection; + +namespace System.Data.Linq.Provider +{ + public abstract class MetaModel + { + #region .ctor + protected MetaModel() + { + } + #endregion + + #region Properties + public abstract string DatabaseName { get; } + + public abstract Type ProviderType { get; } + #endregion + + + #region Public Methods + public abstract MetaFunction GetFunction(MethodInfo method); + + public abstract IEnumerable<MetaFunction> GetFunctions(); + + public abstract MetaTable GetTable(Type rowType); + + public abstract IEnumerable<MetaTable> GetTables(); + + public abstract MetaType GetUnmappedType(Type type); + #endregion + } +} \ No newline at end of file _______________________________________________ Mono-patches maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-patches
