// Add the given source viewer to the global collection of source files. static void AddSourceViewer(SourceViewerBaseForm source) { Debug.Assert(source != null); object key = source.GetHashKey(); Debug.Assert(key != null); m_sourceList.Add(key, source); }
// Handle key commands that don't require source focus (like Stepping). static public void HandleGlobalKeyCommand(System.Windows.Forms.KeyEventArgs e) { // Find th SourceViewerBaseForm f = m_ActiveSourceFile; if (m_ActiveSourceFile != null) { f.HandleGlobalKeyCommandWorker(e); } }
// There's one SourceViewerForm instance for each source-file // Get the instance for the new source file. // Called on UI thread. public static SourceViewerBaseForm GetSourceFile(MainForm parent, MDbgFunction function) { SourceViewerBaseForm source = (SourceViewerBaseForm)m_sourceList[function]; if (source == null) { source = new VirtualSourceViewerForm(parent, function); AddSourceViewer(source); } m_ActiveSourceFile = source; return(source); }
// There's one SourceViewerForm instance for each source-file // Get the instance for the new source file. // Called on UI thread. public static SourceViewerForm GetSourceFile(MainForm parent, string path) { path = CommandBase.Shell.FileLocator.GetFileLocation(path); SourceViewerForm source = (SourceViewerForm)m_sourceList[path]; if (source == null) { source = SourceViewerForm.Build(parent, path); if (source != null) { AddSourceViewer(source); } } m_ActiveSourceFile = source; return(source); }
// this is called on the UI thread. bool ShowSourceFile(SourceViewerBaseForm f) { if (f == null) { return false; } f.Focus(); cmdInput.Focus(); return true; }
// There's one SourceViewerForm instance for each source-file // Get the instance for the new source file. // Called on UI thread. public static SourceViewerBaseForm GetSourceFile(MainForm parent, MDbgFunction function) { SourceViewerBaseForm source = (SourceViewerBaseForm)m_sourceList[function]; if (source == null) { source = new VirtualSourceViewerForm(parent, function); AddSourceViewer(source); } m_ActiveSourceFile = source; return source; }
// There's one SourceViewerForm instance for each source-file // Get the instance for the new source file. // Called on UI thread. public static SourceViewerForm GetSourceFile(MainForm parent,string path) { path = CommandBase.Shell.FileLocator.GetFileLocation(path); SourceViewerForm source = (SourceViewerForm)m_sourceList[path]; if(source==null) { source = SourceViewerForm.Build(parent, path); if (source != null) { AddSourceViewer(source); } } m_ActiveSourceFile = source; return source; }
// Add the given source viewer to the global collection of source files. static void AddSourceViewer(SourceViewerBaseForm source) { Debug.Assert(source != null); object key = source.GetHashKey(); Debug.Assert(key != null); m_sourceList.Add(key, source); }
/// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose( bool disposing ) { // if disposing==true, then we release managed + unmanaged resources. // if disposing==false, then we only release unmanaged resources. if( disposing ) { m_sourceList.Remove(this.GetHashKey()); if (m_ActiveSourceFile == this) { m_ActiveSourceFile = null; } if(components != null) { components.Dispose(); } } base.Dispose( disposing ); }