Beispiel #1
0
 public Foo(int a, string b, Type c, IBar bar)
 {
     A = a;
     B = b;
     C = c;
     Bar = bar;
 }
        public void Setup()
        {
            _barStub = MockRepository.GenerateStub<IBar>();
            _barMock = MockRepository.GenerateMock<IBar>();

            _barStubTwo = MockRepository.GenerateStub<IBar>();
            _barMockTwo = MockRepository.GenerateMock<IBar>();
        }
Beispiel #3
0
        public PingHub(ILifetimeScope lifetimeScope)
        {
            // Create a lifetime scope for this hub instance.
            _hubLifetimeScope = lifetimeScope.BeginLifetimeScope();

            // Resolve the dependencies from the hub lifetime scope (unfortunately, service locator style).
            _bar = _hubLifetimeScope.Resolve<IBar>();
            _foo = _hubLifetimeScope.Resolve<IFoo>();
        }
        public Baz(IEnumerable<IFoo> foos, IBar bar)
        {
            foreach (var foo in foos)
            {
                foo.DoFoo();
            }

            bar.DoBar();
        }
Beispiel #5
0
 public Tick(IBar bar)
 {
     if (bar.High != bar.Low)
         l.Error("Преобразую в Tick бар, который тиком не является " + bar);
     this.number = bar.Number;
     this.price = bar.Close;
     this.volume = bar.Volume;
     this.dt = bar.DT;
 }
Beispiel #6
0
		public FooBar(IFoo f, IBar b)
		{
			if (f == null)
				throw new ArgumentNullException("f");
			if (b == null)
				throw new ArgumentNullException("b");

			Foo = f;
			Bar = b;
		}
Beispiel #7
0
        public Foo(IBar bar, IBaz baz)
        {
            if (bar == null)
                throw new ArgumentException("bar");

            if (baz == null)
                throw new ArgumentNullException("baz");

            this.Bar = bar;
            this.Baz = baz;
        }
Beispiel #8
0
 /// <summary>
 /// Initialize Quote Bar with Bid(OHLC) and Ask(OHLC) Values:
 /// </summary>
 /// <param name="time">DateTime Timestamp of the bar</param>
 /// <param name="symbol">Market MarketType Symbol</param>
 /// <param name="bid">Bid OLHC bar</param>
 /// <param name="avgBidSize">Average bid size over period</param>
 /// <param name="ask">Ask OLHC bar</param>
 /// <param name="avgAskSize">Average ask size over period</param>
 /// <param name="period">The period of this bar, specify null for default of 1 minute</param>
 public QuoteBar(DateTime time, Symbol symbol, IBar bid, long avgBidSize, IBar ask, long avgAskSize, TimeSpan? period = null)
 {
     Symbol = symbol;
     Time = time;
     Bid = bid == null ? new Bar() : new Bar(bid.Open, bid.High, bid.Low, bid.Close);
     Ask = ask == null ? new Bar() : new Bar(ask.Open, ask.High, ask.Low, ask.Close);
     AvgBidSize = avgBidSize;
     AvgAskSize = avgAskSize;
     Value = Close;
     Period = period ?? TimeSpan.FromMinutes(1);
     DataType = MarketDataType.QuoteBar;
 }
        public void Add(IBar barToAdd)
        {
            // Remove old bar before adding new one
            if (_hasBar)
            {
                RemoveBar();
                Debug.WriteLine("AddBarClicked: Removing old theme");
            }

            _hasBar = true;
            _currentBar = barToAdd;

            BarCreated(barToAdd);
            AlignmentOptionsChanged(_currentBar.PositionOptions);
        }
        public void AddExternalBar(IBar ibb, IPositionOptions po)
        {
            _currentBar = ibb;
            _hasBar = true;
            _currentBar.PositionOptions = po;

            /*
             * Událost ExternalBarAdded kromě aktivace Add tlačítka
             * iteruje přes všechny ovládací prvky Ribbonu a povolí je.
             * Problém nastává u StrippedBaru, který mí Right a Left zakázané.
             *
             * Nejdříve tedy aktivujeme všechny prvky na liště a teprve poté případně
             * zakážeme některá tlačítka pro zarovnání.
             */

            ExternalBarAdded();
            AlignmentOptionsChanged(GetCurrentBar().PositionOptions);
        }
        public void AddTick(IBar tick)
        {
            if (l.IsDebugEnabled)
                l.Debug("AddTick Добавляю тик " + tick);

            if (Double.IsNaN(Open))
            {
                Open = tick.Open;
                High = tick.High;
                Low = tick.Low;
                Close = tick.Close;
            }
            else
            {
                this.Close = tick.Close;
                if (this.High < tick.High)
                    this.High = tick.High;
                if (this.Low > tick.Low)
                    this.Low = tick.Low;
            }
            this.Volume += tick.Volume;
        }
