Exemplo n.º 1
0
            public RowDependencySetup CreateDependencySetup()
            {
                var setup = new RowDependencySetup(Schema);

                setup.DependentColumns.AddRange <Column, Column>(DependentColumns);

                setup.NestedDependencies.AddRange(ParentRows.Select(kvp =>
                                                                    new ParentRowDependency(kvp.Value.CreateDependencySetup(), kvp.Key)
                                                                    ));

                setup.NestedDependencies.AddRange(ChildRows.Select(kvp =>
                                                                   new ChildRowDependency(kvp.Value.CreateDependencySetup(), kvp.Key)
                                                                   ));

                return(setup);
            }
Exemplo n.º 2
0
        ///<summary>Creates a new RowDependency.</summary>
        protected RowDependency(RowDependencySetup setup)
        {
            if (setup == null)
            {
                throw new ArgumentNullException("setup");
            }

            DependentColumns   = new ReadOnlyCollection <Column>(setup.DependentColumns.ToArray());
            NestedDependencies = new ReadOnlyCollection <Dependency>(setup.NestedDependencies.ToArray());

            RequiresDataContext = NestedDependencies.Any(d => d.RequiresDataContext);

            foreach (var d in NestedDependencies)
            {
                d.RowInvalidated += NestedDependency_RowInvalidated;
            }
        }
 ///<summary>Creates a new SameRowDependancy.</summary>
 public SameRowDependency(RowDependencySetup setup) : base(setup)
 {
 }
 ///<summary>Creates a new ParentRowDependency.</summary>
 public ParentRowDependency(RowDependencySetup setup, ForeignKeyColumn parentColumn)
     : base(setup)
 {
     ParentColumn        = parentColumn;
     RequiresDataContext = true;
 }
 ///<summary>Creates a new ChildRowDependency.</summary>
 public ChildRowDependency(RowDependencySetup setup, ChildRelation childRelation)
     : base(setup)
 {
     ChildRelation       = childRelation;
     RequiresDataContext = true;
 }