本文整理汇总了C#中Configure类的典型用法代码示例。如果您正苦于以下问题:C# Configure类的具体用法?C# Configure怎么用?C# Configure使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Configure类属于命名空间,在下文中一共展示了Configure类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
/// <summary>
/// The run method
/// </summary>
/// <param name="config">
/// The config.
/// </param>
public void Run(Configure config)
{
Logger.Info("Statup.Run()");
var initMessage = new MyMessage
{
SomeId = "carlos",
LargeBlob = new DataBusProperty<byte[]>(Guid.NewGuid().ToByteArray())
};
var anotherMessage = new AnotherSagaCommand { SomeId = initMessage.SomeId, SleepHowLong = 2000 };
Thread.Sleep(5000);
this.bus.Send(initMessage);
Thread.Sleep(1000);
for (var i = 0; i < 5; i++)
{
anotherMessage.SleepHowLong = i;
this.bus.SendLocal(anotherMessage);
}
anotherMessage.SleepHowLong = 0;
this.bus.SendLocal(anotherMessage);
this.bus.SendLocal(anotherMessage);
this.bus.SendLocal(anotherMessage);
}
示例2: Install
public void Install(string identity, Configure config)
{
if (config.Settings.Get<bool>("Endpoint.SendOnly"))
{
return;
}
if (!config.CreateQueues())
{
return;
}
var wantQueueCreatedInstances = config.Builder.BuildAll<IWantQueueCreated>().ToList();
foreach (var wantQueueCreatedInstance in wantQueueCreatedInstances.Where(wantQueueCreatedInstance => wantQueueCreatedInstance.ShouldCreateQueue()))
{
if (wantQueueCreatedInstance.Address == null)
{
throw new InvalidOperationException(string.Format("IWantQueueCreated implementation {0} returned a null address", wantQueueCreatedInstance.GetType().FullName));
}
QueueCreator.CreateQueueIfNecessary(wantQueueCreatedInstance.Address, identity);
Logger.DebugFormat("Verified that the queue: [{0}] existed", wantQueueCreatedInstance.Address);
}
}
示例3: ToBrokeredMessage
public static BrokeredMessage ToBrokeredMessage(this TransportMessage message, SendOptions options, SettingsHolder settings, bool expectDelay, Configure config)
{
var brokeredMessage = BrokeredMessageBodyConversion.InjectBody(message.Body);
SetHeaders(message, options, settings, config, brokeredMessage);
var timeToSend = DelayIfNeeded(options, expectDelay);
if (timeToSend.HasValue)
brokeredMessage.ScheduledEnqueueTimeUtc = timeToSend.Value;
TimeSpan? timeToLive = null;
if (message.TimeToBeReceived < TimeSpan.MaxValue)
{
timeToLive = message.TimeToBeReceived;
}
else if (options.TimeToBeReceived.HasValue && options.TimeToBeReceived < TimeSpan.MaxValue)
{
timeToLive = options.TimeToBeReceived.Value;
}
if (timeToLive.HasValue)
{
if (timeToLive.Value <= TimeSpan.Zero) return null;
brokeredMessage.TimeToLive = timeToLive.Value;
}
GuardMessageSize(brokeredMessage);
return brokeredMessage;
}
示例4: ConfigurePublishingInfrastructure
private void ConfigurePublishingInfrastructure(Configure config, AzureServiceBusQueueConfig configSection)
{
config.Configurer.ConfigureComponent<AzureServiceBusTopicPublisher>(DependencyLifecycle.InstancePerCall);
config.Configurer.ConfigureProperty<AzureServiceBusTopicPublisher>(t => t.MaxDeliveryCount, configSection.MaxDeliveryCount);
config.Configurer.ConfigureComponent<AzureServiceBusTopicSubscriptionManager>(DependencyLifecycle.InstancePerCall);
}
示例5: SetUp
public void SetUp()
{
config = Configure.With(new[] { typeof(MySaga).Assembly})
.DefaultBuilder()
.Sagas()
.NHibernateSagaPersister();
}
开发者ID:togakangaroo,项目名称:NServiceBus,代码行数:7,代码来源:When_configuring_the_saga_persister_from_appconfig.cs
示例6: EnablingSla
void EnablingSla(Configure configure)
{
#region enable-sla
// in this version there was no granular control over individual counters
configure.EnablePerformanceCounters();
#endregion
}
示例7: EnablingCriticalTime
void EnablingCriticalTime(Configure configure)
{
#region enable-criticaltime
// in this version there was no granular control over individual counters
configure.EnablePerformanceCounters();
#endregion
}
示例8: RenamePrincipalHack
void RenamePrincipalHack(Configure configure)
{
#region 3to4RenamePrincipalHack
var unicastBus = configure.UnicastBus();
unicastBus.RunHandlersUnderIncomingPrincipal(true);
#endregion
}
示例9: Initialize
protected override void Initialize(Configure config)
{
connectionStringFunc = () => "Url = http://localhost:8080; DefaultDatabase=MyDB";
database = "CustomDatabase";
config.RavenPersistence(connectionStringFunc, database);
}
开发者ID:89sos98,项目名称:NServiceBus,代码行数:7,代码来源:When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_lambda_and_database.cs
示例10: Configure
/// <summary>
/// Wraps the given configuration object but stores the same
/// builder and configurer properties.
/// </summary>
/// <param name="config"></param>
public void Configure(Configure config)
{
Builder = config.Builder;
Configurer = config.Configurer;
transportConfig = Configurer.ConfigureComponent<XmsTransport>(ComponentCallModelEnum.Singleton);
var cfg = GetConfigSection<XmsTransportConfig>();
var dictionary = new Dictionary<string, string>();
if (cfg != null)
{
transportConfig.ConfigureProperty(t => t.InputQueue, cfg.InputQueue);
transportConfig.ConfigureProperty(t => t.NumberOfWorkerThreads, cfg.NumberOfWorkerThreads);
transportConfig.ConfigureProperty(t => t.ErrorQueue, cfg.ErrorQueue);
transportConfig.ConfigureProperty(t => t.MaxRetries, cfg.MaxRetries);
if(cfg.Aliases!=null)
{
dictionary = cfg.Aliases.ToDictionary(x => x.Name, y => y.Value);
}
}
transportConfig.ConfigureProperty(t => t.Aliases, dictionary);
var unicastConfig = GetConfigSection<UnicastBusConfig>();
if (unicastConfig != null)
{
if (!string.IsNullOrEmpty(unicastConfig.ForwardReceivedMessagesTo))
transportConfig.ConfigureProperty(t => t.ForwardReceivedMessagesTo, unicastConfig.ForwardReceivedMessagesTo);
}
}
示例11: CustomRavenConfig
CustomRavenConfig(Configure configure)
{
#region OldRavenDBPersistenceInitialization
configure.RavenPersistence();
configure.RavenSagaPersister();
configure.RavenSubscriptionStorage();
configure.UseRavenTimeoutPersister();
configure.UseRavenGatewayDeduplication();
configure.UseRavenGatewayPersister();
#endregion
#region Version2_5RavenDBPersistenceInitialization
// Need to call this method
configure.RavenDBStorage();
// Call this method to use Raven saga storage
configure.UseRavenDBSagaStorage();
// Call this method to use Raven subscription storage
configure.UseRavenDBSubscriptionStorage();
// Call this method to use Raven timeout storage
configure.UseRavenDBTimeoutStorage();
// Call this method to use Raven deduplication storage for the Gateway
configure.UseRavenDBGatewayDeduplicationStorage();
// Call this method to use the Raven Gateway storage method
configure.UseRavenDBGatewayStorage();
#endregion
}
示例12: Install
public void Install(string identity, Configure config)
{
Console.Title = "Complaint.Frontend";
Console.WriteLine(
"Hy there from CustomWindowsEverytimeInstaller! I will run every time! Identity {0}", identity);
}
示例13: Configure
public void Configure(Configure config)
{
this.Builder = config.Builder;
this.Configurer = config.Configurer;
this.config = Configurer.ConfigureComponent<RabbitMqTransport>(ComponentCallModelEnum.Singleton);
var cfg = NServiceBus.Configure.GetConfigSection<RabbitMqTransportConfig>();
if(cfg != null)
{
this.config.ConfigureProperty(t => t.NumberOfWorkerThreads, cfg.NumberOfWorkerThreads);
this.config.ConfigureProperty(t => t.MaximumNumberOfRetries, cfg.MaxRetries);
this.config.ConfigureProperty(t => t.InputBroker, cfg.InputBroker);
this.config.ConfigureProperty(t => t.InputExchange, cfg.InputExchange);
this.config.ConfigureProperty(t => t.InputExchangeType, cfg.InputExchangeType);
this.config.ConfigureProperty(t => t.InputQueue, cfg.InputQueue);
this.config.ConfigureProperty(t => t.InputRoutingKeys, cfg.InputRoutingKeys);
this.config.ConfigureProperty(t => t.DoNotCreateInputExchange, cfg.DoNotCreateInputExchange);
this.config.ConfigureProperty(t => t.DoNotCreateInputQueue, cfg.DoNotCreateInputQueue);
this.config.ConfigureProperty(t => t.ErrorBroker, cfg.ErrorBroker);
this.config.ConfigureProperty(t => t.ErrorExchange, cfg.ErrorExchange);
this.config.ConfigureProperty(t => t.ErrorExchangeType, cfg.ErrorExchangeType);
this.config.ConfigureProperty(t => t.ErrorQueue, cfg.ErrorQueue);
this.config.ConfigureProperty(t => t.ErrorRoutingKeys, cfg.ErrorRoutingKeys);
this.config.ConfigureProperty(t => t.DoNotCreateErrorExchange, cfg.DoNotCreateErrorExchange);
this.config.ConfigureProperty(t => t.DoNotCreateErrorQueue, cfg.DoNotCreateErrorQueue);
this.config.ConfigureProperty(t => t.TransactionTimeout, TimeSpan.FromMinutes(cfg.TransactionTimeout));
this.config.ConfigureProperty(t => t.SendAcknowledgement, cfg.SendAcknowledgement);
}
}
示例14: SqsDequeueStrategy
public SqsDequeueStrategy(Configure config)
{
if (config != null)
_purgeOnStartup = config.PurgeOnStartup();
else
_purgeOnStartup = false;
}
示例15: SetUp
public void SetUp()
{
config = Configure.With()
.SpringBuilder()
.DBSubcriptionStorage();
}