Beispiel #1
0
        /// <summary>
        /// Initialize platform specific commands used by <see cref="Editor"/>.
        /// </summary>
        /// <param name="editor">The editor instance.</param>
        public static void InitializeCommands(ProjectEditor editor)
        {
            Commands.OpenCommand =
                Command <string> .Create(
                    (path) => { },
                    (path) => editor.IsEditMode());

            Commands.SaveCommand =
                Command.Create(
                    () => { },
                    () => editor.IsEditMode());

            Commands.SaveAsCommand =
                Command.Create(
                    () => { },
                    () => editor.IsEditMode());

            Commands.ImportObjectCommand =
                Command <string> .Create(
                    (path) => { },
                    (path) => editor.IsEditMode());

            Commands.ExportObjectCommand =
                Command <object> .Create(
                    (item) => { },
                    (item) => editor.IsEditMode());

            Commands.ImportXamlCommand =
                Command <string> .Create(
                    (path) => { },
                    (path) => editor.IsEditMode());

            Commands.ExportXamlCommand =
                Command <object> .Create(
                    (item) => { },
                    (item) => editor.IsEditMode());

            Commands.ImportJsonCommand =
                Command <string> .Create(
                    (path) => { },
                    (path) => editor.IsEditMode());

            Commands.ExportJsonCommand =
                Command <object> .Create(
                    (item) => { },
                    (item) => editor.IsEditMode());

            Commands.ExportCommand =
                Command <object> .Create(
                    (item) => { },
                    (item) => editor.IsEditMode());

            Commands.ImportDataCommand =
                Command <XProject> .Create(
                    (project) => { },
                    (project) => editor.IsEditMode());

            Commands.ExportDataCommand =
                Command <XDatabase> .Create(
                    (db) => { },
                    (db) => editor.IsEditMode());

            Commands.UpdateDataCommand =
                Command <XDatabase> .Create(
                    (db) => { },
                    (db) => editor.IsEditMode());

            Commands.ZoomResetCommand =
                Command.Create(
                    () => editor.ResetZoom(),
                    () => true);

            Commands.ZoomAutoFitCommand =
                Command.Create(
                    () => editor.AutoFitZoom(),
                    () => true);

            Commands.LoadWindowLayoutCommand =
                Command.Create(
                    () => { },
                    () => true);

            Commands.SaveWindowLayoutCommand =
                Command.Create(
                    () => { },
                    () => true);

            Commands.ResetWindowLayoutCommand =
                Command.Create(
                    () => { },
                    () => true);

            Commands.ObjectBrowserCommand =
                Command.Create(
                    () => { },
                    () => true);

            Commands.DocumentViewerCommand =
                Command.Create(
                    () => { },
                    () => true);
        }