public ExtensionConfigurationBuilder(ExtensionManager extensionManager)
 {
     if (extensionManager == null)
     {
         throw new ArgumentNullException("extensionManager");
     }
     this.extensionManager = extensionManager;
     allRoles = new HashSet<string>();
     namedRoles = new Dictionary<string, HashSet<string>>();
 }
 public ExtensionConfigurationBuilder(ExtensionManager extensionManager, ExtensionConfiguration config)
     : this(extensionManager)
 {
     Add(config);
 }
        protected void ValidateService()
        {
            string serviceName;
            ServiceSettings settings = General.GetDefaultSettings(General.TryGetServiceRootPath(CurrentPath()),
                ServiceName, null, null, null, null, CurrentSubscription.SubscriptionId, out serviceName);

            if (string.IsNullOrEmpty(serviceName))
            {
                throw new Exception(string.Format(Resources.ServiceExtensionCannotFindServiceName, ServiceName));
            }
            else
            {
                ServiceName = serviceName;
                if (!IsServiceAvailable(ServiceName))
                {
                    throw new Exception(string.Format(Resources.ServiceExtensionCannotFindServiceName, ServiceName));
                }
            }

            ExtensionManager = new ExtensionManager(Channel, CurrentSubscription.SubscriptionId, ServiceName);
        }