Beispiel #1
0
        /// <summary>
        /// Handles the Loaded event of the MdiChild control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        private void MdiChild_Loaded(object sender, RoutedEventArgs e)
        {
            FrameworkElement currentControl = this;

            while (currentControl != null && currentControl.GetType() != typeof(MdiContainer))
            {
                currentControl = (FrameworkElement)currentControl.Parent;
            }

            if (currentControl != null)
            {
                Container = (MdiContainer)currentControl;
            }

            if (this.Resizable)
            {
                this.WindowState = WindowState.Maximized;
                this.MaximizeBox = true;
                this.MinimizeBox = true;
            }
            else
            {
                this.WindowState = WindowState.Normal;
                this.MaximizeBox = false;
                this.MinimizeBox = false;
                this.MaxWidth    = this.Width;
                this.MaxHeight   = this.Height;
            }

            //else throw new Exception("Unable to find MdiContainer parent.");
        }
Beispiel #2
0
        /// <summary>
        /// Dependency property event once the theme value has changed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void ThemeValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            MdiContainer mdiContainer = (MdiContainer)sender;
            ThemeType    themeType    = (ThemeType)e.NewValue;

            bool max_mode = mdiContainer.ActiveMdiChild != null && mdiContainer.ActiveMdiChild.WindowState == WindowState.Maximized;

            if (max_mode)
            {
                mdiContainer.ActiveMdiChild.WindowState = WindowState.Normal;
            }

            if (currentResourceDictionary != null)
            {
                Application.Current.Resources.MergedDictionaries.Remove(currentResourceDictionary);
            }

            switch (themeType)
            {
            case ThemeType.Luna:
                Application.Current.Resources.MergedDictionaries.Add(currentResourceDictionary = new ResourceDictionary {
                    Source = new Uri(@"/WPF.MDI;component/Themes/Luna.xaml", UriKind.Relative)
                });
                break;

            case ThemeType.Aero:
                Application.Current.Resources.MergedDictionaries.Add(currentResourceDictionary = new ResourceDictionary {
                    Source = new Uri(@"/WPF.MDI;component/Themes/Aero.xaml", UriKind.Relative)
                });
                break;
            }

            //if (max_mode)
            //    mdiContainer.ActiveMdiChild.WindowState = WindowState.Maximized;
        }
Beispiel #3
0
        /// <summary>
        /// Dependency property event once the theme value has changed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void ThemeValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            MdiContainer mdiContainer = (MdiContainer)sender;
            ThemeType    themeType    = (ThemeType)e.NewValue;

            if (currentResourceDictionary != null)
            {
                Application.Current.Resources.MergedDictionaries.Remove(currentResourceDictionary);
            }

            switch (themeType)
            {
            case ThemeType.Luna:
                Application.Current.Resources.MergedDictionaries.Add(currentResourceDictionary = new ResourceDictionary {
                    Source = new Uri(@"/WPF.MDI;component/Themes/Luna.xaml", UriKind.Relative)
                });
                break;

            case ThemeType.Aero:
                Application.Current.Resources.MergedDictionaries.Add(currentResourceDictionary = new ResourceDictionary {
                    Source = new Uri(@"/WPF.MDI;component/Themes/Aero.xaml", UriKind.Relative)
                });
                break;
            }
        }
Beispiel #4
0
        static void MdiContainer_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            MdiContainer mdiContainer = (MdiContainer)sender;

            if (mdiContainer.Children.Count < 2)
            {
                return;
            }
            switch (e.Key)
            {
            case Key.Tab:
                if (e.KeyboardDevice.Modifiers == ModifierKeys.Control)
                {
                    int minZindex = Panel.GetZIndex(mdiContainer.Children[0]);
                    foreach (MdiChild mdiChild in mdiContainer.Children)
                    {
                        if (Panel.GetZIndex(mdiChild) < minZindex)
                        {
                            minZindex = Panel.GetZIndex(mdiChild);
                        }
                    }
                    Panel.SetZIndex(mdiContainer.GetTopChild(), minZindex - 1);
                    mdiContainer.GetTopChild().Focus();
                    e.Handled = true;
                }
                break;
            }
        }
Beispiel #5
0
        /// <summary>
        /// Dependency property event once the menu element has changed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void MenuValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            MdiContainer mdiContainer = (MdiContainer)sender;
            UIElement    menu         = (UIElement)e.NewValue;

            mdiContainer._menu.Child = menu;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Container = ((WPF.MDI.MdiContainer)(target));
                return;

            case 2:
                this.WindowsMenu = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 3:

            #line 18 "..\..\StartWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.StudWindow_Click);

            #line default
            #line hidden
                return;

            case 4:

            #line 19 "..\..\StartWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.PrepWindow_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #7
0
        /// <summary>
        /// Dependency property event once the MdiChild's Buttons property has changed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void ButtonsValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            MdiContainer mdiContainer = (MdiContainer)sender;
            Panel        panel        = (Panel)e.NewValue;

            mdiContainer._buttons.Child = panel;
            mdiContainer.MdiChildTitleChanged(mdiContainer, new RoutedEventArgs());
        }
