public GridDefaults() { PreloadData = true; QueryOnPageLoad = true; Paging = false; ItemsPerPage = 20; Sorting = false; DefaultSortColumn = null; DefaultSortDirection = SortDirection.Unspecified; NoResultsMessage = "No results."; ClientSideLoadingMessageFunctionName = null; ClientSideLoadingCompleteFunctionName = null; Filtering = false; //RenderingEngine = typeof(MVCGrid.Rendering.BootstrapRenderingEngine); TemplatingEngine = typeof(MVCGrid.Templating.SimpleTemplatingEngine); AdditionalSettings = new Dictionary <string, object>(); RenderingMode = Models.RenderingMode.RenderingEngine; ViewPath = "~/Views/MVCGrid/_Grid.cshtml"; ContainerViewPath = null; ErrorMessageHtml = @"<div class=""alert alert-warning"" role=""alert"">There was a problem loading the grid.</div>"; AdditionalQueryOptionNames = new HashSet <string>(); PageParameterNames = new HashSet <string>(); AllowChangingPageSize = false; MaxItemsPerPage = null; AuthorizationType = Models.AuthorizationType.AllowAnonymous; RenderingEngines = new ProviderSettingsCollection(); RenderingEngines.Add(new ProviderSettings("BootstrapRenderingEngine", "MVCGrid.Rendering.BootstrapRenderingEngine, MVCGrid")); RenderingEngines.Add(new ProviderSettings("Export", "MVCGrid.Rendering.CsvRenderingEngine, MVCGrid")); DefaultRenderingEngineName = "BootstrapRenderingEngine"; }
public void LoadValuesFromConfigurationXml(XmlNode node) { foreach (XmlNode child in node.ChildNodes) { if (child.Name == "providers") { foreach (XmlNode providerNode in child.ChildNodes) { if ( (providerNode.NodeType == XmlNodeType.Element) && (providerNode.Name == "add") ) { if ( (providerNode.Attributes["name"] != null) && (providerNode.Attributes["type"] != null) ) { ProviderSettings providerSettings = new ProviderSettings( providerNode.Attributes["name"].Value, providerNode.Attributes["type"].Value); providerSettingsCollection.Add(providerSettings); } } } } } }
public void InstantiateProviders() { ProviderSettingsCollection providerSettingsCollection = new ProviderSettingsCollection(); providerSettingsCollection.Add(new ProviderSettings("Custom", "Remotion.UnitTests::Configuration.FakeProvider")); ProviderCollection providerCollection = new ProviderCollection(); _providerHelper.InstantiateProviders(providerSettingsCollection, providerCollection, typeof(FakeProviderBase), typeof(IFakeProvider)); Assert.That(providerCollection.Count, Is.EqualTo(1)); ProviderBase providerBase = providerCollection["Custom"]; Assert.IsInstanceOf(typeof(FakeProvider), providerBase); Assert.That(providerBase.Name, Is.EqualTo("Custom")); }
void ProcessAdd(MembershipSection section, SettingsMappingWhatContents how) { string name, type; if (!GetCommonAttributes(how, out name, out type)) { return; } ProviderSettingsCollection providers = section.Providers; ProviderSettings provider = providers [name]; if (provider != null) { return; } ProviderSettings prov = new ProviderSettings(name, type); SetProviderProperties(how, prov); providers.Add(prov); }
private static void EnsureProviders() { if (!initialized) { VerificationCodeSection section = (VerificationCodeSection)WebConfigurationManager.GetSection("spbVerificationCode/autoInputProtection"); bool hasSection = section != null; if (!hasSection) { section = new VerificationCodeSection(); } //userMode = section.UserMode; PersistenceMode = section.PersistenceMode; InitializeTextProviders(hasSection, section); InitializeImageProviders(hasSection, section); ProviderSettingsCollection pc = new ProviderSettingsCollection(); pc.Add(new ProviderSettings("filters", "Spacebuilder.Common.CrosshatchVerificationCodeFilterProvider,Spacebuilder.Common")); ProvidersHelper.InstantiateProviders(pc, filterProviders, typeof(VerificationCodeFilterProvider)); initialized = true; } }