A wrapper around a Hashtable for Setting objects. Setting objects are intended to use with the CustomPropertyGrid
Exemplo n.º 1
0
		protected override void LoadDefaultSettings(Settings settings)
		{
			brushes = new Hashtable();

			ValueChangedDelegate bc = new ValueChangedDelegate(brushChanged);

			foreach(string s in Enum.GetNames(typeof(SpecialType)))
			{
				brushes[s]=new SolidBrush(TilePanel.tileTypes[(int)Enum.Parse(typeof(SpecialType),s)]);
				settings.AddSetting(s,((SolidBrush)brushes[s]).Color,"Color of specified tile type","TileView",bc,false,null);
			}
			TilePanel.Colors=brushes;
		}
Exemplo n.º 2
0
		public static void ReadSettings(VarCollection vc,KeyVal kv,Settings currSettings)
		{
			while((kv = vc.ReadLine())!=null)
			{
				switch(kv.Keyword)
				{
					case "}": //all done
						return;
					case "{"://starting out
						break;
					default:
						if(currSettings[kv.Keyword]!=null)
						{
							currSettings[kv.Keyword].Value=kv.Rest;
							currSettings[kv.Keyword].FireUpdate(kv.Keyword);
						}
						break;
				}
			}
		}
Exemplo n.º 3
0
		private void loadDefaults()
		{
			RegistryKey swKey = Registry.CurrentUser.CreateSubKey("Software");
			RegistryKey mvKey = swKey.CreateSubKey("MapView");
			RegistryKey riKey = mvKey.CreateSubKey("MainView");

			Left = (int)riKey.GetValue("Left", Left);
			Top = (int)riKey.GetValue("Top", Top);
			Width = (int)riKey.GetValue("Width", Width);
			Height = (int)riKey.GetValue("Height", Height);

			riKey.Close();
			mvKey.Close();
			swKey.Close();

			Settings settings = new Settings();
			//Color.FromArgb(175,69,100,129)
			ValueChangedDelegate eh = new ValueChangedDelegate(changeSetting);
			settings.AddSetting("Animation", MapViewPanel.Updating, "If true, the map will animate itself", "Main", eh, false, null);
			settings.AddSetting("Doors", false, "If true, the door tiles will animate themselves", "Main", eh, false, null);
			settings.AddSetting("SaveWindowPositions", PathsEditor.SaveRegistry, "If true, the window positions and sizes will be saved in the windows registry", "Main", eh, false, null);
			settings.AddSetting("UseGrid", MapViewPanel.Instance.View.UseGrid, "If true, a grid will show up at the current level of editing", "MapView", null, true, MapViewPanel.Instance.View);
			settings.AddSetting("GridColor", MapViewPanel.Instance.View.GridColor, "Color of the grid in (a,r,g,b) format", "MapView", null, true, MapViewPanel.Instance.View);
			settings.AddSetting("GridLineColor", MapViewPanel.Instance.View.GridLineColor, "Color of the lines that make up the grid", "MapView", null, true, MapViewPanel.Instance.View);
			settings.AddSetting("GridLineWidth", MapViewPanel.Instance.View.GridLineWidth, "Width of the grid lines in pixels", "MapView", null, true, MapViewPanel.Instance.View);
			settings.AddSetting("SelectGrayscale", MapViewPanel.Instance.View.SelectGrayscale, "If true, the selection area will show up in gray", "MapView", null, true, MapViewPanel.Instance.View);
			//settings.AddSetting("SaveOnExit",true,"If true, these settings will be saved on program exit","Main",null,false,null);
			settingsHash["MainWindow"] = settings;
		}
Exemplo n.º 4
0
		public PropertyForm(string typeName,Settings settings):this()
		{
			propertyGrid.TypeName=typeName;
			propertyGrid.Settings=settings;			
		}
Exemplo n.º 5
0
		protected virtual void LoadDefaultSettings(Settings settings){}
Exemplo n.º 6
0
		public Map_Observer_Form()
		{
			moreObservers = new Dictionary<string, IMap_Observer>();
			settings = new Settings();
			Load += new EventHandler(Map_Observer_Form_Load);			
		}