Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spelling errors: replace all 'Uri' with 'Url' #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ category:
- [时间表](profile/time-layout.md)
- [科目](profile/subject.md)
- [提醒](notifications.md)
- [Uri 导航](uri-navigation.md)
- [Url 导航](url-navigation.md)

学习完以上的内容,就掌握了本软件的基本功能。此外,本应用的大部分按钮都有工具提示,将鼠标放在按钮上即可查看按钮功能的解释。应用设置页面中大部分的选项中都有对应的解释。这些解释可以帮助您进一步了解本应用。

Expand Down
14 changes: 7 additions & 7 deletions src/app/uri-navigation.md → src/app/url-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ category:
- 使用指南
tag:
- 应用
- Uri 导航
- Url 导航
---

# Uri 导航
# Url 导航

::: info
本文章主要讲述用户如何使用 Uri 导航。如果您想了解在 ClassIsland 注册自定义 Uri 的方法,请参阅[开发 Uri 导航](../dev/uri-navigation.md)。
本文章主要讲述用户如何使用 Url 导航。如果您想了解在 ClassIsland 注册自定义 Url 的方法,请参阅[开发 Url 导航](../dev/url-navigation.md)。
:::

ClassIsland 支持在应用内通过 Uri 进行导航,同时也在系统注册 Url 协议,从外部调用 ClassIsland 的各项功能。
ClassIsland 支持在应用内通过 Url 进行导航,同时也在系统注册 Url 协议,从外部调用 ClassIsland 的各项功能。

ClassIsland 默认的 Uri 导航协议是 `classisland://`。应用内置的导航路径在 `classisland://app/` 下,插件扩展的导航路径一般在 `classisland://plugins/` 下。
ClassIsland 默认的 Url 导航协议是 `classisland://`。应用内置的导航路径在 `classisland://app/` 下,插件扩展的导航路径一般在 `classisland://plugins/` 下。

## 注册 Url 协议

