Пример #1
0
        ///--------------------------------------------------------------------------------
        /// <summary>This method gets the collection context associated with this node.</summary>
        ///
        /// <param name="solutionContext">The associated solution.</param>
        /// <param name="templateContext">The associated template.</param>
        /// <param name="modelContext">The associated model context.</param>
        ///--------------------------------------------------------------------------------
        public IEnterpriseEnumerable GetCollection(Solution solutionContext, ITemplate templateContext, IDomainEnterpriseObject modelContext)
        {
            IDomainEnterpriseObject nodeContext = modelContext;

            if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentAuditProperty))
            {
                return(AuditProperty.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentCollection))
            {
                return(Collection.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentEntity))
            {
                return(Entity.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentEntityReference))
            {
                return(EntityReference.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentEnumeration))
            {
                return(Enumeration.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentFeature))
            {
                return(Feature.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentIndex))
            {
                return(Index.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentIndexProperty))
            {
                return(IndexProperty.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentMethod))
            {
                return(Method.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentMethodRelationship))
            {
                return(MethodRelationship.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentModel))
            {
                return(Model.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentModelObject))
            {
                return(ModelObject.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentModelProperty))
            {
                return(ModelProperty.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentObjectInstance))
            {
                return(ObjectInstance.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentParameter))
            {
                return(Parameter.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentProject))
            {
                return(Project.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentProperty))
            {
                return(Property.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentPropertyInstance))
            {
                return(PropertyInstance.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentPropertyReference))
            {
                return(PropertyReference.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentPropertyRelationship))
            {
                return(PropertyRelationship.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentRelationship))
            {
                return(Relationship.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentRelationshipProperty))
            {
                return(RelationshipProperty.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStage))
            {
                return(Stage.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStageTransition))
            {
                return(StageTransition.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentState))
            {
                return(State.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStateModel))
            {
                return(StateModel.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStateTransition))
            {
                return(StateTransition.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStep))
            {
                return(Step.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStepTransition))
            {
                return(StepTransition.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentValue))
            {
                return(Value.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentView))
            {
                return(View.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentViewProperty))
            {
                return(ViewProperty.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentWorkflow))
            {
                return(Workflow.GetCollectionContext(solutionContext, nodeContext));
            }
            #region protected
            #endregion protected
            else if (solutionContext.ModelObjectNames.AllKeys.Contains(CurrentItemName.Substring(7)) == true)
            {
                return(ObjectInstance.GetCollectionContext(solutionContext, CurrentItemName.Substring(7), nodeContext));
            }
            return(null);
        }
Пример #2
0
        ///--------------------------------------------------------------------------------
        /// <summary>This method gets the collection context associated with this node.</summary>
        ///
        /// <param name="solutionContext">The associated solution.</param>
        /// <param name="templateContext">The associated template.</param>
        /// <param name="modelContext">The associated model context.</param>
        ///--------------------------------------------------------------------------------
        public IEnterpriseEnumerable GetCollection(Solution solutionContext, ITemplate templateContext, IDomainEnterpriseObject modelContext)
        {
            IDomainEnterpriseObject nodeContext = modelContext;
            bool isValidContext;

            if (ModelContext != null)
            {
                nodeContext = ModelContext.GetModelContext(solutionContext, templateContext, modelContext, out isValidContext);
            }
            if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.AuditProperty))
            {
                return(AuditProperty.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Collection))
            {
                return(Collection.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Entity))
            {
                return(Entity.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.EntityReference))
            {
                return(EntityReference.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Enumeration))
            {
                return(Enumeration.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Feature))
            {
                return(Feature.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Index))
            {
                return(Index.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.IndexProperty))
            {
                return(IndexProperty.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Method))
            {
                return(Method.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.MethodRelationship))
            {
                return(MethodRelationship.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Model))
            {
                return(Model.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.ModelObject))
            {
                return(ModelObject.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.ModelProperty))
            {
                return(ModelProperty.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.ObjectInstance))
            {
                return(ObjectInstance.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Parameter))
            {
                return(Parameter.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Project))
            {
                return(Project.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Property))
            {
                return(Property.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.PropertyInstance))
            {
                return(PropertyInstance.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.PropertyReference))
            {
                return(PropertyReference.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.PropertyRelationship))
            {
                return(PropertyRelationship.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Relationship))
            {
                return(Relationship.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.RelationshipProperty))
            {
                return(RelationshipProperty.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Solution))
            {
                return(Solution.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Stage))
            {
                return(Stage.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.StageTransition))
            {
                return(StageTransition.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.State))
            {
                return(State.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.StateModel))
            {
                return(StateModel.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.StateTransition))
            {
                return(StateTransition.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Step))
            {
                return(Step.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.StepTransition))
            {
                return(StepTransition.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Value))
            {
                return(Value.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.View))
            {
                return(View.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.ViewProperty))
            {
                return(ViewProperty.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Workflow))
            {
                return(Workflow.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlColumn))
            {
                return(SqlColumn.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlDatabase))
            {
                return(SqlDatabase.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlExtendedProperty))
            {
                return(SqlExtendedProperty.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlForeignKey))
            {
                return(SqlForeignKey.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlForeignKeyColumn))
            {
                return(SqlForeignKeyColumn.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlIndex))
            {
                return(SqlIndex.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlIndexedColumn))
            {
                return(SqlIndexedColumn.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlProperty))
            {
                return(SqlProperty.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlTable))
            {
                return(SqlTable.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlView))
            {
                return(SqlView.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlViewProperty))
            {
                return(SqlViewProperty.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.XmlAttribute))
            {
                return(XmlAttribute.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.XmlDocument))
            {
                return(XmlDocument.GetCollectionContext(solutionContext, nodeContext));
            }
            else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.XmlNode))
            {
                return(XmlNode.GetCollectionContext(solutionContext, nodeContext));
            }
            #region protected
            else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Tag))
            {
                return(Tag.GetCollectionContext(solutionContext, modelContext));
            }
            #endregion protected
            else if (solutionContext.ModelObjectNames.AllKeys.Contains(ModelContextName) == true)
            {
                return(ObjectInstance.GetCollectionContext(solutionContext, ModelContextName, nodeContext));
            }
            LogException(solutionContext, templateContext, modelContext, String.Format(DisplayValues.Exception_InvalidModelContext, ModelContextName, modelContext.GetType().Name), InterpreterTypeCode.None);
            return(null);
        }