当前位置: 首页>>代码示例>>C#>>正文


C# NameValueCollection.Remove方法代码示例

本文整理汇总了C#中System.Collections.Specialized.NameValueCollection.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# NameValueCollection.Remove方法的具体用法?C# NameValueCollection.Remove怎么用?C# NameValueCollection.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Collections.Specialized.NameValueCollection的用法示例。


在下文中一共展示了NameValueCollection.Remove方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FilterInputParameters

 void FilterInputParameters(NameValueCollection inputParameters)
 {
     inputParameters.Remove("_");
     inputParameters.Remove("_q");
     inputParameters.Remove("_rm");
     inputParameters.Remove("_cmd");
 }
开发者ID:LenFon,项目名称:Bifrost,代码行数:7,代码来源:RestServiceMethodInvoker.cs

示例2: GetNavigationData

		public override NameValueCollection GetNavigationData(State state, NameValueCollection data)
		{
			data[NavigationSettings.Config.PreviousStateIdKey] = data["previous"];
			data.Remove("previous");
			data.Remove("custom");
			return data;
		}
开发者ID:ericziko,项目名称:navigation,代码行数:7,代码来源:CustomStateHandler.cs

示例3: Response

        public Response(string resp)
        {
            _resp = resp;
            _nvc = new NameValueCollection();
            string[] parts = resp.Split( '&' );
            for( int i = 0; i < parts.Length; i++ )
            {
                string[] ps = parts[i].Split( '=' );
                string name = System.Web.HttpContext.Current.Server.UrlDecode( ps[0] );
                string value = System.Web.HttpContext.Current.Server.UrlDecode( ps[1] );
                _nvc[name] = value;
            }

            _errors = new List<Error>();
            int index = 0;
            while(true)
            {
                if( _nvc["L_ERRORCODE" + index] == null )
                    break;

                var e = new Error() { ErrorCode = _nvc["L_ERRORCODE" + index], ShortMessage = _nvc["L_SHORTMESSAGE" + index], LongMessage = _nvc["L_LONGMESSAGE" + index], SeverityCode = _nvc["L_SEVERITYCODE" + index] };
                _errors.Add( e );

                _nvc.Remove( "L_ERRORCODE" + index );
                _nvc.Remove( "L_SHORTMESSAGE" + index );
                _nvc.Remove( "L_LONGMESSAGE" + index );
                _nvc.Remove( "L_SEVERITYCODE" + index );

                index++;
            }
        }
开发者ID:REMSLogic,项目名称:REMSLogic,代码行数:31,代码来源:Response.cs

