Exemple #1
0
        public override bool Equals(object obj)
        {
            if (!(obj is RefTable))
            {
                return(false);
            }
            RefTable o = (RefTable)obj;

            return(object.Equals(Constraint, o.Constraint) && Direction == o.Direction);
        }
Exemple #2
0
        private void buttonAddJoin_Click(object sender, RoutedEventArgs e)
        {
            ContentPresenter obj       = App.FindVisualParent <ContentPresenter>(sender as DependencyObject);
            ContextMenu      menu      = Resources["ContextMenuJoinTableCandidates"] as ContextMenu;
            JoinTable        joinTable = obj.Content as JoinTable;

            menu.DataContext = joinTable;
            menu.ItemsSource = null;
            List <RefTable> l = new List <RefTable>();

            RefTable.AddRefTables(l, joinTable.SelectableForeignKeys, JoinDirection.ReferTo);
            RefTable.AddRefTables(l, (joinTable.Table as Table).ReferFrom, JoinDirection.ReferFrom);
            menu.ItemsSource     = l;
            menu.PlacementTarget = sender as UIElement;
            menu.Placement       = System.Windows.Controls.Primitives.PlacementMode.Bottom;
            menu.IsOpen          = true;
        }
Exemple #3
0
        private void MenuItemAddJoin_Click(object sender, RoutedEventArgs e)
        {
            MenuItem item = (sender as MenuItem);

            if (item == null)
            {
                return;
            }
            RefTable refTbl = item.DataContext as RefTable;

            if (refTbl == null)
            {
                return;
            }
            ContextMenu menu = App.FindVisualParent <ContextMenu>(item);

            if (menu == null)
            {
                return;
            }
            JoinTable join = menu.DataContext as JoinTable;

            JoinTables.Add(new JoinTable(join, refTbl.Constraint, refTbl.Direction));
        }