Exemple #1
0
        public ListItem Add(ListItem parent, string name, Asset asset)
        {
            ListItem listItem  = (parent == null) ? this.root : parent;
            ListItem listItem2 = new ListItem();

            listItem2.Name  = name;
            listItem2.Asset = asset;
            listItem.Add(listItem2);
            ListItem twinAsset = this.GetTwinAsset(listItem2);

            if (twinAsset != null && listItem2.Asset != null && twinAsset.Asset.state == (listItem2.Asset.state & ~Asset.States.MetaFile))
            {
                listItem2.Hidden = true;
            }
            ListItem result;

            if (listItem2.Asset == null)
            {
                result = listItem2;
            }
            else
            {
                if (listItem2.Asset.path.Length > 0)
                {
                    this.pathSearch[listItem2.Asset.path.ToLower()] = listItem2;
                }
                result = listItem2;
            }
            return(result);
        }
Exemple #2
0
        public ListItem Add(ListItem parent, string name, Asset asset)
        {
            ListItem insert = (parent != null) ? parent : root;
            ListItem item   = new ListItem();

            item.Name = name;
            // Can this be null
            item.Asset = asset;
            insert.Add(item);

            // Meta files that are next to their asset file are collapsed into
            // the asset file when rendered but only if they are the same state.
            ListItem twinAsset = GetTwinAsset(item);

            if (twinAsset != null && item.Asset != null &&
                twinAsset.Asset.state == (item.Asset.state & ~Asset.States.MetaFile))
            {
                item.Hidden = true;
            }

            if (item.Asset == null)
            {
                return(item);
            }

            // Create a lookup table
            if (item.Asset.path.Length > 0)
            {
                pathSearch[item.Asset.path.ToLower()] = item;
            }
            return(item);
        }
Exemple #3
0
        public ListItem Add(ListItem parent, string name, ChangeSet change)
        {
            ListItem listItem  = (parent == null) ? this.root : parent;
            ListItem listItem2 = new ListItem();

            listItem2.Name   = name;
            listItem2.Change = (change ?? new ChangeSet(name));
            listItem.Add(listItem2);
            this.pathSearch["_chkeyprfx_" + change.id.ToString()] = listItem2;
            return(listItem2);
        }
Exemple #4
0
        public ListItem Add(ListItem parent, string name, ChangeSet change)
        {
            ListItem insert = (parent != null) ? parent : root;
            ListItem item   = new ListItem();

            item.Name   = name;
            item.Change = change ?? new ChangeSet(name);
            insert.Add(item);

            // Create a lookup table
            pathSearch[c_changeKeyPrefix + change.id] = item;

            return(item);
        }
Exemple #5
0
        public ListItem Add(ListItem parent, string name, ChangeSet change)
        {
            ListItem item     = (parent == null) ? this.root : parent;
            ListItem listItem = new ListItem {
                Name = name
            };

            if (change == null)
            {
            }
            listItem.Change = new ChangeSet(name);
            item.Add(listItem);
            this.pathSearch["_chkeyprfx_" + change.id.ToString()] = listItem;
            return(listItem);
        }
Exemple #6
0
        public ListItem Add(ListItem parent, string name, Asset asset)
        {
            ListItem listItem  = (parent == null) ? this.root : parent;
            ListItem listItem2 = new ListItem();

            listItem2.Name  = name;
            listItem2.Asset = asset;
            listItem.Add(listItem2);
            if (listItem2.Asset == null)
            {
                return(listItem2);
            }
            if (listItem2.Asset.path.Length > 0)
            {
                this.pathSearch[listItem2.Asset.path.ToLower()] = listItem2;
            }
            return(listItem2);
        }
Exemple #7
0
        public ListItem Add(ListItem parent, string name, Asset asset)
        {
            ListItem item     = (parent == null) ? this.root : parent;
            ListItem listItem = new ListItem {
                Name  = name,
                Asset = asset
            };

            item.Add(listItem);
            ListItem twinAsset = this.GetTwinAsset(listItem);

            if (((twinAsset != null) && (listItem.Asset != null)) && (twinAsset.Asset.state == (listItem.Asset.state & ~Asset.States.MetaFile)))
            {
                listItem.Hidden = true;
            }
            if ((listItem.Asset != null) && (listItem.Asset.path.Length > 0))
            {
                this.pathSearch[listItem.Asset.path.ToLower()] = listItem;
            }
            return(listItem);
        }
        public ListItem Add(ListItem parent, string name, Asset asset)
        {
            ListItem listItem1 = parent == null ? this.root : parent;
            ListItem listItem2 = new ListItem();

            listItem2.Name  = name;
            listItem2.Asset = asset;
            listItem1.Add(listItem2);
            ListItem twinAsset = this.GetTwinAsset(listItem2);

            if (twinAsset != null && listItem2.Asset != null && twinAsset.Asset.state == (listItem2.Asset.state & ~Asset.States.MetaFile))
            {
                listItem2.Hidden = true;
            }
            if (listItem2.Asset == null || listItem2.Asset.path.Length <= 0)
            {
                return(listItem2);
            }
            this.pathSearch[listItem2.Asset.path.ToLower()] = listItem2;
            return(listItem2);
        }