Пример #1
0
        public static string GetSaveTextureFileName(string name)
        {
            var saveMessage = new SaveFileDialogMessage
            {
                DefaultExtension = ".png",
                Filter = "Textures (*.png, *.bmp)|*.png;*.bmp|PNG files (*.png)|*.png|BMP files (*.bmp)|*.bmp",
                FileName = string.IsNullOrEmpty(name) ? null : System.IO.Path.GetFileNameWithoutExtension(name)
            };

            Messenger.Instance.Notify(saveMessage);

            return saveMessage.FileName;
        }
Пример #2
0
        private void OnSaveFileDialogMessage(SaveFileDialogMessage message)
        {
            Action action = () =>
            {
                var dialog = new SaveFileDialog();
                dialog.AddExtension = true;
                dialog.DefaultExt = message.DefaultExtension;
                dialog.Filter = message.Filter;
                dialog.FileName = message.FileName;

                if (dialog.ShowDialog(this) == true)
                {
                    message.FileName = dialog.FileName;
                }
                else
                {
                    message.FileName = null;
                }

            };

            this.Dispatcher.Invoke(action);
        }
Пример #3
0
        public static string GetSaveRhinoFileName(string name)
        {
            var saveMessage = new SaveFileDialogMessage
            {
                DefaultExtension = ".3dm",
                Filter = "3DM files (*.3dm)|*.3dm",
                FileName = string.IsNullOrEmpty(name) ? null : System.IO.Path.GetFileNameWithoutExtension(name)
            };

            Messenger.Instance.Notify(saveMessage);

            return saveMessage.FileName;
        }