Exemple #1
0
 /// <summary>
 ///  Get the Root item for the tree (default implimentation uses first entity type)
 /// </summary>
 /// <param name="treeItem"></param>
 /// <returns></returns>
 protected virtual SyncLocalItem GetRootItem(SyncTreeItem treeItem)
 => new SyncLocalItem(Constants.System.RootString)
 {
     EntityType = EntityType,
     Name       = EntityType,
     Udi        = Udi.Create(EntityType)
 };
Exemple #2
0
        public virtual SyncLocalItem GetEntity(SyncTreeItem treeItem)
        {
            if (treeItem.IsRoot())
            {
                return(GetRootItem(treeItem));
            }

            var attempt = treeItem.Id.TryConvertTo <TIndexType>();

            if (attempt.Success)
            {
                return(GetLocalEntity(attempt.Result));
            }

            return(null);
        }
Exemple #3
0
 /// <summary>
 ///  Is this the root item for the entity
 /// </summary>
 /// <remarks>
 ///  this method assums the item is following Umbraco conventions for root (i.e "-1")
 /// </remarks>
 public static bool IsRoot(this SyncTreeItem item)
 => item.Id == Constants.System.RootString;
Exemple #4
0
        } = true;                                            ///  show in the tree.


        public virtual SyncTreeType GetTreeType(SyncTreeItem treeItem) => SyncTreeType.Settings;