コード例 #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)
 };
コード例 #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);
        }
コード例 #3
0
ファイル: SyncTreeItem.cs プロジェクト: KevinJump/uSync
 /// <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;
コード例 #4
0
        } = true;                                            ///  show in the tree.


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