Exemplo n.º 1
0
        public void Instantiate(SymbolTable symbolTable, UnboundReferences unboundReferences)
        {
            var parentContainer = ParentItem as AstContainerTaskBaseNode;
            var taskTemplate = Template as AstTaskTemplateNode;
            var clonedMapping = new Dictionary<IFrameworkItem, IFrameworkItem>();
            if (taskTemplate != null && parentContainer != null)
            {
                var clonedTasks = new List<AstTaskNode>();
                foreach (var task in taskTemplate.Tasks)
                {
                    clonedTasks.Add((AstTaskNode)task.Clone(parentContainer, clonedMapping));
                }

                parentContainer.Tasks.Replace(this, clonedTasks);
            }

            foreach (var bindingItem in taskTemplate.UnboundReferences)
            {
                var clonedBindingItem = new BindingItem(
                    bindingItem.BoundProperty,
                    bindingItem.XObject,
                    bindingItem.XValue,
                    clonedMapping[bindingItem.ParentItem],
                    bindingItem.BimlFile,
                    this);
                unboundReferences.Add(clonedBindingItem);
            }
        }
Exemplo n.º 2
0
        public void Instantiate(SymbolTable symbolTable, UnboundReferences unboundReferences)
        {
            var rootNode = ParentItem as AstRootNode;
            var tableTemplate = Template as AstTableTemplateNode;
            var clonedMapping = new Dictionary<IFrameworkItem, IFrameworkItem>();
            if (tableTemplate != null && rootNode != null)
            {
                var clonedTable = (AstTableNode)tableTemplate.Table.Clone(rootNode, clonedMapping);
                clonedTable.Emit = this.Emit;

                // TODO: Some of the ViewModel stuff might not fully support Replace - so simulating with Remove and Insert
                int index = rootNode.Tables.IndexOf(this);
                rootNode.Tables.Remove(this);
                rootNode.Tables.Insert(index, clonedTable);
            }

            foreach (var bindingItem in tableTemplate.UnboundReferences)
            {
                var clonedBindingItem = new BindingItem(
                    bindingItem.BoundProperty,
                    bindingItem.XObject,
                    bindingItem.XValue,
                    clonedMapping[bindingItem.ParentItem],
                    bindingItem.BimlFile,
                    this);
                unboundReferences.Add(clonedBindingItem);
            }
        }
Exemplo n.º 3
0
        public void Instantiate(SymbolTable symbolTable, UnboundReferences unboundReferences)
        {
            var rootNode        = ParentItem as AstRootNode;
            var packageTemplate = Template as AstPackageTemplateNode;
            var clonedMapping   = new Dictionary <IFrameworkItem, IFrameworkItem>();

            if (packageTemplate != null && rootNode != null)
            {
                var clonedPackage = (AstPackageNode)packageTemplate.Package.Clone(rootNode, clonedMapping);
                clonedPackage.Emit = this.Emit;

                // TODO: Some of the ViewModel stuff might not fully support Replace - so simulating with Remove and Insert
                int index = rootNode.Packages.IndexOf(this);
                rootNode.Packages.Remove(this);
                rootNode.Packages.Insert(index, clonedPackage);
            }

            foreach (var bindingItem in packageTemplate.UnboundReferences)
            {
                var clonedBindingItem = new BindingItem(
                    bindingItem.BoundProperty,
                    bindingItem.XObject,
                    bindingItem.XValue,
                    clonedMapping[bindingItem.ParentItem],
                    bindingItem.BimlFile,
                    this);
                unboundReferences.Add(clonedBindingItem);
            }
        }
        public void Instantiate(SymbolTable symbolTable, UnboundReferences unboundReferences)
        {
            var parentEtl = ParentItem as AstEtlRootNode;
            var transformationTemplate = Template as AstTransformationTemplateNode;
            var clonedMapping = new Dictionary<IFrameworkItem, IFrameworkItem>();
            if (transformationTemplate != null && parentEtl != null)
            {
                var clonedTransformations = new List<AstTransformationNode>();
                foreach (var transformation in transformationTemplate.Transformations)
                {
                    clonedTransformations.Add((AstTransformationNode)transformation.Clone(parentEtl, clonedMapping));
                }

                parentEtl.Transformations.Replace(this, clonedTransformations);
            }

            foreach (var bindingItem in transformationTemplate.UnboundReferences)
            {
                var clonedBindingItem = new BindingItem(
                    bindingItem.BoundProperty,
                    bindingItem.XObject,
                    bindingItem.XValue,
                    clonedMapping[bindingItem.ParentItem],
                    bindingItem.BimlFile,
                    this);
                unboundReferences.Add(clonedBindingItem);
            }
        }
Exemplo n.º 5
0
        public void Instantiate(SymbolTable symbolTable, UnboundReferences unboundReferences)
        {
            var parentContainer = ParentItem as AstContainerTaskBaseNode;
            var taskTemplate    = Template as AstTaskTemplateNode;
            var clonedMapping   = new Dictionary <IFrameworkItem, IFrameworkItem>();

            if (taskTemplate != null && parentContainer != null)
            {
                var clonedTasks = new List <AstTaskNode>();
                foreach (var task in taskTemplate.Tasks)
                {
                    clonedTasks.Add((AstTaskNode)task.Clone(parentContainer, clonedMapping));
                }

                parentContainer.Tasks.Replace(this, clonedTasks);
            }

            foreach (var bindingItem in taskTemplate.UnboundReferences)
            {
                var clonedBindingItem = new BindingItem(
                    bindingItem.BoundProperty,
                    bindingItem.XObject,
                    bindingItem.XValue,
                    clonedMapping[bindingItem.ParentItem],
                    bindingItem.BimlFile,
                    this);
                unboundReferences.Add(clonedBindingItem);
            }
        }
        public void Instantiate(SymbolTable symbolTable, UnboundReferences unboundReferences)
        {
            var parentEtl = ParentItem as AstEtlRootNode;
            var transformationTemplate = Template as AstTransformationTemplateNode;
            var clonedMapping          = new Dictionary <IFrameworkItem, IFrameworkItem>();

            if (transformationTemplate != null && parentEtl != null)
            {
                var clonedTransformations = new List <AstTransformationNode>();
                foreach (var transformation in transformationTemplate.Transformations)
                {
                    clonedTransformations.Add((AstTransformationNode)transformation.Clone(parentEtl, clonedMapping));
                }

                parentEtl.Transformations.Replace(this, clonedTransformations);
            }

            foreach (var bindingItem in transformationTemplate.UnboundReferences)
            {
                var clonedBindingItem = new BindingItem(
                    bindingItem.BoundProperty,
                    bindingItem.XObject,
                    bindingItem.XValue,
                    clonedMapping[bindingItem.ParentItem],
                    bindingItem.BimlFile,
                    this);
                unboundReferences.Add(clonedBindingItem);
            }
        }