Sdílet prostřednictvím


IInterfaceInfo.Source – vlastnost

Získá hodnotu určující, zda je zdroj –, který klient naslouchá, spíše než volání rozhraní.

Obor názvů:  Microsoft.VisualStudio.VsWizard
Sestavení:  Microsoft.VisualStudio.VsWizard (v Microsoft.VisualStudio.VsWizard.dll)

Syntaxe

'Deklarace
ReadOnly Property Source As Boolean
bool Source { get; }
property bool Source {
    bool get ();
}
abstract Source : bool with get
function get Source () : boolean

Hodnota vlastnosti

Typ: Boolean
true Pokud je rozhraní zdroje; jinak false.

Poznámky

Zdrojové rozhraní je rozhraní pro klienta komunikuje, nikoli volá rozhraní klienta (například formou spojovací body v jazyce C++).Server zavolá (nebo multiplexes volání, pokud rozhraní umožňuje několik klientů) a klient implementuje obslužnou rutinu.

Pouze jedno rozhraní lze v daném coclass označeny [zdroje].

Příklady

// From the Visual C++ Member Variable wizard

function GenerateActiveXControlClassText(oTypeLib)
{
   var strClassText = "";

   var oInterfaces = oTypeLib.Interfaces;
   var nCount = oInterfaces.Count;

   var bGenerate_Array = new Array();
   var Name_Array = new Array();
   var Base_Array = new Array();
   var i;
   for (i = 0; i < nCount; i++)
   {
      var oInterface = oInterfaces.item(i+1);

      if (oInterface.CoClass != CONTROL_TYPE.text 
         || oInterface.Default == false 
         || oInterface.Source == true)
         continue;

      Name_Array[i] = oInterface.Name;
      Base_Array[i] = oInterface.Base;
      bGenerate_Array[i] = true;
   }
   for (i = 0; i < nCount; i++)
   {
      if (oInterface.CoClass != CONTROL_TYPE.text 
         || oInterface.Default == false 
         || oInterface.Source == true)
         continue;

      var strBase = Base_Array[i];
      if(strBase && strBase.length && 
         strBase!="IDispatch" && strBase!="IUnknown")
      {
         for(var j=0; j< nCount; j++)
         {
            if(strBase == Name_Array[j])
            {
               bGenerate_Array[j] = false;
               break;
            }
         }
      }
   }
   for (i = 0; i <  nCount; i++)
   {
      var oInterface = oInterfaces.item(i+1);
      if(!bGenerate_Array[i])
      {
         strClassText += "// Interface: " + Name_Array[i] + " not generated, because it was a base interface for others.\n\n";
      }
      else if (oInterface.Type == 2 
               && oInterface.CoClass == CONTROL_TYPE.text 
               && oInterface.Default 
               && !oInterface.Source)  // einterfaceDispinterface
      {
         strClassText += "// ";
         strClassText += Name_Array[i];
         strClassText += "\r\n\r\n// Functions\r\n//\r\n\r\n";
         strClassText += GetFuncText(oTypeLib, oInterface, strClassText);
      }
   }
   return strClassText;
}

Zabezpečení rozhraní .NET Framework

Viz také

Referenční dokumentace

IInterfaceInfo Rozhraní

Microsoft.VisualStudio.VsWizard – obor názvů