static ProtectedProviderSettings ()
		{
			providersProp = new ConfigurationProperty ("", typeof (ProviderSettingsCollection), null,
								   null, null, ConfigurationPropertyOptions.IsDefaultCollection);

			properties = new ConfigurationPropertyCollection ();
			properties.Add (providersProp);
		}
Beispiel #2
0
        static WebServicesSection()
        {
            conformanceWarningsProp = new ConfigurationProperty("conformanceWarnings", typeof(WsiProfilesElementCollection), null,
                                                                null, null, ConfigurationPropertyOptions.None);
            diagnosticsProp = new ConfigurationProperty("diagnostics", typeof(DiagnosticsElement), null,
                                                        null, null, ConfigurationPropertyOptions.None);
            protocolsProp = new ConfigurationProperty("protocols", typeof(ProtocolElementCollection), null,
                                                      null, null, ConfigurationPropertyOptions.None);
            serviceDescriptionFormatExtensionTypesProp = new ConfigurationProperty("serviceDescriptionFormatExtensionTypes", typeof(TypeElementCollection), null,
                                                                                   null, null, ConfigurationPropertyOptions.None);
            soapEnvelopeProcessingProp = new ConfigurationProperty("soapEnvelopeProcessing", typeof(SoapEnvelopeProcessingElement), null,
                                                                   null, null, ConfigurationPropertyOptions.None);
            soapExtensionImporterTypesProp = new ConfigurationProperty("soapExtensionImporterTypes", typeof(TypeElementCollection), null,
                                                                       null, null, ConfigurationPropertyOptions.None);
            soapExtensionReflectorTypesProp = new ConfigurationProperty("soapExtensionReflectorTypes", typeof(TypeElementCollection), null,
                                                                        null, null, ConfigurationPropertyOptions.None);
            soapExtensionTypesProp = new ConfigurationProperty("soapExtensionTypes", typeof(SoapExtensionTypeElementCollection), null,
                                                               null, null, ConfigurationPropertyOptions.None);
            soapServerProtocolFactoryProp = new ConfigurationProperty("soapServerProtocolFactory", typeof(TypeElement), null,
                                                                      null, null, ConfigurationPropertyOptions.None);
            soapTransportImporterTypesProp = new ConfigurationProperty("soapTransportImporterTypes", typeof(TypeElementCollection), null,
                                                                       null, null, ConfigurationPropertyOptions.None);
            wsdlHelpGeneratorProp = new ConfigurationProperty("wsdlHelpGenerator", typeof(WsdlHelpGeneratorElement), null,
                                                              null, null, ConfigurationPropertyOptions.None);
            properties = new ConfigurationPropertyCollection();

            properties.Add(conformanceWarningsProp);
            properties.Add(diagnosticsProp);
            properties.Add(protocolsProp);
            properties.Add(serviceDescriptionFormatExtensionTypesProp);
            properties.Add(soapEnvelopeProcessingProp);
            properties.Add(soapExtensionImporterTypesProp);
            properties.Add(soapExtensionReflectorTypesProp);
            properties.Add(soapExtensionTypesProp);
            properties.Add(soapServerProtocolFactoryProp);
            properties.Add(soapTransportImporterTypesProp);
            properties.Add(wsdlHelpGeneratorProp);
        }
