示例#1
0
        public MainWindow(Mutex mut, WelcomeWindow welWin, INetProto netJungleProto, MapMode selectedMapMode)
        {
            this.m = mut;
            this.currentMapMode = selectedMapMode;

            InitializeComponent();

            rowDefs = new Dictionary<MapMode, RowDefinition>
            {
                { MapMode.SUMMONERS_RIFT, summonersRiftRowDefinition }
            };

            this.welWin = welWin;
            this.netJungleProto = netJungleProto;

            netJungleProto.NewNetworkMessage += new NewNetworkMessageHandler(this.OnNetworkMessage);

            KeyboardManager.Instance.HotKeyPressed += new HotKeyPressedEventHandler(OnHotKeyHandlerWrapper);

            ResetState();

            if (netJungleProto is MockupNetProto)
            {
                nowPlayingRowDefinition.Height = new GridLength(0);
                statusRowDefinition.Height = new GridLength(0);
            }

            // okay, here goes nothing
            foreach (KeyValuePair<MapMode, RowDefinition> rowDefKvp in rowDefs)
            {
                if (rowDefKvp.Key != selectedMapMode)
                {
                    rowDefKvp.Value.Height = new GridLength(0);
                }
            }
        }
示例#2
0
        public void GoAway()
        {
            leagueOfLegendsWindowHndl = IntPtr.Zero;

            if (uiTimer != null)
                uiTimer.Stop();
            uiTimer = null;

            if (processingTimer != null)
                processingTimer.Stop();
            processingTimer = null;

            if (uiElements != null)
                uiElements.Clear();
            uiElements = null; // bye ;D

            if (netJungleProto != null)
                netJungleProto.NewNetworkMessage -= new NewNetworkMessageHandler(this.OnNetworkMessage);
            netJungleProto = null;

            KeyboardManager.Instance.HotKeyPressed -= new HotKeyPressedEventHandler(OnHotKeyHandlerWrapper);

            welWin = null;
        }