Beispiel #12
0
 public Foo(IBar bar)
 {
     Bar = bar;
 }
Beispiel #13
0
 public Baz(IBar bar)
 {
     Bar = bar;
 }
Beispiel #14
0
 public FooDependingOnBar(IBar bar)
 {
     Bar = bar;
 }
Beispiel #15
0
 public FooDependingOnMultipleBars(IBar bar1, IBar bar2)
 {
     Bar1 = bar1;
     Bar2 = bar2;
 }
Beispiel #16
0
 public Foo1(IBar bar)
 {
     this.Bar = bar;
 }
 public AThingModelBinder(IBar bar)
 {
     _bar = bar;
 }
Beispiel #18
0
        public void AddBarToWorkspace(IBar bar, int workspaceId = 0, bool top = true, int position = 0)
        {
            var workspace = workspaceId == 0 ? CurrentWorkspace : config.Workspaces[workspaceId - 1];
            var bars = top ? workspace.barsAtTop[bar.Monitor.monitorIndex] : workspace.barsAtBottom[bar.Monitor.monitorIndex];
            if (!bars.Contains(bar))
            {
                if (workspace.IsWorkspaceVisible)
                {
                    workspace.Monitor.ShowHideAppBars(workspace, null);
                }

                // add bar to its place
                var barPosition = bars.First;
                while (barPosition != null && position-- > 0)
                {
                    barPosition = barPosition.Next;
                }
                if (barPosition != null)
                {
                    bars.AddBefore(barPosition, bar);
                }
                else
                {
                    bars.AddLast(bar);
                }

                // remove and then add the workspace so the AppBars can be recreated
                workspace.Monitor.RemoveWorkspace(workspace);
                workspace.Monitor.AddWorkspace(workspace);

                if (workspace.IsWorkspaceVisible)
                {
                    workspace.Monitor.ShowHideAppBars(null, workspace);
                }
            }
        }
 public MenuUIContext(IBar bar, string identifier, string caption, Image image)
     : base(bar, () => bar.Items.AddMenu(identifier, caption, image))
 {
 }
 public void AmbiguousMethod(IBar bar)
 {
     AmbiguousWasCalled = true;
 }
 public MenuUIContext(IBar bar)
     : base(bar, () => bar.Items.AddSeparator())
 {
 }
 public DefaultFoo(IBar bar)
 {
     _bar = bar;
 }
 public AlternateFoo(IBar bar)
 {
     _bar = bar;
 }
Beispiel #24
0
 public Foo(IBar bar, IBaz baz)
 {
 }
 public static bool Impl(IBar bar, IContext context)
 {
     bar.Called = true;
     return false;
 }
Beispiel #26
0
 public FooBar(IFoo f, IBar b)
 {
     Foo = f;
     Bar = b;
 }
Beispiel #27
0
        public void RemoveBarFromWorkspace(IBar bar, int workspaceId = 0)
        {
            var workspace = workspaceId == 0 ? CurrentWorkspace : config.Workspaces[workspaceId - 1];
            if (workspace.barsAtTop[bar.Monitor.monitorIndex].Contains(bar) || workspace.barsAtBottom[bar.Monitor.monitorIndex].Contains(bar))
            {
                if (workspace.IsWorkspaceVisible)
                {
                    workspace.Monitor.ShowHideAppBars(workspace, null);
                }

                if (!workspace.barsAtTop[bar.Monitor.monitorIndex].Remove(bar))
                {
                    workspace.barsAtBottom[bar.Monitor.monitorIndex].Remove(bar);
                }

                // remove and then add the workspace so the AppBars can be recreated
                workspace.Monitor.RemoveWorkspace(workspace);
                workspace.Monitor.AddWorkspace(workspace);

                if (workspace.IsWorkspaceVisible)
                {
                    workspace.Monitor.ShowHideAppBars(null, workspace);
                }
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="Baz"/> class.
 /// </summary>
 /// <param name="bar">The injected bar object.</param>
 public Baz(IBar bar)
 {
     this.Bar = bar;
 }
Beispiel #29
0
 public void MethodWithTwoScopedArguments(IFoo foo, IBar bar)
 {
     Assert.NotNull(foo);
 }
 public Foo(string constantString, IBar bar, IBar bar2)
 {
 }