ToString() public method

public ToString ( ) : string
return string
示例#1
0
        public TcpServer(string address)
        {
            AddressEntry[] entries = DBus.Address.Parse(address);
            AddressEntry   entry   = entries[0];

            if (entry.Method != "tcp")
            {
                throw new Exception();
            }

            string val;

            if (entry.Properties.TryGetValue("port", out val))
            {
                port = UInt32.Parse(val);
            }

            if (entry.GUID == UUID.Zero)
            {
                entry.GUID = UUID.Generate();
            }
            Id = entry.GUID;

            /*
             * Id = entry.GUID;
             * if (Id == UUID.Zero)
             *      Id = UUID.Generate ();
             */

            this.address = entry.ToString();
            //Console.WriteLine ("Server address: " + Address);
        }
示例#2
0
        public UnixServer(string address)
        {
            AddressEntry[] entries = DBus.Address.Parse(address);
            AddressEntry   entry   = entries[0];

            if (entry.Method != "unix")
            {
                throw new Exception();
            }

            string val;

            if (entry.Properties.TryGetValue("path", out val))
            {
                unixPath   = val;
                isAbstract = false;
            }
            else if (entry.Properties.TryGetValue("abstract", out val))
            {
                unixPath   = val;
                isAbstract = true;
            }

            if (String.IsNullOrEmpty(unixPath))
            {
                throw new Exception("Address path is invalid");
            }

            if (entry.GUID == UUID.Zero)
            {
                entry.GUID = UUID.Generate();
            }
            Id = entry.GUID;

            /*
             * Id = entry.GUID;
             * if (Id == UUID.Zero)
             *      Id = UUID.Generate ();
             */

            this.address = entry.ToString();
            //Console.WriteLine ("Server address: " + Address);
        }
示例#3
0
        public WinServer(string address)
        {
            AddressEntry[] entries = DBus.Address.Parse(address);
            AddressEntry   entry   = entries[0];

            if (entry.Method != "win")
            {
                throw new Exception();
            }

            string val;

            if (entry.Properties.TryGetValue("path", out val))
            {
                pipePath = val;
            }

            if (String.IsNullOrEmpty(pipePath))
            {
                throw new Exception("Address path is invalid");
            }

            if (entry.GUID == UUID.Zero)
            {
                entry.GUID = UUID.Generate();
            }
            Id = entry.GUID;

            /*
             * Id = entry.GUID;
             * if (Id == UUID.Zero)
             *      Id = UUID.Generate ();
             */

            this.address = entry.ToString();
            Console.WriteLine("Server address: " + Address);
        }