Beispiel #3
0
        /// <summary>
        /// Initializes the <see cref="CacheRegionElement"/> class.
        /// </summary>
        static CommandCacheDependencyElement()
        {
            //building the properties collection and overriding the properties property apparently
            //increases performace considerably
            properties = new ConfigurationPropertyCollection();

            var nameProperty = new ConfigurationProperty("name", typeof(string), String.Empty,
                                                         ConfigurationPropertyOptions.IsKey);

            properties.Add(nameProperty);

            var commandProperty = new ConfigurationProperty("command", typeof(string), String.Empty,
                                                            ConfigurationPropertyOptions.IsRequired);

            properties.Add(commandProperty);

            var commandTimeoutProperty = new ConfigurationProperty("commandTimeout", typeof(int?), null,
                                                                   ConfigurationPropertyOptions.None);

            properties.Add(commandTimeoutProperty);

            var connectionNameProperty = new ConfigurationProperty("connectionName", typeof(string), String.Empty,
                                                                   ConfigurationPropertyOptions.None);

            properties.Add(connectionNameProperty);

            var isSprocProperty = new ConfigurationProperty("isStoredProcedure", typeof(bool), false,
                                                            ConfigurationPropertyOptions.None);

            properties.Add(isSprocProperty);

            var providerTypeProperty = new ConfigurationProperty("connectionStringProviderType", typeof(System.Type), null,
                                                                 new TypeNameConverter(),
                                                                 new SubclassTypeValidator(typeof(IConnectionStringProvider)),
                                                                 ConfigurationPropertyOptions.None);

            properties.Add(providerTypeProperty);
        }
        static EdgeServicesConfiguration()
        {
            s_extensions = new ConfigurationProperty(
                "Extensions",
                typeof(ExtensionElementCollection)
                );
            s_services = new ConfigurationProperty(
                "Services",
                typeof(ServiceElementCollection),
                null,
                ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsDefaultCollection);

            s_accounts = new ConfigurationProperty(
                "Accounts",
                typeof(AccountElementCollection),
                null,
                ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsDefaultCollection);

            s_properties = new ConfigurationPropertyCollection();
            s_properties.Add(s_extensions);
            s_properties.Add(s_services);
            s_properties.Add(s_accounts);
        }
        public static T ConvertValue <T>(IConfigSchema schema, string settingName, object rawValue)
        {
            if (!(rawValue is T))
            {
                ConfigurationProperty property = schema.GetConfigurationProperty(settingName, typeof(T));
                ExchangeConfigurationSection.RunConfigOperation(delegate
                {
                    TypeConverter converter = property.Converter;
                    rawValue = converter.ConvertTo(rawValue, typeof(T));
                }, (Exception ex) => new ConfigurationSettingsPropertyBadTypeException(string.Format("{0}:{1}", settingName, (rawValue != null) ? rawValue.GetType().ToString() : "(null)"), typeof(T).ToString(), ex));
            }
            T result;

            try
            {
                result = (T)((object)rawValue);
            }
            catch (InvalidCastException innerException)
            {
                throw new ConfigurationSettingsPropertyBadTypeException(string.Format("{0}:{1}", settingName, (rawValue != null) ? rawValue.GetType().ToString() : "(null)"), typeof(T).ToString(), innerException);
            }
            return(result);
        }
Beispiel #6
0
        /// <summary>
        /// Der statische ctor initialisiert auch hier das ganze Ding
        /// </summary>
        static ShaperDebugOptions()
        {
            s_IsSimulateOnly      = new ConfigurationProperty("IsSimulateOnly", typeof(bool), true, ConfigurationPropertyOptions.IsRequired);
            s_IsInteractive       = new ConfigurationProperty("IsInteractive", typeof(bool), true, ConfigurationPropertyOptions.IsRequired);
            s_OnExceptionSendMail = new ConfigurationProperty("OnExceptionSendMail", typeof(bool), true, ConfigurationPropertyOptions.IsRequired);
            s_MailReceiverList    = new ConfigurationProperty("MailReceiverList", typeof(string), "*****@*****.**", ConfigurationPropertyOptions.None);
            s_MailSender          = new ConfigurationProperty("MailSender", typeof(string), "*****@*****.**", ConfigurationPropertyOptions.None);
            s_MailSmtpHostname    = new ConfigurationProperty("MailSmtpHostname", typeof(string), "mail.domain.com", ConfigurationPropertyOptions.None);
            s_MailSmtpPort        = new ConfigurationProperty("MailSmtpPort", typeof(int), 0, ConfigurationPropertyOptions.None);
            s_MailSmtpUsername    = new ConfigurationProperty("MailSmtpUsername", typeof(string), "username", ConfigurationPropertyOptions.None);
            s_MailSmtpPassword    = new ConfigurationProperty("MailSmtpPassword", typeof(string), "password", ConfigurationPropertyOptions.None);

            s_Properties = new ConfigurationPropertyCollection();
            s_Properties.Add(s_IsSimulateOnly);
            s_Properties.Add(s_IsInteractive);
            s_Properties.Add(s_OnExceptionSendMail);
            s_Properties.Add(s_MailReceiverList);
            s_Properties.Add(s_MailSender);
            s_Properties.Add(s_MailSmtpHostname);
            s_Properties.Add(s_MailSmtpPort);
            s_Properties.Add(s_MailSmtpUsername);
            s_Properties.Add(s_MailSmtpPassword);
        }
Beispiel #7
0
        // If a configuration section has a default value coming from 4.0 config and the AppDomain is opted in to auto-config upgrade,
        // set the configuration section element explicitly to its new 4.5 value. If the property has been explicitly set, no change
        // will be made.
        internal static void SetFX45DefaultValue(ConfigurationSection configSection, ConfigurationProperty property, object newDefaultValue)
        {
            if (BinaryCompatibility.Current.TargetsAtLeastFramework45 && !configSection.IsReadOnly())
            {
                PropertyInformation propInfo = configSection.ElementInformation.Properties[property.Name];
                Debug.Assert(propInfo != null);
                Debug.Assert(propInfo.Type.IsInstanceOfType(newDefaultValue));

                if (propInfo.ValueOrigin == PropertyValueOrigin.Default)
                {
                    try {
                        propInfo.Value = newDefaultValue;
                    }
                    catch (ConfigurationErrorsException) {
                        // Calling the Value setter might throw if the configuration element is locked.
                        // We can technically override the "is locked?" check by calling the appropriate
                        // method, but for now let's just honor the locks and ignore these errors. The
                        // config sections we're touching shouldn't really ever be locked anyway, so
                        // nobody should ever run into this in practice.
                    }
                }
            }
        }
