示例#1
0
        public static DialogResult ShowAsDialog(string title, string path, out string fileName)
        {
            AddRename dlg = new AddRename
            {
                ViewModel = {FileName = Path.GetFileName(path)},
                Title = title
            };

            bool? res = dlg.ShowDialog();
            fileName = null;

            if (res.GetValueOrDefault())
            {
                fileName = dlg.ViewModel.FileName;
                return System.Windows.Forms.DialogResult.OK;
            }

            return System.Windows.Forms.DialogResult.Cancel;
        }
示例#2
0
        public static DialogResult ShowAsDialog(string title, string path, out string fileName)
        {
            AddRename dlg = new AddRename
            {
                ViewModel = { FileName = Path.GetFileName(path) },
                Title     = title
            };

            bool?res = dlg.ShowDialog();

            fileName = null;

            if (res.GetValueOrDefault())
            {
                fileName = dlg.ViewModel.FileName;
                return(System.Windows.Forms.DialogResult.OK);
            }

            return(System.Windows.Forms.DialogResult.Cancel);
        }