示例#1
0
        private static void OnForeignKeyConstraintChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            DataTableForeignKeyDescription foreignKeyDescription = sender as DataTableForeignKeyDescription;

            if (foreignKeyDescription != null)
            {
                foreignKeyDescription.m_foreignKeyConstraint = e.NewValue as ForeignKeyConstraint;
                foreignKeyDescription.UpdateValuePath();
                foreignKeyDescription.UpdateItemsSource();
            }
        }
示例#2
0
    private static DataTableForeignKeyDescription GetDataGridForeignKeyDescriptionForForeignKeyConstraint(
      ForeignKeyConstraint foreignKeyConstraint )
    {
      DataTableForeignKeyDescription foreignKeyDescription = null;

      if( foreignKeyConstraint != null )
      {
        if( ( foreignKeyConstraint.Columns != null )
          && ( foreignKeyConstraint.Columns.Length == 1 ) )
        {
          foreignKeyDescription = new DataTableForeignKeyDescription();
          ( ( DataTableForeignKeyDescription )foreignKeyDescription ).ForeignKeyConstraint = foreignKeyConstraint;
          foreignKeyDescription.IsAutoCreated = true;
        }
      }

      return foreignKeyDescription;
    }