Example #1
0
        private void CollectionActionSyncToStaticSource(VulcanCollectionPropertyChangedEventArgs e)
        {
            foreach (AstTableStaticSourceNode staticSource in Sources)
            {
                if (e.Action == NotifyCollectionChangedAction.Remove ||
                    e.Action == NotifyCollectionChangedAction.Replace ||
                    e.Action == NotifyCollectionChangedAction.Reset)
                {
                    for (int i = 0; i < e.OldItems.Count; i++)
                    {
                        foreach (var row in staticSource.Rows)
                        {
                            // Column will be null since the table column will have been undefined in its StaticSourceColumnValueNode object.
                            // Thus, search for the StaticSourceColumnValueNode whose Column is null.
                            AstStaticSourceColumnValueNode columnValueNode = row.ColumnValues.FirstOrDefault(columnValue => columnValue.Column == null);
                            row.ColumnValues.Remove(columnValueNode);
                        }
                    }
                }

                if (e.Action == NotifyCollectionChangedAction.Add || e.Action == NotifyCollectionChangedAction.Replace)
                {
                    foreach (AstTableColumnBaseNode newItem in e.NewItems)
                    {
                        foreach (var row in staticSource.Rows)
                        {
                            row.ColumnValues.Add(new AstStaticSourceColumnValueNode(row)
                            {
                                Column = newItem, Value = newItem.DefaultValue
                            });
                        }
                    }
                }
            }
        }
Example #2
0
 private void AstTableIndexNode_CollectionPropertyChanged(object sender, VulcanCollectionPropertyChangedEventArgs e)
 {
     if (e.PropertyName == "Columns" || e.PropertyName == "Leafs")
     {
         VulcanCompositeCollectionChanged(_items, e);
     }
 }
Example #3
0
 private void AstMulticastNode_CollectionPropertyChanged(object sender, VulcanCollectionPropertyChangedEventArgs e)
 {
     if (e.PropertyName == "OutputPaths")
     {
         for (int outputIndex = 0; outputIndex < OutputPaths.Count; outputIndex++)
         {
             OutputPaths[outputIndex].SsisName = String.Format(CultureInfo.InvariantCulture, "Multicast Output {0}", outputIndex + 1);
         }
     }
 }
Example #4
0
        private void AstTableNode_CollectionPropertyChanged(object sender, VulcanCollectionPropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Sources" || e.PropertyName == "Lookups")
            {
                VulcanCompositeCollectionChanged(_dataItems, e);
            }

            if (e.PropertyName == "Columns" && SideEffectManager.SideEffectMode == AstSideEffectMode.ConsistencySideEffects)
            {
                CollectionActionSyncToStaticSource(e);
            }
        }
Example #5
0
 private void AstRootNode_CollectionPropertyChanged(object sender, VulcanCollectionPropertyChangedEventArgs e)
 {
     if (e.PropertyName == "Connections" ||
         e.PropertyName == "Tables" ||
         e.PropertyName == "Dimensions" ||
         e.PropertyName == "Facts" ||
         e.PropertyName == "Packages" ||
         e.PropertyName == "Schemas" ||
         e.PropertyName == "Principals")
     {
         VulcanCompositeCollectionChanged(Items, e);
     }
 }
        protected void VulcanOnCollectionPropertyChanged(string propertyName, NotifyCollectionChangedEventArgs e)
        {
            VulcanCollectionPropertyChangedEventArgs collectionArgs = null;

            if (e.Action == NotifyCollectionChangedAction.Add)
            {
                collectionArgs = new VulcanCollectionPropertyChangedEventArgs(propertyName, e.Action, e.NewItems, e.NewStartingIndex);
            }
            else if (e.Action == NotifyCollectionChangedAction.Remove)
            {
                collectionArgs = new VulcanCollectionPropertyChangedEventArgs(propertyName, e.Action, e.OldItems);
            }
            else if (e.Action == NotifyCollectionChangedAction.Reset)
            {
                collectionArgs = new VulcanCollectionPropertyChangedEventArgs(propertyName, e.Action);
            }
            else if (e.Action == NotifyCollectionChangedAction.Move)
            {
                collectionArgs = new VulcanCollectionPropertyChangedEventArgs(propertyName, e.Action, e.OldItems, e.NewStartingIndex, e.OldStartingIndex);
            }
            else if (e.Action == NotifyCollectionChangedAction.Replace)
            {
                collectionArgs = new VulcanCollectionPropertyChangedEventArgs(propertyName, e.Action, e.NewItems, e.OldItems, e.NewStartingIndex);
            }

            if (CollectionPropertyChanged != null)
            {
                CollectionPropertyChanged(this, collectionArgs);
            }

            if (AnyCollectionPropertyChanged != null)
            {
                AnyCollectionPropertyChanged(this, collectionArgs);
            }

            if (PropertyChanged != null)
            {
                PropertyChanged(this, new VulcanPropertyChangedEventArgs(propertyName, e.OldItems, e.NewItems));
            }

            if (AnyAllPropertyChanged != null)
            {
                AnyAllPropertyChanged(this, new VulcanPropertyChangedEventArgs(propertyName, e.OldItems, e.NewItems));
            }
        }
Example #7
0
 private void AstAttributeNode_CollectionPropertyChanged(object sender, VulcanCollectionPropertyChangedEventArgs e)
 {
     VulcanCompositeCollectionChanged(_columns, e);
 }