SolutionEvents الواجهة
يوفر أحداث تغييرات إلى حلاً. استخدم هذا كائن للوظيفة والرجوع إلى SolutionEventsClassلهذه الوثائق كائن's.
مساحة الاسم: EnvDTE
التجميع: EnvDTE (في EnvDTE.dll)
بناء الجملة
'إقرار
<GuidAttribute("BF8BBF37-5415-46A9-940D-594CAD9DEC26")> _
Public Interface SolutionEvents _
Inherits _SolutionEvents, _dispSolutionEvents_Event
[GuidAttribute("BF8BBF37-5415-46A9-940D-594CAD9DEC26")]
public interface SolutionEvents : _SolutionEvents,
_dispSolutionEvents_Event
[GuidAttribute(L"BF8BBF37-5415-46A9-940D-594CAD9DEC26")]
public interface class SolutionEvents : _SolutionEvents,
_dispSolutionEvents_Event
[<GuidAttribute("BF8BBF37-5415-46A9-940D-594CAD9DEC26")>]
type SolutionEvents =
interface
interface _SolutionEvents
interface _dispSolutionEvents_Event
end
public interface SolutionEvents extends _SolutionEvents, _dispSolutionEvents_Event
ملاحظات
SolutionEventsكائن يمكن الانتقال خارج نطاق وتكون البيانات المهملة جمع قبل أن يتم مغلق الحل. للاحتفاظ بمرجع إلى هذا كائن، تعريف متغير خاص في فئة تطبيق معالجات أحداث الحل.
أمثلة
public class Connect : IDTExtensibility2
{
private SolutionEvents _solnEvents;
public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
_applicationObject = (DTE2)application;
_addInInstance = (AddIn)addInInst;
_solnEvents = _applicationObject.Events.SolutionEvents;
_solutionBeforeClosingEventHandler = new _dispSolutionEvents_BeforeClosingEventHandler(this.SolutionBeforeClosing);
_solnEvents.BeforeClosing += _solutionBeforeClosingEventHandler;
}
private _dispSolutionEvents_BeforeClosingEventHandler _solutionBeforeClosingEventHandler
private void SolutionBeforeClosing()
{
System.Windows.Forms.MessageBox.Show("SolutionBeforeClosing");
}
}