Ejemplo n.º 1
0
        private void Current_Startup(object sender, StartupEventArgs e)
        {
            Rect        positionAndSize = PlotManager.UI.Properties.Settings.Default.MainWindowPosition;
            WindowState wState          = PlotManager.UI.Properties.Settings.Default.MainWindowState;

            wnd             = new wndMain();
            vmm             = new ViewModelMain();
            wnd.DataContext = vmm;

            wnd.Closing += Wnd_Closing;

            if ((positionAndSize.IsEmpty) ||
                (SystemParameters.VirtualScreenWidth < positionAndSize.Left) ||
                (SystemParameters.VirtualScreenHeight < positionAndSize.Top))
            {
                positionAndSize = new Rect(10, 10, 800, 600);
            }

            wnd.Left        = positionAndSize.Left;
            wnd.Top         = positionAndSize.Top;
            wnd.Width       = positionAndSize.Width;
            wnd.Height      = positionAndSize.Height;
            wnd.WindowState = wState;

            wnd.Show();
        }
Ejemplo n.º 2
0
 public void Show_Window_Main()
 {
     if (Window_Main == null)
     {
         Window_Main         = new wndMain(this);
         Window_Main.Closed += (s, args) => Window_Main = null;
     }
     Window_Main.Show();
     StaticWindowUtilities.EnsureVisibility(Window_Main);
 }
    public static void Main()
    {
        App app = new App();

        app.ShutdownMode = ShutdownMode.OnExplicitShutdown;
        wndMain wnd = new wndMain();

        wnd.Closed += Wnd_Closed;
        app.Run(wnd);
    }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructor for wndSearch
 /// </summary>
 public wndSearch(wndMain window)
 {
     try {
         InitializeComponent();
         PopulateDropdowns();
         PopulateDataGrid();
         mw = window;
     } catch (Exception ex) {
         throw new Exception(MethodInfo.GetCurrentMethod().DeclaringType.Name + " " + MethodInfo.GetCurrentMethod().Name + " -> " + ex.Message);
     }
 }
Ejemplo n.º 5
0
            /// <summary>
            /// 窗体大小发生改变时的事件处理
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            public void Window_SizeChanged(object sender, SizeChangedEventArgs e)
            {
                wndMain wnd = (wndMain)sender;

                wnd.UpdateLayout();
                if (wnd.Opacity == 0 && wnd.WindowState == WindowState.Normal)
                {
                    wnd.WindowState = WindowState.Minimized;
                }
                if (wnd.IsInformationsInitialized)
                {
                    AppInfoOperations.SetWidth(wnd.ActualWidth);
                    AppInfoOperations.SetHeight(wnd.ActualHeight);
                }
            }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes wndSearch
 /// </summary>
 public wndSearch(wndMain main)
 {
     try
     {
         InitializeComponent();
         mainWindow  = main;
         searchLogic = new clsSearchLogic();
         Start();
     }
     catch (Exception ex)
     {
         throw new Exception(MethodInfo.GetCurrentMethod().DeclaringType.Name + "." +
                             MethodInfo.GetCurrentMethod().Name + " ->" + ex.Message);
     }
 }
        /// <summary>
        /// Instantiates Item window
        /// </summary>
        /// <param name="main">Main window object</param>
        public wndItem(wndMain main)
        {
            try
            {
                InitializeComponent();
                mainWindow = main;
                clsIL      = new clsItemsLogic();

                dgItems.ItemsSource = clsIL.getItems();
            }
            catch (Exception ex)
            {
                HandleError(MethodInfo.GetCurrentMethod().DeclaringType.Name,
                            MethodInfo.GetCurrentMethod().Name, ex.Message);
            }
        }
