コード例 #1
0
        internal ImmutableModelList <ImmutableObject> MGetMembers(ObjectId oid)
        {
            GreenList result = GreenList.EmptyUnique;

            foreach (var prop in this.MProperties(oid))
            {
                if (prop.CanResolve)
                {
                    if (prop.IsCollection)
                    {
                        var items = this.GetGreenValue(oid, prop) as GreenList;
                        if (items != null)
                        {
                            result = result.AddRange(items);
                        }
                    }
                    else
                    {
                        var item = this.GetGreenValue(oid, prop);
                        result = result.Add(item);
                    }
                }
            }
            return(ImmutableModelList <ImmutableObject> .FromGreenList(result, this, oid));
        }
コード例 #2
0
        private GreenList CollectBases(ObjectId oid)
        {
            GreenList result = GreenList.EmptyUnique;

            foreach (var prop in this.MProperties(oid))
            {
                if (prop.IsBaseScope)
                {
                    if (prop.IsCollection)
                    {
                        var items = this.GetGreenValue(oid, prop) as GreenList;
                        if (items != null)
                        {
                            result = result.AddRange(items);
                        }
                    }
                    else
                    {
                        var item = this.GetGreenValue(oid, prop);
                        result = result.Add(item);
                    }
                }
            }
            return(result);
        }
コード例 #3
0
        private void CollectAllBases(ObjectId oid, ref GreenList result)
        {
            if (oid == null)
            {
                return;
            }

            var oldResult = result;

            result = result.Add(oid);
            if (result == oldResult)
            {
                return;
            }

            var bases = this.CollectBases(oid);

            foreach (var item in bases)
            {
                this.CollectAllBases(item as ObjectId, ref result);
            }
        }