Esempio n. 1
0
		void save()
		{
			FileLoader fl = new FileLoader();
			ProjectConfig pc = new ProjectConfig();
			
			pc.Name = txtName.Text;
			pc.XmlNameSpace = txtNS.Text;
			pc.GUID = _guid;
			pc.HelpFile = txtHelp.Text;
			pc.Icon = txtIcon.Text;
			if( ((Set)_project.Tag).Groups.Count > 0 )
				pc.Sets.Add( _project.Tag );
			if( ((Set)_file.Tag).Groups.Count > 0 )
				pc.Sets.Add( _file.Tag );
			if( ((Set)_folder.Tag).Groups.Count > 0 )
				pc.Sets.Add( _folder.Tag );
			
			fl.Save(_filename, pc);

			enableButtons();
		}
Esempio n. 2
0
		public void Save(string filename, ProjectConfig projConf)
		{
			System.Xml.XmlTextWriter xtw = new System.Xml.XmlTextWriter(filename, System.Text.Encoding.UTF8);
			xtw.Formatting = System.Xml.Formatting.Indented;
			xtw.Indentation = 1;
			xtw.IndentChar = '\t';
			XmlSerializerNamespaces xsn = new XmlSerializerNamespaces();
			xsn.Add("", "");
			XmlSerializer xs = new XmlSerializer(typeof(ProjectConfig));
			xs.Serialize(xtw, projConf, xsn);
			xtw.Close();
		}
Esempio n. 3
0
		private void show(ProjectConfig c)
		{
			setup();

			txtName.Text = c.Name;
			txtNS.Text = c.XmlNameSpace;
			txtIcon.Text = c.Icon;
			txtHelp.Text = c.HelpFile;
			_guid = c.GUID;
			
			foreach(Set s in c.Sets)
			{
				switch(s.Type)
				{
					case SetType.Project:
					{
						_project.Tag = s;
					}
						break;
					case SetType.Folder:
					{
						_folder.Tag = s;
					}
						break;
					case SetType.File:
					{
						_file.Tag = s;
					}
						break;
				}
			}

			displaySet(_project);
			displaySet(_folder);
			displaySet(_file);
		}