コード例 #1
0
		public ResolverViewModel(ConfigStore left, ConfigStore right)
		{
			Left = left;
			Right = right;
		}
コード例 #2
0
		private void SaveConfigExecute(object sender)
		{
			var fileDialog = new SaveFileDialog();
			fileDialog.DefaultExt = ".msConfigStore";
			fileDialog.Filter = "ConfigFile (*.msConfigStore)|*.msConfigStore";
			fileDialog.CheckFileExists = false;
			var fileResult = fileDialog.ShowDialog();
			if (fileResult == DialogResult.OK)
			{
				var options = new ConfigStore();
				options.StoredPrcInfoModels = this.StoredProcs.ToList();
				options.Views = this.Views.Select(s => s.SourceElement).ToList();
				options.Tables = this.Tables.Select(s => s.SourceElement).ToList();

				options.GenerateConstructor = this.GenerateConstructor;
				options.GenerateForgeinKeyDeclarations = this.GenerateForgeinKeyDeclarations;
				options.GenerateCompilerHeader = this.GenerateCompilerHeader;
				options.GenerateConfigMethod = this.GenerateConfigMethod;
				options.Namespace = this.Namespace;
				options.TargetDir = this.TargetDir;

				var version = typeof(SharedMethods).Assembly.GetName().Version;
			
				options.Version = version.ToString();

				if (this.ConnectionString != null)
				{
					options.SourceConnectionString = this.ConnectionString;
				}

				if (File.Exists(fileDialog.FileName))
				{
					File.Delete(fileDialog.FileName);
				}
				using (var fs = fileDialog.OpenFile())
				{
					new BinaryFormatter().Serialize(fs, options);
				}
			}
		}