本文整理汇总了C#中IReceiver类的典型用法代码示例。如果您正苦于以下问题:C# IReceiver类的具体用法?C# IReceiver怎么用?C# IReceiver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IReceiver类属于命名空间,在下文中一共展示了IReceiver类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Session
public Session(IReceiver receiver, IAnalysis analysis)
{
Id = Guid.NewGuid();
Receiver = receiver;
DiagnoseOutputEntries = new ReactiveCollection<IDiagnoseOutputEntry>();
Analysis = new ReactiveCollection<IAnalysis>();
Analysis.ItemsAdded.Subscribe(x =>
{
foreach (var diagnoseOutputEntry in DiagnoseOutputEntries)
{
x.ProcessNewDiagnoseOutputEntry(diagnoseOutputEntry);
}
});
Analysis.Add(analysis);
DiagnoseOutputEntries.ItemsAdded.Subscribe(x =>
{
foreach (var analyse in Analysis)
{
analyse.ProcessNewDiagnoseOutputEntry(x);
}
});
}
开发者ID:GraphalyzerPro,项目名称:GraphalyzerPro,代码行数:26,代码来源:Session.cs
示例2: StartReceiving
public void StartReceiving(IReceiver receiver, ILogger logger)
{
Scheduler.Start(() =>
{
int exceptionCount = 0;
var receivingState = ReceivingState.CanContinueReceiving;
while (receivingState == ReceivingState.CanContinueReceiving)
{
try
{
receivingState = Channel.Receive(receiver);
exceptionCount = 0;
}
catch (Exception ex)
{
logger.InfoMessage(new ReceiveFailed { ChannelKey = Key, Exception = ex });
logger.Error("Error in receive loop", ex);
if (++exceptionCount > 9)
{
// We're probably stuck getting the same error forever, let the process crash.
throw new ReceiveFailureException(
"Received repeated errors while listening for messages on channel: " + Key,
ex);
}
}
}
});
}
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:28,代码来源:ChannelNode.cs
示例3: Command
static Invoker VoiceCall, VideoCall, Chat; //Add more commands here
#endregion Fields
#region Constructors
public Command(IReceiver receiver, CommandType type)
{
VoiceCall = receiver.MakeAVoiceCall;
VideoCall = receiver.MakeAVideoCall;
Chat = receiver.StartChat;
SendFile = receiver.SendFile;
Type = type;
}
开发者ID:radtek,项目名称:rrcomssys-team-5,代码行数:14,代码来源:CommandPattern.cs
示例4: AddSession
public Guid AddSession(IReceiver receiver, IAnalysis analysis)
{
var newSession = new Session(receiver, analysis);
Sessions.Add(newSession);
return newSession.Id;
}
开发者ID:GraphalyzerPro,项目名称:GraphalyzerPro,代码行数:8,代码来源:InformationEngine.cs
示例5: ReceiveDataHandler
public ReceiveDataHandler(Topic t, Participant part, IReceiver receiver)
{
topic = t;
bytes = new byte[t.GetSampleMaxSize()];
headerBytes = new byte[FRAGMENT_HEADER_SIZE];
participant = part;
fragmentSize = Globals.MAX_SEGMENT_SIZE;
this.receiver = receiver;
}
开发者ID:staxgr,项目名称:ops,代码行数:9,代码来源:ReceiveDataHandler.cs
示例6: SetUp
public void SetUp()
{
Helper.SetupTestMessaging();
mock_event_hook = Substitute.For<IEventHook>();
ObjectFactory.Configure(map=> map.For<IEventHook>().Use(mock_event_hook));
node_factory = ObjectFactory.GetInstance<IReceiver>();
}
开发者ID:i-e-b,项目名称:SevenDigital.Messaging,代码行数:9,代码来源:FailingHandlerEventHookTests.cs
示例7: AddReceiver
private void AddReceiver(IReceiver receiver)
{
string displayName = String.IsNullOrEmpty(receiver.DisplayName)
? ReceiverUtils.GetTypeDescription(receiver.GetType())
: receiver.DisplayName;
ListViewItem lvi = receiversListView.Items.Add(displayName);
lvi.Tag = receiver;
lvi.Selected = true;
}
开发者ID:TanyaTPG,项目名称:Log2Console,代码行数:9,代码来源:ReceiversForm.cs
示例8: Receive
public ReceivingState Receive(IReceiver receiver)
{
var stream = _queueManager.ReceiveStream(_queueName);
foreach (var message in stream.TakeWhile(message => !_disposed))
{
receiver.Receive(message.Message.Data, new NameValueHeaders(message.Message.Headers),
new TransactionCallback(message.TransactionalScope, message.Message, _delayedMessages));
}
return ReceivingState.StopReceiving;
}
开发者ID:joemcbride,项目名称:fubumvc,代码行数:10,代码来源:LightningQueuesChannel.cs
示例9: SetUp
protected override void SetUp()
{
var fiber = new StubFiber();
_mock_first = CreateMock<IReceiver<int>>();
_mock_rest = CreateMock<IReceiver<int>>();
_receiver = new FirstReceiver<int>(fiber,
_mock_first.Object, _mock_rest.Object);
}
开发者ID:GWBasic,项目名称:retlang,代码行数:10,代码来源:FirstReceiverFixture.cs
示例10: CreateCommand
public override Command CreateCommand(ConsoleKeyInfo keyInfo, IReceiver receiver)
{
switch (keyInfo.Key)
{
case ConsoleKey.Enter:
return new SubmitCommand(receiver);
case ConsoleKey.Backspace:
return new BackspaceCommand(receiver);
default:
return new InputCharacterCommand(keyInfo.KeyChar, receiver);
}
}
开发者ID:jagmeet-chaudhary,项目名称:ChatApp,代码行数:12,代码来源:Command.cs
示例11: ChatConsoleActor
public ChatConsoleActor(string userName,string clientActorPath)
{
_userName = userName;
_clientActorPath = clientActorPath;
_clientActor = ActorSystemContainer.Instance.System.ActorSelection(_clientActorPath).ResolveOne(new TimeSpan(0, 0, 10)).Result;
_clientActor.Tell(new Messages.AttachConsole(Self));
Dictionary<string, object> parameters = new Dictionary<string, object>() { { "actor", _clientActor }, { "userName", _userName } };
//Dictionary<string, object> parameters = new Dictionary<string, object>() { { "filePath", @"c:\logs\fileoutput.txt" } };
_receiver = GlobalIocContainer.Container.IocContainer.Resolve<IReceiver>(parameters);
_commandFactory = GlobalIocContainer.Container.IocContainer.Resolve<CommandFactory>();
_commandManager = new CommandManager();
}
开发者ID:jagmeet-chaudhary,项目名称:ChatApp,代码行数:13,代码来源:ChatConsoleActor.cs
示例12: MessageBroker
public MessageBroker(IChannel channel, IWorker worker, IReceiver[] receivers, Configuration.HostSection config)
{
this.channel = channel;
this.worker = worker;
this.receivers = receivers.ToLookup(r => r.MessageType);
this.Name = config.Messaging.SenderName;
this.Enabled = config.Messaging.Enabled;
this.Async = config.Messaging.Async;
this.OnlyFromMachineNamed = config.Messaging.Targets.OnlyFromMachineNamed;
this.SharedSecret = config.Messaging.Targets.SharedSecret;
this.Targets = config.Messaging.Targets.AllElements.Select(te => new MessageTarget { Name = te.Name, Address = te.Address, ExceptFromMachineNamed = te.ExceptFromMachineNamed }).ToArray();
}
开发者ID:JohnsonYuan,项目名称:n2cms,代码行数:13,代码来源:MessageBroker.cs
示例13: Receive
public ReceivingState Receive(IReceiver receiver)
{
_disposable = _queueManager.Receive(_queueName).Subscribe(message =>
{
Task.Run(() =>
{
receiver.Receive(message.Message.Data, new DictionaryHeaders(message.Message.Headers),
new TransactionCallback(message.QueueContext, message.Message));
});
});
return ReceivingState.StopReceiving;
}
开发者ID:DarthFubuMVC,项目名称:fubumvc,代码行数:13,代码来源:LightningQueuesChannel.cs
示例14: GetReceiver
public static IReceiver GetReceiver()
{
if(_receiver == null)
{
try
{
_receiver = new UDPReceiver();
}
catch (System.Exception ex)
{
throw new Exception(ex.Message);
}
}
return _receiver;
}
开发者ID:Waterstrong,项目名称:iSlide,代码行数:15,代码来源:UDPFactory.cs
示例15: Receive
public void Receive(IReceiver receiver)
{
while (!_disposed)
{
foreach (var data in _queue.GetConsumingEnumerable())
{
using (var stream = new MemoryStream(data))
{
var token = _formatter.Deserialize(stream).As<EnvelopeToken>();
var callback = new InMemoryCallback(this, token);
receiver.Receive(token.Data, token.Headers, callback);
}
}
}
}
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:17,代码来源:InMemoryQueue.cs
示例16: PressHome
public PressHome(IReceiver aReceiver )
{
myReceiver= aReceiver ;
}
开发者ID:hajirazin,项目名称:DesignPatternsDotNet,代码行数:4,代码来源:PressHome.cs
示例17: CharacterAction
protected CharacterAction(IReceiver receiver)
{
Receiver = receiver;
IsExecuted = false;
}
开发者ID:Kavignon,项目名称:Augmented_Tactics,代码行数:5,代码来源:CharacterAction.cs
示例18: TerminateReceiver
private void TerminateReceiver(IReceiver receiver)
{
try
{
receiver.Detach();
receiver.Terminate();
}
catch (Exception ex)
{
ShowErrorBox("Failed to Terminate Receiver: " + ex.Message);
}
}
开发者ID:dunston,项目名称:Log2Console,代码行数:12,代码来源:MainForm.cs
示例19: InitializeReceiver
private void InitializeReceiver(IReceiver receiver)
{
try
{
receiver.Initialize();
receiver.Attach(this);
//LogManager.Instance.SetRootLoggerName(String.Format("Root [{0}]", receiver));
}
catch (Exception ex)
{
try
{
receiver.Terminate();
}
catch { }
ShowErrorBox("Failed to Initialize Receiver: " + ex.Message);
}
}
开发者ID:dunston,项目名称:Log2Console,代码行数:20,代码来源:MainForm.cs
示例20: Receiver
internal Receiver(IReceiver aReceiver)
{
iReceiver = aReceiver;
iDescription = iReceiver.Room + " (" + iReceiver.Group + ")";
}
开发者ID:openhome,项目名称:ohSongcast,代码行数:5,代码来源:ReceiverList.cs
注:本文中的IReceiver类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论