Nota
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare ad accedere o modificare le directory.
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare a modificare le directory.
Ottiene l'oggetto VSWebSiteEvents per il sito Web, che può essere utilizzato per aggiungere gestori eventi.
Spazio dei nomi: VsWebSite
Assembly: VsWebSite.Interop (in VsWebSite.Interop.dll)
Sintassi
'Dichiarazione
ReadOnly Property VSWebSiteEvents As VSWebSiteEvents
Get
VSWebSiteEvents VSWebSiteEvents { get; }
property VSWebSiteEvents^ VSWebSiteEvents {
VSWebSiteEvents^ get ();
}
abstract VSWebSiteEvents : VSWebSiteEvents
function get VSWebSiteEvents () : VSWebSiteEvents
Valore proprietà
Tipo: VsWebSite.VSWebSiteEvents
Un oggetto VSWebSiteEvents.
Esempi
Nell'esempio seguente la proprietà VSWebSiteEvents viene utilizzata per aggiungere due metodi dell'evento. Questo esempio fa parte di un esempio più esaustivo relativo ai cenni preliminari sulla classe VSWebSite.
C#
private void SolutionEvents_Opened()
{
// When solution is opened, attach event handlers for projects
foreach (Project proj in _applicationObject.Solution.Projects)
{ // Only attach event handlers if it is a Web site
if (proj.Object is VSWebSite)
{
((VSWebSite)proj.Object).VSWebSiteEvents.WebReferencesEvents.WebReferenceAdded +=
new _dispWebReferencesEvents_WebReferenceAddedEventHandler
(WebRefEvents_WebRefAdded);
((VSWebSite)proj.Object).VSWebSiteEvents.AssemblyReferencesEvents.AssemblyReferenceAdded +=
new _dispAssemblyReferencesEvents_AssemblyReferenceAddedEventHandler
(AssemblyRefsEvents_AssemblyRefAdded);
}
}
}
Sicurezza di .NET Framework
- Attendibilità totale per il chiamante immediato. Impossibile utilizzare questo membro in codice parzialmente attendibile. Per ulteriori informazioni, vedere Utilizzo di librerie da codice parzialmente attendibile.