コード例 #1
0
 public void RemoveImport(ImportedContext import)
 {
     imports.Remove(import);
     foreach (var schema in import.Schemas)
     {
         Schemas.Remove(schema);
     }
 }
コード例 #2
0
ファイル: AstRootNode.Designer.cs プロジェクト: mosamy/vulcan
        public bool RemoveRootNode(IFrameworkItem frameworkItem)
        {
            var localItemPrincipals = frameworkItem as VulcanEngine.IR.Ast.Table.AstPrincipalNode;

            if (localItemPrincipals != null)
            {
                return(Principals.Remove(localItemPrincipals));
            }
            var localItemSchemas = frameworkItem as VulcanEngine.IR.Ast.Table.AstSchemaNode;

            if (localItemSchemas != null)
            {
                return(Schemas.Remove(localItemSchemas));
            }
            var localItemTemplates = frameworkItem as VulcanEngine.IR.Ast.AstTemplateNode;

            if (localItemTemplates != null)
            {
                return(Templates.Remove(localItemTemplates));
            }
            var localItemPersistentVariables = frameworkItem as VulcanEngine.IR.Ast.PersistentVariables.AstPersistentVariableNode;

            if (localItemPersistentVariables != null)
            {
                return(PersistentVariables.Remove(localItemPersistentVariables));
            }
            var localItemPackages = frameworkItem as VulcanEngine.IR.Ast.Task.AstPackageBaseNode;

            if (localItemPackages != null)
            {
                return(Packages.Remove(localItemPackages));
            }
            var localItemConnections = frameworkItem as VulcanEngine.IR.Ast.Connection.AstConnectionNode;

            if (localItemConnections != null)
            {
                return(Connections.Remove(localItemConnections));
            }
            var localItemDimensions = frameworkItem as VulcanEngine.IR.Ast.Dimension.AstDimensionNode;

            if (localItemDimensions != null)
            {
                return(Dimensions.Remove(localItemDimensions));
            }
            var localItemFacts = frameworkItem as VulcanEngine.IR.Ast.Fact.AstFactNode;

            if (localItemFacts != null)
            {
                return(Facts.Remove(localItemFacts));
            }
            var localItemTables = frameworkItem as VulcanEngine.IR.Ast.Table.AstTableBaseNode;

            if (localItemTables != null)
            {
                return(Tables.Remove(localItemTables));
            }
            return(false);
        }
コード例 #3
0
        public void UpdateSchemas()
        {
            var currSchemaGuid = powerWraper.GetActiveGuid();
            var newSchemas     = powerWraper.GetCurrentSchemas();

            //Add and update new / changed schemas
            foreach (var newSchema in newSchemas)
            {
                var originalSchema = Schemas.FirstOrDefault(sch => sch.Guid == newSchema.Guid);
                if (originalSchema == null)
                {
                    InsertNewSchema(newSchemas, newSchema); originalSchema = newSchema;
                }

                if (newSchema.Guid == currSchemaGuid && originalSchema?.IsActive != true)
                {
                    SetNewCurrSchema(originalSchema);
                }

                if (originalSchema?.Name != newSchema.Name)
                {
                    ((PowerSchema)originalSchema).Name = newSchema.Name;
                }
            }

            if (!Schemas.Any(sch => currSchemaGuid == sch.Guid))
            {
                NoSchemaIsActive();
            }

            //remove old schemas
            var schemasToBeRemoved = new List <IPowerSchema>();

            foreach (var oldSchema in Schemas)
            {
                if (newSchemas.FirstOrDefault(sch => sch.Guid == oldSchema.Guid) == null)
                {
                    schemasToBeRemoved.Add(oldSchema);
                }
            }
            schemasToBeRemoved.ForEach(sch => Schemas.Remove(sch));
        }
コード例 #4
0
        public void UpdateSchemas()
        {
            var currSchemaGuid = powerWraper.GetActiveGuid();
            var newSchemas     = powerWraper.GetCurrentSchemas();

            //Add and update new / changed schemas
            foreach (var newSchema in newSchemas)
            {
                var originalSchema = Schemas.FirstOrDefault(sch => sch.Guid == newSchema.Guid);
                if (originalSchema == null)
                {
                    insertNewSchema(newSchemas, newSchema);
                }

                if (newSchema.Guid == currSchemaGuid)
                {
                    handleCurrentSchema(newSchema, originalSchema);
                }

                if (newSchema.Guid != currSchemaGuid && originalSchema?.IsActive == true)
                {
                    updateSchema(originalSchema, false);
                }

                if (originalSchema != null && originalSchema.Name != newSchema.Name)
                {
                    ((PowerSchema)originalSchema).Name = newSchema.Name;
                }
            }

            //remove old schemas
            foreach (var oldSchema in Schemas)
            {
                if (newSchemas.FirstOrDefault(sch => sch.Guid == oldSchema.Guid) == null)
                {
                    Schemas.Remove(oldSchema);
                }
            }
        }
コード例 #5
0
 /// <summary>
 /// Excludes a document <paramref name="schema"/> from the execution request.
 /// </summary>
 /// <remarks>For more details about schemas, check
 /// <a href="https://doc.nuxeo.com/display/NXDOC60/How+to+Override+Existing+Document+Types">Nuxeo Documentation Center</a>.
 /// </remarks>
 /// <param name="schema">The schema name.</param>
 /// <returns>The current <see cref="Operation"/> instance.</returns>
 public Operation ClearSchema(string schema)
 {
     Schemas?.Remove(schema);
     return(this);
 }
コード例 #6
0
 public void On(SchemaDeleted @event, EnvelopeHeaders headers)
 {
     Schemas = Schemas.Remove(@event.SchemaId.Id);
 }
コード例 #7
0
 /// <summary>
 /// Removes a document schema, which will no longer be sent in the next request.
 /// </summary>
 /// <remarks>For more details about schemas, check
 /// <a href="https://doc.nuxeo.com/display/NXDOC60/How+to+Override+Existing+Document+Types">Nuxeo Documentation Center</a>.
 /// </remarks>
 /// <param name="schema">The schema's name</param>
 /// <returns>The current <see cref="Document"/> instance.</returns>
 public Document RemoveSchema(string schema)
 {
     Schemas.Remove(schema);
     return(this);
 }