Esempio n. 1
0
 /// <summary>
 /// If Key is >=0 returns "@Key", otherwise "#GetHashCode()"
 /// </summary>
 public static string GetKeyOrHash(this IStorageItem storageItem)
 {
     if (storageItem.Key >= 0)
     {
         return('@' + storageItem.Key.ToString());
     }
     return('#' + storageItem.GetHashCode().ToString());
 }
Esempio n. 2
0
        internal static void SetKey(IStorageItem demoChild, int key, bool isRollback)
        {
#if DEBUG
            if (isRollback)
            {
                if (key == StorageExtensions.NoKey)
                {
                    DC.Trace?.Invoke($"Release DemoChild key @{demoChild.Key} #{demoChild.GetHashCode()}");
                }
                else
                {
                    DC.Trace?.Invoke($"Store DemoChild key @{key} #{demoChild.GetHashCode()}");
                }
            }
#endif
            ((DemoChild)demoChild).Key = key;
        }
Esempio n. 3
0
        internal static void SetKey(IStorageItem sample, int key, bool isRollback)
        {
#if DEBUG
            if (isRollback)
            {
                if (key == StorageExtensions.NoKey)
                {
                    DC.Trace?.Invoke($"Release Sample key @{sample.Key} #{sample.GetHashCode()}");
                }
                else
                {
                    DC.Trace?.Invoke($"Store Sample key @{key} #{sample.GetHashCode()}");
                }
            }
#endif
            ((Sample)sample).Key = key;
        }
Esempio n. 4
0
        internal static void SetKey(IStorageItem parentOneChild_Parent, int key, bool isRollback)
        {
#if DEBUG
            if (isRollback)
            {
                if (key == StorageExtensions.NoKey)
                {
                    DC.Trace?.Invoke($"Release ParentOneChild_Parent key @{parentOneChild_Parent.Key} #{parentOneChild_Parent.GetHashCode()}");
                }
                else
                {
                    DC.Trace?.Invoke($"Store ParentOneChild_Parent key @{key} #{parentOneChild_Parent.GetHashCode()}");
                }
            }
#endif
            ((ParentOneChild_Parent)parentOneChild_Parent).Key = key;
        }
