当前位置: 首页>>代码示例>>C#>>正文


C# EditorContext.IsEditMode方法代码示例

本文整理汇总了C#中EditorContext.IsEditMode方法的典型用法代码示例。如果您正苦于以下问题:C# EditorContext.IsEditMode方法的具体用法?C# EditorContext.IsEditMode怎么用?C# EditorContext.IsEditMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EditorContext的用法示例。


在下文中一共展示了EditorContext.IsEditMode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitializePlatformCommands

        /// <summary>
        /// Initialize platform commands used by <see cref="EditorContext"/>.
        /// </summary>
        /// <param name="context">The editor context instance.</param>
        private void InitializePlatformCommands(EditorContext context)
        {
            Commands.OpenCommand =
                Command<object>.Create(
                    (parameter) => OnOpen(parameter),
                    (parameter) => context.IsEditMode());

            Commands.SaveCommand =
                Command.Create(
                    () => OnSave(),
                    () => context.IsEditMode());

            Commands.SaveAsCommand =
                Command.Create(
                    () => OnSaveAs(),
                    () => context.IsEditMode());

            Commands.ExportCommand =
                Command<object>.Create(
                    (item) => OnExport(item),
                    (item) => context.IsEditMode());

            Commands.ImportDataCommand =
                Command<object>.Create(
                    (item) => OnImportData(),
                    (item) => context.IsEditMode());

            Commands.ExportDataCommand =
                Command<object>.Create(
                    (item) => OnExportData(),
                    (item) => context.IsEditMode());

            Commands.UpdateDataCommand =
                Command<object>.Create(
                    (item) => OnUpdateData(),
                    (item) => context.IsEditMode());

            Commands.ImportStyleCommand =
                Command<object>.Create(
                    (item) => OnImportObject(item, ImportType.Style),
                    (item) => context.IsEditMode());

            Commands.ImportStylesCommand =
                Command<object>.Create(
                    (item) => OnImportObject(item, ImportType.Styles),
                    (item) => context.IsEditMode());

            Commands.ImportStyleLibraryCommand =
                Command<object>.Create(
                    (item) => OnImportObject(item, ImportType.StyleLibrary),
                    (item) => context.IsEditMode());

            Commands.ImportStyleLibrariesCommand =
                Command<object>.Create(
                    (item) => OnImportObject(item, ImportType.StyleLibraries),
                    (item) => context.IsEditMode());

            Commands.ImportGroupCommand =
                Command<object>.Create(
                    (item) => OnImportObject(item, ImportType.Group),
                    (item) => context.IsEditMode());

            Commands.ImportGroupsCommand =
                Command<object>.Create(
                    (item) => OnImportObject(item, ImportType.Groups),
                    (item) => context.IsEditMode());

            Commands.ImportGroupLibraryCommand =
                Command<object>.Create(
                    (item) => OnImportObject(item, ImportType.GroupLibrary),
                    (item) => context.IsEditMode());

            Commands.ImportGroupLibrariesCommand =
                Command<object>.Create(
                    (item) => OnImportObject(item, ImportType.GroupLibraries),
                    (item) => context.IsEditMode());

            Commands.ImportTemplateCommand =
                Command<object>.Create(
                    (item) => OnImportObject(item, ImportType.Template),
                    (item) => context.IsEditMode());

            Commands.ImportTemplatesCommand =
                Command<object>.Create(
                    (item) => OnImportObject(item, ImportType.Templates),
                    (item) => context.IsEditMode());

            Commands.ExportStyleCommand =
                Command<object>.Create(
                    (item) => OnExportObject(item, ExportType.Style),
                    (item) => context.IsEditMode());

            Commands.ExportStylesCommand =
                Command<object>.Create(
                    (item) => OnExportObject(item, ExportType.Styles),
                    (item) => context.IsEditMode());
//.........这里部分代码省略.........
开发者ID:hacklex,项目名称:Core2D,代码行数:101,代码来源:App.xaml.cs

示例2: InitializePlatformCommands

        /// <summary>
        /// Initialize platform commands used by <see cref="EditorContext"/>.
        /// </summary>
        /// <param name="context">The editor context instance.</param>
        private void InitializePlatformCommands(EditorContext context)
        {
            Commands.OpenCommand =
                Command<object>.Create(
                    async (parameter) => await OnOpen(parameter),
                    (parameter) => context.IsEditMode());

            Commands.SaveCommand =
                Command.Create(
                    async () => await OnSave(),
                    () => context.IsEditMode());

            Commands.SaveAsCommand =
                Command.Create(
                    async () => await OnSaveAs(),
                    () => context.IsEditMode());

            Commands.ExportCommand =
                Command<object>.Create(
                    async (item) => await OnExport(item),
                    (item) => context.IsEditMode());

            Commands.ImportDataCommand =
                Command<object>.Create(
                    async (item) => await OnImportData(),
                    (item) => context.IsEditMode());

            Commands.ExportDataCommand =
                Command<object>.Create(
                    async (item) => await OnExportData(),
                    (item) => context.IsEditMode());

            Commands.UpdateDataCommand =
                Command<object>.Create(
                    async (item) => await OnUpdateData(),
                    (item) => context.IsEditMode());

            Commands.ImportStyleCommand =
                Command<object>.Create(
                    async (item) => await OnImportObject(item, ImportType.Style),
                    (item) => context.IsEditMode());

            Commands.ImportStylesCommand =
                Command<object>.Create(
                    async (item) => await OnImportObject(item, ImportType.Styles),
                    (item) => context.IsEditMode());

            Commands.ImportStyleLibraryCommand =
                Command<object>.Create(
                    async (item) => await OnImportObject(item, ImportType.StyleLibrary),
                    (item) => context.IsEditMode());

            Commands.ImportStyleLibrariesCommand =
                Command<object>.Create(
                    async (item) => await OnImportObject(item, ImportType.StyleLibraries),
                    (item) => context.IsEditMode());

            Commands.ImportGroupCommand =
                Command<object>.Create(
                    async (item) => await OnImportObject(item, ImportType.Group),
                    (item) => context.IsEditMode());

            Commands.ImportGroupsCommand =
                Command<object>.Create(
                    async (item) => await OnImportObject(item, ImportType.Groups),
                    (item) => context.IsEditMode());

            Commands.ImportGroupLibraryCommand =
                Command<object>.Create(
                    async (item) => await OnImportObject(item, ImportType.GroupLibrary),
                    (item) => context.IsEditMode());

            Commands.ImportGroupLibrariesCommand =
                Command<object>.Create(
                    async (item) => await OnImportObject(item, ImportType.GroupLibraries),
                    (item) => context.IsEditMode());

            Commands.ImportTemplateCommand =
                Command<object>.Create(
                    async (item) => await OnImportObject(item, ImportType.Template),
                    (item) => context.IsEditMode());

            Commands.ImportTemplatesCommand =
                Command<object>.Create(
                    async (item) => await OnImportObject(item, ImportType.Templates),
                    (item) => context.IsEditMode());

            Commands.ExportStyleCommand =
                Command<object>.Create(
                    async (item) => await OnExportObject(item, ExportType.Style),
                    (item) => context.IsEditMode());

            Commands.ExportStylesCommand =
                Command<object>.Create(
                    async (item) => await OnExportObject(item, ExportType.Styles),
                    (item) => context.IsEditMode());
//.........这里部分代码省略.........
开发者ID:hacklex,项目名称:Core2D,代码行数:101,代码来源:App.paml.cs


注:本文中的EditorContext.IsEditMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。