示例4: Initialize

        public override void Initialize(string name, NameValueCollection config){
            if (String.IsNullOrEmpty(name))
                name = "WindowsTokenProvider";
            if (string.IsNullOrEmpty(config["description"])) {
                config.Remove("description");
                config.Add("description", SR.GetString(SR.RoleWindowsTokenProvider_description));
            }
            base.Initialize(name, config);

            if (config == null)
               throw new ArgumentNullException("config");
            _AppName = config["applicationName"];
            if (string.IsNullOrEmpty(_AppName))
                _AppName = SecUtility.GetDefaultAppName();

            if( _AppName.Length > 256 )
            {
                throw new ProviderException(SR.GetString(SR.Provider_application_name_too_long));
            }

            config.Remove("applicationName");
            if (config.Count > 0)
            {
                string attribUnrecognized = config.GetKey(0);
                if (!String.IsNullOrEmpty(attribUnrecognized))
                    throw new ProviderException(SR.GetString(SR.Provider_unrecognized_attribute, attribUnrecognized));
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:28,代码来源:WindowsTokenRoleProvider.cs

示例5: Initialize

        /// <summary>
        /// init
        /// </summary>
        /// <param name="name"></param>
        /// <param name="config"></param>
        public override void Initialize(string name, NameValueCollection config)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (String.IsNullOrEmpty(name))
            {
                name = "DbBlogProvider";
            }

            if (String.IsNullOrEmpty(config["description"]))
            {
                config.Remove("description");
                config.Add("description", "Generic Database Blog Provider");
            }

            base.Initialize(name, config);

            if (config["storageVariable"] == null)
            {
                // default to BlogEngine
                config["storageVariable"] = "BlogEngine";
            }

            this.connStringName = config["storageVariable"];
            config.Remove("storageVariable");

            if (config["tablePrefix"] == null)
            {
                // default
                config["tablePrefix"] = "be_";
            }

            this.tablePrefix = config["tablePrefix"];
            config.Remove("tablePrefix");

            if (config["parmPrefix"] == null)
            {
                // default
                config["parmPrefix"] = "@";
            }

            this.parmPrefix = config["parmPrefix"];
            config.Remove("parmPrefix");

            // Throw an exception if unrecognized attributes remain
            if (config.Count > 0)
            {
                var attr = config.GetKey(0);
                if (!String.IsNullOrEmpty(attr))
                {
                    throw new ProviderException(string.Format("Unrecognized attribute: {0}", attr));
                }
            }
        }
开发者ID:sagasu,项目名称:tddLegacy,代码行数:62,代码来源:DbFileSystemProvider.cs

示例6: Initialize

        public override void Initialize(string name, NameValueCollection config)
        {
            this.mongoCollection = ConnectionHelper.GetDatabase(config).GetCollection(config["collection"] ?? "WebEvents");

            config.Remove("collection");
            config.Remove("connectionString");
            config.Remove("database");

            base.Initialize(name, config);
        }
开发者ID:marcosb,项目名称:MongoDB.Web,代码行数:10,代码来源:MongoDBWebEventProvider.cs

示例7: Initialize

        public override void Initialize(string name, NameValueCollection config)
        {
            this.mongoCollection = new MongoClient(config["connectionString"] ?? "mongodb://localhost").GetServer().GetDatabase(config["database"] ?? "ASPNETDB").GetCollection(config["collection"] ?? "WebEvents");

            config.Remove("collection");
            config.Remove("connectionString");
            config.Remove("database");

            base.Initialize(name, config);
        }
开发者ID:jango2015,项目名称:MongoDB.Web,代码行数:10,代码来源:MongoDBWebEventProvider.cs

示例8: Initialize

        public override void Initialize(string name,
            NameValueCollection config)
        {
            // Verify that config isn't null
            if (config == null)
                throw new ArgumentNullException("config");

            // Assign the provider a default name if it doesn't have one
            if (String.IsNullOrEmpty(name))
                name = "SimpleMySqlPersonalizationProvider";

            // Add a default "description" attribute to config if the
            // attribute doesn't exist or is empty
            if (string.IsNullOrEmpty(config["description"]))
            {
                config.Remove("description");
                config.Add("description",
                    "Simple MySql personalization provider");
            }

            // Call the base class's Initialize method
            base.Initialize(name, config);

            if (string.IsNullOrEmpty(config["connectionStringName"]))
            {
                throw new ProviderException
                    ("ConnectionStringName property has not been specified");
            }
            else
            {
                m_ConnectionStringName = config["connectionStringName"];
                config.Remove("connectionStringName");
            }

            if (string.IsNullOrEmpty(config["applicationName"]))
            {
                throw new ProviderException
                    ("applicationName property has not been specified");
            }
            else
            {
                m_ApplicationName = config["applicationName"];
                config.Remove("applicationName");
            }

            // Throw an exception if unrecognized attributes remain
            if (config.Count > 0)
            {
                string attr = config.GetKey(0);
                if (!String.IsNullOrEmpty(attr))
                    throw new ProviderException
                        ("Unrecognized attribute: " + attr);
            }
        }
开发者ID:adlnet,项目名称:3D-Repository,代码行数:54,代码来源:MysqlPersonalizationProvider.cs

示例9: Initialize

        public override void Initialize(string name, NameValueCollection config)
        {
            this.mongoCollection = MongoDatabase.Create(
                ConfigurationManager.ConnectionStrings[config["connectionStringName"] ?? "MongoConnection"].ConnectionString ?? "mongodb://localhost")
                .GetCollection(config["collection"] ?? "WebEvents");

            config.Remove("collection");
            config.Remove("connectionStringName");

            base.Initialize(name, config);
        }
开发者ID:JasonSHD,项目名称:SaveASpot,代码行数:11,代码来源:MongoDBWebEventProvider.cs

示例10: Initialize

        public override void Initialize(string name, NameValueCollection settings)
        {
            var config = DependencyResolver.Current.GetService<IConfig>();

            this.mongoCollection = ConnectionUtils.GetCollection(settings, config, "WebEvents");

            settings.Remove("collection");
            settings.Remove("connectionString");
            settings.Remove("database");

            base.Initialize(name, settings);
        }
开发者ID:mikalai-silivonik,项目名称:bnh,代码行数:12,代码来源:MongoDbWebEventProvider.cs

示例11: Initialize

        ////////////////////////////////////////////////////////////
        // Public properties

        public override void Initialize(string name, NameValueCollection config)
        {
            if (name == null || name.Length < 1)
                name = "AccessProfileProvider";

            if (string.IsNullOrEmpty(config["description"]))
            {
                config.Remove("description");
                config.Add("description", "Nada.DA Profile Provider");
            }
            base.Initialize(name, config);
            if (config == null)
                throw new ArgumentNullException("config");

            _DatabaseFileName = config["connectionStringName"];
            if (_DatabaseFileName == null || _DatabaseFileName.Length < 1)
                throw new ProviderException("Connection name not specified");
            string temp = AccessConnectionHelper.GetFileNameFromConnectionName(_DatabaseFileName, true);
            if (temp == null || temp.Length < 1)
            {
                throw new ProviderException("Connection string not found" + _DatabaseFileName);
            }
            _DatabaseFileName = temp;

            // EDIT GET THE IN MEMORY CONNECTION STRING
            _DatabaseFileName = DatabaseData.Instance.AccessConnectionString;
            //HandlerBase.CheckAndReadRegistryValue(ref _DatabaseFileName, true);
            AccessConnectionHelper.CheckConnectionString(_DatabaseFileName);

            _AppName = config["applicationName"];
            if (string.IsNullOrEmpty(_AppName))
                _AppName = SecUtility.GetDefaultAppName();

            if (_AppName.Length > 255)
            {
                throw new ProviderException("ApplicationName exceeded max length of " + 255);
            }

            //_Description = config["description"];
            config.Remove("connectionStringName");
            config.Remove("applicationName");
            config.Remove("description");
            if (config.Count > 0)
            {
                string attribUnrecognized = config.GetKey(0);
                if (!String.IsNullOrEmpty(attribUnrecognized))
                    throw new ProviderException("Unrecognized attribute: " + attribUnrecognized);
            }
        }
开发者ID:ericjohnolson,项目名称:NadaNtd,代码行数:52,代码来源:AccessProfileProvider.cs

示例12: RemoveIgnoredParameters

        private void RemoveIgnoredParameters(NameValueCollection parameters, ICollection<string> ignoreList)
        {
            foreach (string parameterName in ignoreList)
            {
                parameters.Remove(parameterName);
            }

            // This is in a somewhat obscure location (mostly used to remove slider filters).
            // Maybe I should move this somewhere else?
            for (int i = parameters.AllKeys.Length - 1; i >= 0; i--)
            {
                if (parameters[i].Length == 0)
                    parameters.Remove(parameters.AllKeys[i]);
            }
        }
开发者ID:FACT-Finder,项目名称:FACT-Finder-.NET-Library,代码行数:15,代码来源:ParametersConverter.cs

示例13: Initialize

        public override void Initialize(string name, NameValueCollection configSettings)
        {
            if (configSettings == null)
                throw new ArgumentNullException("configSettings");

            if (string.IsNullOrEmpty(name))
                name = "PersonalizationProvider";

            if (string.IsNullOrEmpty(configSettings["description"]))
            {
                configSettings.Remove("description");
                configSettings.Add("description", ResourceStringLoader.GetResourceString(
                    "PersonalizationProvider_Description"));
            }

            base.Initialize(name, configSettings);

            this._applicationName = configSettings["applicationName"];

            if (this._applicationName != null)
            {
                configSettings.Remove("applicationName");
                if (this._applicationName.Length > 0x100)
                {
                    object[] args = new object[] { 0x100.ToString(CultureInfo.CurrentCulture) };
                    throw new ProviderException(ResourceStringLoader.GetResourceString(
                        "PersonalizationProvider_ApplicationNameExceedMaxLength", args));
                }
            }

            if (!string.IsNullOrEmpty(configSettings["directoryName"]))
                this._directoryName = configSettings["directoryName"];

            configSettings.Remove("directoryName");

            if (!VirtualPathUtility.IsAppRelative(this._directoryName))
                throw new ProviderException(ResourceStringLoader.GetResourceString(
                    "PersonalizationProvider_DirectoryNameNotRelative"));

            this._directoryName = VirtualPathUtility.AppendTrailingSlash(this._directoryName);

            if (configSettings.Count > 0)
            {
                string key = configSettings.GetKey(0);
                throw new ProviderException(ResourceStringLoader.GetResourceString(
                    "PersonalizationProvider_UnknownProp", new object[] { key, name }));
            }
        }
开发者ID:kohku,项目名称:codefactory,代码行数:48,代码来源:FileBasedPersonalizationProvider.cs

示例14: Initialize

        public override void Initialize(string name, NameValueCollection config)
        {
            // Verify that config isn't null
            if (config == null)
                throw new ArgumentNullException("config");

            // Assign the provider a default name if it doesn't have one
            if (String.IsNullOrEmpty(name))
                name = "ProductProvider";

            // Add a default "description" attribute to config if the
            // attribute doesn't exist or is empty
            if (string.IsNullOrEmpty(config["description"]))
            {
                config.Remove("description");
                config.Add("description", "SQL Account provider");
            }

            // Call the base class's Initialize method
            base.Initialize(name, config);

            // Initialize _connectionString
            string connect = config["connectionStringName"];

            if (String.IsNullOrEmpty(connect))
                throw new ProviderException
                    ("Empty or missing connectionStringName");

            config.Remove("connectionStringName");

            if (WebConfigurationManager.ConnectionStrings[connect] == null)
                throw new ProviderException("Missing connection string");

            _connectionString = WebConfigurationManager.ConnectionStrings
                [connect].ConnectionString;

            if (String.IsNullOrEmpty(_connectionString))
                throw new ProviderException("Empty connection string");

            // Throw an exception if unrecognized attributes remain
            if (config.Count > 0)
            {
                string attr = config.GetKey(0);
                if (!String.IsNullOrEmpty(attr))
                    throw new ProviderException
                        ("Unrecognized attribute: " + attr);
            }
        }
开发者ID:IdeaFortune,项目名称:Monaco,代码行数:48,代码来源:ProductProvider.cs

示例15: PasswordModelBinderShouldReturnValuesForSpecifiedQueryStrings

		public void PasswordModelBinderShouldReturnValuesForSpecifiedQueryStrings()
		{
			var viewContext = new ViewContext();
			viewContext.HttpContext = MockHttpContext.FakeHttpContext();
			var appraisalCompanyAdminManagement = Substitute.For<IAppraiserManagement>();
			var appraisalCompanyWizardService = Substitute.For<IAppraisalCompanyService>();
		
			var controller = new AppraisalCompanyFeesController(appraisalCompanyWizardService, appraisalCompanyAdminManagement);
			controller.SetFakeControllerContext(viewContext.HttpContext);
			NameValueCollection queryString = new NameValueCollection();

			controller.HttpContext.Request.QueryString.Returns(queryString); 
			PasswordModelBinder target = new PasswordModelBinder();
			var testCases = new[] {
				new {QueryStringParameterName="UserChangePasswordViewModel.NewPassword",Value="17"},
				new {QueryStringParameterName="CreateUserGeneralInfoViewModel.Password",Value="42"},
				new {QueryStringParameterName="Password",Value="2"},
				new {QueryStringParameterName="NewPassword",Value="33"},
				new {QueryStringParameterName="AppraisalCompanyAdmin.Password",Value="asd"},
				new {QueryStringParameterName="GeneralInfo.Password",Value="sssssssssss"},
			};
				
			//act
			foreach (var testCase in testCases)
			{
				queryString.Add(testCase.QueryStringParameterName, testCase.Value);
				
				string result = (string)target.BindModel(controller.ControllerContext, new ModelBindingContext());
				result.Should().BeEquivalentTo(testCase.Value);

				queryString.Remove(testCase.QueryStringParameterName);
			}
		}
开发者ID:evkap,项目名称:DVS,代码行数:33,代码来源:PasswordModelBinderTest.cs


注:本文中的System.Collections.Specialized.NameValueCollection.Remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。