Esempio n. 5
0
        internal static void SetKey(IStorageItem lookup_ParentNullable, int key, bool isRollback)
        {
#if DEBUG
            if (isRollback)
            {
                if (key == StorageExtensions.NoKey)
                {
                    DC.Trace?.Invoke($"Release Lookup_ParentNullable key @{lookup_ParentNullable.Key} #{lookup_ParentNullable.GetHashCode()}");
                }
                else
                {
                    DC.Trace?.Invoke($"Store Lookup_ParentNullable key @{key} #{lookup_ParentNullable.GetHashCode()}");
                }
            }
#endif
            ((Lookup_ParentNullable)lookup_ParentNullable).Key = key;
        }
        internal static void SetKey(IStorageItem childrenDictionary_Child, int key, bool isRollback)
        {
#if DEBUG
            if (isRollback)
            {
                if (key == StorageExtensions.NoKey)
                {
                    DC.Trace?.Invoke($"Release ChildrenDictionary_Child key @{childrenDictionary_Child.Key} #{childrenDictionary_Child.GetHashCode()}");
                }
                else
                {
                    DC.Trace?.Invoke($"Store ChildrenDictionary_Child key @{key} #{childrenDictionary_Child.GetHashCode()}");
                }
            }
#endif
            ((ChildrenDictionary_Child)childrenDictionary_Child).Key = key;
        }
        internal static void SetKey(IStorageItem privateConstructor, int key, bool isRollback)
        {
#if DEBUG
            if (isRollback)
            {
                if (key == StorageExtensions.NoKey)
                {
                    DC.Trace?.Invoke($"Release PrivateConstructor key @{privateConstructor.Key} #{privateConstructor.GetHashCode()}");
                }
                else
                {
                    DC.Trace?.Invoke($"Store PrivateConstructor key @{key} #{privateConstructor.GetHashCode()}");
                }
            }
#endif
            ((PrivateConstructor)privateConstructor).Key = key;
        }
        internal static void SetKey(IStorageItem createOnly_Parent, int key, bool isRollback)
        {
#if DEBUG
            if (isRollback)
            {
                if (key == StorageExtensions.NoKey)
                {
                    DC.Trace?.Invoke($"Release CreateOnly_Parent key @{createOnly_Parent.Key} #{createOnly_Parent.GetHashCode()}");
                }
                else
                {
                    DC.Trace?.Invoke($"Store CreateOnly_Parent key @{key} #{createOnly_Parent.GetHashCode()}");
                }
            }
#endif
            ((CreateOnly_Parent)createOnly_Parent).Key = key;
        }
        internal static void SetKey(IStorageItem childrenList_CreateOnlyParentReadonly, int key, bool isRollback)
        {
#if DEBUG
            if (isRollback)
            {
                if (key == StorageExtensions.NoKey)
                {
                    DC.Trace?.Invoke($"Release ChildrenList_CreateOnlyParentReadonly key @{childrenList_CreateOnlyParentReadonly.Key} #{childrenList_CreateOnlyParentReadonly.GetHashCode()}");
                }
                else
                {
                    DC.Trace?.Invoke($"Store ChildrenList_CreateOnlyParentReadonly key @{key} #{childrenList_CreateOnlyParentReadonly.GetHashCode()}");
                }
            }
#endif
            ((ChildrenList_CreateOnlyParentReadonly)childrenList_CreateOnlyParentReadonly).Key = key;
        }
        internal static void SetKey(IStorageItem notMatchingChildrenListName_Child, int key, bool isRollback)
        {
#if DEBUG
            if (isRollback)
            {
                if (key == StorageExtensions.NoKey)
                {
                    DC.Trace?.Invoke($"Release NotMatchingChildrenListName_Child key @{notMatchingChildrenListName_Child.Key} #{notMatchingChildrenListName_Child.GetHashCode()}");
                }
                else
                {
                    DC.Trace?.Invoke($"Store NotMatchingChildrenListName_Child key @{key} #{notMatchingChildrenListName_Child.GetHashCode()}");
                }
            }
#endif
            ((NotMatchingChildrenListName_Child)notMatchingChildrenListName_Child).Key = key;
        }
        internal static void SetKey(IStorageItem childrenSortedList_ParentNullable, int key, bool isRollback)
        {
#if DEBUG
            if (isRollback)
            {
                if (key == StorageExtensions.NoKey)
                {
                    DC.Trace?.Invoke($"Release ChildrenSortedList_ParentNullable key @{childrenSortedList_ParentNullable.Key} #{childrenSortedList_ParentNullable.GetHashCode()}");
                }
                else
                {
                    DC.Trace?.Invoke($"Store ChildrenSortedList_ParentNullable key @{key} #{childrenSortedList_ParentNullable.GetHashCode()}");
                }
            }
#endif
            ((ChildrenSortedList_ParentNullable)childrenSortedList_ParentNullable).Key = key;
        }
Esempio n. 12
0
        internal static void SetKey(IStorageItem propertyNeedsDictionaryClass, int key, bool isRollback)
        {
#if DEBUG
            if (isRollback)
            {
                if (key == StorageExtensions.NoKey)
                {
                    DC.Trace?.Invoke($"Release PropertyNeedsDictionaryClass key @{propertyNeedsDictionaryClass.Key} #{propertyNeedsDictionaryClass.GetHashCode()}");
                }
                else
                {
                    DC.Trace?.Invoke($"Store PropertyNeedsDictionaryClass key @{key} #{propertyNeedsDictionaryClass.GetHashCode()}");
                }
            }
#endif
            ((PropertyNeedsDictionaryClass)propertyNeedsDictionaryClass).Key = key;
        }