本文整理汇总了C#中Mono.Debugging.Client.StackFrame.UpdateSourceFile方法的典型用法代码示例。如果您正苦于以下问题:C# StackFrame.UpdateSourceFile方法的具体用法?C# StackFrame.UpdateSourceFile怎么用?C# StackFrame.UpdateSourceFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Debugging.Client.StackFrame
的用法示例。
在下文中一共展示了StackFrame.UpdateSourceFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowLoadSourceFile
void ShowLoadSourceFile (StackFrame sf)
{
if (messageOverlayWindow != null) {
messageOverlayWindow.Destroy ();
messageOverlayWindow = null;
}
messageOverlayWindow = new OverlayMessageWindow ();
var hbox = new HBox ();
hbox.Spacing = 8;
var label = new Label (string.Format ("{0} not found. Find source file at alternative location.", Path.GetFileName (sf.SourceLocation.FileName)));
hbox.TooltipText = sf.SourceLocation.FileName;
var color = (HslColor)editor.ColorStyle.NotificationText.Foreground;
label.ModifyFg (StateType.Normal, color);
int w, h;
label.Layout.GetPixelSize (out w, out h);
hbox.PackStart (label, true, true, 0);
var openButton = new Button (Gtk.Stock.Open);
openButton.WidthRequest = 60;
hbox.PackEnd (openButton, false, false, 0);
var container = new HBox ();
const int containerPadding = 8;
container.PackStart (hbox, true, true, containerPadding);
messageOverlayWindow.Child = container;
messageOverlayWindow.ShowOverlay (editor);
messageOverlayWindow.SizeFunc = () => openButton.SizeRequest ().Width + w + hbox.Spacing * 5 + containerPadding * 2;
openButton.Clicked += delegate {
var dlg = new OpenFileDialog (GettextCatalog.GetString ("File to Open"), SelectFileDialogAction.Open) {
TransientFor = IdeApp.Workbench.RootWindow,
ShowEncodingSelector = true,
ShowViewerSelector = true
};
if (!dlg.Run ())
return;
var newFilePath = dlg.SelectedFile;
try {
if (File.Exists (newFilePath)) {
if (SourceCodeLookup.CheckFileMd5 (newFilePath, sf.SourceLocation.FileHash)) {
SourceCodeLookup.AddLoadedFile (newFilePath, sf.SourceLocation.FileName);
sf.UpdateSourceFile (newFilePath);
if (IdeApp.Workbench.OpenDocument (newFilePath, null, sf.SourceLocation.Line, 1, OpenDocumentOptions.Debugger) != null) {
this.WorkbenchWindow.CloseWindow (false);
}
} else {
MessageService.ShowWarning ("File checksum doesn't match.");
}
} else {
MessageService.ShowWarning ("File not found.");
}
} catch (Exception) {
MessageService.ShowWarning ("Error opening file");
}
};
}