Aracılığıyla paylaş


ContextAttributes Arabirim

Genel bir içerik veya pencerenin içeriği içinde ilişkili tüm öznitelikleri içeren Dynamic Help pencere.

Ad alanı:  EnvDTE
Derleme:  EnvDTE (EnvDTE.dll içinde)

Sözdizimi

'Bildirim
<GuidAttribute("33C5EBB8-244E-449D-9CEE-FAD70A774E59")> _
Public Interface ContextAttributes _
    Inherits IEnumerable
[GuidAttribute("33C5EBB8-244E-449D-9CEE-FAD70A774E59")]
public interface ContextAttributes : IEnumerable
[GuidAttribute(L"33C5EBB8-244E-449D-9CEE-FAD70A774E59")]
public interface class ContextAttributes : IEnumerable
[<GuidAttribute("33C5EBB8-244E-449D-9CEE-FAD70A774E59")>]
type ContextAttributes =  
    interface
        interface IEnumerable
    end
public interface ContextAttributes extends IEnumerable

ContextAttributes türü aşağıdaki üyeleri ortaya koyar.

Özellikler

  Ad Açıklama
Genel özellik Count Nesnelerin sayısını belirten bir değeri alır ContextAttributes koleksiyonu.
Genel özellik DTE Üst düzey bir geniþletilebilirlik nesnesi alır.
Genel özellik HighPriorityAttributes Yüksek öncelikli öznitelikleri koleksiyonu alır.
Genel özellik Parent Hemen üst nesnesi alır bir ContextAttributes koleksiyonu.
Genel özellik Type Nesne türünü gösteren bir sabit alır.

Üst

Yöntemler

  Ad Açıklama
Genel yöntem Add Bir öznitelik ad/değer çiftini ekler ContextAttributes koleksiyonu.
Genel yöntem GetEnumerator() Bir Numaralandırıcı topluluk içinde yineleme döndürür. (IEnumerable kaynağından devralındı.)
Genel yöntem GetEnumerator() Maddeler için bir numaralayıcı koleksiyonu döndürür.
Genel yöntem Item Döndürür bir ContextAttribute öğesi olan nesne ContextAttributes koleksiyonu.
Genel yöntem Refresh Bu öznitelik koleksiyonunun bağlamlarını yenile.

Üst

Notlar

İçin DTE.ContextAttributes, bu konular sıralama en düşük önceliğe sahip genel içeriği bag etkiler.

İçin Window.ContextAttributes, bu pencere için içerik bag etkiler.Pencere odaklanmış olduğunda araç pencereleri için etkili nitelikleridir.Son etkin MDI alt Düzenleyici olduğu sürece öznitelikleri editörler ve tasarımcılar için etkin olur.HighPriorityAttributes Özelliği ayarlanmış true, sonra da her zaman etkili ve yüksek öncelikleri nitelikleridir.

Alma sonra bir ContextAttributes koleksiyonu, çağırmanız gerekir ContextAttributes.Refresh sadece nesne getiriliyor bunu yapmaz çünkü öznitelikler topluluğu tarihe kadar olmasını sağlamak için.Ekleme ve niteliklerini kaldırma, ancak dolaylı olarak yeniler ContextAttributes koleksiyonu ekleme veya kaldırma işlemlerinin sonuçlarını geçerli olacak şekilde.

Örnekler

Sub ContextAttributesExample()
   ' Get a reference to Solution Explorer.
   Dim SolnEx As Window = DTE.Windows.Item _
   (Constants.vsWindowKindSolutionExplorer)
   Dim CA As ContextAttribute

   ' List the current attributes associated with Solution Explorer.
   ListAttr(SolnEx, CA)

   ' Associate a new F1 keyword with Solution Explorer.
   SolnEx.ContextAttributes.Add("ANewKeyword", 900, _
   vsContextAttributeType.vsContextAttributeLookupF1)
   ListAttr(SolnEx, CA)

   ' Delete the new F1 keyword from Solution Explorer.
   SolnEx.ContextAttributes.Item(3).Remove()
   ListAttr(SolnEx, CA)
End Sub

Sub ListAttr(ByVal SolnEx As Object, ByVal CA As ContextAttribute)
   ' Support function for CATest(). Lists the current attributes 
   ' associated with Solution Explorer.
   Dim msg As String

   MsgBox("Number of context attributes in Solution Explorer: " & _
   SolnEx.ContextAttributes.Count)
   For Each CA In SolnEx.ContextAttributes
      msg = msg & CA.Name & Chr(13)
   Next
   MsgBox(msg)
   msg = ""
End Sub

Ayrıca bkz.

Başvuru

EnvDTE Ad Alanı