--- /dev/null
+#region MIT license\r
+// \r
+// MIT license\r
+//\r
+// Copyright (c) 2007-2008 Jiri Moudry, Pascal Craponne\r
+// \r
+// Permission is hereby granted, free of charge, to any person obtaining a copy\r
+// of this software and associated documentation files (the "Software"), to deal\r
+// in the Software without restriction, including without limitation the rights\r
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+// copies of the Software, and to permit persons to whom the Software is\r
+// furnished to do so, subject to the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be included in\r
+// all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+// THE SOFTWARE.\r
+// \r
+#endregion\r
+\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+\r
+#if MONO_STRICT\r
+using System.Data.Linq.Identity;\r
+#else\r
+using DbLinq.Data.Linq.Identity;\r
+#endif\r
+\r
+#if MONO_STRICT\r
+namespace System.Data.Linq.Implementation\r
+#else\r
+namespace DbLinq.Data.Linq.Implementation\r
+#endif\r
+{\r
+ /// <summary>\r
+ /// List of entities, with their corresponding state (to insert, to watch, to delete)\r
+ /// </summary>\r
+ internal class DisabledEntityTracker : IEntityTracker\r
+ {\r
+ private static IEnumerable<EntityTrack> trackedEntities = new EntityTrack[] { };\r
+\r
+ /// <summary>\r
+ /// Finds entity by key (PK)\r
+ /// </summary>\r
+ /// <param name="identityKey"></param>\r
+ /// <returns></returns>\r
+ public EntityTrack FindByIdentity(IdentityKey identityKey)\r
+ {\r
+ return null;\r
+ }\r
+\r
+ /// <summary>\r
+ /// Returns true if the list contains the entity\r
+ /// </summary>\r
+ /// <param name="entity"></param>\r
+ /// <returns></returns>\r
+ public bool ContainsReference(object entity)\r
+ {\r
+ return false;\r
+ }\r
+\r
+ /// <summary>\r
+ /// Registers an entity to be inserted\r
+ /// </summary>\r
+ /// <param name="entity"></param>\r
+ public void RegisterToInsert(object entity)\r
+ {\r
+ }\r
+\r
+ /// <summary>\r
+ /// Registers an entity to be watched\r
+ /// </summary>\r
+ /// <param name="entity"></param>\r
+ /// <param name="identityKey"></param>\r
+ public void RegisterToWatch(object entity, IdentityKey identityKey)\r
+ {\r
+ }\r
+\r
+ /// <summary>\r
+ /// Registers entity to be deleted\r
+ /// </summary>\r
+ /// <param name="entity"></param>\r
+ public void RegisterToDelete(object entity)\r
+ {\r
+ }\r
+\r
+ /// <summary>\r
+ /// Unregisters the entity after deletion\r
+ /// </summary>\r
+ /// <param name="entity"></param>\r
+ public void RegisterDeleted(object entity)\r
+ {\r
+ }\r
+\r
+ /// <summary>\r
+ /// Enumerates all registered entities\r
+ /// </summary>\r
+ /// <returns></returns>\r
+ public IEnumerable<EntityTrack> EnumerateAll()\r
+ {\r
+ return trackedEntities;\r
+ }\r
+ }\r
+}\r
--- /dev/null
+#region MIT license\r
+// \r
+// MIT license\r
+//\r
+// Copyright (c) 2007-2008 Jiri Moudry, Pascal Craponne\r
+// \r
+// Permission is hereby granted, free of charge, to any person obtaining a copy\r
+// of this software and associated documentation files (the "Software"), to deal\r
+// in the Software without restriction, including without limitation the rights\r
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+// copies of the Software, and to permit persons to whom the Software is\r
+// furnished to do so, subject to the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be included in\r
+// all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+// THE SOFTWARE.\r
+// \r
+#endregion\r
+\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+\r
+#if MONO_STRICT\r
+using System.Data.Linq.Identity;\r
+#else\r
+using DbLinq.Data.Linq.Identity;\r
+#endif\r
+\r
+#if MONO_STRICT\r
+namespace System.Data.Linq.Implementation\r
+#else\r
+namespace DbLinq.Data.Linq.Implementation\r
+#endif\r
+{\r
+ /// <summary>\r
+ /// Interface of Entity Trackers\r
+ /// </summary>\r
+ internal interface IEntityTracker\r
+ {\r
+ /// <summary>\r
+ /// Finds entity by key (PK)\r
+ /// </summary>\r
+ /// <param name="identityKey"></param>\r
+ /// <returns></returns>\r
+ EntityTrack FindByIdentity(IdentityKey identityKey);\r
+\r
+ /// <summary>\r
+ /// Returns true if the list contains the entity\r
+ /// </summary>\r
+ /// <param name="entity"></param>\r
+ /// <returns></returns>\r
+ bool ContainsReference(object entity);\r
+\r
+ /// <summary>\r
+ /// Registers an entity to be inserted\r
+ /// </summary>\r
+ /// <param name="entity"></param>\r
+ void RegisterToInsert(object entity);\r
+\r
+ /// <summary>\r
+ /// Registers an entity to be watched\r
+ /// </summary>\r
+ /// <param name="entity"></param>\r
+ /// <param name="identityKey"></param>\r
+ void RegisterToWatch(object entity, IdentityKey identityKey);\r
+\r
+ /// <summary>\r
+ /// Registers entity to be deleted\r
+ /// </summary>\r
+ /// <param name="entity"></param>\r
+ void RegisterToDelete(object entity);\r
+\r
+ /// <summary>\r
+ /// Unregisters the entity after deletion\r
+ /// </summary>\r
+ /// <param name="entity"></param>\r
+ void RegisterDeleted(object entity);\r
+\r
+ /// <summary>\r
+ /// Enumerates all registered entities\r
+ /// </summary>\r
+ /// <returns></returns>\r
+ IEnumerable<EntityTrack> EnumerateAll();\r
+ }\r
+}\r