コード例 #1
0
        /// <summary>
        /// Initializes the current instance with a contained <see cref="RelayNode"/>
        /// </summary>
		/// <param name="dataHandler">The data handler.</param>
		/// <param name="relayNode">The relay node.</param>
		/// <exception cref="ArgumentNullException">Thrown when <paramref name="dataHandler"/> is null
		/// or when <paramref name="relayNode"/> is null.</exception>
		public SocketServerRelayMessageHandler(IDataHandler dataHandler, IRelayNode relayNode)
		{
			if (dataHandler == null) throw new ArgumentNullException("dataHandler");
			if (relayNode == null) throw new ArgumentNullException("relayNode");
			_dataHandler = dataHandler;
			_relayNode = relayNode;
        }
コード例 #2
0
 public override void Digest(IDataHandler handler)
 {
     foreach (var dataItem in this._data)
     {
         handler.HandleDocument(dataItem);
     }
 }
コード例 #3
0
ファイル: MockSender.cs プロジェクト: xujyan/brunet
 public MockSender(ISender ReturnPath, object State, IDataHandler Receiver,
     int RemoveNPTypes)
 {
   this.ReturnPath = ReturnPath;
   this.State = State;
   this.Receiver = Receiver;
   _remove_n_ptypes = RemoveNPTypes;
 }
コード例 #4
0
ファイル: ThreadedMockSender.cs プロジェクト: johnynek/brunet
 public ThreadedMockSender(ISender ReturnPath, object State,
     IDataHandler Receiver, int RemoveNPTypes, double drop_rate) :
   base(ReturnPath, State, Receiver, RemoveNPTypes, drop_rate)
 {
   _queue = new BlockingQueue();
   Thread runner = new Thread(ThreadRun);
   runner.IsBackground = true;
   runner.Start();
 }
コード例 #5
0
 public SSH2PacketBuilder(IDataHandler handler)
     : base(handler)
 {
     _buffer = new DataFragment(0x1000);
     _packet = new DataFragment(_buffer.Capacity);
     _sequence = 0;
     _cipher = null;
     _mac = null;
     _head = null;
 }
コード例 #6
0
 public NaivePortfolio(IEventBus eventBus, IDataHandler bars, decimal initialCapital)
 {
     this.eventBus = eventBus;
     this.bars = bars;
     this.initialCapital = initialCapital;
     this.HoldingHistory = new Dictionary<DateTime, Holding>();
     this.currentPositions = this.bars.Symbols.ToDictionary(symbol => symbol, qty => 0); ;
     this.currentComission = decimal.Zero;
     this.currentCash = this.initialCapital;
 }
コード例 #7
0
ファイル: MockSender.cs プロジェクト: pstjuste/brunet
 public MockSender(ISender ReturnPath, object State, IDataHandler Receiver,
     int RemoveNPTypes, double drop_rate)
 {
   this.ReturnPath = ReturnPath;
   this.State = State;
   this.Receiver = Receiver;
   _remove_n_ptypes = RemoveNPTypes;
   _drop_rate = drop_rate;
   _rand = new Random();
 }
コード例 #8
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            TableView.Source = new GenericTableSource<Question>();

            _handler = new UITableViewDataHandler<Question> (this);

            RefreshControl = new UIRefreshControl();
            RefreshControl.ValueChanged += (sender, e) => _handler.LoadData ();

            _handler.LoadData();
        }
コード例 #9
0
 public BackTest(
     IEventBus eventBus,
     IDataHandler bars, 
     IStrategy strategy, 
     IPortfolio portfolio, 
     IExecutionHandler executionHandler)
 {
     this.eventBus = eventBus;
     this.bars = bars;
     this.strategy = strategy;
     this.portfolio = portfolio;
     this.executionHandler = executionHandler;
     this.stopWatch = new Stopwatch();
 }
コード例 #10
0
ファイル: CGEngine.cs プロジェクト: hgrandry/Mgx
 public void AddHandler(IDataHandler handler)
 {
     _handlers.Add(handler);
 }
コード例 #11
0
 public BuyAndHoldStrategy(IEventBus eventBus, IDataHandler dataHandler)
 {
     this.eventBus = eventBus;
     this.bars = dataHandler;
     this.bought = this.CalculateInitialBought();
 }
コード例 #12
0
ファイル: Socket.cs プロジェクト: poderosaproject/poderosa
 /// <summary>
 /// Set callback handler.
 /// </summary>
 /// <param name="handler">handler</param>
 public void SetHandler(IDataHandler handler)
 {
     _handler = handler ?? new NullDataHandler();
 }
コード例 #13
0
ファイル: Socket.cs プロジェクト: poderosaproject/poderosa
 /// <summary>
 /// Set a core handler.
 /// </summary>
 /// <param name="innerHandler">a core handler</param>
 public void SetInnerHandler(IDataHandler innerHandler)
 {
     _innerHandler = innerHandler;
 }
コード例 #14
0
ファイル: Socket.cs プロジェクト: PavelTorgashov/nfx
 public void SetHandler(IDataHandler h) {
     _handler = h;
 }
コード例 #15
0
ファイル: Socket.cs プロジェクト: PavelTorgashov/nfx
 internal ChannelSocket(IDataHandler h)
     : base(h) {
 }
コード例 #16
0
 public SimulatedExecutionHandler(IEventBus eventBus, IDataHandler bars)
 {
     this.eventBus = eventBus;
     this.bars = bars;
 }
