/// <summary> /// Copies all the elements to another HashArray. /// </summary> /// <param name="sink">The HashArray to fill.</param> public void CopyTo(HashArray <T> sink) { foreach (T item in array) { sink.Add(item); } }
/// <summary> /// Initializes a new instance of the <see cref="Database"/> class. /// </summary> public Database() { Constraints = new HashArray <Constraint>(); FulltextCatalogs = new HashArray <FulltextCatalog>(); FulltextIndexes = new HashArray <FulltextIndex>(); Functions = new HashArray <Function>(); Permissions = new PermissionSet(); Procedures = new HashArray <Procedure>(); Tables = new HashArray <Table>(); Triggers = new HashArray <Trigger>(); TriggerOrder = new HashArray <TriggerOrder>(); Views = new HashArray <View>(); }
/// <summary> /// Gets the differences between this collection of items and another. /// </summary> /// <param name="other">The set of items to compare against.</param> /// <param name="dependencies">The dependencies for this collection.</param> /// <param name="otherDependencies">The dependencies for the other collection.</param> /// <param name="differences">The set of differences to fill.</param> public void GetDifferences(HashArray <T> other, DependencyCollection dependencies, DependencyCollection otherDependencies, DifferenceSet differences) { foreach (Item item in this) { Item otherItem = other == null ? null : other[item.Name]; Difference difference = item.GetDifferences(otherItem, true); if (difference != null) { differences.Add(difference, dependencies, otherDependencies); } } if (RunOptions.Current.FullyScripted && other != null) { foreach (Item otherItem in other) { if (this[otherItem.Name] == null) { differences.Add(new Difference(DifferenceType.Removed, otherItem.Name), otherDependencies); } } } }
/// <summary> /// Initializes a new instance of the <see cref="Table"/> class. /// </summary> /// <param name="name">The table name.</param> public Table(string name) : base(name) { Columns = new HashArray <Column>(); Data = new TableData(((Name)name).Unescaped + "___Data"); Indexes = new HashArray <Index>(); }
/// <summary> /// Initializes a new instance of the <see cref="View"/> class. /// </summary> /// <param name="name">The view name.</param> /// <param name="body">The view definition.</param> public View(string name, string body) : base(name, body) { Indexes = new HashArray <Index>(); }