Beispiel #8
0
        static GlobalizationSection()
        {
            cultureProp = new ConfigurationProperty("culture", typeof(string), "");
            enableBestFitResponseEncodingProp = new ConfigurationProperty("enableBestFitResponseEncoding", typeof(bool), false);
            enableClientBasedCultureProp      = new ConfigurationProperty("enableClientBasedCulture", typeof(bool), false);
            fileEncodingProp                = new ConfigurationProperty("fileEncoding", typeof(string));
            requestEncodingProp             = new ConfigurationProperty("requestEncoding", typeof(string), "utf-8");
            resourceProviderFactoryTypeProp = new ConfigurationProperty("resourceProviderFactoryType", typeof(string), "");
            responseEncodingProp            = new ConfigurationProperty("responseEncoding", typeof(string), "utf-8");
            responseHeaderEncodingProp      = new ConfigurationProperty("responseHeaderEncoding", typeof(string), "utf-8");
            uiCultureProp = new ConfigurationProperty("uiCulture", typeof(string), "");
            properties    = new ConfigurationPropertyCollection();

            properties.Add(cultureProp);
            properties.Add(enableBestFitResponseEncodingProp);
            properties.Add(enableClientBasedCultureProp);
            properties.Add(fileEncodingProp);
            properties.Add(requestEncodingProp);
            properties.Add(resourceProviderFactoryTypeProp);
            properties.Add(responseEncodingProp);
            properties.Add(responseHeaderEncodingProp);
            properties.Add(uiCultureProp);
        }
Beispiel #9
0
        static UserElement()
        {
            _admin    = new ConfigurationProperty("admin", typeof(bool), false, ConfigurationPropertyOptions.None);
            _email    = new ConfigurationProperty("email", typeof(string), null, ConfigurationPropertyOptions.IsRequired);
            _name     = new ConfigurationProperty("name", typeof(string), null, ConfigurationPropertyOptions.IsRequired);
            _password = new ConfigurationProperty("password", typeof(string), null, ConfigurationPropertyOptions.IsRequired);

            _sandboxes = new ConfigurationProperty(
                "sandboxes", typeof(InitializationSandboxes), null, ConfigurationPropertyOptions.None);

            _namespacePrefixes = new ConfigurationProperty(
                "namespacePrefixes", typeof(InitializationNamespacePrefixes), null, ConfigurationPropertyOptions.None);

            _properties = new ConfigurationPropertyCollection
            {
                _admin,
                _email,
                _name,
                _password,
                _sandboxes,
                _namespacePrefixes
            };
        }
Beispiel #10
0
        /// <summary>
        /// Gets a configuration value or the specified default value.
        /// </summary>
        /// <param name="sectionName">Name of the section containing the parameter.</param>
        /// <param name="parameterName">Name of the parameter containing the value.</param>
        /// <param name="value">Default value.</param>
        /// <returns>Configuraiton value or default.</returns>
        private int GetConfigValueAsInteger(string sectionName, string parameterName, int value = 0)
        {
            if (null != this.Settings)
            {
                ConfigurationSection section = this.Settings.Sections[sectionName];
                if (null != section)
                {
                    ConfigurationProperty parameter = section.Parameters[parameterName];
                    if (null != parameter)
                    {
                        if (int.TryParse(
                                parameter.Value,
                                out int
                                val))
                        {
                            value = val;
                        }
                    }
                }
            }

            return(value);
        }
Beispiel #11
0
        /// <summary>
        /// Gets a configuration value or the specified default value.
        /// </summary>
        /// <param name="sectionName">Name of the section containing the parameter.</param>
        /// <param name="parameterName">Name of the parameter containing the value.</param>
        /// <param name="value">Default value.</param>
        /// <returns>Configuraiton value or default.</returns>
        private TimeSpan GetConfigValueAsTimeSpan(string sectionName, string parameterName, TimeSpan value = default(TimeSpan))
        {
            if (null != this.Settings)
            {
                ConfigurationSection section = this.Settings.Sections[sectionName];
                if (null != section)
                {
                    ConfigurationProperty parameter = section.Parameters[parameterName];
                    if (null != parameter)
                    {
                        if (TimeSpan.TryParse(
                                parameter.Value,
                                out TimeSpan
                                val))
                        {
                            value = val;
                        }
                    }
                }
            }

            return(value);
        }