Beispiel #8
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.MainMenu = ((System.Windows.Controls.Menu)(target));
                return;

            case 2:
                this.menuHome = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 3:
                this.menuMaster = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 4:
                this.userRegistration = ((System.Windows.Controls.MenuItem)(target));

            #line 15 "..\..\MainWindow.xaml"
                this.userRegistration.Click += new System.Windows.RoutedEventHandler(this.userRegistration_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.compRegistration = ((System.Windows.Controls.MenuItem)(target));

            #line 16 "..\..\MainWindow.xaml"
                this.compRegistration.Click += new System.Windows.RoutedEventHandler(this.compRegistration_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.menuExit = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 7:
                this.Exit = ((System.Windows.Controls.MenuItem)(target));

            #line 19 "..\..\MainWindow.xaml"
                this.Exit.Click += new System.Windows.RoutedEventHandler(this.menuExit_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.MainMdiContainer = ((WPF.MDI.MdiContainer)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #9
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ToolBar = ((CourseWork_Project.ToolBarControl)(target));
                return;

            case 2:
                this.Container = ((WPF.MDI.MdiContainer)(target));
                return;

            case 3:

            #line 32 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.RestoreMenuItem_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.PendulumSimMenuItem = ((System.Windows.Controls.MenuItem)(target));

            #line 36 "..\..\MainWindow.xaml"
                this.PendulumSimMenuItem.Click += new System.Windows.RoutedEventHandler(this.PendulumSimMenuItem_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.SpringSimMenuItem = ((System.Windows.Controls.MenuItem)(target));

            #line 39 "..\..\MainWindow.xaml"
                this.SpringSimMenuItem.Click += new System.Windows.RoutedEventHandler(this.SpringSimMenuItem_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.DoublePendlumSimMenuItem = ((System.Windows.Controls.MenuItem)(target));

            #line 42 "..\..\MainWindow.xaml"
                this.DoublePendlumSimMenuItem.Click += new System.Windows.RoutedEventHandler(this.DoublePendlumSimMenuItem_OnClick);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #10
0
        private static void CanDragOutPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            MdiContainer mdiContainer = (MdiContainer)sender;

            if ((bool)e.NewValue)
            {
                mdiContainer._scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
                mdiContainer._scrollViewer.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;
            }
            else
            {
                mdiContainer._scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
                mdiContainer._scrollViewer.VerticalScrollBarVisibility   = ScrollBarVisibility.Disabled;
            }
        }
Beispiel #11
0
        /// <summary>
        /// Handles the Loaded event of the MdiChild control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        private void MdiChild_Loaded(object sender, RoutedEventArgs e)
        {
            FrameworkElement currentControl = this;

            while (currentControl != null && currentControl.GetType() != typeof(MdiContainer))
            {
                currentControl = (FrameworkElement)currentControl.Parent;
            }

            if (currentControl != null)
            {
                Container = (MdiContainer)currentControl;
            }
            //else throw new Exception("Unable to find MdiContainer parent.");
        }
Beispiel #12
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
                return;

            case 2:
                this.Container = ((WPF.MDI.MdiContainer)(target));
                return;

            case 3:
                this.ChildWindowContent = ((WPF.MDI.MdiChild)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #13
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 17 "..\..\KeywordAnalyze.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);

            #line default
            #line hidden
                return;

            case 2:
                this.Container = ((WPF.MDI.MdiContainer)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #14
0
        /// <summary>
        /// Dependency property event once the focused mdi child has changed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void ActiveMdiChildValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            MdiContainer mdiContainer = (MdiContainer)sender;
            MdiChild     newChild     = (MdiChild)e.NewValue,
                         oldChild     = (MdiChild)e.OldValue;

            if (newChild == null || newChild == oldChild)
            {
                return;
            }

            if (oldChild != null && oldChild.WindowState == WindowState.Maximized)
            {
                newChild.WindowState = WindowState.Maximized;
            }

            int maxZindex = 0;

            for (int i = 0; i < mdiContainer.Children.Count; i++)
            {
                int zindex = Panel.GetZIndex(mdiContainer.Children[i]);
                if (zindex > maxZindex)
                {
                    maxZindex = zindex;
                }
                if (mdiContainer.Children[i] != newChild)
                {
                    mdiContainer.Children[i].Focused = false;
                }
                else
                {
                    newChild.Focused = true;
                }
            }

            Panel.SetZIndex(newChild, maxZindex + 1);

            if (mdiContainer.MdiChildTitleChanged != null)
            {
                mdiContainer.MdiChildTitleChanged(mdiContainer, new RoutedEventArgs());
            }
        }
Beispiel #15
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 16 "..\..\Main_window_of_system.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 2:

            #line 17 "..\..\Main_window_of_system.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click_1);

            #line default
            #line hidden
                return;

            case 3:

            #line 18 "..\..\Main_window_of_system.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click_2);

            #line default
            #line hidden
                return;

            case 4:
                this.main_container = ((WPF.MDI.MdiContainer)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #16
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Container = ((WPF.MDI.MdiContainer)(target));
                return;

            case 2:

            #line 11 "..\..\Main.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.AddWindow_Click);

            #line default
            #line hidden
                return;

            case 3:

            #line 12 "..\..\Main.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.AddFixedWindow_Click);

            #line default
            #line hidden
                return;

            case 4:

            #line 13 "..\..\Main.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.AddScrollWindow_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.Generic = ((System.Windows.Controls.MenuItem)(target));

            #line 16 "..\..\Main.xaml"
                this.Generic.Click += new System.Windows.RoutedEventHandler(this.Generic_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.Luna = ((System.Windows.Controls.MenuItem)(target));

            #line 17 "..\..\Main.xaml"
                this.Luna.Click += new System.Windows.RoutedEventHandler(this.Luna_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.Aero = ((System.Windows.Controls.MenuItem)(target));

            #line 18 "..\..\Main.xaml"
                this.Aero.Click += new System.Windows.RoutedEventHandler(this.Aero_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.WindowsMenu = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 9:
                this.Window1 = ((WPF.MDI.MdiChild)(target));
                return;

            case 10:
                this.DisableMinimize = ((System.Windows.Controls.Button)(target));

            #line 26 "..\..\Main.xaml"
                this.DisableMinimize.Click += new System.Windows.RoutedEventHandler(this.DisableMinimize_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.EnableMinimize = ((System.Windows.Controls.Button)(target));

            #line 27 "..\..\Main.xaml"
                this.EnableMinimize.Click += new System.Windows.RoutedEventHandler(this.EnableMinimize_Click);

            #line default
            #line hidden
                return;

            case 12:
                this.DisableMaximize = ((System.Windows.Controls.Button)(target));

            #line 28 "..\..\Main.xaml"
                this.DisableMaximize.Click += new System.Windows.RoutedEventHandler(this.DisableMaximize_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.EnableMaximize = ((System.Windows.Controls.Button)(target));

            #line 29 "..\..\Main.xaml"
                this.EnableMaximize.Click += new System.Windows.RoutedEventHandler(this.EnableMaximize_Click);

            #line default
            #line hidden
                return;

            case 14:
                this.ShowIcon = ((System.Windows.Controls.Button)(target));

            #line 30 "..\..\Main.xaml"
                this.ShowIcon.Click += new System.Windows.RoutedEventHandler(this.ShowIcon_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.HideIcon = ((System.Windows.Controls.Button)(target));

            #line 31 "..\..\Main.xaml"
                this.HideIcon.Click += new System.Windows.RoutedEventHandler(this.HideIcon_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #17
0
        /// <summary>
        /// Dependency property event once the MDI layout value has changed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void MdiLayoutValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            MdiContainer mdiContainer = (MdiContainer)sender;
            MdiLayout    value        = (MdiLayout)e.NewValue;

            if (value == MdiLayout.ArrangeIcons ||
                mdiContainer.Children.Count < 1)
            {
                return;
            }

            // 1. WindowState.Maximized -> WindowState.Normal
            List <MdiChild> minimizedWindows = new List <MdiChild>(),
                            normalWindows    = new List <MdiChild>();

            foreach (MdiChild mdiChild in mdiContainer.Children)
            {
                switch (mdiChild.WindowState)
                {
                case WindowState.Minimized:
                    minimizedWindows.Add(mdiChild);
                    break;

                case WindowState.Maximized:
                    mdiChild.WindowState = WindowState.Normal;
                    normalWindows.Add(mdiChild);
                    break;

                default:
                    normalWindows.Add(mdiChild);
                    break;
                }
            }

            minimizedWindows.Sort(new MdiChildComparer());
            normalWindows.Sort(new MdiChildComparer());

            // 2. Arrange minimized windows
            double containerHeight = mdiContainer.InnerHeight;

            for (int i = 0; i < minimizedWindows.Count; i++)
            {
                MdiChild mdiChild = minimizedWindows[i];
                int      capacity = Convert.ToInt32(mdiContainer.ActualWidth / MdiChild.MinimizedWidth),
                         row      = i / capacity + 1,
                         col      = i % capacity;
                containerHeight = mdiContainer.InnerHeight - MdiChild.MinimizedHeight * row;
                double newLeft = MdiChild.MinimizedWidth * col;
                mdiChild.Position = new Point(newLeft, containerHeight);
            }

            // 3. Resize & arrange normal windows
            switch (value)
            {
            case MdiLayout.Cascade:
            {
                double newWidth            = mdiContainer.ActualWidth - (int)(mdiContainer.ActualWidth * 0.20); //Width - 20%
                double newHeight           = containerHeight - (int)(containerHeight * 0.30);                   //Height - 30%
                double CurrentWindowOffset = 0;

                foreach (MdiChild mdiChild in normalWindows)
                {
                    if (mdiChild.Resizable)
                    {
                        mdiChild.Width  = newWidth;
                        mdiChild.Height = newHeight;
                    }
                    mdiChild.Position = new Point(CurrentWindowOffset, CurrentWindowOffset);

                    CurrentWindowOffset += WindowOffset;
                    if (CurrentWindowOffset + mdiChild.Width > mdiContainer.ActualWidth)
                    {
                        CurrentWindowOffset = 0;
                    }
                    if (CurrentWindowOffset + mdiChild.Height > containerHeight)
                    {
                        CurrentWindowOffset = 0;
                    }
                }
            }
            break;

            case MdiLayout.TileHorizontal:
            {
                double cols = Math.Sqrt(normalWindows.Count),
                       rows = normalWindows.Count / cols;

                List <double> col_count = new List <double>();                               // windows per column
                for (int i = 0; i < cols; i++)
                {
                    if (normalWindows.Count % cols > cols - i - 1)
                    {
                        col_count.Add(rows + 1);
                    }
                    else
                    {
                        col_count.Add(rows);
                    }
                }

                double newWidth   = mdiContainer.ActualWidth / cols,
                       newHeight  = containerHeight / col_count[0],
                       offsetTop  = 0,
                       offsetLeft = 0;

                double prev_count = 0;
                for (int i = 0, col_index = 0; i < normalWindows.Count; i++)
                {
                    if (i >= prev_count + col_count[col_index])
                    {
                        prev_count += col_count[col_index++];
                        offsetLeft += newWidth;
                        offsetTop   = 0;
                        newHeight   = containerHeight / col_count[col_index];
                    }

                    MdiChild mdiChild = normalWindows[i];
                    if (mdiChild.Resizable)
                    {
                        mdiChild.Width  = newWidth;
                        mdiChild.Height = newHeight;
                    }
                    mdiChild.Position = new Point(offsetLeft, offsetTop);
                    offsetTop        += newHeight;
                }
            }
            break;

            case MdiLayout.TileVertical:
            {
                double rows = Math.Sqrt(normalWindows.Count),
                       cols = normalWindows.Count / rows;

                List <double> col_count = new List <double>();                               // windows per column
                for (int i = 0; i < cols; i++)
                {
                    if (normalWindows.Count % cols > cols - i - 1)
                    {
                        col_count.Add(rows + 1);
                    }
                    else
                    {
                        col_count.Add(rows);
                    }
                }

                double newWidth   = mdiContainer.ActualWidth / cols,
                       newHeight  = containerHeight / col_count[0],
                       offsetTop  = 0,
                       offsetLeft = 0;

                double prev_count = 0;
                for (int i = 0, col_index = 0; i < normalWindows.Count; i++)
                {
                    if (i >= prev_count + col_count[col_index])
                    {
                        prev_count += col_count[col_index++];
                        offsetLeft += newWidth;
                        offsetTop   = 0;
                        newHeight   = containerHeight / col_count[col_index];
                    }

                    MdiChild mdiChild = normalWindows[i];
                    if (mdiChild.Resizable)
                    {
                        mdiChild.Width  = newWidth;
                        mdiChild.Height = newHeight;
                    }
                    mdiChild.Position = new Point(offsetLeft, offsetTop);
                    offsetTop        += newHeight;
                }
            }
            break;
            }
            mdiContainer.InvalidateSize();
            mdiContainer.MdiLayout = MdiLayout.ArrangeIcons;
        }
Beispiel #18
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.MainWindowDB = ((Lab6._2.MainWindow)(target));
                return;

            case 2:
                this.MainMenu = ((System.Windows.Controls.Menu)(target));
                return;

            case 3:
                this.menuFile = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 4:
                this.submenuClose = ((System.Windows.Controls.MenuItem)(target));

            #line 15 "..\..\MainWindow.xaml"
                this.submenuClose.Click += new System.Windows.RoutedEventHandler(this.submenuClose_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.menuTable = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 6:
                this.submenuConference = ((System.Windows.Controls.MenuItem)(target));

            #line 18 "..\..\MainWindow.xaml"
                this.submenuConference.Click += new System.Windows.RoutedEventHandler(this.submenuConference_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.submenuSectionLeaders = ((System.Windows.Controls.MenuItem)(target));

            #line 19 "..\..\MainWindow.xaml"
                this.submenuSectionLeaders.Click += new System.Windows.RoutedEventHandler(this.submenuConference_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.submenuMember = ((System.Windows.Controls.MenuItem)(target));

            #line 20 "..\..\MainWindow.xaml"
                this.submenuMember.Click += new System.Windows.RoutedEventHandler(this.submenuConference_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.submenuSection = ((System.Windows.Controls.MenuItem)(target));

            #line 21 "..\..\MainWindow.xaml"
                this.submenuSection.Click += new System.Windows.RoutedEventHandler(this.submenuConference_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.submenuLecture = ((System.Windows.Controls.MenuItem)(target));

            #line 22 "..\..\MainWindow.xaml"
                this.submenuLecture.Click += new System.Windows.RoutedEventHandler(this.submenuConference_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.menuWindow = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 12:
                this.submenuCascade = ((System.Windows.Controls.MenuItem)(target));

            #line 25 "..\..\MainWindow.xaml"
                this.submenuCascade.Click += new System.Windows.RoutedEventHandler(this.submenuCascade_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.submenuHorizontal = ((System.Windows.Controls.MenuItem)(target));

            #line 26 "..\..\MainWindow.xaml"
                this.submenuHorizontal.Click += new System.Windows.RoutedEventHandler(this.submenuHorizontal_Click);

            #line default
            #line hidden
                return;

            case 14:
                this.submenuVertical = ((System.Windows.Controls.MenuItem)(target));

            #line 27 "..\..\MainWindow.xaml"
                this.submenuVertical.Click += new System.Windows.RoutedEventHandler(this.submenuVertical_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.MainMdiContainer = ((WPF.MDI.MdiContainer)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #19
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 5 "..\..\MainWindow.xaml"
                ((ProcessDesigner.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing);

            #line default
            #line hidden
                return;

            case 2:
                this.Container = ((WPF.MDI.MdiContainer)(target));
                return;

            case 3:
                this.miOperationMaster = ((System.Windows.Controls.MenuItem)(target));

            #line 21 "..\..\MainWindow.xaml"
                this.miOperationMaster.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.miFinishMast = ((System.Windows.Controls.MenuItem)(target));

            #line 22 "..\..\MainWindow.xaml"
                this.miFinishMast.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.miCoatingMast = ((System.Windows.Controls.MenuItem)(target));

            #line 23 "..\..\MainWindow.xaml"
                this.miCoatingMast.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.miRawMaterial = ((System.Windows.Controls.MenuItem)(target));

            #line 25 "..\..\MainWindow.xaml"
                this.miRawMaterial.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.miCustomer = ((System.Windows.Controls.MenuItem)(target));

            #line 27 "..\..\MainWindow.xaml"
                this.miCustomer.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.miCCMaster = ((System.Windows.Controls.MenuItem)(target));

            #line 28 "..\..\MainWindow.xaml"
                this.miCCMaster.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.miUnitMaster = ((System.Windows.Controls.MenuItem)(target));

            #line 30 "..\..\MainWindow.xaml"
                this.miUnitMaster.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.miLocationMaster = ((System.Windows.Controls.MenuItem)(target));

            #line 31 "..\..\MainWindow.xaml"
                this.miLocationMaster.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.miCategoryMaster = ((System.Windows.Controls.MenuItem)(target));

            #line 32 "..\..\MainWindow.xaml"
                this.miCategoryMaster.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 12:
                this.miApplicationMaster = ((System.Windows.Controls.MenuItem)(target));

            #line 33 "..\..\MainWindow.xaml"
                this.miApplicationMaster.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.miUpdateFeature = ((System.Windows.Controls.MenuItem)(target));

            #line 34 "..\..\MainWindow.xaml"
                this.miUpdateFeature.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 14:
                this.miPartNumberConfiguration = ((System.Windows.Controls.MenuItem)(target));

            #line 36 "..\..\MainWindow.xaml"
                this.miPartNumberConfiguration.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.miProductCategoryMaster = ((System.Windows.Controls.MenuItem)(target));

            #line 37 "..\..\MainWindow.xaml"
                this.miProductCategoryMaster.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 16:
                this.miFeatureUpdationMaster = ((System.Windows.Controls.MenuItem)(target));

            #line 39 "..\..\MainWindow.xaml"
                this.miFeatureUpdationMaster.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 17:
                this.miCharacteristicMaster = ((System.Windows.Controls.MenuItem)(target));

            #line 40 "..\..\MainWindow.xaml"
                this.miCharacteristicMaster.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 18:
                this.miCPMMaster = ((System.Windows.Controls.MenuItem)(target));

            #line 41 "..\..\MainWindow.xaml"
                this.miCPMMaster.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 19:
                this.miPSWMaster = ((System.Windows.Controls.MenuItem)(target));

            #line 42 "..\..\MainWindow.xaml"
                this.miPSWMaster.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 20:
                this.miExhibit = ((System.Windows.Controls.MenuItem)(target));

            #line 46 "..\..\MainWindow.xaml"
                this.miExhibit.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 21:
                this.miToolAdmin = ((System.Windows.Controls.MenuItem)(target));

            #line 47 "..\..\MainWindow.xaml"
                this.miToolAdmin.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 22:
                this.miChangePassword = ((System.Windows.Controls.MenuItem)(target));

            #line 49 "..\..\MainWindow.xaml"
                this.miChangePassword.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 23:
                this.miExit = ((System.Windows.Controls.MenuItem)(target));

            #line 51 "..\..\MainWindow.xaml"
                this.miExit.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 24:
                this.miFRCS = ((System.Windows.Controls.MenuItem)(target));

            #line 54 "..\..\MainWindow.xaml"
                this.miFRCS.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 25:
                this.miRequestDevelopment = ((System.Windows.Controls.MenuItem)(target));

            #line 55 "..\..\MainWindow.xaml"
                this.miRequestDevelopment.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 26:
                this.miCostSheetSearch = ((System.Windows.Controls.MenuItem)(target));

            #line 56 "..\..\MainWindow.xaml"
                this.miCostSheetSearch.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 27:
                this.miProductInformation = ((System.Windows.Controls.MenuItem)(target));

            #line 59 "..\..\MainWindow.xaml"
                this.miProductInformation.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 28:
                this.miProcessSheet = ((System.Windows.Controls.MenuItem)(target));

            #line 60 "..\..\MainWindow.xaml"
                this.miProcessSheet.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 29:
                this.miToolSchedule = ((System.Windows.Controls.MenuItem)(target));

            #line 62 "..\..\MainWindow.xaml"
                this.miToolSchedule.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 30:
                this.miControlPlanPI = ((System.Windows.Controls.MenuItem)(target));

            #line 63 "..\..\MainWindow.xaml"
                this.miControlPlanPI.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 31:
                this.miDrawings = ((System.Windows.Controls.MenuItem)(target));

            #line 65 "..\..\MainWindow.xaml"
                this.miDrawings.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 32:
                this.miDevelopmentReport = ((System.Windows.Controls.MenuItem)(target));

            #line 66 "..\..\MainWindow.xaml"
                this.miDevelopmentReport.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 33:
                this.miManufacturingReport = ((System.Windows.Controls.MenuItem)(target));

            #line 67 "..\..\MainWindow.xaml"
                this.miManufacturingReport.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 34:
                this.miProductSearch = ((System.Windows.Controls.MenuItem)(target));

            #line 69 "..\..\MainWindow.xaml"
                this.miProductSearch.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 35:
                this.miTollInfo = ((System.Windows.Controls.MenuItem)(target));

            #line 71 "..\..\MainWindow.xaml"
                this.miTollInfo.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 36:
                this.miHardnessConversion = ((System.Windows.Controls.MenuItem)(target));

            #line 73 "..\..\MainWindow.xaml"
                this.miHardnessConversion.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 37:
                this.miThreadDetails = ((System.Windows.Controls.MenuItem)(target));

            #line 74 "..\..\MainWindow.xaml"
                this.miThreadDetails.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 38:
                this.miChemicalComposition = ((System.Windows.Controls.MenuItem)(target));

            #line 76 "..\..\MainWindow.xaml"
                this.miChemicalComposition.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 39:
                this.miSurfaceFinish = ((System.Windows.Controls.MenuItem)(target));

            #line 77 "..\..\MainWindow.xaml"
                this.miSurfaceFinish.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 40:
                this.miLibrarySearch = ((System.Windows.Controls.MenuItem)(target));

            #line 79 "..\..\MainWindow.xaml"
                this.miLibrarySearch.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 41:
                this.miDDPerformance = ((System.Windows.Controls.MenuItem)(target));

            #line 82 "..\..\MainWindow.xaml"
                this.miDDPerformance.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 42:
                this.miMFMPlanDetails = ((System.Windows.Controls.MenuItem)(target));

            #line 83 "..\..\MainWindow.xaml"
                this.miMFMPlanDetails.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 43:
                this.miAuditReportAll = ((System.Windows.Controls.MenuItem)(target));

            #line 85 "..\..\MainWindow.xaml"
                this.miAuditReportAll.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 44:
                this.miSpecialCharacteristicsReport = ((System.Windows.Controls.MenuItem)(target));

            #line 87 "..\..\MainWindow.xaml"
                this.miSpecialCharacteristicsReport.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 45:
                this.miSpecialCharacteristicsExcel = ((System.Windows.Controls.MenuItem)(target));

            #line 88 "..\..\MainWindow.xaml"
                this.miSpecialCharacteristicsExcel.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 46:
                this.miCFTMeet = ((System.Windows.Controls.MenuItem)(target));

            #line 93 "..\..\MainWindow.xaml"
                this.miCFTMeet.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 47:
                this.miAPQP = ((System.Windows.Controls.MenuItem)(target));

            #line 94 "..\..\MainWindow.xaml"
                this.miAPQP.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 48:
                this.miTFCNPD = ((System.Windows.Controls.MenuItem)(target));

            #line 96 "..\..\MainWindow.xaml"
                this.miTFCNPD.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 49:
                this.miTFCECN = ((System.Windows.Controls.MenuItem)(target));

            #line 97 "..\..\MainWindow.xaml"
                this.miTFCECN.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 50:
                this.miTFCPCR = ((System.Windows.Controls.MenuItem)(target));

            #line 98 "..\..\MainWindow.xaml"
                this.miTFCPCR.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 51:
                this.miQCP = ((System.Windows.Controls.MenuItem)(target));

            #line 100 "..\..\MainWindow.xaml"
                this.miQCP.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 52:
                this.miEcnPcnCFT = ((System.Windows.Controls.MenuItem)(target));

            #line 101 "..\..\MainWindow.xaml"
                this.miEcnPcnCFT.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 53:
                this.miMISCustomerPartNos = ((System.Windows.Controls.MenuItem)(target));

            #line 105 "..\..\MainWindow.xaml"
                this.miMISCustomerPartNos.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 54:
                this.miMISFeatureWise = ((System.Windows.Controls.MenuItem)(target));

            #line 106 "..\..\MainWindow.xaml"
                this.miMISFeatureWise.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 55:
                this.miMISMFMReport = ((System.Windows.Controls.MenuItem)(target));

            #line 108 "..\..\MainWindow.xaml"
                this.miMISMFMReport.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 56:
                this.miMISPartNos = ((System.Windows.Controls.MenuItem)(target));

            #line 109 "..\..\MainWindow.xaml"
                this.miMISPartNos.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 57:
                this.miOTPMChart = ((System.Windows.Controls.MenuItem)(target));

            #line 112 "..\..\MainWindow.xaml"
                this.miOTPMChart.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 58:
                this.miMachineBooking = ((System.Windows.Controls.MenuItem)(target));

            #line 114 "..\..\MainWindow.xaml"
                this.miMachineBooking.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 59:
                this.miPendingPartStatus = ((System.Windows.Controls.MenuItem)(target));

            #line 115 "..\..\MainWindow.xaml"
                this.miPendingPartStatus.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 60:
                this.miAllFeature = ((System.Windows.Controls.MenuItem)(target));

            #line 117 "..\..\MainWindow.xaml"
                this.miAllFeature.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 61:
                this.miSecurity = ((System.Windows.Controls.MenuItem)(target));

            #line 128 "..\..\MainWindow.xaml"
                this.miSecurity.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 62:
                this.miSapHalb = ((System.Windows.Controls.MenuItem)(target));

            #line 130 "..\..\MainWindow.xaml"
                this.miSapHalb.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 63:
                this.miSapFert = ((System.Windows.Controls.MenuItem)(target));

            #line 131 "..\..\MainWindow.xaml"
                this.miSapFert.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 64:
                this.miSapBom = ((System.Windows.Controls.MenuItem)(target));

            #line 132 "..\..\MainWindow.xaml"
                this.miSapBom.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 65:
                this.miSapRouting = ((System.Windows.Controls.MenuItem)(target));

            #line 133 "..\..\MainWindow.xaml"
                this.miSapRouting.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 66:
                this.miSapProductVersion = ((System.Windows.Controls.MenuItem)(target));

            #line 134 "..\..\MainWindow.xaml"
                this.miSapProductVersion.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 67:
                this.miSapImport = ((System.Windows.Controls.MenuItem)(target));

            #line 136 "..\..\MainWindow.xaml"
                this.miSapImport.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 68:
                this.miOqa = ((System.Windows.Controls.MenuItem)(target));

            #line 138 "..\..\MainWindow.xaml"
                this.miOqa.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 69:
                this.miWindows = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 70:
                this.miTileHorizontally = ((System.Windows.Controls.MenuItem)(target));

            #line 140 "..\..\MainWindow.xaml"
                this.miTileHorizontally.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 71:
                this.miTileVertically = ((System.Windows.Controls.MenuItem)(target));

            #line 141 "..\..\MainWindow.xaml"
                this.miTileVertically.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 72:
                this.miTileCascade = ((System.Windows.Controls.MenuItem)(target));

            #line 142 "..\..\MainWindow.xaml"
                this.miTileCascade.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 73:
                this.miLog = ((System.Windows.Controls.MenuItem)(target));

            #line 144 "..\..\MainWindow.xaml"
                this.miLog.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 74:
                this.miTesting = ((System.Windows.Controls.MenuItem)(target));

            #line 145 "..\..\MainWindow.xaml"
                this.miTesting.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 75:
                this.stMain = ((System.Windows.Controls.Primitives.StatusBar)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #20
0
        /// <summary>
        /// Dependency property event once the MDI layout value has changed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void MdiLayoutValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            MdiContainer mdiContainer = (MdiContainer)sender;
            MdiLayout    value        = (MdiLayout)e.NewValue;

            if (value == MdiLayout.ArrangeIcons ||
                mdiContainer.Children.Count < 1)
            {
                return;
            }

            // 1. WindowState.Maximized -> WindowState.Normal
            List <MdiChild> minimizedWindows = new List <MdiChild>(),
                            normalWindows    = new List <MdiChild>();

            foreach (MdiChild mdiChild in mdiContainer.Children)
            {
                switch (mdiChild.WindowState)
                {
                case WindowState.Minimized:
                    minimizedWindows.Add(mdiChild);
                    break;

                case WindowState.Maximized:
                    mdiChild.WindowState = WindowState.Normal;
                    normalWindows.Add(mdiChild);
                    break;

                default:
                    normalWindows.Add(mdiChild);
                    break;
                }
            }

            minimizedWindows.Sort(new MdiChildComparer());
            normalWindows.Sort(new MdiChildComparer());

            // 2. Arrange minimized windows
            double containerHeight = mdiContainer.InnerHeight;

            for (int i = 0; i < minimizedWindows.Count; i++)
            {
                MdiChild mdiChild = minimizedWindows[i];
                int      capacity = Convert.ToInt32(mdiContainer.InnerWidth) / mdiChild.MinimizedWidth,
                         row      = i / capacity + 1,
                         col      = i % capacity;
                containerHeight = mdiContainer.InnerHeight - mdiChild.MinimizedHeight * row;
                double newLeft = mdiChild.MinimizedWidth * col;
                mdiChild.Position = new Point(newLeft, containerHeight);
            }

            // 3. Resize & arrange normal windows
            switch (value)
            {
            case MdiLayout.Cascade:
            {
                double newWidth     = mdiContainer.InnerWidth * 0.58,                             // should be non-linear formula here
                       newHeight    = containerHeight * 0.67,
                       windowOffset = 0;
                foreach (MdiChild mdiChild in normalWindows)
                {
                    if (mdiChild.Resizable)
                    {
                        mdiChild.Width  = newWidth;
                        mdiChild.Height = newHeight;
                    }
                    mdiChild.Position = new Point(windowOffset, windowOffset);

                    windowOffset += WindowOffset;
                    if (windowOffset + mdiChild.Width > mdiContainer.InnerWidth)
                    {
                        windowOffset = 0;
                    }
                    if (windowOffset + mdiChild.Height > containerHeight)
                    {
                        windowOffset = 0;
                    }
                }
            }
            break;

            case MdiLayout.TileHorizontal:
            {
                var _h = mdiContainer.MinimizedAreaHeight;

                int cols = Math.Max((int)Math.Sqrt(normalWindows.Count), 1);
                int rows = normalWindows.Count / cols;

                rows = Math.Min(rows, mdiContainer.MdiLayoutMaxRow);
                cols = (int)Math.Ceiling((double)normalWindows.Count / (double)rows);

                double w = Math.Max(mdiContainer.InnerWidth / cols, 0);
                double h = Math.Max((mdiContainer.InnerHeight - _h) / rows, 0);

                int count = 0;
                foreach (var item in normalWindows)
                {
                    item.Position = new Point((int)(count % cols) * w, (int)(count / cols) * h);
                    if (w == 0 && h == 0)
                    {
                        item.Width  = item.MinimizedWidth;
                        item.Height = item.MinimizedHeight;
                    }
                    else
                    {
                        item.Width  = w;
                        item.Height = h;
                    }
                    count++;
                }
            }
            break;

            case MdiLayout.TileVertical:
            {
                var _h = mdiContainer.MinimizedAreaHeight;

                int rows = Math.Max((int)Math.Sqrt(normalWindows.Count), 1);
                int cols = normalWindows.Count / rows;

                cols = Math.Min(cols, mdiContainer.MdiLayoutMaxCol);
                rows = (int)Math.Ceiling((double)normalWindows.Count / (double)cols);

                double w = Math.Max(mdiContainer.InnerWidth / cols, 0);
                double h = Math.Max((mdiContainer.InnerHeight - _h) / rows, 0);

                int count = 0;
                foreach (var item in normalWindows)
                {
                    item.Position = new Point((int)(count % cols) * w, (int)(count / cols) * h);
                    if (w == 0 && h == 0)
                    {
                        item.Width  = item.MinimizedWidth;
                        item.Height = item.MinimizedHeight;
                    }
                    else
                    {
                        item.Width  = w;
                        item.Height = h;
                    }
                    count++;
                }
            }
            break;
            }
            mdiContainer.InvalidateSize();
            mdiContainer.MdiLayout = MdiLayout.ArrangeIcons;
        }
Beispiel #21
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mnUser = ((System.Windows.Controls.MenuItem)(target));

            #line 13 "..\..\..\frmMain.xaml"
                this.mnUser.Click += new System.Windows.RoutedEventHandler(this.mnUser_Click);

            #line default
            #line hidden
                return;

            case 2:
                this.mnCompany = ((System.Windows.Controls.MenuItem)(target));

            #line 14 "..\..\..\frmMain.xaml"
                this.mnCompany.Click += new System.Windows.RoutedEventHandler(this.mnCompany_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.mnOverview = ((System.Windows.Controls.MenuItem)(target));

            #line 15 "..\..\..\frmMain.xaml"
                this.mnOverview.Click += new System.Windows.RoutedEventHandler(this.mnOverview_Click_1);

            #line default
            #line hidden
                return;

            case 4:
                this.mnRevisited = ((System.Windows.Controls.MenuItem)(target));

            #line 16 "..\..\..\frmMain.xaml"
                this.mnRevisited.Click += new System.Windows.RoutedEventHandler(this.mnRevisited_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.mnRollingBalls = ((System.Windows.Controls.MenuItem)(target));

            #line 17 "..\..\..\frmMain.xaml"
                this.mnRollingBalls.Click += new System.Windows.RoutedEventHandler(this.mnRollingBalls_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.mnDownload = ((System.Windows.Controls.MenuItem)(target));

            #line 18 "..\..\..\frmMain.xaml"
                this.mnDownload.Click += new System.Windows.RoutedEventHandler(this.mnDownload_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.mnDynamic = ((System.Windows.Controls.MenuItem)(target));

            #line 19 "..\..\..\frmMain.xaml"
                this.mnDynamic.Click += new System.Windows.RoutedEventHandler(this.mnDynamic_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.mnPer_Frame = ((System.Windows.Controls.MenuItem)(target));

            #line 20 "..\..\..\frmMain.xaml"
                this.mnPer_Frame.Click += new System.Windows.RoutedEventHandler(this.mnPer_Frame_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.mnPoint = ((System.Windows.Controls.MenuItem)(target));

            #line 21 "..\..\..\frmMain.xaml"
                this.mnPoint.Click += new System.Windows.RoutedEventHandler(this.mnPoint_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.mnSimple = ((System.Windows.Controls.MenuItem)(target));

            #line 22 "..\..\..\frmMain.xaml"
                this.mnSimple.Click += new System.Windows.RoutedEventHandler(this.mnSimple_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.mnAnimation = ((System.Windows.Controls.MenuItem)(target));

            #line 23 "..\..\..\frmMain.xaml"
                this.mnAnimation.Click += new System.Windows.RoutedEventHandler(this.mnAnimation_Click);

            #line default
            #line hidden
                return;

            case 12:
                this.mnImgBitmap = ((System.Windows.Controls.MenuItem)(target));

            #line 28 "..\..\..\frmMain.xaml"
                this.mnImgBitmap.Click += new System.Windows.RoutedEventHandler(this.mnImgBitmap_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.mnLGColor = ((System.Windows.Controls.MenuItem)(target));

            #line 29 "..\..\..\frmMain.xaml"
                this.mnLGColor.Click += new System.Windows.RoutedEventHandler(this.mnLGColor_Click);

            #line default
            #line hidden
                return;

            case 14:
                this.mnOpacity = ((System.Windows.Controls.MenuItem)(target));

            #line 30 "..\..\..\frmMain.xaml"
                this.mnOpacity.Click += new System.Windows.RoutedEventHandler(this.mnOpacity_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.mnRadGran = ((System.Windows.Controls.MenuItem)(target));

            #line 31 "..\..\..\frmMain.xaml"
                this.mnRadGran.Click += new System.Windows.RoutedEventHandler(this.mnRadGran_Click);

            #line default
            #line hidden
                return;

            case 16:
                this.mnShape = ((System.Windows.Controls.MenuItem)(target));

            #line 32 "..\..\..\frmMain.xaml"
                this.mnShape.Click += new System.Windows.RoutedEventHandler(this.mnShape_Click);

            #line default
            #line hidden
                return;

            case 17:
                this.mnSolidColor = ((System.Windows.Controls.MenuItem)(target));

            #line 33 "..\..\..\frmMain.xaml"
                this.mnSolidColor.Click += new System.Windows.RoutedEventHandler(this.mnSolidColor_Click);

            #line default
            #line hidden
                return;

            case 18:
                this.MainMdiContainer = ((WPF.MDI.MdiContainer)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #22
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.BT_Connection = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 2:
                this.BT_Deconnection = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 3:
                this.BT_Quiter = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 4:
                this.BT_Patient = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 5:
                this.BT_save = ((System.Windows.Controls.MenuItem)(target));

            #line 17 "..\..\..\MainWindow.xaml"
                this.BT_save.Click += new System.Windows.RoutedEventHandler(this.BT_save_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.BT_ModifierPatient = ((System.Windows.Controls.MenuItem)(target));

            #line 18 "..\..\..\MainWindow.xaml"
                this.BT_ModifierPatient.Click += new System.Windows.RoutedEventHandler(this.BT_ModifierPatient_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.BT_SearchPatient = ((System.Windows.Controls.MenuItem)(target));

            #line 19 "..\..\..\MainWindow.xaml"
                this.BT_SearchPatient.Click += new System.Windows.RoutedEventHandler(this.BT_SearchPatient_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.BT_ListPatient = ((System.Windows.Controls.MenuItem)(target));

            #line 20 "..\..\..\MainWindow.xaml"
                this.BT_ListPatient.Click += new System.Windows.RoutedEventHandler(this.BT_ListPatient_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.BT_SaveVisite = ((System.Windows.Controls.MenuItem)(target));

            #line 23 "..\..\..\MainWindow.xaml"
                this.BT_SaveVisite.Click += new System.Windows.RoutedEventHandler(this.BT_SaveVisite_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.BT_ModifierVisite = ((System.Windows.Controls.MenuItem)(target));

            #line 24 "..\..\..\MainWindow.xaml"
                this.BT_ModifierVisite.Click += new System.Windows.RoutedEventHandler(this.BT_ModifierVisite_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.BT_RechercherVisite = ((System.Windows.Controls.MenuItem)(target));

            #line 25 "..\..\..\MainWindow.xaml"
                this.BT_RechercherVisite.Click += new System.Windows.RoutedEventHandler(this.BT_RechercherVisite_Click);

            #line default
            #line hidden
                return;

            case 12:
                this.BT_ListerVisite = ((System.Windows.Controls.MenuItem)(target));

            #line 26 "..\..\..\MainWindow.xaml"
                this.BT_ListerVisite.Click += new System.Windows.RoutedEventHandler(this.BT_ListerVisite_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.BT_MakeLabOrder = ((System.Windows.Controls.MenuItem)(target));

            #line 30 "..\..\..\MainWindow.xaml"
                this.BT_MakeLabOrder.Click += new System.Windows.RoutedEventHandler(this.BT_MakeLabOrder_Click);

            #line default
            #line hidden
                return;

            case 14:
                this.BT_SearchLabOrder = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 15:
                this.BT_SaveDrugOrder = ((System.Windows.Controls.MenuItem)(target));

            #line 34 "..\..\..\MainWindow.xaml"
                this.BT_SaveDrugOrder.Click += new System.Windows.RoutedEventHandler(this.BT_SaveDrugOrder_Click);

            #line default
            #line hidden
                return;

            case 16:
                this.BT_SearchDrugOrder = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 17:
                this.BT_CreerUser = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 18:
                this.BT_ModifierUser = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 19:
                this.BT_ListerUser = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 20:
                this.MainMdiContainer = ((WPF.MDI.MdiContainer)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #23
0
        /// <summary>
        /// Dependency property event once the windows state value has changed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void WindowStateValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            MdiChild mdiChild = (MdiChild)sender;

            WindowState previousWindowState = (WindowState)e.OldValue;
            WindowState windowState         = (WindowState)e.NewValue;

            if (mdiChild.Container == null ||
                previousWindowState == windowState)
            {
                return;
            }

            if (previousWindowState == WindowState.Maximized)
            {
                //for (int i = 0; i < mdiChild.Container.Children.Count; i++)
                //{
                //    if (mdiChild.Container.Children[i] != mdiChild &&
                //            mdiChild.Container.Children[i].WindowState == WindowState.Maximized &&
                //            mdiChild.Container.Children[i].MaximizeBox) { }
                //        //mdiChild.Container.Children[i].WindowState = WindowState.Normal;
                //}

                ScrollViewer sv = (ScrollViewer)((Grid)mdiChild.Container.Content).Children[1];
                sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
                sv.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;

                //mdiChild.Buttons.Children.Clear();
                //mdiChild.buttonsPanel.Children.Add(mdiChild.minimizeButton);
                //mdiChild.buttonsPanel.Children.Add(mdiChild.maximizeButton);
                //mdiChild.buttonsPanel.Children.Add(mdiChild.closeButton);
            }

            if (previousWindowState == WindowState.Minimized)
            {
                mdiChild.minimizedPosition = mdiChild.Position;
            }

            switch (windowState)
            {
            case WindowState.Normal:
            {
                mdiChild.Position = new Point(mdiChild.originalDimension.X, mdiChild.originalDimension.Y);

                mdiChild.Width  = mdiChild.originalDimension.Width;
                mdiChild.Height = mdiChild.originalDimension.Height;
            }
            break;

            case WindowState.Minimized:
            {
                if (previousWindowState == WindowState.Normal)
                {
                    mdiChild.originalDimension = new Rect(mdiChild.Position.X, mdiChild.Position.Y, mdiChild.ActualWidth, mdiChild.ActualHeight);
                }

                double newLeft, newTop;
                if (mdiChild.minimizedPosition.X >= 0 || mdiChild.minimizedPosition.Y >= 0)
                {
                    newLeft = mdiChild.minimizedPosition.X;
                    newTop  = mdiChild.minimizedPosition.Y;
                }
                else
                {
                    #region Simple
                    int minimizedWindows = 0;
                    for (int i = 0; i < mdiChild.Container.Children.Count; i++)
                    {
                        if (mdiChild.Container.Children[i] != mdiChild && mdiChild.Container.Children[i].WindowState == WindowState.Minimized)
                        {
                            minimizedWindows++;
                        }
                    }
                    int capacity = Convert.ToInt32(mdiChild.Container.ActualWidth) / MdiChild.MinimizedWidth,
                        row      = minimizedWindows / capacity + 1,
                        col      = minimizedWindows % capacity;
                    newTop  = mdiChild.Container.InnerHeight - MdiChild.MinimizedHeight * row;
                    newLeft = MdiChild.MinimizedWidth * col;
                    #endregion
                    #region Complex
                    //List<MdiChild> minimizedWindows = new List<MdiChild>();
                    //for (int i = 0; i < mdiChild.Container.Children.Count; i++)
                    //    if (mdiChild.Container.Children[i] != mdiChild && mdiChild.Container.Children[i].WindowState == WindowState.Minimized)
                    //        minimizedWindows.Add(mdiChild.Container.Children[i]);

                    #endregion
                }

                mdiChild.Position = new Point(newLeft, newTop);

                mdiChild.Width  = MdiChild.MinimizedWidth;
                mdiChild.Height = MdiChild.MinimizedHeight;
            }
            break;

            case WindowState.Maximized:
            {
                if (previousWindowState == WindowState.Normal)
                {
                    mdiChild.originalDimension = new Rect(mdiChild.Position.X, mdiChild.Position.Y, mdiChild.ActualWidth, mdiChild.ActualHeight);
                }

                mdiChild.buttonsPanel.Children.Clear();


                mdiChild.buttonsPanel.Children.Add(mdiChild.minimizeButton);
                mdiChild.buttonsPanel.Children.Add(mdiChild.maximizeButton);
                mdiChild.buttonsPanel.Children.Add(mdiChild.closeButton);


                mdiChild.Position = new Point(0, 0);
                mdiChild.Width    = mdiChild.Container.ActualWidth;
                mdiChild.Height   = mdiChild.Container.InnerHeight - 2;                               // ContentBorder.BorderThickness="1" in template

                if (mdiChild.Container.AllowWindowStateMax)
                {
                    MdiContainer mdiContainer = mdiChild.Container;
                    mdiContainer.AllowWindowStateMax = false;

                    //for (int i = 0; i < mdiContainer.Children.Count; i++)
                    //    if (mdiContainer.Children[i] != mdiChild)
                    //    {
                    //        if (mdiContainer.Children[i].WindowState == WindowState.Normal &&
                    //            mdiContainer.Children[i].MaximizeBox)
                    //            mdiContainer.Children[i].WindowState = WindowState.Maximized;
                    //        else if (mdiContainer.Children[i].WindowState == WindowState.Maximized)
                    //            mdiContainer.Children[i].Height = mdiContainer.InnerHeight;
                    //    }

                    ScrollViewer sv = (ScrollViewer)((Grid)mdiContainer.Content).Children[1];
                    sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden;
                    sv.VerticalScrollBarVisibility   = ScrollBarVisibility.Hidden;

                    mdiChild.Focus();
                    mdiContainer.InvalidateSize();
                    mdiContainer.AllowWindowStateMax = true;
                }
            }
            break;
            }
        }
Beispiel #24
0
 /// <summary>
 /// Set focus to the child window and brings into view.
 /// </summary>
 public new void Focus()
 {
     MdiContainer.Focus(this);
 }
Beispiel #25
0
        /// <summary>
        /// Dependency property event once the windows state value has changed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void WindowStateValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            MdiChild mdiChild = (MdiChild)sender;

            WindowState previousWindowState = (WindowState)e.OldValue;
            WindowState windowState         = (WindowState)e.NewValue;

            if (mdiChild.Container == null ||
                previousWindowState == windowState)
            {
                return;
            }

            if (previousWindowState == WindowState.Maximized)
            {
                for (int i = 0; i < mdiChild.Container.Children.Count; i++)
                {
                    if (mdiChild.Container.Children[i] != mdiChild &&
                        mdiChild.Container.Children[i].WindowState == WindowState.Maximized &&
                        mdiChild.Container.Children[i].MaximizeBox)
                    {
                        mdiChild.Container.Children[i].WindowState = WindowState.Normal;
                    }
                }

                ScrollViewer sv = (ScrollViewer)((Grid)mdiChild.Container.Content).Children[1];
                sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
                sv.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;

                if (mdiChild.Buttons != null)
                {
                    mdiChild.Buttons.Children.Clear();
                }
                try
                {
                    mdiChild.buttonsPanel.Children.Add(mdiChild.minimizeButton);
                    mdiChild.buttonsPanel.Children.Add(mdiChild.maximizeButton);
                    mdiChild.buttonsPanel.Children.Add(mdiChild.closeButton);
                }
                catch { }
            }

            if (previousWindowState == WindowState.Minimized)
            {
                mdiChild.minimizedPosition = mdiChild.Position;
            }

            switch (windowState)
            {
            case WindowState.Normal:
            {
                mdiChild.Position = new Point(mdiChild.originalDimension.X, mdiChild.originalDimension.Y);

                if (mdiChild._minimizedWidth > 0 && mdiChild._minimizedHeight > 0)
                {
                    mdiChild.MinWidth  = mdiChild._minimizedWidth;
                    mdiChild.MinHeight = mdiChild._minimizedHeight;
                }

                mdiChild.Width  = mdiChild.originalDimension.Width;
                mdiChild.Height = mdiChild.originalDimension.Height;
            }
            break;

            case WindowState.Minimized:
            {
                if (previousWindowState == WindowState.Normal)
                {
                    mdiChild.originalDimension = new Rect(mdiChild.Position.X, mdiChild.Position.Y, mdiChild.ActualWidth, mdiChild.ActualHeight);
                }

                //double newLeft, newTop;
                //if (mdiChild.minimizedPosition.X >= 0 || mdiChild.minimizedPosition.Y >= 0)
                //{
                //    newLeft = mdiChild.minimizedPosition.X;
                //    newTop = mdiChild.minimizedPosition.Y;
                //}
                //else
                //{
                //    int minimizedWindows = 0;
                //    for (int i = 0; i < mdiChild.Container.Children.Count; i++)
                //        if (mdiChild.Container.Children[i] != mdiChild && mdiChild.Container.Children[i].WindowState == WindowState.Minimized)
                //            minimizedWindows++;
                //    int capacity = Convert.ToInt32(mdiChild.Container.InnerWidth) / mdiChild.MinimizedWidth,
                //        row = minimizedWindows / capacity + 1,
                //        col = minimizedWindows % capacity;
                //    newTop = mdiChild.Container.InnerHeight - mdiChild.MinimizedHeight * row;
                //    newLeft = mdiChild.MinimizedWidth * col;
                //}

                //mdiChild.Position = new Point(newLeft, newTop);

                int minimizedWindows = 0;
                for (int i = 0; i < mdiChild.Container.Children.Count; i++)
                {
                    if (mdiChild.Container.Children[i] != mdiChild && mdiChild.Container.Children[i].WindowState == WindowState.Minimized)
                    {
                        minimizedWindows++;
                    }
                }
                int cols  = (int)(mdiChild.Container.InnerWidth / mdiChild.MinimizedWidth);
                int count = 0;
                foreach (var item in mdiChild.Container.Children)
                {
                    if (item.WindowState == WindowState.Minimized)
                    {
                        item.Position = new Point((int)(count % cols) * item.MinimizedWidth, mdiChild.Container.InnerHeight - ((int)((int)(count / cols) + 1)) * item.MinimizedHeight);
                        count++;
                    }
                }

                mdiChild._minimizedWidth  = (int)mdiChild.MinWidth;
                mdiChild._minimizedHeight = (int)mdiChild.MinHeight;

                mdiChild.MinWidth  = mdiChild.MinimizedWidth;
                mdiChild.MinHeight = mdiChild.MinimizedHeight;

                mdiChild.Width  = mdiChild.MinimizedWidth;
                mdiChild.Height = mdiChild.MinimizedHeight;
            }
            break;

            case WindowState.Maximized:
            {
                if (previousWindowState == WindowState.Normal)
                {
                    mdiChild.originalDimension = new Rect(mdiChild.Position.X, mdiChild.Position.Y, mdiChild.ActualWidth, mdiChild.ActualHeight);
                }

                try
                {
                    StackPanel sp = new StackPanel {
                        Orientation = Orientation.Horizontal
                    };
                    mdiChild.Buttons = sp;
                    if (mdiChild.Container.Theme != ThemeType.Metro)
                    {
                        if (mdiChild.buttonsPanel != null)
                        {
                            mdiChild.buttonsPanel.Children.Clear();
                        }
                        sp.Children.Add(mdiChild.minimizeButton);
                        sp.Children.Add(mdiChild.maximizeButton);
                        sp.Children.Add(mdiChild.closeButton);
                    }
                }
                catch { }

                mdiChild.Position = new Point(0, 0);

                if (mdiChild._minimizedWidth > 0 && mdiChild._minimizedHeight > 0)
                {
                    mdiChild.MinWidth  = mdiChild._minimizedWidth;
                    mdiChild.MinHeight = mdiChild._minimizedHeight;
                }

                mdiChild.Width  = mdiChild.Container.InnerWidth;
                mdiChild.Height = mdiChild.Container.InnerHeight;

                if (mdiChild.Container.AllowWindowStateMax)
                {
                    MdiContainer mdiContainer = mdiChild.Container;
                    mdiContainer.AllowWindowStateMax = false;

                    for (int i = 0; i < mdiContainer.Children.Count; i++)
                    {
                        if (mdiContainer.Children[i] != mdiChild)
                        {
                            if (mdiContainer.Children[i].WindowState == WindowState.Normal &&
                                mdiContainer.Children[i].MaximizeBox)
                            {
                                mdiContainer.Children[i].WindowState = WindowState.Maximized;
                            }
                            else if (mdiContainer.Children[i].WindowState == WindowState.Maximized)
                            {
                                mdiContainer.Children[i].Height = mdiContainer.InnerHeight;
                            }
                        }
                    }

                    ScrollViewer sv = (ScrollViewer)((Grid)mdiContainer.Content).Children[1];
                    sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden;
                    sv.VerticalScrollBarVisibility   = ScrollBarVisibility.Hidden;

                    mdiChild.Focus();
                    mdiContainer.InvalidateSize();
                    mdiContainer.AllowWindowStateMax = true;
                }
            }
            break;
            }
            mdiChild.RaiseEvent(new RoutedEventArgs(WindowStateChangedEvent));
        }
Beispiel #26
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Main_Window = ((XMonitor_GUI.MainWindow)(target));

            #line 14 "..\..\MainWindow.xaml"
                this.Main_Window.Closing += new System.ComponentModel.CancelEventHandler(this.MainWindowCosing);

            #line default
            #line hidden

            #line 15 "..\..\MainWindow.xaml"
                this.Main_Window.SizeChanged += new System.Windows.SizeChangedEventHandler(this.Window_SizeChanged);

            #line default
            #line hidden

            #line 15 "..\..\MainWindow.xaml"
                this.Main_Window.PreviewKeyDown += new System.Windows.Input.KeyEventHandler(this.Window_PreviewKeyDown);

            #line default
            #line hidden
                return;

            case 2:
                this.MainMap = ((GMap.NET.WindowsPresentation.GMapControl)(target));
                return;

            case 3:
                this.Copyright = ((System.Windows.Controls.Label)(target));
                return;

            case 4:
                this.BaseWidth = ((System.Windows.Controls.ColumnDefinition)(target));
                return;

            case 5:
                this.BaseColumn = ((System.Windows.Controls.ColumnDefinition)(target));
                return;

            case 6:
                this.BaseRow = ((System.Windows.Controls.RowDefinition)(target));
                return;

            case 7:
                this.BaseHeight = ((System.Windows.Controls.RowDefinition)(target));
                return;

            case 8:
                this.LeftsideArea = ((System.Windows.Controls.Canvas)(target));
                return;

            case 9:
                this.TopArea = ((System.Windows.Controls.Canvas)(target));
                return;

            case 10:
                this.RightsideArea = ((System.Windows.Controls.Canvas)(target));
                return;

            case 11:
                this.TimerName = ((ControlsUnit.TimerView)(target));
                return;

            case 12:
                this.BatteryName = ((ControlsUnit.BatteryView)(target));
                return;

            case 13:
                this.GPSName = ((ControlsUnit.GPSView)(target));
                return;

            case 14:
                this.LinkName = ((ControlsUnit.LinkView)(target));
                return;

            case 15:
                this.RCrecName = ((ControlsUnit.RCrecView)(target));
                return;

            case 16:
                this.ControlModeName = ((ControlsUnit.ControlModeView)(target));
                return;

            case 17:
                this.FlightModeName = ((ControlsUnit.FlightModeView)(target));
                return;

            case 18:
                this.SpeedName = ((ControlsUnit.SpeedView)(target));
                return;

            case 19:
                this.Altitude = ((ControlsUnit.UAVAltitude)(target));
                return;

            case 20:
                this.OpenFlightPlan = ((System.Windows.Controls.MenuItem)(target));

            #line 112 "..\..\MainWindow.xaml"
                this.OpenFlightPlan.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click_FplaOpen);

            #line default
            #line hidden
                return;

            case 21:
                this.CloseFlightPlan = ((System.Windows.Controls.MenuItem)(target));

            #line 113 "..\..\MainWindow.xaml"
                this.CloseFlightPlan.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click_FplaClose);

            #line default
            #line hidden
                return;

            case 22:
                this.SendFlightPlan = ((System.Windows.Controls.MenuItem)(target));

            #line 114 "..\..\MainWindow.xaml"
                this.SendFlightPlan.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click_FplaTrans);

            #line default
            #line hidden
                return;

            case 23:
                this.ListFlightPlan = ((System.Windows.Controls.MenuItem)(target));

            #line 115 "..\..\MainWindow.xaml"
                this.ListFlightPlan.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click_FplaData);

            #line default
            #line hidden
                return;

            case 24:
                this.OpenFlightLog = ((System.Windows.Controls.MenuItem)(target));

            #line 117 "..\..\MainWindow.xaml"
                this.OpenFlightLog.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click_FlogOpen);

            #line default
            #line hidden
                return;

            case 25:
                this.CloseFlightLog = ((System.Windows.Controls.MenuItem)(target));

            #line 118 "..\..\MainWindow.xaml"
                this.CloseFlightLog.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click_FlogClose);

            #line default
            #line hidden
                return;

            case 26:
                this.SaveFlightLog = ((System.Windows.Controls.MenuItem)(target));

            #line 119 "..\..\MainWindow.xaml"
                this.SaveFlightLog.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click_FlogSave);

            #line default
            #line hidden
                return;

            case 27:
                this.OpenExplorer = ((System.Windows.Controls.MenuItem)(target));

            #line 120 "..\..\MainWindow.xaml"
                this.OpenExplorer.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click_OpenExplorer);

            #line default
            #line hidden
                return;

            case 28:

            #line 123 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click_UAVData);

            #line default
            #line hidden
                return;

            case 29:

            #line 124 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click_Setting);

            #line default
            #line hidden
                return;

            case 30:

            #line 125 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click_Manual);

            #line default
            #line hidden
                return;

            case 31:

            #line 126 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click_About);

            #line default
            #line hidden
                return;

            case 32:

            #line 128 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click_End);

            #line default
            #line hidden
                return;

            case 33:
                this.MarkerIcon = ((System.Windows.Controls.Canvas)(target));

            #line 134 "..\..\MainWindow.xaml"
                this.MarkerIcon.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MarkerIcon_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 34:
                this.TouchIcon = ((System.Windows.Controls.Canvas)(target));

            #line 139 "..\..\MainWindow.xaml"
                this.TouchIcon.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.TouchIconMouse);

            #line default
            #line hidden
                return;

            case 35:
                this.SettingIcon = ((System.Windows.Controls.Canvas)(target));

            #line 140 "..\..\MainWindow.xaml"
                this.SettingIcon.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.SettingIconMouseLeftButton);

            #line default
            #line hidden
                return;

            case 36:
                this.GridLine = ((System.Windows.Controls.Border)(target));
                return;

            case 37:
                this.canvas = ((System.Windows.Controls.Canvas)(target));

            #line 152 "..\..\MainWindow.xaml"
                this.canvas.Loaded += new System.Windows.RoutedEventHandler(this.canvas_Loaded);

            #line default
            #line hidden

            #line 153 "..\..\MainWindow.xaml"
                this.canvas.SizeChanged += new System.Windows.SizeChangedEventHandler(this.canvas_SizeChanged);

            #line default
            #line hidden
                return;

            case 38:
                this.Arrow = ((System.Windows.Controls.Grid)(target));
                return;

            case 39:
                this.DisArrow = ((System.Windows.Controls.Grid)(target));
                return;

            case 40:
                this.Dis1 = ((System.Windows.Shapes.Line)(target));
                return;

            case 41:
                this.Dis2 = ((System.Windows.Shapes.Line)(target));
                return;

            case 42:
                this.Dis3 = ((System.Windows.Shapes.Line)(target));
                return;

            case 43:
                this.DisName = ((System.Windows.Controls.Label)(target));
                return;

            case 44:
                this.User1 = ((System.Windows.Controls.Label)(target));
                return;

            case 45:
                this.User2 = ((System.Windows.Controls.Label)(target));
                return;

            case 46:
                this.User3 = ((System.Windows.Controls.Label)(target));
                return;

            case 47:
                this.User4 = ((System.Windows.Controls.Label)(target));
                return;

            case 48:
                this.PosSet = ((System.Windows.Controls.Label)(target));
                return;

            case 49:
                this.PosSpd = ((System.Windows.Controls.Label)(target));

            #line 186 "..\..\MainWindow.xaml"
                this.PosSpd.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.PosSpd_MouseDoubleClick);

            #line default
            #line hidden
                return;

            case 50:
                this.PosClear = ((System.Windows.Controls.Label)(target));
                return;

            case 51:
                this.MapRotate = ((ControlsUnit.RotateAzimuthal)(target));

            #line 188 "..\..\MainWindow.xaml"
                this.MapRotate.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.RotateAzimuthalValueChanged);

            #line default
            #line hidden

            #line 188 "..\..\MainWindow.xaml"
                this.MapRotate.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MapRotate_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 52:
                this.Container = ((WPF.MDI.MdiContainer)(target));

            #line 195 "..\..\MainWindow.xaml"
                this.Container.SizeChanged += new System.Windows.SizeChangedEventHandler(this.OptionAreaSizeChanged);

            #line default
            #line hidden
                return;

            case 53:
                this.cm = ((System.Windows.Controls.ContextMenu)(target));
                return;

            case 54:

            #line 198 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.WaypointWindow_Click);

            #line default
            #line hidden
                return;

            case 55:

            #line 199 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChartWindow_Click);

            #line default
            #line hidden
                return;

            case 56:

            #line 200 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ApplicationWindow_Click);

            #line default
            #line hidden
                return;

            case 57:

            #line 201 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ModelWindow_Click);

            #line default
            #line hidden
                return;

            case 58:

            #line 203 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Cascade_Click);

            #line default
            #line hidden
                return;

            case 59:

            #line 204 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Horizontally_Click);

            #line default
            #line hidden
                return;

            case 60:

            #line 205 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Vertically_Click);

            #line default
            #line hidden
                return;

            case 61:

            #line 207 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.CloseAll_Click);

            #line default
            #line hidden
                return;

            case 62:
                this.OptionGridSplitter = ((System.Windows.Controls.GridSplitter)(target));
                return;

            case 63:
                this.ZoomName = ((ControlsUnit.MapZoom)(target));

            #line 221 "..\..\MainWindow.xaml"
                this.ZoomName.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.MapZoomChanged);

            #line default
            #line hidden
                return;

            case 64:
                this.AlertMessageName = ((ControlsUnit.AlarmMessage)(target));
                return;

            case 65:
                this.PlayerSlide = ((ControlsUnit.TrimmingSlide)(target));

            #line 231 "..\..\MainWindow.xaml"
                this.PlayerSlide.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.PlayerSlide_ValueChanged);

            #line default
            #line hidden
                return;

            case 66:
                this.test = ((System.Windows.Controls.TextBox)(target));
                return;

            case 67:
                this.TransmitWindow = ((System.Windows.Controls.Grid)(target));
                return;

            case 68:

            #line 257 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.TransmitClosingButton_Click);

            #line default
            #line hidden
                return;

            case 69:
                this.TransmitBar = ((System.Windows.Controls.ProgressBar)(target));
                return;

            case 70:

            #line 261 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.TransmitButton_Click);

            #line default
            #line hidden
                return;

            case 71:

            #line 262 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.TransmitCancelButton_Click);

            #line default
            #line hidden
                return;

            case 72:
                this.WaitWindow = ((System.Windows.Controls.Label)(target));
                return;

            case 73:
                this.TopCanvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 74:
                this.VersionName = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 75:

            #line 283 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.MinWindowButton_Click);

            #line default
            #line hidden
                return;

            case 76:

            #line 284 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.MaxWindowButton_Click);

            #line default
            #line hidden
                return;

            case 77:

            #line 285 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.DefaultWindowButton_Click);

            #line default
            #line hidden
                return;

            case 78:

            #line 286 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.CloseButton_Click);

            #line default
            #line hidden
                return;

            case 79:
                this.me1 = ((System.Windows.Controls.MediaElement)(target));
                return;

            case 80:
                this.me2 = ((System.Windows.Controls.MediaElement)(target));
                return;

            case 81:
                this.SendSound = ((System.Windows.Controls.MediaElement)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #27
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.menuList = ((System.Windows.Controls.Menu)(target));
                return;

            case 2:
                this.newPermit = ((System.Windows.Controls.MenuItem)(target));

            #line 39 "..\..\MainWindow.xaml"
                this.newPermit.Click += new System.Windows.RoutedEventHandler(this.newPermit_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.allPermits = ((System.Windows.Controls.MenuItem)(target));

            #line 40 "..\..\MainWindow.xaml"
                this.allPermits.Click += new System.Windows.RoutedEventHandler(this.allPermits_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.ApprovedPermits = ((System.Windows.Controls.MenuItem)(target));

            #line 41 "..\..\MainWindow.xaml"
                this.ApprovedPermits.Click += new System.Windows.RoutedEventHandler(this.ApprovedPermits_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.Settings = ((System.Windows.Controls.MenuItem)(target));

            #line 42 "..\..\MainWindow.xaml"
                this.Settings.Click += new System.Windows.RoutedEventHandler(this.Settings_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.Alias = ((System.Windows.Controls.MenuItem)(target));

            #line 43 "..\..\MainWindow.xaml"
                this.Alias.Click += new System.Windows.RoutedEventHandler(this.ContractorAlias_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.PermitFee = ((System.Windows.Controls.MenuItem)(target));

            #line 44 "..\..\MainWindow.xaml"
                this.PermitFee.Click += new System.Windows.RoutedEventHandler(this.PermitFee_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.tabAbout = ((System.Windows.Controls.MenuItem)(target));

            #line 45 "..\..\MainWindow.xaml"
                this.tabAbout.Click += new System.Windows.RoutedEventHandler(this.tabAbout_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.Image = ((System.Windows.Controls.Image)(target));
                return;

            case 10:
                this.MainMdiContainer = ((WPF.MDI.MdiContainer)(target));

            #line 58 "..\..\MainWindow.xaml"
                this.MainMdiContainer.Loaded += new System.Windows.RoutedEventHandler(this.MainMdiContainer_Loaded);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #28
0
        /// <summary>
        /// Dependency property event once the windows state value has changed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void WindowStateValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            MdiChild     mdiChild     = (MdiChild)sender;
            MdiContainer mdiContainer = mdiChild.Container;

            WindowState previousWindowState = (WindowState)e.OldValue;
            WindowState windowState         = (WindowState)e.NewValue;

            if (mdiChild.Container == null ||
                previousWindowState == windowState)
            {
                return;
            }

            if (previousWindowState == WindowState.Maximized)
            {
                if (mdiContainer.ActiveMdiChild.WindowState != WindowState.Maximized)
                {
                    for (int i = 0; i < mdiContainer.Children.Count; i++)
                    {
                        if (mdiContainer.Children[i] != mdiChild &&
                            mdiContainer.Children[i].WindowState == WindowState.Maximized &&
                            mdiContainer.Children[i].MaximizeBox)
                        {
                            mdiContainer.Children[i].WindowState = WindowState.Normal;
                        }
                    }

                    ScrollViewer sv = (ScrollViewer)((Grid)mdiContainer.Content).Children[1];
                    sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
                    sv.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;
                }

                mdiChild.Buttons.Children.Clear();
                mdiChild.Buttons = null;
                mdiChild.buttonsPanel.Children.Add(mdiChild.minimizeButton);
                mdiChild.buttonsPanel.Children.Add(mdiChild.maximizeButton);
                mdiChild.buttonsPanel.Children.Add(mdiChild.closeButton);
            }

            if (previousWindowState == WindowState.Minimized)
            {
                mdiChild.minimizedPosition = mdiChild.Position;
            }

            switch (windowState)
            {
            case WindowState.Normal:
            {
                mdiChild.Position = new Point(mdiChild.originalDimension.X, mdiChild.originalDimension.Y);
                mdiChild.Width    = mdiChild.originalDimension.Width;
                mdiChild.Height   = mdiChild.originalDimension.Height;
            }
            break;

            case WindowState.Minimized:
            {
                if (previousWindowState == WindowState.Normal)
                {
                    mdiChild.originalDimension = new Rect(mdiChild.Position.X, mdiChild.Position.Y, mdiChild.ActualWidth, mdiChild.ActualHeight);
                }

                double newLeft, newTop;
                if (mdiChild.minimizedPosition.X >= 0 || mdiChild.minimizedPosition.Y >= 0)
                {
                    newLeft = mdiChild.minimizedPosition.X;
                    newTop  = mdiChild.minimizedPosition.Y;
                }
                else
                {
                    List <Rect> minimizedWindows = new List <Rect>();
                    for (int i = 0; i < mdiContainer.Children.Count; i++)
                    {
                        MdiChild child = mdiContainer.Children[i];
                        if (child != mdiChild &&
                            child.WindowState == WindowState.Minimized)
                        {
                            minimizedWindows.Add(new Rect(child.Position.X, mdiContainer.InnerHeight - child.Position.Y, child.Width, child.Height));
                        }
                    }
                    Rect newWindowPlace;
                    bool occupied = true;
                    int  count    = 0,
                         capacity = Convert.ToInt32(mdiContainer.ActualWidth) / MdiChild.MinimizedWidth;
                    do
                    {
                        int row = count / capacity + 1,
                            col = count % capacity;
                        newTop  = MdiChild.MinimizedHeight * row;
                        newLeft = MdiChild.MinimizedWidth * col;

                        newWindowPlace = new Rect(newLeft, newTop, MdiChild.MinimizedWidth, MdiChild.MinimizedHeight);
                        occupied       = false;
                        foreach (Rect rect in minimizedWindows)
                        {
                            Rect intersection = rect;
                            intersection.Intersect(newWindowPlace);
                            if (intersection != Rect.Empty && intersection.Width > 0 && intersection.Height > 0)
                            {
                                occupied = true;
                                break;
                            }
                        }
                        count++;

                        // TODO: handle negative Canvas coordinates somehow.
                        if (newTop < 0)
                        {
                            // ugly workaround for now.
                            newTop   = 0;
                            occupied = false;
                        }
                    } while (occupied);

                    newTop = mdiContainer.InnerHeight - newTop;
                }

                mdiChild.Position = new Point(newLeft, newTop);

                mdiChild.Width  = MdiChild.MinimizedWidth;
                mdiChild.Height = MdiChild.MinimizedHeight;
            }
            break;

            case WindowState.Maximized:
            {
                if (previousWindowState == WindowState.Normal)
                {
                    mdiChild.originalDimension = new Rect(mdiChild.Position.X, mdiChild.Position.Y, mdiChild.ActualWidth, mdiChild.ActualHeight);
                }
                mdiChild.NonMaximizedState = previousWindowState;

                mdiChild.buttonsPanel.Children.Clear();
                StackPanel sp = new StackPanel
                {
                    Orientation = Orientation.Horizontal
                };
                sp.Children.Add(mdiChild.minimizeButton);
                sp.Children.Add(mdiChild.maximizeButton);
                sp.Children.Add(mdiChild.closeButton);
                mdiChild.Buttons = sp;

                mdiChild.Position = new Point(0, 0);
                mdiChild.Width    = mdiContainer.ActualWidth;
                mdiChild.Height   = mdiContainer.InnerHeight - 2;       // ContentBorder.BorderThickness="1" in template

                ScrollViewer sv = (ScrollViewer)((Grid)mdiContainer.Content).Children[1];
                sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden;
                sv.VerticalScrollBarVisibility   = ScrollBarVisibility.Hidden;
            }
            break;
            }
            if (mdiContainer.ActiveMdiChild == mdiChild)
            {
                mdiContainer.Buttons = mdiChild.Buttons;
            }
            mdiContainer.InvalidateSize();
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.RootGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 2:
     this.radRibbonBar1 = ((Telerik.Windows.Controls.RadRibbonView)(target));
     return;
     case 3:
     this.tabHome = ((Telerik.Windows.Controls.RadRibbonTab)(target));
     return;
     case 4:
     this.grpGeneral = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
     return;
     case 5:
     this.btnHomePage = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 6:
     this.btnDashboard = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 7:
     this.grpBusinessPartner = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
     return;
     case 8:
     this.btnCustomer = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 9:
     this.btnVendor = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 10:
     this.tabIMS = ((Telerik.Windows.Controls.RadRibbonTab)(target));
     return;
     case 11:
     this.grpSales = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
     return;
     case 12:
     this.btnQuotes = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 13:
     this.btnNewOrder = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 14:
     this.btnSaleOrderList = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 15:
     this.btnRecentOrders = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 16:
     this.btnOpenOrders = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 17:
     this.btnInvoicedOrders = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 18:
     this.btnPaidOrders = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 19:
     this.grpPurchasing = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
     return;
     case 20:
     this.btnPO = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 21:
     this.btnPOL = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 22:
     this.btnRPO = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 23:
     this.btnOPO = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 24:
     this.btnRecievePO = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 25:
     this.btnPaidPO = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 26:
     this.Customergroup = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
     return;
     case 27:
     this.btnProductPricing = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 28:
     this.btnCurrentStock = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 29:
     this.btnAdjustStock = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 30:
     this.TabRecharge = ((Telerik.Windows.Controls.RadRibbonTab)(target));
     return;
     case 31:
     this.rechargeGroup = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
     return;
     case 32:
     this.btnRechrge = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 33:
     this.TabExpenses = ((Telerik.Windows.Controls.RadRibbonTab)(target));
     return;
     case 34:
     this.ExpensesGroup = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
     return;
     case 35:
     this.btnExpenses = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 36:
     this.SetupsTab = ((Telerik.Windows.Controls.RadRibbonTab)(target));
     return;
     case 37:
     this.setupgroup = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
     return;
     case 38:
     this.btnCompany = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     
     #line 488 "..\..\..\..\Views\RibbionControl.xaml"
     this.btnCompany.Click += new System.Windows.RoutedEventHandler(this.btnCompany_Click_1);
     
     #line default
     #line hidden
     return;
     case 39:
     this.btnProduct = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 40:
     this.btnProductCategory = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 41:
     this.reportsTab = ((Telerik.Windows.Controls.RadRibbonTab)(target));
     return;
     case 42:
     this.reportsgroup = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
     return;
     case 43:
     this.btnReport1 = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 44:
     this.btnReport2 = ((Telerik.Windows.Controls.RadRibbonButton)(target));
     return;
     case 45:
     this.MainMdiContainer = ((WPF.MDI.MdiContainer)(target));
     return;
     }
     this._contentLoaded = true;
 }
Beispiel #30
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.RootGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 2:
                this.radRibbonBar1 = ((Telerik.Windows.Controls.RadRibbonView)(target));
                return;

            case 3:
                this.tabHome = ((Telerik.Windows.Controls.RadRibbonTab)(target));
                return;

            case 4:
                this.grpGeneral = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
                return;

            case 5:
                this.btnHomePage = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 6:
                this.btnDashboard = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 7:
                this.grpBusinessPartner = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
                return;

            case 8:
                this.btnCustomer = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 9:
                this.btnVendor = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 10:
                this.tabIMS = ((Telerik.Windows.Controls.RadRibbonTab)(target));
                return;

            case 11:
                this.grpSales = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
                return;

            case 12:
                this.btnQuotes = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 13:
                this.btnNewOrder = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 14:
                this.btnSaleOrderList = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 15:
                this.btnRecentOrders = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 16:
                this.btnOpenOrders = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 17:
                this.btnInvoicedOrders = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 18:
                this.btnPaidOrders = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 19:
                this.grpPurchasing = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
                return;

            case 20:
                this.btnPO = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 21:
                this.btnPOL = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 22:
                this.btnRPO = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 23:
                this.btnOPO = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 24:
                this.btnRecievePO = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 25:
                this.btnPaidPO = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 26:
                this.Customergroup = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
                return;

            case 27:
                this.btnProductPricing = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 28:
                this.btnCurrentStock = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 29:
                this.btnAdjustStock = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 30:
                this.TabRecharge = ((Telerik.Windows.Controls.RadRibbonTab)(target));
                return;

            case 31:
                this.rechargeGroup = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
                return;

            case 32:
                this.btnRechrge = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 33:
                this.TabExpenses = ((Telerik.Windows.Controls.RadRibbonTab)(target));
                return;

            case 34:
                this.ExpensesGroup = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
                return;

            case 35:
                this.btnExpenses = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 36:
                this.SetupsTab = ((Telerik.Windows.Controls.RadRibbonTab)(target));
                return;

            case 37:
                this.setupgroup = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
                return;

            case 38:
                this.btnCompany = ((Telerik.Windows.Controls.RadRibbonButton)(target));

            #line 488 "..\..\..\..\Views\RibbionControl.xaml"
                this.btnCompany.Click += new System.Windows.RoutedEventHandler(this.btnCompany_Click_1);

            #line default
            #line hidden
                return;

            case 39:
                this.btnProduct = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 40:
                this.btnProductCategory = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 41:
                this.reportsTab = ((Telerik.Windows.Controls.RadRibbonTab)(target));
                return;

            case 42:
                this.reportsgroup = ((Telerik.Windows.Controls.RadRibbonGroup)(target));
                return;

            case 43:
                this.btnReport1 = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 44:
                this.btnReport2 = ((Telerik.Windows.Controls.RadRibbonButton)(target));
                return;

            case 45:
                this.MainMdiContainer = ((WPF.MDI.MdiContainer)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #31
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.AppWindow = ((com.levivoir.rh.ui.MainWindow)(target));

            #line 7 "..\..\..\ui\MainWindow.xaml"
                this.AppWindow.Loaded += new System.Windows.RoutedEventHandler(this.AppWindow_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.MainDockPanel = ((System.Windows.Controls.DockPanel)(target));
                return;

            case 3:
                this.MainMenu = ((System.Windows.Controls.Menu)(target));
                return;

            case 4:
                this.miRestaurerDatabase = ((System.Windows.Controls.MenuItem)(target));

            #line 48 "..\..\..\ui\MainWindow.xaml"
                this.miRestaurerDatabase.Click += new System.Windows.RoutedEventHandler(this.miRestaurerDatabase_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.miBackupDatabase = ((System.Windows.Controls.MenuItem)(target));

            #line 49 "..\..\..\ui\MainWindow.xaml"
                this.miBackupDatabase.Click += new System.Windows.RoutedEventHandler(this.miBackupDatabase_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.miQuitter = ((System.Windows.Controls.MenuItem)(target));

            #line 50 "..\..\..\ui\MainWindow.xaml"
                this.miQuitter.Click += new System.Windows.RoutedEventHandler(this.miQuitter_Click);

            #line default
            #line hidden
                return;

            case 7:

            #line 53 "..\..\..\ui\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.EmbaucherEmploye_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.miModifierEmploye = ((System.Windows.Controls.MenuItem)(target));

            #line 54 "..\..\..\ui\MainWindow.xaml"
                this.miModifierEmploye.Click += new System.Windows.RoutedEventHandler(this.miModifierEmploye_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.miRechercheCode = ((System.Windows.Controls.MenuItem)(target));

            #line 56 "..\..\..\ui\MainWindow.xaml"
                this.miRechercheCode.Click += new System.Windows.RoutedEventHandler(this.miRechercheCode_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.miRechercheNom = ((System.Windows.Controls.MenuItem)(target));

            #line 57 "..\..\..\ui\MainWindow.xaml"
                this.miRechercheNom.Click += new System.Windows.RoutedEventHandler(this.miRechercheNom_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.miPromotionEmploye = ((System.Windows.Controls.MenuItem)(target));

            #line 61 "..\..\..\ui\MainWindow.xaml"
                this.miPromotionEmploye.Click += new System.Windows.RoutedEventHandler(this.miPromotionEmploye_Click);

            #line default
            #line hidden
                return;

            case 12:
                this.miTransfertEmploye = ((System.Windows.Controls.MenuItem)(target));

            #line 62 "..\..\..\ui\MainWindow.xaml"
                this.miTransfertEmploye.Click += new System.Windows.RoutedEventHandler(this.miTransfertEmploye_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.miRevocationEmploye = ((System.Windows.Controls.MenuItem)(target));

            #line 63 "..\..\..\ui\MainWindow.xaml"
                this.miRevocationEmploye.Click += new System.Windows.RoutedEventHandler(this.miRevocationEmploye_Click);

            #line default
            #line hidden
                return;

            case 14:
                this.miDemandeConge = ((System.Windows.Controls.MenuItem)(target));

            #line 66 "..\..\..\ui\MainWindow.xaml"
                this.miDemandeConge.Click += new System.Windows.RoutedEventHandler(this.miDemandeConge_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.miRetourConge = ((System.Windows.Controls.MenuItem)(target));

            #line 67 "..\..\..\ui\MainWindow.xaml"
                this.miRetourConge.Click += new System.Windows.RoutedEventHandler(this.miRetourConge_Click);

            #line default
            #line hidden
                return;

            case 16:
                this.miCalculerPayroll = ((System.Windows.Controls.MenuItem)(target));

            #line 70 "..\..\..\ui\MainWindow.xaml"
                this.miCalculerPayroll.Click += new System.Windows.RoutedEventHandler(this.miCalculerPayroll_Click);

            #line default
            #line hidden
                return;

            case 17:
                this.miEmployeStatut = ((System.Windows.Controls.MenuItem)(target));

            #line 74 "..\..\..\ui\MainWindow.xaml"
                this.miEmployeStatut.Click += new System.Windows.RoutedEventHandler(this.miEmployeStatut_Click);

            #line default
            #line hidden
                return;

            case 18:
                this.miComptageEmploye = ((System.Windows.Controls.MenuItem)(target));

            #line 75 "..\..\..\ui\MainWindow.xaml"
                this.miComptageEmploye.Click += new System.Windows.RoutedEventHandler(this.miComptageEmploye_Click);

            #line default
            #line hidden
                return;

            case 19:
                this.miContactEmploye = ((System.Windows.Controls.MenuItem)(target));

            #line 76 "..\..\..\ui\MainWindow.xaml"
                this.miContactEmploye.Click += new System.Windows.RoutedEventHandler(this.miContactEmploye_Click);

            #line default
            #line hidden
                return;

            case 20:
                this.miAnniversaire = ((System.Windows.Controls.MenuItem)(target));

            #line 77 "..\..\..\ui\MainWindow.xaml"
                this.miAnniversaire.Click += new System.Windows.RoutedEventHandler(this.miAnniversaire_Click);

            #line default
            #line hidden
                return;

            case 21:
                this.miPresenceJour = ((System.Windows.Controls.MenuItem)(target));

            #line 80 "..\..\..\ui\MainWindow.xaml"
                this.miPresenceJour.Click += new System.Windows.RoutedEventHandler(this.miPresenceJour_Click);

            #line default
            #line hidden
                return;

            case 22:
                this.miPresenceMois = ((System.Windows.Controls.MenuItem)(target));

            #line 81 "..\..\..\ui\MainWindow.xaml"
                this.miPresenceMois.Click += new System.Windows.RoutedEventHandler(this.miPresenceMois_Click);

            #line default
            #line hidden
                return;

            case 23:
                this.miPresenceAnnee = ((System.Windows.Controls.MenuItem)(target));

            #line 82 "..\..\..\ui\MainWindow.xaml"
                this.miPresenceAnnee.Click += new System.Windows.RoutedEventHandler(this.miPresenceAnnee_Click);

            #line default
            #line hidden
                return;

            case 24:
                this.miEmplois = ((System.Windows.Controls.MenuItem)(target));

            #line 84 "..\..\..\ui\MainWindow.xaml"
                this.miEmplois.Click += new System.Windows.RoutedEventHandler(this.miEmplois_Click);

            #line default
            #line hidden
                return;

            case 25:
                this.LeftGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 26:
                this.GridEmploye = ((System.Windows.Controls.Grid)(target));
                return;

            case 27:
                this.lbCodeEmploye = ((System.Windows.Controls.Label)(target));
                return;

            case 28:
                this.lbPrenom = ((System.Windows.Controls.Label)(target));
                return;

            case 29:
                this.lbNom = ((System.Windows.Controls.Label)(target));
                return;

            case 30:
                this.lbSexe = ((System.Windows.Controls.Label)(target));
                return;

            case 31:
                this.lbDepartement = ((System.Windows.Controls.Label)(target));
                return;

            case 32:
                this.lbPoste = ((System.Windows.Controls.Label)(target));
                return;

            case 33:
                this.MainMdiContainer = ((WPF.MDI.MdiContainer)(target));
                return;
            }
            this._contentLoaded = true;
        }