private void Import_Execute(object parameter)
        {
            ErpResourceViewModel resView = ((ErpResourceViewModel)parameter);
            var dlg = new CommonOpenFileDialog();

            dlg.Title          = "Select a folder to import the resource from:";
            dlg.IsFolderPicker = true;

            dlg.AddToMostRecentlyUsedList = false;
            dlg.AllowNonFileSystemItems   = false;
            dlg.EnsureFileExists          = true;
            dlg.EnsurePathExists          = true;
            dlg.EnsureReadOnly            = false;
            dlg.EnsureValidNames          = true;
            dlg.Multiselect    = false;
            dlg.ShowPlacesList = true;

            if (dlg.ShowDialog() == CommonFileDialogResult.Ok)
            {
                try
                {
                    string[] files = Directory.GetFiles(dlg.FileName, "*", SearchOption.AllDirectories);
                    resView.Resource.Import(files);
                    resView.UpdateSize();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Failed Importing!" + Environment.NewLine + Environment.NewLine +
                                    ex.Message, Properties.Resources.AppTitleLong, MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Beispiel #2
0
        public ErpTextureViewModel(ErpResourceViewModel resView)
        {
            this.resView = resView;
            _width       = 0;
            _height      = 0;

            _texArrayIndexDownCommand = new RelayCommand(TexArrayIndexDownCommand_Execute, TexArrayIndexDownCommand_CanExecute);
            _texArrayIndexUpCommand   = new RelayCommand(TexArrayIndexUpCommand_Execute, TexArrayIndexUpCommand_CanExecute);
        }
Beispiel #3
0
 public ErpPackageViewModel(ErpResourceViewModel resView, ErpFragment fragment)
 {
     this.resView = resView;
     Fragment     = fragment;
 }
Beispiel #4
0
 public ErpXmlFileViewModel(ErpResourceViewModel resView)
 {
     this.resView = resView;
 }
Beispiel #5
0
 public ErpPackageViewModel(ErpResourceViewModel resView)
 {
     this.resView = resView;
 }