コード例 #17
0
ファイル: DataDigester.cs プロジェクト: yao-yi/BoboBrowse.Net
 public abstract void Digest(IDataHandler handler);
コード例 #18
0
ファイル: Socket.cs プロジェクト: PavelTorgashov/nfx
        internal PlainSocket(Socket s, IDataHandler h) : base(h) 
        {
            _socket = s;
            Debug.Assert(_socket.Connected);
            _socketStatus = SocketStatus.Ready;

            _data = new DataFragment(0x1000);
            _callback = new AsyncCallback(RepeatCallback);
        }
コード例 #19
0
ファイル: Source.cs プロジェクト: johnynek/brunet
 /**
 <summary>Subscribes the out going data from this source to the specified
 handler.</summary>
 <param name="hand">Data that the subscriber wants passed to the handler on
 each call.</param>
 <param name="state">Data that the subscriber wants passed to the handler on
 each call.</param>
 */
 public virtual void Subscribe(IDataHandler hand, object state) {
   lock(_sync) {
     _sub = new Subscriber(hand, state);
   }
 }
コード例 #20
0
ファイル: Socket.cs プロジェクト: PavelTorgashov/nfx
 protected AbstractGranadosSocket(IDataHandler h) {
     _handler = h;
     _single = new byte[1];
     _socketStatus = SocketStatus.Unknown;
 }
コード例 #21
0
ファイル: Source.cs プロジェクト: johnynek/brunet
 /**
 <summary>Unsubscribes the the IDataHandler if it is the current
 IDatahandler.</summary>
 <param name="hand">An IDataHandler that wishes to remove itself as a
 destination for data coming from this source.</param>
 */
 public virtual void Unsubscribe(IDataHandler hand) {
   lock(_sync) {
     if( _sub.Handler == hand ) {
       _sub = null;
     }
     else {
       throw new Exception(String.Format("Handler: {0}, not subscribed", hand));
     }
   }
 }
コード例 #22
0
ファイル: Socket.cs プロジェクト: poderosaproject/poderosa
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="innerHandler">a core handler</param>
 public FilterDataHandler(IDataHandler innerHandler)
 {
     _innerHandler = innerHandler;
 }
コード例 #23
0
ファイル: Source.cs プロジェクト: johnynek/brunet
 /**
 <summary>Subscribes the out going data from this source to the specified
 handler.</summary>
 <param name="hand">Data that the subscriber wants passed to the handler on
 each call.</param>
 <param name="state">Data that the subscriber wants passed to the handler on
 each call.</param>
 */
 public void Subscribe(IDataHandler h, object state) {
   Subscriber s = new Subscriber(h, state);
 //We have to lock so there is no race between the read and the write
   lock( _sync ) {
     _subs = Brunet.Collections.Functional.Add(_subs, s);
   }
 }
コード例 #24
0
ファイル: Socket.cs プロジェクト: poderosaproject/poderosa
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="socket">socket object (must be already connected)</param>
 /// <param name="handler">callback handler (can be null if no handler is specified)</param>
 public PlainSocket(Socket socket, IDataHandler handler)
 {
     _handler = handler ?? new NullDataHandler();
     _socket = socket;
     Debug.Assert(_socket.Connected);
     _socketStatus = SocketStatus.Ready;
     _data = new DataFragment(0x1000);
 }
コード例 #25
0
ファイル: Source.cs プロジェクト: johnynek/brunet
 /**
 <summary>Unsubscribes the the IDataHandler if it is the current
 IDatahandler.</summary>
 <param name="hand">An IDataHandler that wishes to remove itself as a
 destination for data coming from this source.</param>
 */
 public void Unsubscribe(IDataHandler h) {
   Subscriber s = new Subscriber(h, null);
 //We have to lock so there is no race between the read and the write
   lock( _sync ) {
     int idx = _subs.IndexOf(s);
     _subs = Brunet.Collections.Functional.RemoveAt(_subs, idx);
   }
 }
コード例 #26
0
ファイル: PathEdgeListener.cs プロジェクト: hseom/brunet
 public PathEdge(IDataHandler path_handler, Edge e, string local_path, string remote_path)
    : base(null, e.IsInbound) {
   _pem = path_handler;
   _e = e;
   LocalPath = local_path;
   RemotePath = remote_path;
   //Make sure if the edge closes we also close
   _e.CloseEvent += this.HandleUnderClose;
 }
コード例 #27
0
ファイル: Source.cs プロジェクト: johnynek/brunet
 /**
 <summary>Subscribes the out going data from this source to the specified
 handler.</summary>
 <param name="dh">Data that the subscriber wants passed to the handler on
 each call.</param>
 <param name="state">Data that the subscriber wants passed to the handler on
 each call.</param>
 */
 public Subscriber(IDataHandler dh, object state) {
   Handler = dh;
   State = state;
 }
コード例 #28
0
ファイル: SSH1Packet.cs プロジェクト: FNKGino/poderosa
 public SSH1PacketBuilder(IDataHandler handler)
     : base(handler)
 {
     _buffer = new byte[0x1000];
     _readOffset = 0;
     _writeOffset = 0;
     _cipher = null;
     _checkMAC = false;
 }
コード例 #29
0
ファイル: MockSender.cs プロジェクト: pstjuste/brunet
 public MockSender(ISender ReturnPath, object State, IDataHandler Receiver,
     int RemoveNPTypes) : this(ReturnPath, State, Receiver, RemoveNPTypes, 0)
 {
 }