/// <summary> /// Initializes a new instance of <see cref="CrowHost"/>. /// </summary> /// <param name="log">Instance of logger.</param> /// <param name="convention">Naming convention instance.</param> /// <param name="container">Dependency injection container.</param> /// <param name="configuration">Configuration helper.</param> /// <param name="host">Http host instance.</param> public CrowHost(ILog log, INamingConvention convention, IInjectionContainer container, IConfigurationHelper configuration, IHttpHost host) : base(log, convention, container, configuration, host) { }
public BusinessControllerBase SelectBusinessController(HttpRequestMessage request, ITypeListHost host, INamingConvention convention, IInjectionContainer container) { UrlParser url = new UrlParser(request.RequestUri.ToString()); Type controllerType = host.BusinessTypeList[url.BusinessClass]; var instance = container.Resolve(controllerType); return new CrowBusinessController(instance, url, convention); }
public FullObjectGraphTraversalStrategy(Serializer serializer, ITypeInspector typeDescriptor, ITypeResolver typeResolver, int maxRecursion, INamingConvention namingConvention) { if (maxRecursion <= 0) { throw new ArgumentOutOfRangeException("maxRecursion", maxRecursion, "maxRecursion must be greater than 1"); } this.serializer = serializer; if (typeDescriptor == null) { throw new ArgumentNullException("typeDescriptor"); } this.typeDescriptor = typeDescriptor; if (typeResolver == null) { throw new ArgumentNullException("typeResolver"); } this.typeResolver = typeResolver; this.maxRecursion = maxRecursion; this.namingConvention = namingConvention; }
public string GetStr(INamingConvention naming) { if (!string.IsNullOrEmpty(Alias)) return Alias; else if (IsNonConsecutiveList) return naming.Apply(Name).Singularize(Plurality.CouldBeEither); else return naming.Apply(Name); }
public BusinessControllerBase(object instance, UrlParser url, INamingConvention convention) { _BusinessInstance = instance; _BusinessInstance.ThrowIfNull("instance"); _UrlInformation = url; _UrlInformation.ThrowIfNull("url"); _namingConvention = convention; _namingConvention.ThrowIfNull("convention"); }
public void SetUp() { config = new LauncherConfiguration { ApplicationExe = "Test.App.exe", UpdatesLocation = "ftp://*****:*****@ftp.test.com/remotedir" }; ftp = MockRepository.GenerateMock<IFtpAccessor>(); namingConvention = new DefaultNamingConvention(); }
/// <summary> /// /// </summary> /// <param name="options">Options that control how the serialization is to be performed.</param> /// <param name="namingConvention">Naming strategy to use for serialized property names</param> public Serializer(SerializationOptions options = SerializationOptions.None, INamingConvention namingConvention = null) { this.options = options; this.namingConvention = namingConvention ?? new NullNamingConvention(); Converters = new List<IYamlTypeConverter>(); typeResolver = IsOptionSet(SerializationOptions.DefaultToStaticType) ? (ITypeResolver)new StaticTypeResolver() : (ITypeResolver)new DynamicTypeResolver(); }
/// <summary> /// Initializes a new instance of <see cref="CrowBusinessHandler"/>. /// </summary> public CrowBusinessHandler(ITypeListHost host, INamingConvention convention, IInjectionContainer container) { _host = host; _host.ThrowIfNull("host"); _convention = convention; _convention.ThrowIfNull("convention"); _container = container; _container.ThrowIfNull("container"); }
/// <summary> /// /// </summary> /// <param name="options">Options that control how the serialization is to be performed.</param> /// <param name="namingConvention">Naming strategy to use for serialized property names</param> public Serializer(SerializationOptions options = SerializationOptions.None, INamingConvention namingConvention = null) { this.options = options; this.namingConvention = namingConvention ?? new NullNamingConvention(); Converters = new List<IYamlTypeConverter>(); foreach (IYamlTypeConverter yamlTypeConverter in Utilities.YamlTypeConverters.BuiltInConverters) { Converters.Add(yamlTypeConverter); } typeResolver = IsOptionSet(SerializationOptions.DefaultToStaticType) ? (ITypeResolver)new StaticTypeResolver() : (ITypeResolver)new DynamicTypeResolver(); }
public ExtensibleNamingConventionTypeInspector(IExtensibleTypeInspector innerTypeDescriptor, INamingConvention namingConvention) { if (innerTypeDescriptor == null) { throw new ArgumentNullException(nameof(innerTypeDescriptor)); } this.innerTypeDescriptor = innerTypeDescriptor; if (namingConvention == null) { throw new ArgumentNullException(nameof(namingConvention)); } this.namingConvention = namingConvention; }
/// <summary> /// /// </summary> /// <param name="options">Options that control how the serialization is to be performed.</param> /// <param name="namingConvention">Naming strategy to use for serialized property names</param> /// <param name="overrides">Yaml attribute overrides</param> public Serializer(SerializationOptions options = SerializationOptions.None, INamingConvention namingConvention = null, YamlAttributeOverrides overrides = null) { this.options = options; this.namingConvention = namingConvention ?? new NullNamingConvention(); this.overrides = overrides; Converters = new List<IYamlTypeConverter>(); foreach (IYamlTypeConverter yamlTypeConverter in Utilities.YamlTypeConverters.GetBuiltInConverters(IsOptionSet(SerializationOptions.JsonCompatible))) { Converters.Add(yamlTypeConverter); } typeResolver = IsOptionSet(SerializationOptions.DefaultToStaticType) ? (ITypeResolver)new StaticTypeResolver() : (ITypeResolver)new DynamicTypeResolver(); }
public NamingConventionTypeInspector(ITypeInspector innerTypeDescriptor, INamingConvention namingConvention) { if (innerTypeDescriptor == null) { throw new ArgumentNullException("innerTypeDescriptor"); } this.innerTypeDescriptor = innerTypeDescriptor; if (namingConvention == null) { throw new ArgumentNullException("namingConvention"); } this.namingConvention = namingConvention; }
public static void AssertTemplateResult(string expected, string template, INamingConvention namingConvention) { AssertTemplateResult(expected: expected, template: template, anonymousObject: null, namingConvention: namingConvention); }
private void ShouldApplyConventionGiven(string input, string expectedName, INamingConvention convention) { convention.Apply(input).Should().Be(expectedName); }
public string GetLastVersionFilename(INamingConvention namingConvention) { var fileList = Directory.GetFiles(configuration.UpdatesLocation) .Select(x => Path.GetFileName(x)); return namingConvention.GetLastVersionFilename(fileList, configuration); }
internal AdvancedEnumConverter([NotNull] INamingConvention namingConvention) { _namingConvention = namingConvention; }
public string GetLastVersionFilename(INamingConvention namingConvention) { var fileList = ftp.ListFiles() ?? new string[] {}; var lastNewFilename = namingConvention.GetLastVersionFilename(fileList, configuration); return lastNewFilename; }
public BackwardsCompatibleConfiguration(SerializationOptions options, INamingConvention namingConvention, YamlAttributeOverrides overrides) { this.options = options; this.namingConvention = namingConvention ?? new NullNamingConvention(); this.overrides = overrides; Converters = new List<IYamlTypeConverter>(); Converters.Add(new GuidConverter(IsOptionSet(SerializationOptions.JsonCompatible))); typeResolver = IsOptionSet(SerializationOptions.DefaultToStaticType) ? (ITypeResolver)new StaticTypeResolver() : (ITypeResolver)new DynamicTypeResolver(); }
public NameSplitMember() { SourceMemberNamingConvention = new PascalCaseNamingConvention(); DestinationMemberNamingConvention = new PascalCaseNamingConvention(); }
public SqlGenerator(TableInfo tableInfo, INamingConvention namingConvention) { _tableInfo = tableInfo; _namingConvention = namingConvention; }
public ExRelationSerializer(SerializationOptions options = SerializationOptions.None, INamingConvention namingConvention = null) : base(options, namingConvention) { }
public NamingConventionAsync(INamingConvention <TResult> namingConvention) { _namingConvention = namingConvention; }
public static Task <TOutput> RunCheckpointAsync <TInput, TOutput>(this ICheckpointRunner runner, string key, ISandboxedCheckpoint <TInput, TOutput> wrapper, TInput input, INamingConvention <TOutput> namingConvention) { return(runner.RunCheckpointAsync(key, dir => wrapper.Run(input, dir), namingConvention)); }
public Serializer(SerializationOptions options = SerializationOptions.None, INamingConvention namingConvention = null, YamlAttributeOverrides overrides = null) { backwardsCompatibleConfiguration = new BackwardsCompatibleConfiguration(options, namingConvention, overrides); }
public CheckForInvalidNamesDecorator(INamingConvention realConvention) { _realConvention = realConvention; _defaultConvention = new NamingConvention(); }
/// <summary> /// Initializes a new instance of the <see cref="DotLiquidViewEngine"/> class. /// </summary> /// <param name="fileSystemFactory">Factory used to retrieve the <see cref="IFileSystem"/> instance that should be used by the engine.</param> /// <param name="namingConvention">The naming convention used by filters and DotLiquid's <c>Drop</c>s</param> public DotLiquidViewEngine(IFileSystemFactory fileSystemFactory, INamingConvention namingConvention) { this.fileSystemFactory = fileSystemFactory; this.namingConvention = namingConvention; }
public CrowBusinessController(object businessInstance, UrlParser url, INamingConvention convention) : base(businessInstance, url, convention) { }
public BusinessInvoker(ITypeListHost host, INamingConvention convention, IInjectionContainer container) { _host = host; _convention = convention; _container = container; }
public YamlDeserializer( IObjectFactory objectFactory = null, INamingConvention namingConvention = null, bool ignoreUnmatched = false, bool ignoreNotFoundAnchor = true) { objectFactory = objectFactory ?? new DefaultEmitObjectFactory(); namingConvention = namingConvention ?? new NullNamingConvention(); _typeDescriptor.TypeDescriptor = new ExtensibleYamlAttributesTypeInspector( new ExtensibleNamingConventionTypeInspector( new ExtensibleReadableAndWritablePropertiesTypeInspector( new EmitTypeInspector( new StaticTypeResolver() ) ), namingConvention ) ); _converters = new List <IYamlTypeConverter>(); foreach (IYamlTypeConverter yamlTypeConverter in YamlTypeConverters.BuiltInConverters) { _converters.Add(yamlTypeConverter); } NodeDeserializers = new List <INodeDeserializer>(); NodeDeserializers.Add(new TypeConverterNodeDeserializer(_converters)); NodeDeserializers.Add(new NullNodeDeserializer()); NodeDeserializers.Add(new ScalarNodeDeserializer()); NodeDeserializers.Add(new EmitArrayNodeDeserializer()); NodeDeserializers.Add(new EmitGenericDictionaryNodeDeserializer(objectFactory)); NodeDeserializers.Add(new DictionaryNodeDeserializer(objectFactory)); NodeDeserializers.Add(new EmitGenericCollectionNodeDeserializer(objectFactory)); NodeDeserializers.Add(new CollectionNodeDeserializer(objectFactory)); NodeDeserializers.Add(new EnumerableNodeDeserializer()); NodeDeserializers.Add(new ExtensibleObjectNodeDeserializer(objectFactory, _typeDescriptor, ignoreUnmatched)); _tagMappings = new Dictionary <string, Type>(PredefinedTagMappings); TypeResolvers = new List <INodeTypeResolver>(); TypeResolvers.Add(new TagNodeTypeResolver(_tagMappings)); TypeResolvers.Add(new TypeNameInTagNodeTypeResolver()); TypeResolvers.Add(new DefaultContainersNodeTypeResolver()); TypeResolvers.Add(new ScalarYamlNodeTypeResolver()); if (ignoreNotFoundAnchor) { _valueDeserializer = new LooseAliasValueDeserializer( new NodeValueDeserializer( NodeDeserializers, TypeResolvers ) ); } else { _valueDeserializer = new AliasValueDeserializer( new NodeValueDeserializer( NodeDeserializers, TypeResolvers ) ); } }
/// <summary> /// Initializes a new instance of the <see cref="DotLiquidViewEngine"/> class. /// </summary> /// <param name="namingConvention">Determines the DotLiquid naming convention that will be used for filters and Drops. This will default to the <c>RubyNamingConvention</c>.</param> /// <remarks>The instance will use the <see cref="DefaultFileSystemFactory"/> internally.</remarks> public DotLiquidViewEngine(INamingConvention namingConvention) : this(new DefaultFileSystemFactory(), namingConvention) { }
public static void AssertTemplateResult(string expected, string template, Hash localVariables, INamingConvention namingConvention) { //Have to lock Template.NamingConvention for this test to //prevent other tests from being run simultaneously that //require the default naming convention. var currentNamingConvention = Template.NamingConvention; lock (Template.NamingConvention) { Template.NamingConvention = namingConvention; try { AssertTemplateResult(expected, template, localVariables); } finally { Template.NamingConvention = currentNamingConvention; } } }
public void Render(object data, TextWriter writer, TemplateLocator templateLocator, INamingConvention namingConvention) { Render(data, writer, templateLocator, new ValueProviderCollection(namingConvention)); }
public ResourceMerger(INamingConvention namingConvention) { NamingConvention = namingConvention; }
/// <summary> /// The transform index. /// </summary> /// <param name="index"> /// The index. /// </param> /// <returns> /// The <see cref="string" />. /// </returns> public string TransformIndex(Index index, INamingConvention nc = null) { return(NhibernateDriverType.TransformIndex(index, nc)); }
public static void AssertTemplateResult(string expected, string template, object anonymousObject, INamingConvention namingConvention, SyntaxCompatibility syntax = SyntaxCompatibility.Liquid20) { LockTemplateStaticVars(namingConvention, () => { var localVariables = anonymousObject == null ? null : Hash.FromAnonymousObject(anonymousObject); var parameters = new RenderParameters(System.Globalization.CultureInfo.CurrentCulture) { LocalVariables = localVariables, SyntaxCompatibilityLevel = syntax }; Assert.AreEqual(expected, Template.Parse(template).Render(parameters)); }); }