From bbc40f6427155b34113b2441259c2bb805d7d4ff Mon Sep 17 00:00:00 2001
From: xk <9063830+giteezxk@user.noreply.gitee.com>
Date: Thu, 3 Jun 2021 20:03:38 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E4=BF=AE=E5=A4=87=E6=B3=A8?=
=?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9=E5=87=BD=E6=95=B0=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/IFoxCAD.Cad/Runtime/Env.cs | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/IFoxCAD.Cad/Runtime/Env.cs b/src/IFoxCAD.Cad/Runtime/Env.cs
index 8e8cecf..e6cf84e 100644
--- a/src/IFoxCAD.Cad/Runtime/Env.cs
+++ b/src/IFoxCAD.Cad/Runtime/Env.cs
@@ -1,4 +1,4 @@
-using Autodesk.AutoCAD.ApplicationServices;
+using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.GraphicsSystem;
@@ -108,7 +108,7 @@ public static IConfigurationSection GetGlobalSection(string propertyName)
#region Enum
///
- /// 命令行回显系统变量, 为显示, 为不显示
+ /// 控制在AutoLISP的command函数运行时AutoCAD是否回显提示和输入, 为显示, 为不显示
///
public static bool CmdEcho
{
@@ -376,19 +376,16 @@ public static OSModeType OSMode
Application.SetSystemVariable("osmode", (int)value);
}
}
-
-
///
- /// 检查系统变量的模式是否相同
+ /// 捕捉模式osm1是否包含osm2
///
/// 原模式
/// 要比较的模式
- /// 等于要比较的模式返回 ,反之返回
- public static bool Check(this OSModeType osm1, OSModeType osm2)
+ /// 包含时返回 ,不包含时返回
+ public static bool Include(this OSModeType osm1, OSModeType osm2)
{
return (osm1 & osm2) == osm2;
}
-
#endregion OsMode
private static T ToEnum(this string value)
@@ -430,6 +427,7 @@ public static void SetVar(string varName, object value)
/// 指定的环境变量的值;或者如果找不到环境变量,则返回 null
public static string? GetEnv(string var)
{
+ //从当前进程或者从当前用户或本地计算机的 Windows 操作系统注册表项检索环境变量的值
return Environment.GetEnvironmentVariable(var);
}
///
@@ -439,6 +437,7 @@ public static void SetVar(string varName, object value)
/// 变量值
public static void SetEnv(string var, string? value)
{
+ //创建、修改或删除当前进程中或者为当前用户或本地计算机保留的 Windows 操作系统注册表项中存储的环境变量
Environment.SetEnvironmentVariable(var, value);
}
#nullable disable
--
Gitee
From 84bf715cbf82e94a1e2ae3c0cdacf56e3797ac8b Mon Sep 17 00:00:00 2001
From: xk <9063830+giteezxk@user.noreply.gitee.com>
Date: Thu, 3 Jun 2021 20:06:01 +0800
Subject: [PATCH 2/2] update tests/DBTrans.test/testenv.cs.
---
tests/DBTrans.test/testenv.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/DBTrans.test/testenv.cs b/tests/DBTrans.test/testenv.cs
index 96c5df4..e2513b5 100644
--- a/tests/DBTrans.test/testenv.cs
+++ b/tests/DBTrans.test/testenv.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -52,7 +52,7 @@ public void testosmode()
// 追加模式
Env.OSMode |= Env.OSModeType.Center;
//检查是否有某个模式
- var os = Env.OSMode.Check(Env.OSModeType.Center);
+ var os = Env.OSMode.Include(Env.OSModeType.Center);
// 取消某个模式
Env.OSMode ^= Env.OSModeType.Center;
Env.Editor.WriteMessage(Env.OSMode.ToString());
--
Gitee