Ejemplo n.º 8
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            GetResolution();
            Resize();

            wndMain2 = Application.Current.Windows.OfType <wndMain>().FirstOrDefault();

            if (taleManager.CurrentPageIndex == -1)
            {
                UpdateFrontPage();
            }
            else
            {
                UpdatePage();
            }
        }
    private static void Wnd_Closed(object sender, EventArgs e)
    {
        wndMain wnd = sender as wndMain;

        if (!string.IsNullOrEmpty(wnd.LangSwitch))
        {
            string lang = wnd.LangSwitch;
            wnd.Closed -= Wnd_Closed;
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang);
            wnd         = new wndMain();
            wnd.Closed += Wnd_Closed;
            wnd.Show();
        }
        else
        {
            App.Current.Shutdown();
        }
    }
Ejemplo n.º 10
0
        public AppRuntimeResourcesManager()
        {
            MyTaskbarManager = StaticTaskbarManager.getInstance(AppName);
            MyTaskbarManager.MyTaskbarIcon.PreviewTrayContextMenuOpen += Tb_PreviewTrayContextMenuOpen; //Taskbar ContextMenu binding
            MyTaskbarManager.MyTaskbarIcon.TrayMouseDoubleClick       += (s, args) => mniShowMainWindow_Click(s, args);

            LoadSettings();     //Load this first
            LoadSerializedGroupManager();
            LoadAllChampions(); //Load all champions (Riot api or local)

            MyLolClientProcessInvokeHandler = StaticPinvokeLolClient.GetInstance(MySettings, DisplayPopup);

            Window_Main         = new wndMain(this);
            Window_Main.Closed += (s, args) => Window_Main = null;

            Window_ClientOverlay = new wndClientOverload(MyGroupManager, MyLolClientProcessInvokeHandler, DisplayPopup);

            if (MySettings.StartLeagueWithEcs)
            {
                if (MyLolClientProcessInvokeHandler.ClientState == LolClientState.NoClient)
                {
                    if (MySettings.LeaguePath.Length > 0)
                    {
                        try {
                            FileInfo fi = new FileInfo(MySettings.LeaguePath);
                            Process.Start(new ProcessStartInfo(fi.FullName));
                        } catch (Exception) {
                        }
                    }
                }
            }

            if (MySettings.ShowMainFormOnLaunch)
            {
                Show_Window_Main();
            }
        }
Ejemplo n.º 11
0
        private void Tb_PreviewTrayContextMenuOpen(object sender, System.Windows.RoutedEventArgs e)
        {
            MyTaskbarManager.MyTaskbarIcon.ContextMenu = null;
            System.Windows.Controls.ContextMenu cm = new System.Windows.Controls.ContextMenu();

            if (Window_Main == null)
            {
                Window_Main         = new wndMain(this);
                Window_Main.Closed += (s, args) => Window_Main = null;
                MenuItem mniHideMainWindow = CreateMenuItem("Show", mniShowMainWindow_Click);
                cm.Items.Add(mniHideMainWindow);
            }
            else
            {
                MenuItem mniHideMainWindow = CreateMenuItem("Hide", mniHideMainWindow_Click);
                cm.Items.Add(mniHideMainWindow);
            }

            cm.Items.Add(new Separator());
            if (MyLolClientProcessInvokeHandler.ManuallyEnableTimerVisual)
            {
                MenuItem mniManuallyEnableTimer = CreateMenuItem("Start timer", mniManuallyEnableTimer_Click);
                cm.Items.Add(mniManuallyEnableTimer);
            }

            MenuItem mniContactCreator = CreateMenuItem("Contact Creator", mniContactCreator_Click);

            cm.Items.Add(mniContactCreator);

            cm.Items.Add(new Separator());

            MenuItem mniExit = CreateMenuItem("Exit", mniExit_Click);

            cm.Items.Add(mniExit);

            MyTaskbarManager.MyTaskbarIcon.ContextMenu = cm;
        }
Ejemplo n.º 12
0
        public static void btTalca_Click()
        {
            wndMain wndMain = new wndMain();

            wndMain.Minimizer();
        }
Ejemplo n.º 13
0
 /// <summary>
 /// the default constructor for this class
 /// </summary>
 /// <param name="m">the main window which created this window</param>
 public wndSearch(wndMain m)
 {
     main = m;
     InitializeComponent();
 }