Beispiel #1
0
        public wndMain(AppRuntimeResourcesManager arr) : this()
        {
            _ARR = arr;

            //Visualize the data
            DisplayGroups();
            DisplayAllChampionsMinusInSelectedGroupAccordingToFilter();

            _ARR.AllChampions.ChampionsChanged += AllChampions_ChampionsChanged;
            _ARR.MyGroupManager.GroupsChanged  += MyGroupManager_GroupsChanged;
            for (int i = 0; i < _ARR.MyGroupManager.GroupCount; i++)
            {
                _ARR.MyGroupManager.getGroup(i).NameChanged += MyGroupManager_ChampionList_NameChanged;
            }
            _ARR.MySettings.ApiKeyChanged += MySettings_ApiKeyChanged;

            StaticWindowUtilities.EnsureVisibility(this);
        }
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            if (SingleInstance.IsFirstInstance)
            {
                SingleInstance.ArgumentsReceived += SingleInstanceParameter;
                SingleInstance.ListenForArgumentsFromSuccessiveInstances();
                // Do your other app logic
                arr = new AppRuntimeResourcesManager();
            }
            else
            {
                //Tell it to show it's main window
                SingleInstance.PassArgumentsToFirstInstance("Show");
                // if there is an argument available, fire it
                if (e.Args.Length > 0)
                {
                    SingleInstance.PassArgumentsToFirstInstance(e.Args[0]);
                }

                Application.Current.Shutdown();
            }
        }