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


C# ICommandExecutor.Execute方法代码示例

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


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

示例1: ExecuteCommands

 public void ExecuteCommands(ObjectTypeId objectTypeId, ICommandExecutor commandExecutor, CompositeCommandExecutionContext compositeContext)
 {
     foreach (var command in commands)
     {
         var context = compositeContext.GetFor(command.TargetObjectId);
         commandExecutor.Execute(command, context);
     }
 }
开发者ID:SzymonPobiega,项目名称:ReferenceDataManager,代码行数:8,代码来源:CommandsByObjectTypeCollection.cs

示例2: ExecuteCommands

 public void ExecuteCommands(ObjectId targetObjectId, ICommandExecutor commandExecutor, ICommandExecutionContext context)
 {
     List<AbstractCommand> commandsForObject;
     if (!commands.TryGetValue(targetObjectId, out commandsForObject))
     {
         return;
     }
     foreach (var command in commandsForObject)
     {
         commandExecutor.Execute(command, context);
     }
 }
开发者ID:SzymonPobiega,项目名称:ReferenceDataManager,代码行数:12,代码来源:CommandsByObjectCollection.cs

示例3: UpdateDigest

        /// <summary>
        /// Updates the <see cref="ManifestDigest"/> in an <see cref="Implementation"/>.
        /// </summary>
        /// <param name="implementation">The <see cref="Implementation"/> to update.</param>
        /// <param name="path">The path of the directory to generate the digest for.</param>
        /// <param name="handler">A callback object used when the the user is to be informed about progress.</param>
        /// <param name="executor">Used to apply properties in an undoable fashion.</param>
        /// <param name="keepDownloads"><see langword="true"/> to store the directory as an implementation in the default <see cref="IStore"/>.</param>
        /// <exception cref="OperationCanceledException">The user canceled the task.</exception>
        /// <exception cref="IOException">There is a problem access a temporary file.</exception>
        /// <exception cref="UnauthorizedAccessException">Read or write access to a temporary file is not permitted.</exception>
        /// <exception cref="DigestMismatchException">An existing digest does not match the newly calculated one.</exception>
        private static void UpdateDigest([NotNull] this Implementation implementation, [NotNull] string path, [NotNull] ITaskHandler handler, ICommandExecutor executor, bool keepDownloads = false)
        {
            var digest = GenerateDigest(path, handler, keepDownloads);

            if (implementation.ManifestDigest == default(ManifestDigest))
                executor.Execute(new SetValueCommand<ManifestDigest>(() => implementation.ManifestDigest, value => implementation.ManifestDigest = value, digest));
            else if (!digest.PartialEquals(implementation.ManifestDigest))
                throw new DigestMismatchException(implementation.ManifestDigest.ToString(), digest.ToString());
        }
开发者ID:modulexcite,项目名称:0install-win,代码行数:21,代码来源:ImplementationUtils.cs

示例4: ConvertSha256ToSha256New

        private static void ConvertSha256ToSha256New(Implementation implementation, ICommandExecutor executor)
        {
            if (string.IsNullOrEmpty(implementation.ManifestDigest.Sha256) || !string.IsNullOrEmpty(implementation.ManifestDigest.Sha256New)) return;

            var digest = new ManifestDigest(
                implementation.ManifestDigest.Sha1,
                implementation.ManifestDigest.Sha1New,
                implementation.ManifestDigest.Sha256,
                implementation.ManifestDigest.Sha256.Base16Decode().Base32Encode());

            executor.Execute(new SetValueCommand<ManifestDigest>(() => implementation.ManifestDigest, value => implementation.ManifestDigest = value, digest));
        }
开发者ID:modulexcite,项目名称:0install-win,代码行数:12,代码来源:ImplementationUtils.cs


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