Beispiel #12
0
        static ObjectCacheElement()
        {
            _propName                   = new ConfigurationProperty("name", typeof(string), null, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
            _propType                   = new ConfigurationProperty("type", typeof(string), _defaultObjectCacheTypeName, ConfigurationPropertyOptions.None);
            _propInstanceMode           = new ConfigurationProperty("instanceMode", typeof(ObjectCacheInstanceMode), ObjectCacheInstanceMode.PerName, ConfigurationPropertyOptions.None);
            _propAbsoluteExpiration     = new ConfigurationProperty("absoluteExpiration", typeof(DateTimeOffset), ObjectCache.InfiniteAbsoluteExpiration, ConfigurationPropertyOptions.None);
            _propSlidingExpiration      = new ConfigurationProperty("slidingExpiration", typeof(TimeSpan), ObjectCache.NoSlidingExpiration, ConfigurationPropertyOptions.None);
            _propDuration               = new ConfigurationProperty("duration", typeof(TimeSpan?), null, ConfigurationPropertyOptions.None);
            _propPriority               = new ConfigurationProperty("priority", typeof(CacheItemPriority), CacheItemPriority.Default, ConfigurationPropertyOptions.None);
            _propOutputCacheProfileName = new ConfigurationProperty("outputCacheProfileName", typeof(string), null, ConfigurationPropertyOptions.None);

            _properties = new ConfigurationPropertyCollection
            {
                _propName,
                _propType,
                _propInstanceMode,
                _propAbsoluteExpiration,
                _propSlidingExpiration,
                _propDuration,
                _propPriority,
                _propOutputCacheProfileName,
            };
        }
Beispiel #13
0
        static GeSHiConfigSection()
        {
            s_showNumbering = new ConfigurationProperty(
                "showNumbering",
                typeof(bool),
                false,
                ConfigurationPropertyOptions.None
                );

            s_showCollapsible = new ConfigurationProperty(
                "showCollapsible",
                typeof(bool),
                false,
                ConfigurationPropertyOptions.None
                );

            s_langElement = new ConfigurationProperty(
                "langauges",
                typeof(LanguageElementCollection),
                null,
                ConfigurationPropertyOptions.IsRequired
                );

            s_styleElement = new ConfigurationProperty(
                "styles",
                typeof(StyleElementCollection),
                null,
                ConfigurationPropertyOptions.IsRequired
                );

            s_properties = new ConfigurationPropertyCollection();

            s_properties.Add(s_showNumbering);
            s_properties.Add(s_showCollapsible);
            s_properties.Add(s_langElement);
            s_properties.Add(s_styleElement);
        }
Beispiel #14
0
        static SipUserAgentSettingsSection()
        {
            _accountsProp  = new ConfigurationProperty("accounts", typeof(AccountElementsCollection));
            _transportProp = new ConfigurationProperty("sipTransport", typeof(SipTransportConfigurationElement), null,
                                                       ConfigurationPropertyOptions.IsRequired);

            _secureMediaProp     = new ConfigurationProperty("srtp", typeof(SrtpRequirement), SrtpRequirement.Disabled);
            _secureSignalingProp = new ConfigurationProperty("secureSignaling", typeof(int), 0);
            _netSettingsProp     = new ConfigurationProperty("networkSettings", typeof(NetworkSettingsElement), null);
            _logMsgs             = new ConfigurationProperty("logMessages", typeof(bool), true);
            _logLevel            = new ConfigurationProperty("logLevel", typeof(int), 4, null, new IntegerValidator(0, 5, false),
                                                             ConfigurationPropertyOptions.None);
            _traceAndDebugProp = new ConfigurationProperty("traceAndDebug", typeof(bool), false);
            _autoAnswer        = new ConfigurationProperty("autoAnswer", typeof(bool), false);
            _autoRecording     = new ConfigurationProperty("autoRecording", typeof(bool), false);
            _autoConference    = new ConfigurationProperty("autoConference", typeof(bool), false);
            _maxCalls          = new ConfigurationProperty("maxCalls", typeof(int), 5);
            _mediaConfigProp   = new ConfigurationProperty("media", typeof(MediaConfigurationElement), null,
                                                           ConfigurationPropertyOptions.IsRequired);

            _props = new ConfigurationPropertyCollection
            {
                _accountsProp,
                _transportProp,
                _secureMediaProp,
                _secureSignalingProp,
                _netSettingsProp,
                _logMsgs,
                _logLevel,
                _traceAndDebugProp,
                _autoAnswer,
                _autoRecording,
                _autoConference,
                _maxCalls,
                _mediaConfigProp
            };
        }
        static ArticleElement()
        {
            s_propName = new ConfigurationProperty(
                "name",
                typeof(string),
                null,
                ConfigurationPropertyOptions.IsRequired
                );

            s_propDesc = new ConfigurationProperty(
                "desc",
                typeof(string),
                null,
                ConfigurationPropertyOptions.None
                );

            s_propState = new ConfigurationProperty(
                "state",
                typeof(ArticleState),
                ArticleState.Pending,
                ConfigurationPropertyOptions.None
                );

            s_propSequence = new ConfigurationProperty(
                "sequence",
                typeof(int),
                0,
                ConfigurationPropertyOptions.IsRequired
                );

            s_properties = new ConfigurationPropertyCollection();

            s_properties.Add(s_propName);
            s_properties.Add(s_propDesc);
            s_properties.Add(s_propState);
            s_properties.Add(s_propSequence);
        }
        static ProductElement()
		{
			s_propName = new ConfigurationProperty(
				"name",
				typeof(string),
				null,
				ConfigurationPropertyOptions.IsRequired
				);

            s_propCompany = new ConfigurationProperty(
                "company",
                typeof(string),
                null,
                ConfigurationPropertyOptions.IsRequired
                );

			s_propInstallPath = new ConfigurationProperty(
				"installpath",
				typeof(string),
				null,
                ConfigurationPropertyOptions.IsRequired
				);

            s_propVirtualDirectoryRoot = new ConfigurationProperty(
                "virtualdirectoryroot",
                typeof(string),
                null,
                ConfigurationPropertyOptions.IsRequired
                );

			s_properties = new ConfigurationPropertyCollection();

			s_properties.Add(s_propName);
            s_properties.Add(s_propCompany);
            s_properties.Add(s_propInstallPath);
            s_properties.Add(s_propVirtualDirectoryRoot);
		}
Beispiel #17
0
        /// <summary>
        /// Initializes the <see cref="RouteElement"/> class.
        /// </summary>
        static RouteElement()
        {
            _nonEmptyStringValidator = new StringValidator(1);

            _propName = new ConfigurationProperty(
                "name", typeof(string), null, null, _nonEmptyStringValidator,
                ConfigurationPropertyOptions.IsKey | ConfigurationPropertyOptions.IsRequired);

            _propUrl = new ConfigurationProperty(
                "url", typeof(string), null, null,
                _nonEmptyStringValidator,
                ConfigurationPropertyOptions.IsRequired);

            _propHandlerType = new ConfigurationProperty(
                "routeHandlerType", typeof(string),
                string.Empty, ConfigurationPropertyOptions.None);

            _propDefaults = new ConfigurationProperty(
                "defaults", typeof(RouteAttributeElement),
                null, ConfigurationPropertyOptions.None);

            _propConstraints = new ConfigurationProperty(
                "constraints", typeof(RouteAttributeElement),
                null, ConfigurationPropertyOptions.None);

            _propDataTokens = new ConfigurationProperty(
                "dataTokens", typeof(RouteAttributeElement),
                null, ConfigurationPropertyOptions.None);

            _properties = new ConfigurationPropertyCollection();
            _properties.Add(_propName);
            _properties.Add(_propUrl);
            _properties.Add(_propHandlerType);
            _properties.Add(_propDefaults);
            _properties.Add(_propConstraints);
            _properties.Add(_propDataTokens);
        }
        private static void ParseConfigurationProperty(
            ConfigurationProperty prop,
            HealthReportSettings healthReportSettings)
        {
            switch (prop.Name)
            {
            case "RemoveWhenExpired":
            {
                var removeWhenExpired = false;
                if (bool.TryParse(prop.Value, out removeWhenExpired))
                {
                    healthReportSettings.RemoveWhenExpired = removeWhenExpired;
                }
                break;
            }

            case "TimeToLiveSeconds":
            {
                var timeToLiveSeconds = 0;
                if (int.TryParse(prop.Value, out timeToLiveSeconds))
                {
                    healthReportSettings.TimeToLiveSeconds = timeToLiveSeconds;
                }
                break;
            }

            case "ReportMissingAs":
            {
                var reportMissingAs = HealthState.Unknown;
                if (Enum.TryParse(prop.Value, out reportMissingAs))
                {
                    healthReportSettings.ReportMissingAs = reportMissingAs;
                }
                break;
            }
            }
        }
        static AllowedAppElement()
        {
            s_propShortcut = new ConfigurationProperty(
                "shortcut",
                typeof(string),
                null,
                ConfigurationPropertyOptions.IsRequired
                );

            s_propPath = new ConfigurationProperty(
                "path",
                typeof(string),
                null,
                ConfigurationPropertyOptions.None
                );

            s_propArgs = new ConfigurationProperty(
                "args",
                typeof(string),
                null,
                ConfigurationPropertyOptions.None
                );

            s_propConsole = new ConfigurationProperty(
                "console",
                typeof(bool),
                false,
                ConfigurationPropertyOptions.IsRequired
                );

            s_properties = new ConfigurationPropertyCollection();

            s_properties.Add(s_propShortcut);
            s_properties.Add(s_propPath);
            s_properties.Add(s_propArgs);
            s_properties.Add(s_propConsole);
        }
        void UpdateProperties(ServiceModelExtensionCollectionElement <TServiceModelExtensionElement> sourceElement)
        {
            foreach (ConfigurationProperty property in sourceElement.Properties)
            {
                if (!this.Properties.Contains(property.Name))
                {
                    this.Properties.Add(property);
                }
            }
            foreach (TServiceModelExtensionElement extension in this.Items)
            {
                if (extension is ClearBehaviorElement || extension is RemoveBehaviorElement)
                {
                    continue;
                }

                string configuredSectionName = extension.ConfigurationElementName;
                if (!this.Properties.Contains(configuredSectionName))
                {
                    ConfigurationProperty configProperty = new ConfigurationProperty(configuredSectionName, extension.GetType(), null);
                    this.Properties.Add(configProperty);
                }
            }
        }
Beispiel #21
0
        static TcpConnectionPoolSettingsElement()
        {
            properties = new ConfigurationPropertyCollection();
            group_name = new ConfigurationProperty("groupName",
                                                   typeof(string), "default", new StringConverter(), null,
                                                   ConfigurationPropertyOptions.None);

            idle_timeout = new ConfigurationProperty("idleTimeout",
                                                     typeof(TimeSpan), "00:02:00", null /* FIXME: get converter for TimeSpan*/, null,
                                                     ConfigurationPropertyOptions.None);

            lease_timeout = new ConfigurationProperty("leaseTimeout",
                                                      typeof(TimeSpan), "00:05:00", null /* FIXME: get converter for TimeSpan*/, null,
                                                      ConfigurationPropertyOptions.None);

            max_outbound_connections_per_endpoint = new ConfigurationProperty("maxOutboundConnectionsPerEndpoint",
                                                                              typeof(int), "10", null /* FIXME: get converter for int*/, null,
                                                                              ConfigurationPropertyOptions.None);

            properties.Add(group_name);
            properties.Add(idle_timeout);
            properties.Add(lease_timeout);
            properties.Add(max_outbound_connections_per_endpoint);
        }
        static void FillProperties(ConfigurationPropertyCollection baseProps)
        {
            properties = new ConfigurationPropertyCollection();
            foreach (ConfigurationProperty item in baseProps)
            {
                properties.Add(item);
            }

            privacy_notice_at = new ConfigurationProperty("privacyNoticeAt",
                                                          typeof(Uri), null, new UriTypeConverter(), null,
                                                          ConfigurationPropertyOptions.None);

            privacy_notice_version = new ConfigurationProperty("privacyNoticeVersion",
                                                               typeof(int), "0", null /* FIXME: get converter for int*/, null,
                                                               ConfigurationPropertyOptions.None);

            security = new ConfigurationProperty("security",
                                                 typeof(WSFederationHttpSecurityElement), null, null /* FIXME: get converter for WSFederationHttpSecurityElement*/, null,
                                                 ConfigurationPropertyOptions.None);

            properties.Add(privacy_notice_at);
            properties.Add(privacy_notice_version);
            properties.Add(security);
        }
Beispiel #23
0
        static X509PeerCertificateAuthenticationElement()
        {
            properties = new ConfigurationPropertyCollection();
            certificate_validation_mode = new ConfigurationProperty("certificateValidationMode",
                                                                    typeof(X509CertificateValidationMode), "PeerOrChainTrust", null /* FIXME: get converter for X509CertificateValidationMode*/, null,
                                                                    ConfigurationPropertyOptions.None);

            custom_certificate_validator_type = new ConfigurationProperty("customCertificateValidatorType",
                                                                          typeof(string), "", new StringConverter(), null,
                                                                          ConfigurationPropertyOptions.None);

            revocation_mode = new ConfigurationProperty("revocationMode",
                                                        typeof(X509RevocationMode), "Online", null /* FIXME: get converter for X509RevocationMode*/, null,
                                                        ConfigurationPropertyOptions.None);

            trusted_store_location = new ConfigurationProperty("trustedStoreLocation",
                                                               typeof(StoreLocation), "CurrentUser", null /* FIXME: get converter for StoreLocation*/, null,
                                                               ConfigurationPropertyOptions.None);

            properties.Add(certificate_validation_mode);
            properties.Add(custom_certificate_validator_type);
            properties.Add(revocation_mode);
            properties.Add(trusted_store_location);
        }
Beispiel #24
0
        private void ReadSettings()
        {
            // Read settings from the DeviceActorServiceConfig section in the Settings.xml file
            ICodePackageActivationContext activationContext = this.Context.CodePackageActivationContext;
            ConfigurationPackage          config            = activationContext.GetConfigurationPackageObject(ConfigurationPackage);
            ConfigurationSection          section           = config.Settings.Sections[ConfigurationSection];

            // Read the MaxRetryCount setting from the Settings.xml file
            this.maxRetryCount = DefaultMaxRetryCount;
            ConfigurationProperty parameter = section.Parameters[MaxQueryRetryCountParameter];

            if (!string.IsNullOrWhiteSpace(parameter?.Value))
            {
                int.TryParse(parameter.Value, out this.maxRetryCount);
            }

            // Read the BackoffDelay setting from the Settings.xml file
            this.backoffDelay = DefaultBackoffDelay;
            parameter         = section.Parameters[BackoffDelayParameter];
            if (!string.IsNullOrWhiteSpace(parameter?.Value))
            {
                int.TryParse(parameter.Value, out this.backoffDelay);
            }
        }
Beispiel #25
0
        protected internal override void InitializeFrom(BindingElement bindingElement)
        {
            base.InitializeFrom(bindingElement);
            ConnectionOrientedTransportBindingElement binding = (ConnectionOrientedTransportBindingElement)bindingElement;

            SetPropertyValueIfNotDefaultValue(ConfigurationStrings.ConnectionBufferSize, binding.ConnectionBufferSize);
            SetPropertyValueIfNotDefaultValue(ConfigurationStrings.MaxBufferSize, binding.MaxBufferSize);
#if DESKTOP
            SetPropertyValueIfNotDefaultValue(ConfigurationStrings.HostNameComparisonMode, binding.HostNameComparisonMode);
            SetPropertyValueIfNotDefaultValue(ConfigurationStrings.ChannelInitializationTimeout, binding.ChannelInitializationTimeout);
            if (binding.IsMaxPendingConnectionsSet)
            {
                ConfigurationProperty maxPendingConnectionsProperty = this.Properties[ConfigurationStrings.MaxPendingConnections];
                SetPropertyValue(maxPendingConnectionsProperty, binding.MaxPendingConnections, /*ignoreLocks = */ false);
            }
            SetPropertyValueIfNotDefaultValue(ConfigurationStrings.MaxOutputDelay, binding.MaxOutputDelay);
            if (binding.IsMaxPendingAcceptsSet)
            {
                ConfigurationProperty maxPendingAcceptsProperty = this.Properties[ConfigurationStrings.MaxPendingAccepts];
                SetPropertyValue(maxPendingAcceptsProperty, binding.MaxPendingAccepts, /*ignoreLocks = */ false);
            }
#endif
            SetPropertyValueIfNotDefaultValue(ConfigurationStrings.TransferMode, binding.TransferMode);
        }
        static ParametersSection()
        {
            log = LogManager.GetLogger(typeof(ParametersSection));

            _serverRules = new ConfigurationProperty(
                "server",
                typeof(ParameterRulesElement),
                null,
                ConfigurationPropertyOptions.IsRequired
                );

            _clientRules = new ConfigurationProperty(
                "client",
                typeof(ParameterRulesElement),
                null,
                ConfigurationPropertyOptions.IsRequired
                );

            _properties = new ConfigurationPropertyCollection()
            {
                _serverRules,
                _clientRules,
            };
        }
Beispiel #27
0
            internal PerLanguagePreferences(string language, RoslynPreferences preferences)
            {
                this.language     = language;
                roslynPreferences = preferences;

                PlaceSystemNamespaceFirst = preferences.Wrap <bool> (
                    new OptionKey(Microsoft.CodeAnalysis.Editing.GenerationOptions.PlaceSystemNamespaceFirst, language),
                    language + ".PlaceSystemNamespaceFirst"
                    );

                SeparateImportDirectiveGroups = preferences.Wrap <bool> (
                    new OptionKey(Microsoft.CodeAnalysis.Editing.GenerationOptions.SeparateImportDirectiveGroups, language),
                    language + ".SeparateImportDirectiveGroups"
                    );

                SuggestForTypesInNuGetPackages = preferences.Wrap(
                    new OptionKey(Microsoft.CodeAnalysis.SymbolSearch.SymbolSearchOptions.SuggestForTypesInNuGetPackages, language),
                    true
                    );

                SolutionCrawlerClosedFileDiagnostic = new ClosedFileDiagnosticProperty(preferences.Wrap <bool?> (
                                                                                           new OptionKey(ServiceFeatureOnOffOptions.ClosedFileDiagnostic, language)
                                                                                           ), language, roslynPreferences);
            }
Beispiel #28
0
        static TraceSection()
        {
            enabledProp      = new ConfigurationProperty("enabled", typeof(bool), false);
            localOnlyProp    = new ConfigurationProperty("localOnly", typeof(bool), true);
            mostRecentProp   = new ConfigurationProperty("mostRecent", typeof(bool), false);
            pageOutputProp   = new ConfigurationProperty("pageOutput", typeof(bool), false);
            requestLimitProp = new ConfigurationProperty("requestLimit", typeof(int), 10,
                                                         TypeDescriptor.GetConverter(typeof(int)),
                                                         PropertyHelper.IntFromZeroToMaxValidator,
                                                         ConfigurationPropertyOptions.None);
            traceModeProp = new ConfigurationProperty("traceMode", typeof(TraceDisplayMode), TraceDisplayMode.SortByTime,
                                                      new GenericEnumConverter(typeof(TraceDisplayMode)), null,
                                                      ConfigurationPropertyOptions.None);
            writeToDiagnosticsTraceProp = new ConfigurationProperty("writeToDiagnosticsTrace", typeof(bool), false);
            properties = new ConfigurationPropertyCollection();

            properties.Add(enabledProp);
            properties.Add(localOnlyProp);
            properties.Add(mostRecentProp);
            properties.Add(pageOutputProp);
            properties.Add(requestLimitProp);
            properties.Add(traceModeProp);
            properties.Add(writeToDiagnosticsTraceProp);
        }
Beispiel #29
0
        static X509InitiatorCertificateClientElement()
        {
            properties = new ConfigurationPropertyCollection();
            find_value = new ConfigurationProperty("findValue",
                                                   typeof(string), "", new StringConverter(), null,
                                                   ConfigurationPropertyOptions.None);

            store_location = new ConfigurationProperty("storeLocation",
                                                       typeof(StoreLocation), "CurrentUser", null /* FIXME: get converter for StoreLocation*/, null,
                                                       ConfigurationPropertyOptions.None);

            store_name = new ConfigurationProperty("storeName",
                                                   typeof(StoreName), "My", null /* FIXME: get converter for StoreName*/, null,
                                                   ConfigurationPropertyOptions.None);

            x509_find_type = new ConfigurationProperty("x509FindType",
                                                       typeof(X509FindType), "FindBySubjectDistinguishedName", null /* FIXME: get converter for X509FindType*/, null,
                                                       ConfigurationPropertyOptions.None);

            properties.Add(find_value);
            properties.Add(store_location);
            properties.Add(store_name);
            properties.Add(x509_find_type);
        }
Beispiel #30
0
        static X509RecipientCertificateServiceElement()
        {
            properties = new ConfigurationPropertyCollection();
            find_value = new ConfigurationProperty("findValue",
                                                   typeof(string), "", new StringConverter(), null,
                                                   ConfigurationPropertyOptions.None);

            store_location = new ConfigurationProperty("storeLocation",
                                                       typeof(StoreLocation), "LocalMachine", null, null,
                                                       ConfigurationPropertyOptions.None);

            store_name = new ConfigurationProperty("storeName",
                                                   typeof(StoreName), "My", null, null,
                                                   ConfigurationPropertyOptions.None);

            x509_find_type = new ConfigurationProperty("x509FindType",
                                                       typeof(X509FindType), "FindBySubjectDistinguishedName", null, null,
                                                       ConfigurationPropertyOptions.None);

            properties.Add(find_value);
            properties.Add(store_location);
            properties.Add(store_name);
            properties.Add(x509_find_type);
        }
Beispiel #31
0
        static OutputCacheSection()
        {
            enableFragmentCacheProp            = new ConfigurationProperty("enableFragmentCache", typeof(bool), true);
            enableOutputCacheProp              = new ConfigurationProperty("enableOutputCache", typeof(bool), true);
            omitVaryStarProp                   = new ConfigurationProperty("omitVaryStar", typeof(bool), false);
            sendCacheControlHeaderProp         = new ConfigurationProperty("sendCacheControlHeader", typeof(bool), true);
            enableKernelCacheForVaryByStarProp = new ConfigurationProperty("enableKernelCacheForVaryByStar", typeof(bool), false);
#if NET_4_0
            providersProp           = new ConfigurationProperty("providers", typeof(ProviderSettingsCollection));
            defaultProviderNameProp = new ConfigurationProperty("defaultProvider", typeof(string), "AspNetInternalProvider");
#endif

            properties = new ConfigurationPropertyCollection();

            properties.Add(enableFragmentCacheProp);
            properties.Add(enableOutputCacheProp);
            properties.Add(omitVaryStarProp);
            properties.Add(sendCacheControlHeaderProp);
            properties.Add(enableKernelCacheForVaryByStarProp);
#if NET_4_0
            properties.Add(providersProp);
            properties.Add(defaultProviderNameProp);
#endif
        }
	public void CopyTo(ConfigurationProperty[] array, int index) {}
	public void Add(ConfigurationProperty property) {}
 public static Property FindProperty(this Configuration configuration, ConfigurationProperty configurationProperty) {
     return configuration.Properties.Cast<Property>().Where(property => property.Name == configurationProperty.ToString()).Single();
 }
Beispiel #35
0
Datei: test.cs Projekt: mono/gert
	static CustomConfigSection ()
	{
		modeProp = new ConfigurationProperty ("mode", typeof (string), "RemoteOnly");
		properties = new ConfigurationPropertyCollection ();
		properties.Add (modeProp);
	}