您可以在[【应用设置】->【基本】](classisland://app/settings/general) 中启用【注册 Url 协议】选项以注册 Url 导航协议。

![1721609023773](image/uri-navigation/1721609023773.png)
![1721609023773](image/url-navigation/1721609023773.png)

::: warning
在有些情况下,部分杀毒软件可能会将【注册 Url 协议】视为敏感行为进行拦截。如果在开启此功能时出现这种情况,请点击【允许】。
Expand Down Expand Up @@ -84,7 +84,7 @@ classisland://app/class-swap
打开换课窗口。

::: note
在当前没有加载课表时,此 Uri 不起作用。
在当前没有加载课表时,此 Url 不起作用。
:::

### 测试导航
Expand Down
2 changes: 1 addition & 1 deletion src/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ClassIsland 使用了如下技术栈。在参与 ClassIsland 开发或为 ClassI
- [发布插件](./plugins/publishing.md)
- [基础知识](basics.md)
- [事件](events.md)
- [Uri 导航](uri-navigation.md)
- [Url 导航](url-navigation.md)
- 内置控件
- [组件](components.md)
- [提醒](./notifications/index.md)
Expand Down
2 changes: 1 addition & 1 deletion src/dev/ipc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
| --- | --- |
| IPublicLessonsService | 向其它进程公开的课程服务,用于存储当前课表状态与信息。 |
| IPublicProfileService | 向其它进程公开的档案服务,用于管理 ClassIsland 档案信息。 |
| IPublicUriNavigationService | 向其它进程公开的 Uri 导航服务,用于在 ClassIsland 内部和外部通过 uri 进行导航。 |
| IPublicUriNavigationService | 向其它进程公开的 Url 导航服务,用于在 ClassIsland 内部和外部通过 url 进行导航。~~别问为什么是接口名里的`Uri`不是`Url`~~ |
| ~~IFooService~~ | 用于测试 IPC 功能的测试服务 !!_低情商:没啥用_!! |

## 事件 ID
Expand Down
36 changes: 18 additions & 18 deletions src/dev/uri-navigation.md → src/dev/url-navigation.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
# 开发 Uri 导航
# 开发 Url 导航

::: info
本文章主要讲述开发人员如何注册自定义的 Uri 导航。如果您想了解应用内置的 Uri 导航路径,请参阅[Uri 导航](../app/uri-navigation.md)。
本文章主要讲述开发人员如何注册自定义的 Url 导航。如果您想了解应用内置的 Url 导航路径,请参阅[Url 导航](../app/url-navigation.md)。
:::

ClassIsland 支持通过 Uri 进行应用内导航,同时也支持注册系统 Url 协议,从应用外部打开特定的 Uri
ClassIsland 支持通过 Url 进行应用内导航,同时也支持注册系统 Url 协议,从应用外部打开特定的 Url

本文将介绍如何通过 `UriNavigationService` 来注册您自定义的 Uri 和导航事件处理方法来处理导航,以及如何在 UI 上通过命令和直接调用导航服务进行导航。
本文将介绍如何通过 `UrlNavigationService` 来注册您自定义的 Url 和导航事件处理方法来处理导航,以及如何在 UI 上通过命令和直接调用导航服务进行导航。

ClassIsland 的 Uri 导航协议是 `classisland://`。
ClassIsland 的 Url 导航协议是 `classisland://`。

## 注册导航

要注册导航,您首先需要获取服务 `ClassIsland.Core.Abstractions.Services.IUriNavigationService`。获取服务的详细方法见[基础知识](basics.md#dependency-injection)。
要注册导航,您首先需要获取服务 `ClassIsland.Core.Abstractions.Services.IUrlNavigationService`。获取服务的详细方法见[基础知识](basics.md#dependency-injection)。

::: info
在本文的代码中,我们假定将获取到的服务存储在了属性 `UriNavigationService` 中。
在本文的代码中,我们假定将获取到的服务存储在了属性 `UrlNavigationService` 中。
:::

接下来我们注册路径 `foo/bar` 的处理程序:

```cs
UriNavigationService.HandlePluginsNavigation(
UrlNavigationService.HandlePluginsNavigation(
"foo/bar",
args => {
CommonDialog.ShowInfo($"Hello world! {args.Uri}");
CommonDialog.ShowInfo($"Hello world! {args.Url}");
}
);
```

在上面的代码中,我们使用 `HandlePluginsNavigation` 方法注册了处理导航到路径 `foo/bar` 的处理程序。当导航到这个 Uri `classisland://plugins/foo/bar` 时,会运行传入的处理程序,显示对话框。在事件处理程序中可以通过参数 `args` 获取原始导航的 Uri 和原始 Uri 相对当前注册的路径的子路径。
在上面的代码中,我们使用 `HandlePluginsNavigation` 方法注册了处理导航到路径 `foo/bar` 的处理程序。当导航到这个 Url `classisland://plugins/foo/bar` 时,会运行传入的处理程序,显示对话框。在事件处理程序中可以通过参数 `args` 获取原始导航的 Url 和原始 Url 相对当前注册的路径的子路径。

使用 `HandlePluginsNavigation` 方法注册的 Uri 的主机是 `plugins`,也就是专门为插件预留的导航主机。如果要注册到 `app` 或其他主机下,请使用 `HandleAppNavigation` 方法。
使用 `HandlePluginsNavigation` 方法注册的 Url 的主机是 `plugins`,也就是专门为插件预留的导航主机。如果要注册到 `app` 或其他主机下,请使用 `HandleAppNavigation` 方法。

::: note
`HandleAppNavigation`等方法具有 `internal` 保护,只有从 ClassIsland 内部才能注册到 `app` 和自定义主机下。插件中只能使用 `HandlePluginsNavigation` 方法注册到 `plugins` 主机下。
:::

## 导航

在导航到某个 Uri 时,ClassIsland 会首先尝试导航到指定的路径下。如果这个路径下没有注册处理方法,会逐步向上级导航,直到根目录。
在导航到某个 Url 时,ClassIsland 会首先尝试导航到指定的路径下。如果这个路径下没有注册处理方法,会逐步向上级导航,直到根目录。

``` mermaid
flowchart LR
Expand All @@ -56,9 +56,9 @@ flowchart LR

### 通过 `NavHyperlink`

`NavHyperlink` 继承于 `Hyerlink`,具有后者类似的外观与体验,可以插入到 `TextBlock` 或 `FlowDocument` 等中,实现 Uri 导航。
`NavHyperlink` 继承于 `Hyerlink`,具有后者类似的外观与体验,可以插入到 `TextBlock` 或 `FlowDocument` 等中,实现 Url 导航。

要使用 `NavHyperlink` 导航,需要将 `NavigateTarget` 属性设置为要导航到的 Uri,例如:
要使用 `NavHyperlink` 导航,需要将 `NavigateTarget` 属性设置为要导航到的 Url,例如:

``` xml
<TextBlock>
Expand All @@ -69,18 +69,18 @@ flowchart LR

### 通过代码导航

调用 `IUriNavigationService.Navigate` 方法可以导航到指定的 Uri。如果要导航的 Uri 协议不是 `classisland://`,ClassIsland 会自动调用系统中最合适的应用处理这个 Uri
调用 `IUrlNavigationService.Navigate` 方法可以导航到指定的 Url。如果要导航的 Url 协议不是 `classisland://`,ClassIsland 会自动调用系统中最合适的应用处理这个 Url

```cs
// 打开导航测试窗口
UriNavigationService.Navigate(new Uri("classisland://app/test"));
UrlNavigationService.Navigate(new Url("classisland://app/test"));

// 在系统浏览器中打开 ClassIsland 官网
UriNavigationService.Navigate(new Uri("https://classisland.tech"));
UrlNavigationService.Navigate(new Url("https://classisland.tech"));
```

### 从外部调用

如果 ClassIsland 在系统上注册了 `classisland://` 链接的打开方式,那么在浏览器等地方打开这种协议的链接时,ClassIsland 可以在应用中导航到对应的 Uri 处理程序上。
如果 ClassIsland 在系统上注册了 `classisland://` 链接的打开方式,那么在浏览器等地方打开这种协议的链接时,ClassIsland 可以在应用中导航到对应的 Url 处理程序上。

例如:[classisland://app/test](classisland://app/test)
2 changes: 1 addition & 1 deletion src/en-us/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You can quickly get started with this application by reading this help document.
- [Time Layout](profile/time-layout.md)
- [Subjects](profile/subject.md)
- [Notifications](notifications.md)
- [Uri Navigation](uri-navigation.md)
- [Url Navigation](url-navigation.md)

After learning the above content, you will have mastered the basic functions of this software. In addition, most of the buttons in this application have tooltips. You can view the explanation of the button's function by hovering the mouse over the button. Most of the options on the application settings page also have corresponding explanations. These explanations can help you further understand the application.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Uri 导航
# Url 导航

::: info
本文章主要讲述用户如何使用 Uri 导航。如果您想了解在 ClassIsland 注册自定义 Uri 的方法,请参阅[开发 Uri 导航](../dev/uri-navigation.md)。
本文章主要讲述用户如何使用 Url 导航。如果您想了解在 ClassIsland 注册自定义 Url 的方法,请参阅[开发 Url 导航](../dev/url-navigation.md)。
:::

ClassIsland 支持在应用内通过 Uri 进行导航,同时也在系统注册 Url 协议,从外部调用 ClassIsland 的各项功能。
ClassIsland 支持在应用内通过 Url 进行导航,同时也在系统注册 Url 协议,从外部调用 ClassIsland 的各项功能。

ClassIsland 默认的 Uri 导航协议是 `classisland://`。应用内置的导航路径在 `classisland://app/` 下,插件扩展的导航路径一般在 `classisland://plugins/` 下。
ClassIsland 默认的 Url 导航协议是 `classisland://`。应用内置的导航路径在 `classisland://app/` 下,插件扩展的导航路径一般在 `classisland://plugins/` 下。

## 注册 Url 协议

您可以在[【应用设置】->【基本】](classisland://app/settings/general) 中启用【注册 Url 协议】选项以注册 Url 导航协议。

![1721609023773](image/uri-navigation/1721609023773.png)
![1721609023773](image/url-navigation/1721609023773.png)

::: warning
在有些情况下,部分杀毒软件可能会将【注册 Url 协议】视为敏感行为进行拦截。如果在开启此功能时出现这种情况,请点击【允许】。
Expand Down Expand Up @@ -73,7 +73,7 @@ classisland://app/class-swap
打开换课窗口。

::: note
在当前没有加载课表时,此 Uri 不起作用。
在当前没有加载课表时,此 Url 不起作用。
:::

### 测试导航
Expand Down
2 changes: 1 addition & 1 deletion src/en-us/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ClassIsland 使用了如下技术栈。在参与 ClassIsland 开发或为 ClassI
- [发布插件](./plugins/publishing.md)
- [基础知识](basics.md)
- [事件](events.md)
- [Uri 导航](uri-navigation.md)
- [Url 导航](url-navigation.md)
- 内置控件
- [组件](components.md)
- [提醒](./notifications/index.md)
Expand Down
36 changes: 18 additions & 18 deletions src/en-us/dev/uri-navigation.md → src/en-us/dev/url-navigation.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
# 开发 Uri 导航
# 开发 Url 导航

::: info
本文章主要讲述开发人员如何注册自定义的 Uri 导航。如果您想了解应用内置的 Uri 导航路径,请参阅[Uri 导航](../app/uri-navigation.md)。
本文章主要讲述开发人员如何注册自定义的 Url 导航。如果您想了解应用内置的 Url 导航路径,请参阅[Url 导航](../app/url-navigation.md)。
:::

ClassIsland 支持通过 Uri 进行应用内导航,同时也支持注册系统 Url 协议,从应用外部打开特定的 Uri
ClassIsland 支持通过 Url 进行应用内导航,同时也支持注册系统 Url 协议,从应用外部打开特定的 Url

本文将介绍如何通过 `UriNavigationService` 来注册您自定义的 Uri 和导航事件处理方法来处理导航,以及如何在 UI 上通过命令和直接调用导航服务进行导航。
本文将介绍如何通过 `UrlNavigationService` 来注册您自定义的 Url 和导航事件处理方法来处理导航,以及如何在 UI 上通过命令和直接调用导航服务进行导航。

ClassIsland 的 Uri 导航协议是 `classisland://`。
ClassIsland 的 Url 导航协议是 `classisland://`。

## 注册导航

要注册导航,您首先需要获取服务 `ClassIsland.Core.Abstractions.Services.IUriNavigationService`。获取服务的详细方法见[基础知识](basics.md#dependency-injection)。
要注册导航,您首先需要获取服务 `ClassIsland.Core.Abstractions.Services.IUrlNavigationService`。获取服务的详细方法见[基础知识](basics.md#dependency-injection)。

::: info
在本文的代码中,我们假定将获取到的服务存储在了属性 `UriNavigationService` 中。
在本文的代码中,我们假定将获取到的服务存储在了属性 `UrlNavigationService` 中。
:::

接下来我们注册路径 `foo/bar` 的处理程序:

```cs
UriNavigationService.HandlePluginsNavigation(
UrlNavigationService.HandlePluginsNavigation(
"foo/bar",
args => {
CommonDialog.ShowInfo($"Hello world! {args.Uri}");
CommonDialog.ShowInfo($"Hello world! {args.Url}");
}
);
```

在上面的代码中,我们使用 `HandlePluginsNavigation` 方法注册了处理导航到路径 `foo/bar` 的处理程序。当导航到这个 Uri `classisland://plugins/foo/bar` 时,会运行传入的处理程序,显示对话框。在事件处理程序中可以通过参数 `args` 获取原始导航的 Uri 和原始 Uri 相对当前注册的路径的子路径。
在上面的代码中,我们使用 `HandlePluginsNavigation` 方法注册了处理导航到路径 `foo/bar` 的处理程序。当导航到这个 Url `classisland://plugins/foo/bar` 时,会运行传入的处理程序,显示对话框。在事件处理程序中可以通过参数 `args` 获取原始导航的 Url 和原始 Url 相对当前注册的路径的子路径。

使用 `HandlePluginsNavigation` 方法注册的 Uri 的主机是 `plugins`,也就是专门为插件预留的导航主机。如果要注册到 `app` 或其他主机下,请使用 `HandleAppNavigation` 方法。
使用 `HandlePluginsNavigation` 方法注册的 Url 的主机是 `plugins`,也就是专门为插件预留的导航主机。如果要注册到 `app` 或其他主机下,请使用 `HandleAppNavigation` 方法。

::: note
`HandleAppNavigation`等方法具有 `internal` 保护,只有从 ClassIsland 内部才能注册到 `app` 和自定义主机下。插件中只能使用 `HandlePluginsNavigation` 方法注册到 `plugins` 主机下。
:::

## 导航

在导航到某个 Uri 时,ClassIsland 会首先尝试导航到指定的路径下。如果这个路径下没有注册处理方法,会逐步向上级导航,直到根目录。
在导航到某个 Url 时,ClassIsland 会首先尝试导航到指定的路径下。如果这个路径下没有注册处理方法,会逐步向上级导航,直到根目录。

``` mermaid
flowchart LR
Expand All @@ -56,9 +56,9 @@ flowchart LR

### 通过 `NavHyperlink`

`NavHyperlink` 继承于 `Hyerlink`,具有后者类似的外观与体验,可以插入到 `TextBlock` 或 `FlowDocument` 等中,实现 Uri 导航。
`NavHyperlink` 继承于 `Hyerlink`,具有后者类似的外观与体验,可以插入到 `TextBlock` 或 `FlowDocument` 等中,实现 Url 导航。

要使用 `NavHyperlink` 导航,需要将 `NavigateTarget` 属性设置为要导航到的 Uri,例如:
要使用 `NavHyperlink` 导航,需要将 `NavigateTarget` 属性设置为要导航到的 Url,例如:

``` xml
<TextBlock>
Expand All @@ -69,18 +69,18 @@ flowchart LR

### 通过代码导航

调用 `IUriNavigationService.Navigate` 方法可以导航到指定的 Uri。如果要导航的 Uri 协议不是 `classisland://`,ClassIsland 会自动调用系统中最合适的应用处理这个 Uri
调用 `IUrlNavigationService.Navigate` 方法可以导航到指定的 Url。如果要导航的 Url 协议不是 `classisland://`,ClassIsland 会自动调用系统中最合适的应用处理这个 Url

```cs
// 打开导航测试窗口
UriNavigationService.Navigate(new Uri("classisland://app/test"));
UrlNavigationService.Navigate(new Url("classisland://app/test"));

// 在系统浏览器中打开 ClassIsland 官网
UriNavigationService.Navigate(new Uri("https://classisland.tech"));
UrlNavigationService.Navigate(new Url("https://classisland.tech"));
```

### 从外部调用

如果 ClassIsland 在系统上注册了 `classisland://` 链接的打开方式,那么在浏览器等地方打开这种协议的链接时,ClassIsland 可以在应用中导航到对应的 Uri 处理程序上。
如果 ClassIsland 在系统上注册了 `classisland://` 链接的打开方式,那么在浏览器等地方打开这种协议的链接时,ClassIsland 可以在应用中导航到对应的 Url 处理程序上。

例如:[classisland://app/test](classisland://app/test)