public override void Initialize(string name, System.Collections.Specialized.NameValueCollection parameters) { if (string.IsNullOrEmpty((string)parameters["connectionName"])) { parameters.Remove("connectionName"); parameters.Add("connectionName", "PermissionsCenter"); } if (string.IsNullOrEmpty((string)parameters["sourceName"])) { parameters.Remove("sourceName"); parameters.Add("sourceName", "DefaultSource"); } this.connectionName = parameters["connectionName"]; this.sourceName = parameters["sourceName"]; base.Initialize(name, parameters); parameters.Remove("connectionName"); parameters.Remove("sourceName"); if (parameters.Count > 0) { string key = parameters.GetKey(0); if (!string.IsNullOrEmpty(key)) throw new ProviderException(string.Format("不识别的属性: {0} ", key)); } }
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { if (config == null) throw new ArgumentNullException("config"); if (String.IsNullOrEmpty(name)) name = "TalkCallLogsProvider"; if (String.IsNullOrEmpty(config["description"])) { config.Remove("description"); config.Add("description", "Talk Call Logs Provider"); } base.Initialize(name, config); _applicationName = config["applicationName"]; if (String.IsNullOrEmpty(_applicationName)) _applicationName = "/"; config.Remove("applicationName"); if (config.Count > 0) { string attr = config.Get(0); if (!String.IsNullOrEmpty(attr)) throw new ProviderException("Unrecognized atrtibute: " + attr); } }
/// <summary> /// init /// </summary> /// <param name="name"></param> /// <param name="config"></param> public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { if (config == null) { throw new ArgumentNullException("config"); } if (String.IsNullOrEmpty(name)) { name = "UNCBlogProvider"; } base.Initialize(name, config); if (String.IsNullOrEmpty(config["description"])) { config.Remove("description"); config.Add("description", "Generic UNC File Path Blog Provider"); } if (config["storageVariable"] == null) { // default to BlogEngine XML provider paths config["storageVariable"] = HostingEnvironment.MapPath(Blog.CurrentInstance.StorageLocation); } else { if(config["storageVariable"].EndsWith(@"\")) config["storageVariable"] = config["storageVariable"].Substring(0, config["storageVariable"].Length - 1); if(!System.IO.Directory.Exists(config["storageVariable"])) throw new ArgumentException("storageVariable (as unc path) does not exist. or does not have read\\write permissions"); } this.uncPath = config["storageVariable"]; config.Remove("storageVariable"); }
protected override void PreFilterProperties(System.Collections.IDictionary properties) { base.PreFilterProperties(properties); properties.Remove("BorderStyle"); properties.Remove("Font"); }
protected override void PostFilterProperties(System.Collections.IDictionary properties) { base.PostFilterProperties(properties); properties.Remove("ImageList"); properties.Remove("Nodes"); }
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { // check to ensure config is not null if (config == null) throw new ArgumentNullException("config"); if (string.IsNullOrEmpty(name)) name = "MemoryOperatorProvider"; // Get the operator name if (!string.IsNullOrEmpty(config["opName"])) opName = config["opName"].ToString(); config.Remove("opName"); // Get the operator password if (!string.IsNullOrEmpty(config["opPassword"])) opPassword = config["opPassword"].ToString(); config.Remove("opPassword"); // Get the operator email if (!string.IsNullOrEmpty(config["opEmail"])) opEmail = config["opEmail"].ToString(); config.Remove("opEmail"); base.Initialize(name, config); }
protected override void PreFilterProperties(System.Collections.IDictionary properties) { base.PreFilterProperties(properties); properties.Remove("FlatStyle"); properties.Remove("FlatAppearance"); }
/// <summary> /// Drops the BackgroundImage property /// </summary> /// <param name="properties">properties to remove BackGroundImage from</param> protected override void PreFilterProperties(System.Collections.IDictionary properties) { base.PreFilterProperties (properties); if (properties.Contains("BackgroundImage") == true) properties.Remove("BackgroundImage"); if (properties.Contains("DrawGrid") == true) properties.Remove("DrawGrid"); }
public override void CleanModelState(System.Web.Mvc.ModelStateDictionary modelState) { base.CleanModelState(modelState); modelState.Remove("ValidationSummary"); modelState.Remove("ActionPerformed"); ValidationSummary = ValidationSummary ?? new ValidationSummaryEditorViewModel(); }
/// <summary> /// Prefilters the properties. /// </summary> /// <param name="properties">The property dictionary.</param> protected override void PreFilterProperties(System.Collections.IDictionary properties) { base.PreFilterProperties(properties); properties.Remove("BackgroundImage"); properties.Remove("Text"); properties.Remove("ImeMode"); properties.Remove("Padding"); properties.Remove("BackgroundImageLayout"); }
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { // Validate arguments if (config == null) throw new ArgumentNullException("config"); if (string.IsNullOrEmpty(name)) name = "SimpleSqlProfileProvider"; if (String.IsNullOrEmpty(config["description"])) { config.Remove("description"); config.Add("description", "PAB simple SQL profile provider"); } // Initialize base class base.Initialize(name, config); // Basic init this.configuration = config; this.applicationName = GetConfig("applicationName", ""); // Initialize connection string ConnectionStringSettings ConnectionStringSettings = ConfigurationManager.ConnectionStrings[config["connectionStringName"]]; if (ConnectionStringSettings == null || ConnectionStringSettings.ConnectionString.Trim() == "") throw new ProviderException("Connection string cannot be blank."); this.connectionString = ConnectionStringSettings.ConnectionString; // Initialize table name this.tableName = GetConfig("tableName", "Profiles"); if (!IsValidDbObjectName(this.tableName)) throw new ProviderException("Table name contains illegal characters."); // Initialize key column name this.keyColumnName = GetConfig("keyColumnName", "UserName"); if (!IsValidDbObjectName(this.keyColumnName)) throw new ProviderException("Key column name contains illegal characters."); // Initialize last update column name this.lastUpdateColumnName = GetConfig("lastUpdateColumnName", "LastUpdate"); if (!IsValidDbObjectName(this.lastUpdateColumnName)) throw new ProviderException("Last update column name contains illegal characters."); }
/// <summary> /// 중복 아이피 접근 체크 /// </summary> /// <param name="ConnectHost"></param> /// <param name="Cache"></param> /// <returns></returns> public string DuplicateIP(string ConnectHost, System.Web.Caching.Cache Cache) { DateTime CurrentTime = Convert.ToDateTime(DateTime.Now.ToString("HH:mm")); //접속 가능 시간 체크 if (CurrentTime >= Convert.ToDateTime("03:00") && CurrentTime <= Convert.ToDateTime("07:00")) { if (Cache == null || Cache["ConnectIP"] == null) { //Cache가 없을 경우, 접속IP로 Cache 생성 Cache.Insert("ConnectIP", ConnectHost, null, DateTime.Now.AddMinutes(5), TimeSpan.Zero); return "접속 가능 (첫 접속)"; } else { if (Cache["ConnectIP"].ToString() == ConnectHost) { //5분이내 같은 IP주소로 접속한 경우 return "5분이내에 같은 IP로 접속했습니다! 5분 후에 다시 시도해 주세요."; } else { //다른 IP로 접속했을 경우 Cache에 업데이트 Cache.Remove("ConnectIP"); Cache.Insert("ConnectIP", ConnectHost, null, DateTime.Now.AddMinutes(5), TimeSpan.Zero); return "접속 가능 (Cache 업데이트)"; } } } else { return "접속 가능 시간이 아닙니다.(03:00~07:00)"; } }
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { base.Initialize(name, config); if (string.IsNullOrEmpty(config["dataStorePath"])) throw new ProviderException("dataStorePath config attribute is required."); this._dataStorePath = config["dataStorePath"]; if (!VirtualPathUtility.IsAppRelative(this._dataStorePath)) throw new ArgumentException("dataStorePath must be app-relative"); string fullyQualifiedPath = VirtualPathUtility.Combine( VirtualPathUtility.AppendTrailingSlash(HttpRuntime.AppDomainAppVirtualPath), this._dataStorePath); this._dataStorePath = HostingEnvironment.MapPath(fullyQualifiedPath); config.Remove("dataStorePath"); // Make sure we have permission to read the XML data source and // throw an exception if we don't if (!Directory.Exists(this._dataStorePath)) Directory.CreateDirectory(this._dataStorePath); FileIOPermission permission = new FileIOPermission(FileIOPermissionAccess.AllAccess, this._dataStorePath); permission.Demand(); if (config.Count > 0) throw new ProviderException(string.Format("Unknown config attribute '{0}'", config.GetKey(0))); }
protected override void PreFilterProperties(System.Collections.IDictionary properties) { base.PreFilterProperties(properties); properties.Remove("DockPadding"); properties.Remove("DrawGrid"); properties.Remove("Margin"); properties.Remove("Padding"); properties.Remove("BorderStyle"); properties.Remove("ForeColor"); properties.Remove("BackColor"); properties.Remove("BackgroundImage"); properties.Remove("BackgroundImageLayout"); properties.Remove("GridSize"); properties.Remove("ImeMode"); }
/// <summary> /// 初始化 /// </summary> /// <param name="name"></param> /// <param name="config"></param> public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { if (config == null) throw new ArgumentNullException("config"); if (String.IsNullOrEmpty(name)) name = "BasicEnglishAutoInputProtectionTextProvider"; if (string.IsNullOrEmpty(config["description"])) { config.Remove("description"); config.Add("description", "Basic English Auto-Input Protection Text Provider"); } base.Initialize(name, config); // Throw an exception if unrecognized attributes remain if (config.Count > 0) { string attr = config.GetKey(0); if (!String.IsNullOrEmpty(attr)) throw new ProviderException(string.Format(System.Globalization.CultureInfo.CurrentUICulture, "Errors.UnrecognizedAttribute", attr)); } }
public static bool isConnectPathV5(int X, int Y, System.Collections.Generic.List<Point> path, bool[,] cache, bool[,] limit) { Point p = new Point(X, Y); if (cache[X, Y]) { return false; } path.Add(p); if (X == 0 && Y == 0) { return true; } bool success = false; if (X >= 1 && verifyImpediment(limit, X - 1, Y)) { success = isConnectPathV5(X - 1, Y, path, cache, limit); } if (!success && Y >= 1 && verifyImpediment(limit, X, Y - 1)) { success = isConnectPathV5(X, Y - 1, path, cache, limit); } if (!success) { path.Remove(p); cache[X, Y] = true; } return success; }
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { if (config == null) { throw new ArgumentNullException("config"); } if (name == null || name.Length == 0) { name = "MyCacheStore"; } if (String.IsNullOrEmpty(config["description"])) { config.Remove("description"); config.Add("description", "Redis as a session data store"); } base.Initialize(name, config); // If configuration exists then use it otherwise read from config file and create one if (configuration == null) { lock (configurationCreationLock) { if (configuration == null) { configuration = ProviderConfiguration.ProviderConfigurationForOutputCache(config); } } } }
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { if (config == null) throw new ArgumentNullException("config"); if (string.IsNullOrEmpty(name)) { name = "SoftFluent.Samples.GEDRoleProvider"; } if (string.IsNullOrEmpty(config["description"])) { config.Remove("description"); config.Add("description", SoftFluent.Samples.GED.Resources.Manager.GetStringWithDefault("ProfileProviderDescription", "SoftFluent.Samples.GED")); } base.Initialize(name, config); _applicationName = config["applicationName"]; if (string.IsNullOrEmpty(_applicationName)) { _applicationName = applicationName; } _emailFormat = config["emailFormat"]; if (string.IsNullOrEmpty(_emailFormat)) { _emailFormat = "{0}@example.com"; } config.Remove("applicationName"); config.Remove("name"); config.Remove("emailFormat"); }
public void Fight() { // PART 1. Target selection // Clear objectives foreach (var groups in System.Union(Infect)) { groups.AttackObjective = null; groups.IsTargeted = false; } // System select their targets SelectTargets(System, Infect); // Infect select their targets SelectTargets(Infect, System); // PART 2. Attacking foreach (var group in System.Union(Infect).OrderByDescending(g => g.Initiative)) { group.Attack(); } // Clean System.Where(i => i.Units == 0).ToList().ForEach(i => System.Remove(i)); Infect.Where(i => i.Units == 0).ToList().ForEach(i => Infect.Remove(i)); }
protected override void PreFilterProperties(System.Collections.IDictionary properties) { base.PreFilterProperties(properties); foreach (string p in propsToRemove) if (properties.Contains(p)) properties.Remove(p); }
/// <summary> /// Perform mapping for each character of input. /// </summary> /// <param name="result">Result is modified in place.</param> public override void Prepare(System.Text.StringBuilder result) { // From RFC3454, section 3: Mapped characters are not // re-scanned during the mapping step. That is, if // character A at position X is mapped to character B, // character B which is now at position X is not checked // against the mapping table. int pos; string map; int len; for (int i=0; i<result.Length; i++) { pos = Array.BinarySearch(m_table, result[i], m_comp); if (pos < 0) continue; map = m_table[pos]; len = map.Length; if (len == 1) { result.Remove(i, 1); i--; } else { result[i] = map[1]; if (len > 2) { result.Insert(i+1, map.ToCharArray(2, len - 2)); i += len - 2; } } } }
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { if (config == null) throw new ArgumentNullException("Config is null"); if (String.IsNullOrEmpty(name)) name = "UmbracoSiteMapProvider"; if (!String.IsNullOrEmpty(config["defaultDescriptionAlias"])) { m_defaultDescriptionAlias = config["defaultDescriptionAlias"].ToString(); config.Remove("defaultDescriptionAlias"); } if (config["securityTrimmingEnabled"] != null) { m_enableSecurityTrimming = bool.Parse(config["securityTrimmingEnabled"]); } base.Initialize(name, config); // Throw an exception if unrecognized attributes remain if (config.Count > 0) { string attr = config.GetKey(0); if (!String.IsNullOrEmpty(attr)) throw new ProviderException (String.Format("Unrecognized attribute: {0}", attr)); } }
protected override void PostFilterProperties(System.Collections.IDictionary properties) { base.PostFilterProperties(properties); string[] propsToRemove = { "Anchor", "BackgroundImage", "Font", "ForeColor", "RightToLeft", "Text", "DockPadding", "Dock", "DrawGrid", "Location", "Visible" }; // Remove all properties that have to do with layout foreach (string prop in propsToRemove) { if (properties.Contains(prop)) properties.Remove(prop); } }
protected internal virtual System.Text.StringBuilder assign_to(System.Text.StringBuilder s) { //// s.Replace(s.ToString(0, s.Length - 0), current.ToString(0, limit), 0, s.Length - 0); s.Remove(0, s.Length); s.Append(current.ToString(0, limit)); return s; }
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { base.Initialize(name, config); int.TryParse(config["cacheMinutes"], out _cacheMinutes); config.Remove("cacheMinutes"); }
private void RemoveDescriptors(System.Collections.IDictionary properties, String[] propNames) { foreach (String propName in propNames) { if (properties.Contains(propName)) properties.Remove(propName); } }
/// <summary> /// Allows a designer to change or remove items from the set of events that it exposes through a <see cref="T:System.ComponentModel.TypeDescriptor"></see>. /// </summary> /// <param name="events">The events for the class of the component.</param> protected override void PostFilterEvents(System.Collections.IDictionary events) { events.Remove("AutoValidateChanged"); events.Remove("CausesValidationChanged"); events.Remove("ChangeUICues"); events.Remove("FontChanged"); events.Remove("ForeColorChanged"); events.Remove("Load"); events.Remove("Scroll"); events.Remove("Validated"); events.Remove("Validating"); base.PostFilterEvents(events); }
/// <summary> /// This method will remove the unwanted properties from the /// digital counter control. /// </summary> /// <param name="properties">List of properties for the control</param> protected override void PreFilterProperties(System.Collections.IDictionary properties) { properties.Remove("AllowDrop"); properties.Remove("AutoScroll"); properties.Remove("AutoScrollMargin"); properties.Remove("AutoScrollMinSize"); //properties.Remove("BackColor"); properties.Remove("BackgroundImage"); properties.Remove("CausesValiation"); properties.Remove("Dock"); properties.Remove("DockPadding"); properties.Remove("RightToLeft"); }
/// <summary> /// Allows a designer to change or remove items from the set of properties that it exposes through a <see cref="T:System.ComponentModel.TypeDescriptor"></see>. /// </summary> /// <param name="properties">The properties for the class of the component.</param> protected override void PostFilterProperties(System.Collections.IDictionary properties) { properties.Remove("BackColor"); properties.Remove("Font"); properties.Remove("BackgroundImage"); properties.Remove("ForeColor"); properties.Remove("Text"); properties.Remove("RightToLeft"); properties.Remove("ImeMode"); properties.Remove("Padding"); properties.Remove("BackgroundImageLayout"); base.PostFilterProperties(properties); }
public void RemovePOCache(System.Web.Caching.Cache cache, int userId) { var poKeys = CacheKeyHelper.GetInstance().GetPOCacheKeys(userId); for (var i = 0; i < poKeys.Count; ++i) { cache.Remove(poKeys[i]); } }
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { if (!string.IsNullOrEmpty(config["WorkflowPath"])) { WorkflowPath = config["WorkflowPath"]; config.Remove("WorkflowPath"); } base.Initialize(name, config); }