Exemplo n.º 1
0
		static bool IsVisibleInternal(ResourceData[] infos) => SaveWithPathResourcesCommand.IsVisibleInternal(infos);
Exemplo n.º 2
0
		static string GetHeaderInternal(ResourceData[] infos) => string.Format(dnSpy_AsmEditor_Resources.RawSaveResourcesSubDirectoriesCommand, infos.Length);
Exemplo n.º 3
0
		internal static bool IsVisibleInternal(ResourceData[] infos) => infos.Length > 1 && infos.Any(a => a.Name.Contains('/') || a.Name.Contains('\\'));
Exemplo n.º 4
0
		static string GetHeaderInternal(ResourceData[] infos) {
			if (infos.Length == 1)
				return string.Format(dnSpy_AsmEditor_Resources.RawSaveResourceCommand, UIUtilities.EscapeMenuItemHeader(infos[0].Name));
			return string.Format(dnSpy_AsmEditor_Resources.RawSaveResourcesCommand, infos.Length);
		}
Exemplo n.º 5
0
		static IEnumerable<Tuple<ResourceData, string>> GetFiles(ResourceData[] infos, bool useSubDirs) {
			if (infos.Length == 1) {
				var info = infos[0];
				var name = FixFileNamePart(GetFileName(info.Name));
				var dlg = new WF.SaveFileDialog {
					Filter = PickFilenameConstants.AnyFilenameFilter,
					RestoreDirectory = true,
					ValidateNames = true,
					FileName = name,
				};
				var ext = Path.GetExtension(name);
				dlg.DefaultExt = string.IsNullOrEmpty(ext) ? string.Empty : ext.Substring(1);
				if (dlg.ShowDialog() != WF.DialogResult.OK)
					yield break;
				yield return Tuple.Create(info, dlg.FileName);
			}
			else {
				var dlg = new WF.FolderBrowserDialog();
				if (dlg.ShowDialog() != WF.DialogResult.OK)
					yield break;
				string baseDir = dlg.SelectedPath;
				foreach (var info in infos) {
					var name = GetCleanedPath(info.Name, useSubDirs);
					var pathName = Path.Combine(baseDir, name);
					yield return Tuple.Create(info, pathName);
				}
			}
		}