コード例 #1
0
        private void buttonSearchSchema_Click(object sender, RoutedEventArgs e)
        {
            SearchDataGridWindow win  = new SearchDataGridWindow();
            FrameworkElement     elem = sender as FrameworkElement ?? dataGridColumns;

            WindowLocator.LocateNearby(elem, win, NearbyLocation.UpLeft);
            win.Owner  = Window.GetWindow(this);
            win.Target = dataGridColumns;
            win.Show();
        }
コード例 #2
0
ファイル: TableControl.xaml.cs プロジェクト: calc33/PgTools
        //private void UpdateButtonAddJoinContextMenu()
        //{
        //    Dictionary<JoinTable, List<ForeignKeyConstraint>> dict = new Dictionary<JoinTable, List<ForeignKeyConstraint>>();
        //    foreach (JoinTable join in JoinTables)
        //    {
        //        Table tbl = join.Table as Table;
        //        if (tbl == null)
        //        {
        //            continue;
        //        }
        //        List<ForeignKeyConstraint> l = new List<ForeignKeyConstraint>(tbl.ReferTo);
        //        dict.Add(join, l);
        //    }
        //    foreach (JoinTable join in JoinTables)
        //    {
        //        if (join.Referrer == null)
        //        {
        //            continue;
        //        }
        //        List<ForeignKeyConstraint> l;
        //        if (dict.TryGetValue(join.Referrer, out l))
        //        {
        //            l.Remove(join.JoinBy);
        //        }
        //    }
        //    buttonAddJoinContextMenu.Items.Clear();
        //}

        private void buttonFilterColumns_Click(object sender, RoutedEventArgs e)
        {
            SelectColumnWindow w = GetColumnFilterWindow();

            if (w.IsVisible)
            {
                return;
            }
            w.Grid           = dataGridResult;
            w.SelectedColumn = w.Grid.CurrentColumn;
            WindowLocator.LocateNearby(buttonFilterColumns, w, NearbyLocation.DownLeft);
            w.Closed += ColumnFilterWindow_Closed;
            w.Show();
        }
コード例 #3
0
ファイル: TableControl.xaml.cs プロジェクト: calc33/PgTools
        private void ButtonJoinTableColumns_Click(object sender, RoutedEventArgs e)
        {
            //ListBoxItem item = App.FindLogicalParent<ListBoxItem>(sender as DependencyObject);
            ListBoxItem item = App.FindVisualParent <ListBoxItem>(sender as DependencyObject);
            JoinTable   tbl  = item?.DataContext as JoinTable;

            if (tbl == null)
            {
                return;
            }
            ColumnCheckListWindow win = new ColumnCheckListWindow();

            win.Owner  = Window.GetWindow(this);
            win.Target = tbl;
            WindowLocator.LocateNearby(sender as FrameworkElement, win, NearbyLocation.DownLeft);
            win.Closed += ColumnCheckListWindow_Closed;
            win.Show();
        }
コード例 #4
0
        private void buttonTitleColor_Click(object sender, RoutedEventArgs e)
        {
            ColorPickerWindow win = new ColorPickerWindow();

            WindowLocator.LocateNearby(sender as Button, win, NearbyLocation.DownLeft);
            RGB rgb = Target.BackgroundColor;

            win.Color = Color.FromRgb(rgb.R, rgb.G, rgb.B);
            win.Owner = this;
            bool?ret = win.ShowDialog();

            if (ret.HasValue && ret.Value)
            {
                rgb = new RGB(win.Color.R, win.Color.G, win.Color.B);
                Target.BackgroundColor = rgb;
                UpdateTitleColor();
            }
        }
コード例 #5
0
ファイル: App.xaml.cs プロジェクト: calc33/PgTools
 public static void ShowNearby(Window window, FrameworkElement element, NearbyLocation location)
 {
     WindowLocator.LocateNearby(element, window, location);
     window.Show();
 }