public bool TrySetContext(string name, IAzureContext context)
        {
            bool result = Profile.TrySetContext(name, context);

            DefaultProfile.TrySetContext(name, context);
            return(result);
        }
        public bool TrySetContext(IAzureContext context, out string name)
        {
            bool   local = Profile.TrySetContext(context, out name);
            string remoteName;
            bool   remote = DefaultProfile.TrySetContext(context, out remoteName);

            return(local || remote);
        }
        public bool TrySetDefaultContext(string name)
        {
            bool result = Profile.TrySetDefaultContext(name);

            if (result)
            {
                if (!DefaultProfile.Contexts.ContainsKey(name))
                {
                    var localContext = Profile.Contexts[name];
                    DefaultProfile.TrySetContext(name, localContext);
                }

                DefaultProfile.TrySetDefaultContext(name);
            }

            return(result);
        }