Ejemplo n.º 1
0
        /// <summary>
        /// Launches windows azure management portal with specific service if specified.
        /// </summary>
        /// <param name="serviceUrl">The service uri.</param>
        /// <param name="Realm">Realm of the account.</param>
        public static void LaunchWindowsAzurePortal(string serviceUrl, string Realm)
        {
            Validate.ValidateInternetConnection();

            UriBuilder uriBuilder = new UriBuilder(General.AzurePortalUrl);

            if (!string.IsNullOrEmpty(serviceUrl))
            {
                uriBuilder.Fragment += serviceUrl;
            }

            if (Realm != null)
            {
                string queryToAppend = string.Format("whr={0}", Realm);
                if (uriBuilder.Query != null && uriBuilder.Query.Length > 1)
                {
                    uriBuilder.Query = uriBuilder.Query.Substring(1) + "&" + queryToAppend;
                }
                else
                {
                    uriBuilder.Query = queryToAppend;
                }
            }

            General.LaunchWebPage(uriBuilder.ToString());
        }