Beispiel #1
0
 public WebServiceSettingsBuilder(IServiceProvider serviceProvider,
                                  WebServiceSettingsNode webServiceSettingsNode)
 {
     this.webServiceSettingsNode = webServiceSettingsNode;
     hierarchy          = ServiceHelper.GetCurrentHierarchy(serviceProvider);
     webServiceSettings = new WebServiceSettings();
 }
Beispiel #2
0
        protected override ConfigurationSectionInfo GetConfigurationSectionInfo(
            IServiceProvider serviceProvider)
        {
            ConfigurationNode rootNode = ServiceHelper.GetCurrentRootNode(serviceProvider);

            WebServiceSettingsNode node = null;

            if (rootNode != null)
            {
                node = (WebServiceSettingsNode)rootNode.Hierarchy.FindNodeByType(
                    rootNode,
                    typeof(WebServiceSettingsNode));
            }

            WebServiceSettings webServiceSection = null;

            if (node == null)
            {
                webServiceSection = null;
            }
            else
            {
                WebServiceSettingsBuilder builder = new WebServiceSettingsBuilder(serviceProvider, node);
                webServiceSection = builder.Build();
            }

            return(new ConfigurationSectionInfo(node, webServiceSection, WebServiceSettings.SectionName));
        }
        protected override void OnExecuted(EventArgs e)
        {
            base.OnExecuted(e);
            WebServiceSettingsNode node = ChildNode as
                                          WebServiceSettingsNode;
            WebServiceURLCollectionNode webServiceURLCollectionNode =
                new WebServiceURLCollectionNode();

            node.AddNode(webServiceURLCollectionNode);
        }
Beispiel #4
0
        public WebServiceSettingsNode Build()
        {
            WebServiceSettingsNode      rootNode = new WebServiceSettingsNode();
            WebServiceURLCollectionNode node     = new WebServiceURLCollectionNode();
            WebServiceURLNode           webServiceURLNode;

            foreach (WebServiceURL data in webServiceSettings.WebServiceURLs)
            {
                webServiceURLNode = new WebServiceURLNode(data);
                node.AddNode(webServiceURLNode);

                if (webServiceURLNode.Name == webServiceSettings.DefaultWebServiceURL)
                {
                    defaultNode = webServiceURLNode;
                }
            }

            rootNode.AddNode(node);
            rootNode.DefaultWebServiceURLSetting = defaultNode;

            return(rootNode);
        }