示例#1
0
 public GotoDialog()
 {
     InitializeComponent();
     FormLocationHelper.ApplyWindow(this, "ICSharpCode.SharpDevelop.Gui.GotoDialog.Bounds", true);
     SD.ParserService.LoadSolutionProjectsThread.Finished += ParserService_LoadSolutionProjectsThreadEnded;
     textBox.Focus();
 }
示例#2
0
 void EnsureFloatingWindowsLocations()
 {
     foreach (var window in dockingManager.FloatingWindows)
     {
         var newLocation = FormLocationHelper.Validate(new Rect(window.Left, window.Top, window.Width, window.Height).TransformToDevice(window).ToSystemDrawing()).ToWpf().TransformFromDevice(window);
         window.Left = newLocation.Left;
         window.Top  = newLocation.Top;
     }
 }
示例#3
0
        public void SetMemento(Properties memento)
        {
            Rect bounds = memento.Get("Bounds", new Rect(10, 10, 750, 550));

            bounds      = FormLocationHelper.Validate(bounds);
            this.Left   = bounds.Left;
            this.Top    = bounds.Top;
            this.Width  = bounds.Width;
            this.Height = bounds.Height;
            lastNonMinimizedWindowState = memento.Get("WindowState", System.Windows.WindowState.Maximized);
            this.WindowState            = lastNonMinimizedWindowState;
        }
示例#4
0
        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized(e);
            HwndSource.FromHwnd(this.MainWin32Window.Handle).AddHook(SingleInstanceHelper.WndProc);
            // validate after PresentationSource is initialized
            Rect bounds = new Rect(Left, Top, Width, Height);

            bounds = FormLocationHelper.Validate(bounds.TransformToDevice(this).ToSystemDrawing()).ToWpf().TransformFromDevice(this);
            SetBounds(bounds);
            // Set WindowState after PresentationSource is initialized, because now bounds and location are properly set.
            this.WindowState = lastNonMinimizedWindowState;
        }
示例#5
0
        public TreeViewOptionsDialog(IEnumerable <IOptionPanelDescriptor> optionPanels)
        {
            if (optionPanels == null)
            {
                throw new ArgumentNullException("optionPanels");
            }
            InitializeComponent();

            FormLocationHelper.ApplyWindow(this, "TreeViewOptionsDialog.WindowBounds", true);

            var list = optionPanels.Select(op => new OptionPanelNode(op, this)).ToList();

            treeView.ItemsSource = list;
        }
示例#6
0
 public GotoDialog()
 {
     SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.GotoDialog.xfrm"));
     ControlDictionary["okButton"].Click     += new EventHandler(OKButtonClick);
     ControlDictionary["cancelButton"].Click += new EventHandler(CancelButtonClick);
     listView                = (ListView)ControlDictionary["listView"];
     textBox                 = (TextBox)ControlDictionary["textBox"];
     textBox.TextChanged    += TextBoxTextChanged;
     textBox.KeyDown        += TextBoxKeyDown;
     listView.SmallImageList = ClassBrowserIconService.ImageList;
     listView.ItemActivate  += OKButtonClick;
     listView.Sorting        = SortOrder.Ascending;
     listView.SizeChanged   += ListViewSizeChanged;
     listView.HideSelection  = false;
     ListViewSizeChanged(null, null);
     Owner = WorkbenchSingleton.MainForm;
     Icon  = null;
     FormLocationHelper.Apply(this, "ICSharpCode.SharpDevelop.Gui.GotoDialog.Bounds", true);
 }