Example #1
0
        /// <summary>
        /// Returns network profile information about the client's identity.
        /// </summary>
        /// <param name="IncludeThumbnailImage">If true, the returned profile information will include thumbnail image.</param>
        /// <returns>network profile information about the client's identity.</returns>
        public IdentityNetworkProfileInformation GetIdentityNetworkProfileInformation(bool IncludeThumbnailImage)
        {
            log.Trace("(IncludeThumbnailImage:{0})", IncludeThumbnailImage);

            IdentityNetworkProfileInformation res = new IdentityNetworkProfileInformation()
            {
                IdentityPublicKey = ProtocolHelper.ByteArrayToByteString(keys.PublicKey),
                IsHosted          = false,
                IsOnline          = false,
                Latitude          = location.GetLocationTypeLatitude(),
                Longitude         = location.GetLocationTypeLongitude(),
                Name      = name != null ? name : "",
                Type      = type != null ? type : "",
                Version   = version.ToByteString(),
                ExtraData = extraData != null ? extraData : ""
            };

            if (IncludeThumbnailImage && (thumbnailImage != null))
            {
                res.ThumbnailImage = ProtocolHelper.ByteArrayToByteString(thumbnailImage);
            }
            else
            {
                res.ThumbnailImage = ProtocolHelper.ByteArrayToByteString(new byte[0]);
            }

            log.Trace("(-)");
            return(res);
        }