sdk
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

开发者指南

上次更新日期 2024年10月25日

Studio 活动 SDK

UiPath Activities.API SDK 包托管在 官方 活动订阅源 (https://pkgs.dev.azure.com/uipath/Public.Feeds/_packaging/UiPath-Official/nuget/v3/index.json) 上。

其中,该包用于:

  • Building Workflow Analyzer Rules rules by adding descriptions, parameters, and integrating them in Studio's Workflow Analyzer Settings window.



  • Building Activities Project Settings by adding categories, sections, numeric input fields, combo boxes, and integrating them in the Activity Project Settings window in Studio, much like activities from UiPath packages.



  • Creating Custom Wizards and integrating them in the Studio ribbon.



    重要提示: UiPath Activities.API SDK 包必须用作自定义项目中的开发依赖项。 阅读有关 开发依赖项的更多信息。

如何使用 API

When the activities are loaded into Studio, a reference to IWorkflowDesignApi is provided in several ways:

  1. IRegisterMetadata 实施内部,添加 public void Initialize(object api) 方法。在活动加载过程中,系统将调用此方法,并且活动可以存储 api 参数供以后使用。
  2. Define a class that implements IRegisterWorkflowDesignApi. The method IRegisterWorkflowDesignApi.Initialize(IWorkflowDesignApi api) is called during the activity loading process, and the activity can store the api parameter for later usage. When using this method only Studio versions from 2019.6 are able to load your package.
  3. 通过调用 context.Services.GetService<IWorkflowDesignApi>() 获取 api 对象的引用,其中 contextSystem.Activities.Presentation.EditingContext,通常可供活动设计者访问。

设计功能键

It is important to perform a preliminary check against the DesignFeatureKeys to see if the needed feature keys are supported. For more information, see the DesignFeatureKeys.
为了检查功能,您需要在 IWorkflowDesignApi 引用上调用 HasFeature 方法,否则在较旧的 Studio 版本上,对相关 API 方法的调用可能会失败,并显示“ 缺少成员异常 ”或“ 缺少 方法异常”。
IWorkflowDesignApi studioActivitiesApi;
            // How to check for a feature.
            if (studioActivitiesApi.HasFeature(UiPath.Studio.Activities.Api.DesignFeatureKeys.Settings))
            {
                // Call Method or lambda that is using specific feature
                // This ensures that the code is JIT compiled only after the feature check
           }IWorkflowDesignApi studioActivitiesApi;
            // How to check for a feature.
            if (studioActivitiesApi.HasFeature(UiPath.Studio.Activities.Api.DesignFeatureKeys.Settings))
            {
                // Call Method or lambda that is using specific feature
                // This ensures that the code is JIT compiled only after the feature check
           }
  • 如何使用 API
  • 设计功能键
  • 接口

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo
信任与安全
© 2005-2025 UiPath。保留所有权利。