protected PeerApplication(SerializationInfo serializationInfo, StreamingContext streamingContext) { m_id = (Guid)serializationInfo.GetValue("_Id", typeof(Guid)); m_data = (byte [])serializationInfo.GetValue("_Data", typeof(byte[])); m_description = serializationInfo.GetString("_Description"); m_path = serializationInfo.GetString("_Path"); m_commandLineArgs = serializationInfo.GetString("_CommandLineArgs"); m_peerScope = (PeerScope)serializationInfo.GetInt32("_Scope"); }
public PeerObject(Guid Id, byte[] data, PeerScope peerScope) { if ((data != null) && (data.Length > c_16K)) { throw new ArgumentException(SR.GetString(SR.Collab_ObjectDataSizeFailed), "data"); } m_id = Id; m_peerScope = peerScope; m_data = data; }
public PeerApplication(Guid id, string description, byte[] data, string path, string commandLineArgs, PeerScope peerScope) { if ((data != null) && (data.Length > c_16K)) { throw new ArgumentException(SR.GetString(SR.Collab_ApplicationDataSizeFailed), "data"); } m_id = id; m_description = description; m_data = data; m_path = path; m_commandLineArgs = commandLineArgs; m_peerScope = peerScope; }
public static void SignOut(PeerScope peerScope) { Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "Entering SignOut with peerscope {0}.", peerScope); PeerCollaborationPermission.UnrestrictedPeerCollaborationPermission.Demand(); CollaborationHelperFunctions.Initialize(); if ((peerScope < PeerScope.None) || (peerScope > PeerScope.All)) throw new ArgumentOutOfRangeException("peerScope"); if (peerScope != PeerScope.None){ int errorCode = UnsafeCollabNativeMethods.PeerCollabSignout(peerScope); if (errorCode != 0){ Logging.P2PTraceSource.TraceEvent(TraceEventType.Error, 0, "PeerCollabSignout returned with errorcode {0}", errorCode); throw (PeerToPeerException.CreateFromHr(SR.GetString(SR.Collab_SignOutFailed), errorCode)); } } Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "Signed out of {0}.", peerScope); }
internal extern static int PeerCollabGetSigninOptions(ref PeerScope dwSignInOptions);
internal extern static int PeerCollabSignout(PeerScope dwSignInOptions);
internal extern static int PeerCollabSignin(IntPtr hwndParent, PeerScope dwSignInOptions);
protected PeerObject(SerializationInfo serializationInfo, StreamingContext streamingContext) { m_id = (Guid)serializationInfo.GetValue("_Id", typeof(Guid)); m_data = (byte[])serializationInfo.GetValue("_Data", typeof(byte[])); m_peerScope = (PeerScope)serializationInfo.GetInt32("_Scope"); }