Ejemplo n.º 1
0
		void Command_Files_Create_FromExpressions(CreateFilesDialog.Result result)
		{
			var variables = GetVariables();

			var filenameExpression = new NEExpression(result.FileName);
			var dataExpression = new NEExpression(result.Data);
			var resultCount = variables.ResultCount(filenameExpression, dataExpression);

			var filename = filenameExpression.EvaluateRows<string>(variables, resultCount);
			var data = dataExpression.EvaluateRows<string>(variables, resultCount);
			for (var ctr = 0; ctr < data.Count; ++ctr)
				File.WriteAllBytes(filename[ctr], Coder.StringToBytes(data[ctr], result.CodePage, true));
		}
Ejemplo n.º 2
0
		public static Result Run(Window parent, NEVariables variables, Coder.CodePage codePage)
		{
			var dialog = new CreateFilesDialog(variables, codePage) { Owner = parent };
			return dialog.ShowDialog() ? dialog.result : null;
		}