Пример #1
0
 private List <InstanceDefinitionItem> GetInstanceDefinitionContents(InstanceDefinition definition)
 {
     return(definition
            .GetPartDefinitions()
            .Select(def => new InstanceDefinitionItem(def))
            .ToList());
 }
Пример #2
0
        /// <summary>
        /// Standard constructed for a nested block instance.
        /// This will recursively search the given rhinodoc and build
        /// a nested list of nested blocks...
        /// </summary>
        /// <param name="def"></param>
        public NestedBlock(InstanceDefinition def, NestedBlock parent = null, ChildBlockInsertionParameters relativeInsertion = null)
        {
            // store head (original definition)
            Definition        = def;
            Parent            = parent;
            RelativeInsertion = relativeInsertion != null ? relativeInsertion : RelativeInsertion =
                ChildBlockInsertionParameters.Identity;

            var partDefinitions = def.GetPartDefinitions();
            var partXforms      = def.GetPartRelativeXforms();

            foreach (var element in partDefinitions.Zip(partXforms, (definition, xform) => new { definition, xform }))
            {
                // recursion (•_•) ( •_•)>⌐■-■ (⌐■_■)
                Add(new NestedBlock(element.definition, this, element.xform));
            }
        }
Пример #3
0
 /// <summary>
 /// Gets all top level nested Instance definitions for the given instance definition
 /// </summary>
 /// <param name="definition"></param>
 /// <returns></returns>
 public IEnumerable <InstanceDefinition> GetNestedDefinitions(InstanceDefinition definition)
 {
     return(definition.GetPartDefinitions());
 }