/// <summary> /// Sets the document schemas to be used in 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="schemas">A collection of strings containing the schema names.</param> /// <returns>The current <see cref="Operation"/> instance.</returns> public Operation SetSchemas(ICollection <string> schemas) { Schemas?.Clear(); Schemas = Schemas ?? new List <string>(); foreach (string schema in schemas) { Schemas.Add(schema); } return(this); }
/// <summary> /// Sets a list document schemas to 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="schemas">A list of document schema names.</param> /// <returns>The current <see cref="Document"/> instance.</returns> public Document SetSchemas(string[] schemas) { Schemas?.Clear(); Schemas = Schemas ?? new List <string>(); foreach (string schema in schemas) { Schemas.Add(schema); } return(this); }
public void AssignPhaseData(DatabaseObjectInfo source, DatabaseAnalysePhase phase) { var src = (DatabaseInfo)source; if ((phase & DatabaseAnalysePhase.Tables) != 0) { Tables.Clear(); foreach (var obj in src.Tables) { Tables.Add(obj.CloneTable(this)); } } if ((phase & DatabaseAnalysePhase.Views) != 0) { Views.Clear(); foreach (var obj in src.Views) { Views.Add(obj.CloneView(this)); } } if ((phase & DatabaseAnalysePhase.Functions) != 0) { StoredProcedures.Clear(); Functions.Clear(); Triggers.Clear(); foreach (var obj in src.StoredProcedures) { StoredProcedures.Add(obj.CloneStoredProcedure(this)); } foreach (var obj in src.Functions) { Functions.Add(obj.CloneFunction(this)); } foreach (var obj in src.Triggers) { Triggers.Add(obj.CloneTrigger(this)); } } if ((phase & DatabaseAnalysePhase.Settings) != 0) { Schemas.Clear(); foreach (var obj in src.Schemas) { Schemas.Add(obj.CloneSchema(this)); } DefaultSchema = src.DefaultSchema; } }
private void ReadSchema() { try { //Create connection string if (SelectedDbProvider != null) { if (SelectedDbProvider.Type == DbProvider.SQLSERVER) { if (TrustedConnection) { ConnectionString = string.Format("Data Source={0};Initial Catalog={1};Trusted_Connection=True;", Host, Database); } else { ConnectionString = string.Format("Server={0};Database={1};User Id={2};Password={3}", Host, Database, User, Password); } } if (SelectedDbProvider.Type == DbProvider.POSTGRESQL) { ConnectionString = string.Format("Host={0};Database={1};User Id={2};Password={3}; Minimum Pool Size=0; Command Timeout=0;", Host, Database, User, Password); } if (!IsConnectionStringValid()) { return; } if (Schemas != null) { Schemas.Clear(); } Task tsk = new Task(async() => { await GetSchema(); }); tsk.Start(); } } catch (Exception ex) { IsLoadingSchema = false; IsSchemaLoaded = false; IsCommandEnabled = true; //Logging.Logger.append(ex.Message, Logging.Logger.ERROR); MessageBox.Show(ex.Message); } }
/// <summary> /// Clear all document schemas from the execution request. /// </summary> /// <returns>The current <see cref="Operation"/> instance.</returns> public Operation ClearSchemas() { Schemas?.Clear(); return(this); }