Peer.GetObjects Peer.GetObjects Peer.GetObjects Peer.GetObjects Method

定義

從本機快取中,取得對等電腦所註冊之資料物件的集合。Gets the collection of data objects that were registered by the peer from a local cache.

多載

GetObjects() GetObjects() GetObjects() GetObjects()

取得本機快取中資料物件的集合。Gets the collection of data objects from a local cache.

GetObjects(Guid) GetObjects(Guid) GetObjects(Guid) GetObjects(Guid)

Peer 中,取得與提供的 Guid 相關聯的 PeerObjectCollection 物件。Gets the Peer object associated with the supplied Guid from the PeerObjectCollection.

備註

這項功能只會公開在PeerContact類別。This functionality is only exposed on the PeerContact class. 這項功能不會基於安全性的對等的任何其他型別上公開。This functionality is not exposed on any other type of peer for security reasons.

如果不找到端點的任何物件,則傳回的集合大小為零 (0) 是。If no objects are found for the endpoint, a collection of size zero (0) is returned.

GetObjects() GetObjects() GetObjects() GetObjects()

取得本機快取中資料物件的集合。Gets the collection of data objects from a local cache.

public:
 System::Net::PeerToPeer::Collaboration::PeerObjectCollection ^ GetObjects();
[System.Security.SecurityCritical]
public System.Net.PeerToPeer.Collaboration.PeerObjectCollection GetObjects ();
member this.GetObjects : unit -> System.Net.PeerToPeer.Collaboration.PeerObjectCollection
Public Function GetObjects () As PeerObjectCollection

傳回

這個執行個體所指定的對等電腦或端點的 PeerObject 集合。The PeerObject collection for the peer or endpoint specified by this instance.

例外狀況

呼叫端未訂閱端點,或尚未呼叫 RefreshData()The caller is not subscribed to the endpoint or has not yet called RefreshData().

這個方法無法完成,因為基礎對等共同作業基礎結構中發生錯誤。The method is unable to complete due to an error in the underlying Peer Collaboration infrastructure.

備註

這項功能只會公開在PeerContact類別。This functionality is only exposed on the PeerContact class. 這項功能不會基於安全性的對等的任何其他型別上公開。This functionality is not exposed on any other type of peer for security reasons.

如果對等共同作業工作階段未具現化與PermissionStateUnrestricted,這個方法無法存取本機電腦上的物件。If the peer collaboration session did not instantiate with a PermissionState of Unrestricted, this method cannot access objects on the local computer. 這也註冊的應用程式到共同作業的工作階段,則為 true。The same is true of the applications registered into the collaboration session.

對等物件的集合是由應用程式、 資料物件和這個執行個體所指定端點的對等的顯示狀態資訊所組成。The collection of peer objects consists of application, data object, and presence information for the peer or endpoint specified by this instance. 如果不找到端點的任何物件,則傳回的集合大小為零 (0) 是。If no objects are found for the endpoint, a collection of size zero (0) is returned. 如果呼叫的對等訂閱此端點時,會自動更新快取;否則RefreshData之前呼叫這個方法,必須呼叫。If the calling peer is subscribed to this endpoint, the cache is automatically updated; otherwise RefreshData must be called prior to calling this method.

呼叫端不需要登入共同作業基礎結構,這個方法順利完成。The caller is not required to be signed into the collaboration infrastructure for this method to complete successfully. 在成功呼叫RefreshData或其中一個Subscribe方法必須已完成,而呼叫端之前呼叫這個方法,已登入。A successful call to RefreshData or one of the Subscribe methods must have been completed while the caller was signed in previous to calling this method.

附註:上所定義的其他多載Peer類別而不是子類別PeerContactPeerNearMeNOTE: Additional overloads are defined on the Peer class instead of the subclasses PeerContact and PeerNearMe.

另請參閱

GetObjects(Guid) GetObjects(Guid) GetObjects(Guid) GetObjects(Guid)

Peer 中,取得與提供的 Guid 相關聯的 PeerObjectCollection 物件。Gets the Peer object associated with the supplied Guid from the PeerObjectCollection.

public:
 System::Net::PeerToPeer::Collaboration::PeerObjectCollection ^ GetObjects(Guid objectId);
[System.Security.SecurityCritical]
public System.Net.PeerToPeer.Collaboration.PeerObjectCollection GetObjects (Guid objectId);
member this.GetObjects : Guid -> System.Net.PeerToPeer.Collaboration.PeerObjectCollection
Public Function GetObjects (objectId As Guid) As PeerObjectCollection

參數

objectId
Guid Guid Guid Guid

要從集合中擷取的 Guid 物件的 PeerThe Guid of the Peer object to be retrieved from the collection

傳回

與提供的 Peer 相關聯的 GuidPeer object associated with the supplied Guid. 如果找不到物件,就會傳回大小為零 (0) 的集合。If an object is not found, a collection of size zero (0) is returned.

例外狀況

呼叫端未訂閱 PeerEndPoint,或尚未對它呼叫 RefreshData()The caller is not subscribed to the PeerEndPoint or has not yet called RefreshData() against it.

從對等電腦擷取物件資訊時發生錯誤。An error occurred when getting object information from the peer.

備註

這項功能只會公開在PeerContact類別。This functionality is only exposed on the PeerContact class. 這項功能不會基於安全性的對等的任何其他型別上公開。This functionality is not exposed on any other type of peer for security reasons.

對等物件的集合是由應用程式、 資料物件和這個執行個體所指定端點的對等的顯示狀態資訊所組成。The collection of peer objects consists of application, data object, and presence information for the peer or endpoint specified by this instance. 如果不找到端點的任何物件,則傳回的集合大小為零 (0) 是。If no objects are found for the endpoint, a collection of size zero (0) is returned. 當呼叫的對等訂閱這個端點時,會自動更新快取;否則RefreshData之前呼叫這個方法,必須呼叫。When the calling peer is subscribed to this endpoint, the cache is automatically updated; otherwise RefreshData must be called prior to calling this method.

呼叫端不需要登入共同作業基礎結構,這個方法順利完成。The caller is not required to be signed into the collaboration infrastructure for this method to complete successfully. 在成功呼叫RefreshData或其中一個Subscribe方法必須已完成,而呼叫端之前呼叫這個方法,已登入。A successful call to RefreshData or one of the Subscribe methods must have been completed while the caller was signed in previous to calling this method. 呼叫這個方法需要PermissionStateUnrestrictedCalling this method requires a PermissionState of Unrestricted. 共同作業工作階段開始時,會建立此狀態。This state is created when the collaboration session begins.

附註:上所定義的其他多載Peer而不是在衍生類別的類別PeerContactPeerNearMeNOTE: Additional overloads are defined on the Peer class instead of the derived classes PeerContact and PeerNearMe.

另請參閱

適用於