wpf - PowerShell ISE WPF 控件内联

标签 wpf visual-studio-2010 powershell

我听说 PowerShell ISE 使用与 VisualStudio 2010 和 Oslo IntelliPad 相同的 WPF 文本编辑器。我知道您可以通过将自己的 WPF 控件插入编辑器的 XAML 文件来在 VisualStudio 中扩展此编辑器。我现在的问题是:使用 PowerShellISE 也可以实现这一点吗?有人尝试这样做吗?

最佳答案

确实是同一个控件。我不相信你可以插入你自己的 WPF 控件。但是,ISE 是完全编程的,并且具有可用于自定义 ISE 的对象模型。您可以使用 $psise 变量访问对象模型。您可以使用 $psise.options 调整很多选项

1 >  $psise.options


SelectedScriptPaneState       : Right
ShowToolBar                   : True
TokenColors                   : {[Attribute, #FF84A7C1], [Command, #FFFFFF60], 
                                [CommandArgument, #FFFFFFFF], [CommandParameter
                                , #FFFFDE00]...}
DefaultOptions                : Microsoft.PowerShell.Host.ISE.ISEOptions
FontSize                      : 16
FontName                      : consolas
ErrorForegroundColor          : #FFFF0000
ErrorBackgroundColor          : #00FFFFFF
WarningForegroundColor        : #FFFF8C00
WarningBackgroundColor        : #00FFFFFF
VerboseForegroundColor        : #FF0000FF
VerboseBackgroundColor        : #00FFFFFF
DebugForegroundColor          : #FF0000FF
DebugBackgroundColor          : #00FFFFFF
OutputPaneBackgroundColor     : #FF000000
OutputPaneTextBackgroundColor : #FF000000
OutputPaneForegroundColor     : #FFFFFFFF
CommandPaneBackgroundColor    : #FF000000
ScriptPaneBackgroundColor     : #FF000000
ScriptPaneForegroundColor     : #FF000000
ShowWarningForDuplicateFiles  : True
ShowWarningBeforeSavingOnRun  : True
UseLocalHelp                  : True
CommandPaneUp                 : True

关于wpf - PowerShell ISE WPF 控件内联,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1022181/

相关文章:

wpf - 访问 ControlTemplate 中的内部元素

.net - 使用 IronRuby 编写 WPF 应用程序有什么陷阱吗?

c# - WPF 中的分辨率独立性如何工作?

powershell - 在PowerShell中使用Windows事件日志

windows - 如何写 Yes 命令作为这个问题的答案?谢谢

WPF 用百分比将 TextBlock 绑定(bind)到 ProgressBar

c++ - msvc2010 - 如何建立一个干净的输出目录?

c# - 使用 C# 在 Visual Studio 2010 中使用预处理器指令

c# - 异步方法中的 StringBuilder

rest - 更新Azure DevOps Wiki页面使用Powershell