Click here to Skip to main content
15,894,825 members
Articles / Web Development / ASP.NET

Peer Collaboration - Inviting

Rate me:
Please Sign up or sign in to vote.
4.20/5 (4 votes)
1 May 20067 min read 27.2K   441   28  
Inviting People Near Me using Microsoft's Peer-to-Peer Collaboration technology in Windows Vista.
using System;
using System.Runtime.InteropServices;

namespace Peer.Collaboration
{
    public class PeerApplicationRegistration
    {
        internal PEER_APPLICATION_REGISTRATION_INFO info;

        public PeerApplicationRegistration(Guid ID, string Description, string ApplicationToLaunch)
        {
            info = new PEER_APPLICATION_REGISTRATION_INFO();
            this.ID = ID;
            this.Description = Description;
            this.ApplicationToLaunch = ApplicationToLaunch;
        }

        internal PeerApplicationRegistration(PEER_APPLICATION_REGISTRATION_INFO data)
        {
            info = data;
        }

        public Guid ID
        {
            get { return info.application.id; }
            set { info.application.id = value; }
        }

        public string Description
        {
            get { return info.application.pwzDescription; }
            set { info.application.pwzDescription = value; }
        }

        public string ApplicationToLaunch
        {
            get { return info.pwzApplicationToLaunch; }
            set { info.pwzApplicationToLaunch = value; }
        }

        public string ApplicationArguments
        {
            get { return info.pwzApplicationArguments; }
            set { info.pwzApplicationArguments = value; }
        }

        public PeerPublicationScope PublicationScope
        {
            get { return info.dwPublicationScope; }
            set { info.dwPublicationScope = value; }
        }
    }


    public class PeerApplication
    {
        private PEER_APPLICATION data;

        public PeerApplication(string Description)
        {
            data = new PEER_APPLICATION();
            data.id = Guid.NewGuid();
            data.pwzDescription = Description;
        }

        internal PeerApplication(PEER_APPLICATION info)
        {
            data = info;
        }

        internal PEER_APPLICATION ConvertTo()
        {
            return data;
        }

        public Guid ID
        {
            get { return data.id; }
        }

        public string Description
        {
            get { return data.pwzDescription; }
        }

        //public string DataAsString
        //{
        //    get { return Marshal.PtrToStringUni(data.data.pbData); }
        //}
    }

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Canada Canada
Adrian Moore is the Development Manager for the SCADA Vision system developed by ABB Inc in Calgary, Alberta.

He has been interested in compilers, parsers, real-time database systems and peer-to-peer solutions since the early 90's. In his spare time, he is currently working on a SQL parser for querying .NET DataSets (http://www.queryadataset.com).

Adrian is a Microsoft MVP for Windows Networking.

Comments and Discussions