예제 #1
0
        private void window_Loaded(object sender, RoutedEventArgs e)
        {
            Rect r = WindowLocator.GetWorkingAreaOf(this);

            _maxSize            = r.Size;
            _maxSizeInitialized = true;
            MaxWidth            = _maxSize.Width / 2;
            MaxHeight           = _maxSize.Height * 2 / 3;
        }
예제 #2
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();
        }
예제 #3
0
 private void window_LayoutUpdated(object sender, EventArgs e)
 {
     if (_maxSizeInitialized && SizeToContent != SizeToContent.Manual)
     {
         SizeToContent = SizeToContent.Manual;
         Rect r = WindowLocator.GetWorkingAreaOf(this);
         MaxWidth  = r.Width;
         MaxHeight = r.Height;
     }
 }
예제 #4
0
        //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();
        }
예제 #5
0
        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();
        }
예제 #6
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();
            }
        }
예제 #7
0
파일: App.xaml.cs 프로젝트: calc33/PgTools
 public static void ShowNearby(Window window, FrameworkElement element, NearbyLocation location)
 {
     WindowLocator.LocateNearby(element, window, location);
     window.Show();
 }