Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
d2793f4d
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d2793f4d
编写于
8月 04, 2016
作者:
J
Jonathon Marolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add dialog window
上级
eb5d3f83
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
149 addition
and
37 deletion
+149
-37
src/EditorFeatures/Core/Implementation/EditorLayerExtensionManager.cs
...atures/Core/Implementation/EditorLayerExtensionManager.cs
+3
-3
src/EditorFeatures/Core/Implementation/Workspaces/EditorErrorReportingService.cs
.../Implementation/Workspaces/EditorErrorReportingService.cs
+5
-0
src/VisualStudio/Core/Def/Implementation/Workspace/DetailedErrorInfoDialog.xaml
...Def/Implementation/Workspace/DetailedErrorInfoDialog.xaml
+35
-0
src/VisualStudio/Core/Def/Implementation/Workspace/DetailedErrorInfoDialog.xaml.cs
.../Implementation/Workspace/DetailedErrorInfoDialog.xaml.cs
+48
-0
src/VisualStudio/Core/Def/Implementation/Workspace/VisualStudioErrorReportingService.cs
...ementation/Workspace/VisualStudioErrorReportingService.cs
+12
-34
src/VisualStudio/Core/Def/PublicAPI.Unshipped.txt
src/VisualStudio/Core/Def/PublicAPI.Unshipped.txt
+2
-0
src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs
src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs
+18
-0
src/VisualStudio/Core/Def/ServicesVSResources.resx
src/VisualStudio/Core/Def/ServicesVSResources.resx
+6
-0
src/VisualStudio/Core/Def/ServicesVisualStudio.csproj
src/VisualStudio/Core/Def/ServicesVisualStudio.csproj
+7
-0
src/Workspaces/Core/Portable/ExtensionManager/IErrorReportingService.cs
.../Core/Portable/ExtensionManager/IErrorReportingService.cs
+1
-0
src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs
src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs
+9
-0
src/Workspaces/Core/Portable/WorkspacesResources.resx
src/Workspaces/Core/Portable/WorkspacesResources.resx
+3
-0
未找到文件。
src/EditorFeatures/Core/Implementation/EditorLayerExtensionManager.cs
浏览文件 @
d2793f4d
...
...
@@ -70,7 +70,7 @@ public override void HandleException(object provider, Exception exception)
base
.
HandleException
(
provider
,
exception
);
_errorReportingService
?.
ShowErrorInfo
(
String
.
Format
(
WorkspacesResources
.
_0_encountered_an_error_and_has_been_disabled
,
provider
.
GetType
().
Name
),
new
ErrorReportingUI
(
WorkspacesResources
.
Enable
,
ErrorReportingUI
.
UIKind
.
HyperLink
,
()
=>
LaunchExceptionInfoWindow
(
exception
)
),
new
ErrorReportingUI
(
WorkspacesResources
.
Show_Stack_Trace
,
ErrorReportingUI
.
UIKind
.
HyperLink
,
()
=>
ShowDetailedErrorInfo
(
exception
),
closeAfterAction
:
false
),
new
ErrorReportingUI
(
WorkspacesResources
.
Enable
,
ErrorReportingUI
.
UIKind
.
Button
,
()
=>
{
EnableProvider
(
provider
);
LogEnableProvider
(
provider
);
}),
new
ErrorReportingUI
(
WorkspacesResources
.
Enable_and_ignore_future_errors
,
ErrorReportingUI
.
UIKind
.
Button
,
()
=>
{
EnableProvider
(
provider
);
LogEnableProvider
(
provider
);
}),
new
ErrorReportingUI
(
String
.
Empty
,
ErrorReportingUI
.
UIKind
.
Close
,
()
=>
LogLeaveDisabled
(
provider
)));
...
...
@@ -93,9 +93,9 @@ public override void HandleException(object provider, Exception exception)
_errorLoggerService
?.
LogException
(
provider
,
exception
);
}
private
void
LaunchExceptionInfoWindow
(
Exception
exception
)
private
void
ShowDetailedErrorInfo
(
Exception
exception
)
{
throw
new
NotImplementedException
(
);
_errorReportingService
.
ShowDetailedErrorInfo
(
exception
);
}
private
static
void
LogLeaveDisabled
(
object
provider
)
...
...
src/EditorFeatures/Core/Implementation/Workspaces/EditorErrorReportingService.cs
浏览文件 @
d2793f4d
...
...
@@ -8,6 +8,11 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.Workspaces
{
internal
class
EditorErrorReportingService
:
IErrorReportingService
{
public
void
ShowDetailedErrorInfo
(
Exception
exception
)
{
Logger
.
Log
(
FunctionId
.
Extension_Exception
,
exception
.
StackTrace
);
}
public
void
ShowErrorInfo
(
string
message
,
params
ErrorReportingUI
[]
items
)
{
Logger
.
Log
(
FunctionId
.
Extension_Exception
,
message
);
...
...
src/VisualStudio/Core/Def/Implementation/Workspace/DetailedErrorInfoDialog.xaml
0 → 100644
浏览文件 @
d2793f4d
<ui:DialogWindow x:Class="Microsoft.VisualStudio.LanguageServices.Implementation.DetailedErrorInfoDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:local="clr-namespace:Microsoft.VisualStudio.LanguageServices.Implementation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
xmlns:vs="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.14.0"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
mc:Ignorable="d"
ShowInTaskbar="False"
WindowStartupLocation="CenterOwner"
Background="{DynamicResource {x:Static vs:VsBrushes.ToolboxBackgroundKey}}"
Foreground="{DynamicResource {x:Static vs:VsBrushes.ToolboxGradientKey}}"
d:DesignHeight="300" d:DesignWidth="300"
SizeToContent="Height"
MaxWidth="768"
MinWidth="300"
MinHeight="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="38"/>
</Grid.RowDefinitions>
<ScrollViewer Grid.Column="0" Grid.Row="0" HorizontalScrollBarVisibility="Auto" Style="{DynamicResource {x:Static vs:VsResourceKeys.ScrollViewerStyleKey}}">
<TextBox Name="stackTraceText" IsReadOnly="True"
Background="{DynamicResource {x:Static vs:VsBrushes.ToolboxBackgroundKey}}"
Foreground="{DynamicResource {x:Static vs:VsBrushes.ButtonTextKey}}"/>
</ScrollViewer>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Right">
<Button Name="CopyButton" Height="24" Margin="0,0,10,0" Click="CopyMessageToClipBoard" Style="{DynamicResource {x:Static vs:VsResourceKeys.ButtonStyleKey}}"/>
<Button Name="CloseButton" Height="24" Width="70" Margin="0,0,10,0" Click="CloseWindow" Style="{DynamicResource {x:Static vs:VsResourceKeys.ButtonStyleKey}}"/>
</StackPanel>
</Grid>
</ui:DialogWindow>
\ No newline at end of file
src/VisualStudio/Core/Def/Implementation/Workspace/DetailedErrorInfoDialog.xaml.cs
0 → 100644
浏览文件 @
d2793f4d
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Forms
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Navigation
;
using
System.Windows.Shapes
;
using
Microsoft.VisualStudio.PlatformUI
;
using
Microsoft.VisualStudio.Shell
;
namespace
Microsoft.VisualStudio.LanguageServices.Implementation
{
/// <summary>
/// Interaction logic for UserControl1.xaml
/// </summary>
public
partial
class
DetailedErrorInfoDialog
:
DialogWindow
{
string
errorInfo
;
internal
DetailedErrorInfoDialog
(
string
title
,
string
errorInfo
)
{
InitializeComponent
();
this
.
errorInfo
=
errorInfo
;
this
.
Title
=
title
;
stackTraceText
.
AppendText
(
errorInfo
);
this
.
CopyButton
.
Content
=
ServicesVSResources
.
Copy_to_clipboard
;
this
.
CloseButton
.
Content
=
ServicesVSResources
.
Close
;
}
private
void
CopyMessageToClipBoard
(
object
sender
,
RoutedEventArgs
e
)
{
System
.
Windows
.
Clipboard
.
SetText
(
errorInfo
);
}
private
void
CloseWindow
(
object
sender
,
RoutedEventArgs
e
)
{
this
.
Close
();
}
}
}
src/VisualStudio/Core/Def/Implementation/Workspace/VisualStudioErrorReportingService.cs
浏览文件 @
d2793f4d
...
...
@@ -8,6 +8,7 @@
using
Microsoft.CodeAnalysis.Shared.TestHooks
;
using
Microsoft.VisualStudio.Imaging
;
using
Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem
;
using
Microsoft.VisualStudio.PlatformUI
;
using
Microsoft.VisualStudio.Shell
;
using
Microsoft.VisualStudio.Shell.Interop
;
using
Roslyn.Utilities
;
...
...
@@ -147,46 +148,23 @@ public void OnClosed(IVsInfoBarUIElement infoBarUIElement)
}
}
private
class
CodeFixInfoBarEvents
:
IVsInfoBarUIEvents
private
static
bool
TryCreateInfoBarUI
(
IVsInfoBarUIFactory
infoBarUIFactory
,
IVsInfoBar
infoBar
,
out
IVsInfoBarUIElement
uiElement
)
{
private
readonly
Action
_onClose
;
private
readonly
Action
_onEnable
;
private
readonly
Action
_onEnableAndIgnore
;
public
CodeFixInfoBarEvents
(
Action
onClose
,
Action
onEnable
=
null
,
Action
onEnableAndIgnore
=
null
)
{
Contract
.
ThrowIfNull
(
onClose
);
_onClose
=
onClose
;
_onEnable
=
onEnable
;
_onEnableAndIgnore
=
onEnableAndIgnore
;
}
public
void
OnActionItemClicked
(
IVsInfoBarUIElement
infoBarUIElement
,
IVsInfoBarActionItem
actionItem
)
{
if
(
actionItem
.
Equals
(
s_enableItem
))
{
_onEnable
?.
Invoke
();
}
if
(
actionItem
.
Equals
(
s_enableAndIgnoreItem
))
{
_onEnableAndIgnore
?.
Invoke
();
}
uiElement
=
infoBarUIFactory
.
CreateInfoBar
(
infoBar
);
return
uiElement
!=
null
;
}
infoBarUIElement
.
Close
();
}
public
void
ShowDetailedErrorInfo
(
Exception
exception
)
{
string
errorInfo
=
exception
.
Message
+
Environment
.
NewLine
+
exception
.
StackTrace
;
public
void
OnClosed
(
IVsInfoBarUIElement
infoBarUIElement
)
while
(
exception
.
InnerException
!=
null
)
{
_onClose
();
exception
=
exception
.
InnerException
;
errorInfo
+=
Environment
.
NewLine
+
exception
.
Message
+
Environment
.
NewLine
+
exception
.
StackTrace
;
}
}
private
static
bool
TryCreateInfoBarUI
(
IVsInfoBarUIFactory
infoBarUIFactory
,
IVsInfoBar
infoBar
,
out
IVsInfoBarUIElement
uiElement
)
{
uiElement
=
infoBarUIFactory
.
CreateInfoBar
(
infoBar
);
return
uiElement
!=
null
;
(
new
DetailedErrorInfoDialog
(
exception
.
Message
,
errorInfo
)).
ShowModal
();
}
}
}
src/VisualStudio/Core/Def/PublicAPI.Unshipped.txt
浏览文件 @
d2793f4d
Microsoft.VisualStudio.LanguageServices.Implementation.DetailedErrorInfoDialog
Microsoft.VisualStudio.LanguageServices.Implementation.DetailedErrorInfoDialog.InitializeComponent() -> void
\ No newline at end of file
src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs
浏览文件 @
d2793f4d
...
...
@@ -343,6 +343,15 @@ internal class ServicesVSResources {
}
}
/// <summary>
/// Looks up a localized string similar to Close.
/// </summary>
internal
static
string
Close
{
get
{
return
ResourceManager
.
GetString
(
"Close"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Computing remove suppressions fix....
/// </summary>
...
...
@@ -361,6 +370,15 @@ internal class ServicesVSResources {
}
}
/// <summary>
/// Looks up a localized string similar to Copy to Clopboard.
/// </summary>
internal
static
string
Copy_to_clipboard
{
get
{
return
ResourceManager
.
GetString
(
"Copy_to_clipboard"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Could not find location of folder on disk.
/// </summary>
...
...
src/VisualStudio/Core/Def/ServicesVSResources.resx
浏览文件 @
d2793f4d
...
...
@@ -699,4 +699,10 @@ Additional information: {1}</value>
<data
name=
"Prefer_predefined_type"
xml:space=
"preserve"
>
<value>
Prefer predefined type
</value>
</data>
<data
name=
"Copy_to_clipboard"
xml:space=
"preserve"
>
<value>
Copy to Clopboard
</value>
</data>
<data
name=
"Close"
xml:space=
"preserve"
>
<value>
Close
</value>
</data>
</root>
\ No newline at end of file
src/VisualStudio/Core/Def/ServicesVisualStudio.csproj
浏览文件 @
d2793f4d
...
...
@@ -160,6 +160,9 @@
<Compile
Include=
"Implementation\Watson\Watson.cs"
/>
<Compile
Include=
"Implementation\Watson\WatsonErrorReport.cs"
/>
<Compile
Include=
"Implementation\Watson\WatsonReporter.cs"
/>
<Compile
Include=
"Implementation\Workspace\DetailedErrorInfoDialog.xaml.cs"
>
<DependentUpon>
DetailedErrorInfoDialog.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"Implementation\Workspace\Esent\EsentStorage.ProjectDocumentTableAccessor.cs"
/>
<Compile
Include=
"Implementation\Workspace\Esent\EsentLogger.cs"
/>
<Compile
Include=
"Implementation\Workspace\Esent\EsentStorage.ProjectDocumentTable.cs"
/>
...
...
@@ -714,6 +717,10 @@
<SubType>
Designer
</SubType>
<Generator>
MSBuild:Compile
</Generator>
</Page>
<Page
Include=
"Implementation\Workspace\DetailedErrorInfoDialog.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<EmbeddedResource
Include=
"ServicesVSResources.resx"
>
...
...
src/Workspaces/Core/Portable/ExtensionManager/IErrorReportingService.cs
浏览文件 @
d2793f4d
...
...
@@ -9,6 +9,7 @@ namespace Microsoft.CodeAnalysis.Extensions
internal
interface
IErrorReportingService
:
IWorkspaceService
{
void
ShowErrorInfo
(
string
message
,
params
ErrorReportingUI
[]
items
);
void
ShowDetailedErrorInfo
(
Exception
exception
);
}
internal
struct
ErrorReportingUI
...
...
src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs
浏览文件 @
d2793f4d
...
...
@@ -918,6 +918,15 @@ internal class WorkspacesResources {
}
}
/// <summary>
/// Looks up a localized string similar to Show Stack Trace.
/// </summary>
internal
static
string
Show_Stack_Trace
{
get
{
return
ResourceManager
.
GetString
(
"Show_Stack_Trace"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to Solution file not found: '{0}'.
/// </summary>
...
...
src/Workspaces/Core/Portable/WorkspacesResources.resx
浏览文件 @
d2793f4d
...
...
@@ -483,4 +483,7 @@
<data
name=
"_0_encountered_an_error_and_has_been_disabled"
xml:space=
"preserve"
>
<value>
'{0}' encountered an error and has been disabled.
</value>
</data>
<data
name=
"Show_Stack_Trace"
xml:space=
"preserve"
>
<value>
Show Stack Trace
</value>
</data>
</root>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录