private void EditFileCommandExecute(PackagePart file)
        {
            // before editing file, try to commit metadata pending changes to avoid data loss
            if (IsInEditMetadataMode)
            {
                var isMetadataValid = ApplyEditExecute();
                if (!isMetadataValid)
                {
                    UIServices.Show(Resources.EditFormHasInvalidInput, MessageLevel.Error);
                    return;
                }
            }

            FileEditorViewModel = new FileEditorViewModel(this, file as PackageFile);
        }
        private void EditFileCommandExecute(PackagePart file)
        {
            DiagnosticsClient.TrackEvent("PackageViewModel_EditFileCommandExecute");

            // before editing file, try to commit metadata pending changes to avoid data loss
            if (IsInEditMetadataMode)
            {
                var isMetadataValid = ApplyEditExecute();
                if (!isMetadataValid)
                {
                    UIServices.Show(Resources.EditFormHasInvalidInput, MessageLevel.Error);
                    return;
                }
            }

            if (file is PackageFile f)
            {
                FileEditorViewModel = new FileEditorViewModel(this, f, UIServices);
            }
            else
            {
                FileEditorViewModel = null;
            }
        }
Ejemplo n.º 3
0
 private void EditMetadataSourceCommandExecute()
 {
     FileEditorViewModel = new FileEditorViewModel(this, CreatePackageMetadataFile());
 }
        private void EditMetadataSourceCommandExecute()
        {
            DiagnosticsClient.TrackEvent("PackageViewModel_EditMetadataSourceCommandExecute");

            FileEditorViewModel = new FileEditorViewModel(this, CreatePackageMetadataFile(), UIServices);
        }
 private void EditMetadataSourceCommandExecute()
 {
     FileEditorViewModel = new FileEditorViewModel(this, CreatePackageMetadataFile());
 }
        private void EditFileCommandExecute(PackagePart file)
        {
            // before editing file, try to commit metadata pending changes to avoid data loss
            if (IsInEditMetadataMode)
            {
                bool isMetadataValid = ApplyEditExecute();
                if (!isMetadataValid)
                {
                    UIServices.Show(Resources.EditFormHasInvalidInput, MessageLevel.Error);
                    return;
                }
            }

            FileEditorViewModel = new FileEditorViewModel(this, file as PackageFile);
        }