예제 #1
0
		private void LoadFiles()
		{
			gridControlFiles.DataSource = null;
			var files = new List<StateFile>();
			if (Directory.Exists(SavedFilesPath))
			{
				foreach (var filePath in Directory.GetFiles(SavedFilesPath, "*.xml"))
				{
					var file = new StateFile();
					file.FilePath = filePath;
					files.Add(file);
				}
			}
			files.Sort((x, y) => y.LastModified.CompareTo(x.LastModified));
			gridControlFiles.DataSource = files;

			gridControlTemplates.DataSource = null;
			var templates = new List<StateFile>();
			if (Directory.Exists(SavedTemplatesPath))
			{
				foreach (var filePath in Directory.GetFiles(SavedTemplatesPath, "*.xml"))
				{
					var file = new StateFile();
					file.FilePath = filePath;
					templates.Add(file);
				}
			}
			templates.Sort((x, y) => y.LastModified.CompareTo(x.LastModified));
			gridControlTemplates.DataSource = templates;
		}