将Windows Locale更改为非英语时
我在wpf应用程序代码中有以下C#.NET代码:
public static void ClearList(IHTMLDocument document)
{
if (CanSetBlockFormat(document))
{
OleCommandTargetHelper.Execute(document, MsHtmcid.IDM_BLOCKFMT, new object[] { "Normal" });
}
}
其中:
internal static object Execute(IHTMLDocument document, MsHtmcid command, object[] arguments)
{
var commandTarget = (DocObj.IOleCommandTarget)document;
var retVal = new object[] { null };
var hr = commandTarget.Exec(
ref NativeMethods.Guid_MSHTML,
(int)command,
(int)DocObj.OLECMDEXECOPT.DONTPROMPTUSER,
arguments,
retVal);
return retVal[0];
}
它用于编辑和格式化WebView/WPF中的HTML文本,其中使用的Web浏览器使用的Web浏览器是Internet Explorer,并用作一种富文本编辑器生成所需的html 。
在这种特殊情况下,它用于从项目符号或编号列表中删除格式。
谁能告诉我,为什么我将Windows langauge设置更改为非英语(例如奥地利人?)
I have the following c# .Net code in WPF app code:
public static void ClearList(IHTMLDocument document)
{
if (CanSetBlockFormat(document))
{
OleCommandTargetHelper.Execute(document, MsHtmcid.IDM_BLOCKFMT, new object[] { "Normal" });
}
}
where:
internal static object Execute(IHTMLDocument document, MsHtmcid command, object[] arguments)
{
var commandTarget = (DocObj.IOleCommandTarget)document;
var retVal = new object[] { null };
var hr = commandTarget.Exec(
ref NativeMethods.Guid_MSHTML,
(int)command,
(int)DocObj.OLECMDEXECOPT.DONTPROMPTUSER,
arguments,
retVal);
return retVal[0];
}
This is used for editing and formatting html text in WebView/WPF, where the web browser used is internet explorer and is used as a kind of rich text editor generating required HTML.
In this particular case it is used to remove formatting from bulleted or numbered list.
Can anyone tell me why this code doesn't work the moment I change windows langauge settings to non-english (Austrian for example?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论