This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let makeListOf itemType (items : obj list) = | |
let listType = | |
makeGenericType | |
<| typedefof<Microsoft.FSharp.Collections.List<_>> | |
<| [ itemType; ] | |
let add = | |
let cons = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let makeSeqOf itemType (items : obj list) = | |
let seqType = | |
makeGenericType | |
<| typedefof<List<_>> | |
<| [ itemType; ] | |
let sequence = | |
Activator.CreateInstance seqType |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let intOptionType = | |
makeGenericType | |
<| typedefof<Option<_>> | |
<| [ typeof<Int32> ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let makeGenericType (baseType : Type) (types : Type list) = | |
if (not baseType.IsGenericTypeDefinition) then | |
invalidArg "baseType" "The base type specified was not a generic type definition." | |
baseType.MakeGenericType ( | |
types | |
|> List.toArray | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<consumer name='Test' type='MyAssembly.MyConsumer, MyAssembly'> | |
<settings> | |
<add key='mapping-name' value='example' /> | |
<add key='mapping-file-name' value='example-mappings.xml' /> | |
<provider | |
type='Tribal.Switchboard.Extensions.Mapping.HeaderBasedSettingProvider, Tribal.Switchboard.Extensions' | |
/> | |
</settings> | |
</consumer> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mappings xmlns='http://www.tribalgroup.com/switchboard/header-mapping.xsd'> | |
<mapping name='example'> | |
<header name='LocationCode'> | |
<settings for='Inst-01'> | |
<add key='URL' value='http://inst-01/' /> | |
</settings> | |
<settings for='Inst-02'> | |
<add key='URL' value='http://inst-02/' /> | |
</settings> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ExampleConsumerFactory : ConsumerFactoryBase { | |
public override IEnumerable<IMessageConsumer> GetConsumers(IMessageContext messageContext) { | |
var consumers = new List<IMessageConsumer>(); | |
if(messageContext.Message.Headers.Exists("queues")) { | |
var queues = messageContext | |
.Message |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<factory name='TestFactory' type='MyAssembly.MyFactory, MyAssembly'> | |
<consumer-settings> | |
<add ... /> | |
<provider ... /> | |
</consumer-settings> | |
</factory> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<factory name='TestFactory' type='MyAssembly.MyFactory, MyAssembly'> | |
<factory-settings> | |
<add key='setting-key' value='setting-value' /> | |
</factory-settings> | |
</factory> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<factory | |
name='TestFactory' | |
type='MyAssembly.MyFactory, MyAssembly' | |
/> |
NewerOlder