MapView.MapViewPanel.Stop C# (CSharp) Method

Stop() public static method

public static Stop ( ) : void
return void
		public static void Stop()
		{
			if (timer == null)
			{
				timer = new Timer();
				timer.Interval = 100;
				timer.Tick += new EventHandler(tick);
				started = false;
			}

			if (started)
			{
				timer.Stop();
				started = false;
			}
		}

Usage Example

Exemplo n.º 1
0
        private void ChangeSetting(object sender, string key, object val)
        {
            GetSettings()[key].Value = val;
            switch (key)
            {
            case "Animation":
                onItem.Checked  = (bool)val;
                offItem.Checked = !onItem.Checked;

                if (onItem.Checked)
                {
                    MapViewPanel.Start();
                }
                else
                {
                    MapViewPanel.Stop();
                }
                break;

            case "Doors":
                if (MapViewPanel.Instance.Map != null)
                {
                    if ((bool)val)
                    {
                        foreach (XCTile t in MapViewPanel.Instance.Map.Tiles)
                        {
                            if (t.Info.UFODoor || t.Info.HumanDoor)
                            {
                                t.MakeAnimate();
                            }
                        }
                    }
                    else
                    {
                        foreach (XCTile t in MapViewPanel.Instance.Map.Tiles)
                        {
                            if (t.Info.UFODoor || t.Info.HumanDoor)
                            {
                                t.StopAnimate();
                            }
                        }
                    }
                }
                break;

            case "SaveWindowPositions":
                PathsEditor.SaveRegistry = (bool)val;
                break;

            case "UseGrid":
                MapViewPanel.Instance.MapView.UseGrid = (bool)val;
                break;

            case "GridColor":
                MapViewPanel.Instance.MapView.GridColor = (Color)val;
                break;

            case "GridLineColor":
                MapViewPanel.Instance.MapView.GridLineColor = (Color)val;
                break;

            case "GridLineWidth":
                MapViewPanel.Instance.MapView.GridLineWidth = (int)val;
                break;
            }
        }