コード例 #1
0
 private void FollowUp(object sender, EventArgs e)
 {
     Bar1.Progress = 1;
     Bar2.ProgressTo(1, 5000, Easing.Linear);
     Bar3.ProgressTo(1, 5000, Easing.CubicIn);
     Bar4.ProgressTo(1, 5000, Easing.SinIn);
 }
コード例 #2
0
 public static void test()
 {
     Foo  foo  = ProviderFactory.Get <Foo>().Create <Foo>();
     Foo2 foo2 = ProviderFactory.Get <Foo>().Create <Foo2>();
     // Bar2 bar2 = ProviderFactory.Get<Foo>().Create<Bar2>(); - compile error
     Bar2 bar2 = ProviderFactory.Get <Bar>().Create <Bar2>();   // - ok!
     Bar3 bar3 = ProviderFactory.Get <IWhatever>().Create <Bar3>();
 }
コード例 #3
0
 private void Modificar(object sender, EventArgs args)
 {
     Bar1.Progress = 1;
     Bar2.ProgressTo(1, 10000, Easing.Linear);
     Bar3.ProgressTo(1, 10000, Easing.SpringIn);
     Bar4.ProgressTo(1, 10000, Easing.SinIn);
     Bar5.ProgressTo(1, 10000, Easing.BounceOut);
     Bar6.ProgressTo(1, 10000, Easing.BounceIn);
     Bar7.ProgressTo(1, 10000, Easing.CubicIn);
 }
コード例 #4
0
 public void ModifyProgress(object sender, EventArgs args)
 {
     Bar1.Progress = 1;
     Bar2.ProgressTo(1, 5000, Easing.Linear); //Alguns tipos de animação na classe Easing
     Bar3.ProgressTo(1, 5000, Easing.SpringIn);
     Bar4.ProgressTo(1, 5000, Easing.SpringOut);
     Bar5.ProgressTo(1, 5000, Easing.BounceIn);
     Bar6.ProgressTo(1, 5000, Easing.BounceOut);
     Bar7.ProgressTo(1, 5000, Easing.CubicIn);
     Bar8.ProgressTo(1, 5000, Easing.CubicOut);
     Bar9.ProgressTo(1, 5000, Easing.SinIn);
     Bar10.ProgressTo(1, 5000, Easing.SinOut);
 }
コード例 #5
0
 private void Modificar(object sender, EventArgs args)
 {
     Bar1.ProgressTo(1, 15000, Easing.BounceIn);
     Bar2.ProgressTo(1, 15000, Easing.BounceOut);
     Bar3.ProgressTo(1, 15000, Easing.CubicIn);
     Bar4.ProgressTo(1, 15000, Easing.CubicInOut);
     Bar5.ProgressTo(1, 15000, Easing.CubicOut);
     Bar6.ProgressTo(1, 15000, Easing.SinIn);
     Bar7.ProgressTo(1, 15000, Easing.SinInOut);
     Bar8.ProgressTo(1, 15000, Easing.SinOut);
     Bar9.ProgressTo(1, 15000, Easing.SpringIn);
     Bar10.ProgressTo(1, 15000, Easing.SpringOut);
 }
コード例 #6
0
    public static int Main()
    {
        bool ok = true;
        int  result;

        Foo3 x3 = new Foo3();
        Foo2 x2 = new Foo3();
        Foo1 x1 = new Foo3();
        IFoo x  = new Foo3();

        Bar3 <int> y3 = new Bar3 <int>();
        Bar2 <int> y2 = new Bar3 <int>();
        Bar1 <int> y1 = new Bar3 <int>();
        IBar <int> y  = new Bar3 <int>();

        if ((result = x3.A()) != 2)
        {
            Console.WriteLine("NOT OK: calling Foo3.A() did not return 2! it returned " + result); ok = false;
        }
        if ((result = x2.A()) != 2)
        {
            Console.WriteLine("NOT OK: calling Foo2.A() did not return 2! it returned " + result); ok = false;
        }
        if ((result = x1.A()) != 1)
        {
            Console.WriteLine("NOT OK: calling Foo1.A() did not return 1! it returned " + result); ok = false;
        }
        if ((result = x.A()) != 2)
        {
            Console.WriteLine("NOT OK: calling IFoo.A() did not return 2! it returned " + result); ok = false;
        }

        if ((result = y3.A <string>()) != 2)
        {
            Console.WriteLine("NOT OK: calling Bar3.A() did not return 2! it returned " + result); ok = false;
        }
        if ((result = y2.A <string>()) != 2)
        {
            Console.WriteLine("NOT OK: calling Bar2.A() did not return 2! it returned " + result); ok = false;
        }
        if ((result = y1.A <string>()) != 1)
        {
            Console.WriteLine("NOT OK: calling Bar1.A() did not return 1! it returned " + result); ok = false;
        }
        if ((result = y.A <string>()) != 2)
        {
            Console.WriteLine("NOT OK: calling IBar.A() did not return 2! it returned " + result); ok = false;
        }

        return((ok) ? (100) : (-1));
    }
コード例 #7
0
            public void Method()
            {
                var b1 = new Bar1();
                var b2 = new Bar2();
                var b3 = new Bar3();
                var b4 = new Bar4();
                var b5 = new Bar5();
                var b6 = new Bar6();

                b1.Method();
                b2.Method();
                b3.Method();
                b4.Method();
                b5.Method();
                b6.Method();
            }
コード例 #8
0
 private void Modificar(object sender, EventArgs args)
 {
     Bar1.Progress = 1;
     Bar2.ProgressTo(1, 5000, Easing.Linear);
     Bar3.ProgressTo(1, 5000, Easing.SpringIn);
 }
 public void ModificarBarras(object sender, EventArgs e)
 {
     Bar1.ProgressTo(1, 3000, Easing.CubicIn);
     Bar2.ProgressTo(1, 5000, Easing.BounceIn);
     Bar3.ProgressTo(1, 5000, Easing.SpringOut);
 }
コード例 #10
0
 private void Button_Clicked(object sender, EventArgs e)
 {
     Bar1.Progress = 1;
     Bar2.ProgressTo(1, 5000, Easing.Linear);
     Bar3.ProgressTo(1, 5000, Easing.BounceIn);
 }
コード例 #11
0
        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            // Try to connect, if we are not yet connected.
            // We do this here so that we do not connect everytime the indicator is instanciated.
            // Indicators are often instanciated several times before they are actually used.
            if (_indicatorState == IndicatorState.Uninitialized)
            {
                OpenConnection();
            }

            // Are we in an error state?  If so, display and exit.
            if (_indicatorState == IndicatorState.Error)
            {
                DrawError();
                return;
            }

            // If we are actually connected to a socket, then communicate with it.
            if (_sock != null)
            {
                StringBuilder line = new StringBuilder();

                long when = Time[0].Second +
                            Time[0].Minute * 100l +
                            Time[0].Hour * 10000l +
                            Time[0].Day * 1000000l +
                            Time[0].Month * 100000000l +
                            Time[0].Year * 10000000000l;

                line.Append("\"" + PACKET_BAR + "\",");
                line.Append(when);
                line.Append(",\"");
                line.Append(this.Instrument.FullName);
                line.Append("\"");

                foreach (string name in _sourceData)
                {
                    IDataSeries source;
                    int         totalBars = 1;
                    string      name2     = name;

                    ParseArraySize(name, ref totalBars, ref name2);

                    if (string.Compare(name2, "HIGH", true) == 0)
                    {
                        source = High;
                    }
                    else if (string.Compare(name2, "LOW", true) == 0)
                    {
                        source = Low;
                    }
                    else if (string.Compare(name2, "OPEN", true) == 0)
                    {
                        source = Open;
                    }
                    else if (string.Compare(name2, "CLOSE", true) == 0)
                    {
                        source = Close;
                    }
                    else if (string.Compare(name2, "VOL", true) == 0)
                    {
                        source = Volume;
                    }
                    else if (string.Compare(name2, "THIS", true) == 0)
                    {
                        source = Values[0];
                    }
                    else
                    {
                        source = Eval(name2);
                        if (source == null)
                        {
                            return;
                        }
                    }

                    // now copy needed data
                    var cnt = CurrentBar + 1;

                    for (int i = 0; i < totalBars; i++)
                    {
                        line.Append(",");

                        if (i >= cnt)
                        {
                            line.Append("?");
                        }
                        else
                        {
                            //line.Append(Convert.ToString(source[i]));
                            line.Append(Convert.ToString(source[i], _cultureUSA));
                        }
                    }
                }

                Send(line.ToString());

                // if we are expecting data back from the socket, then wait for it.
                if (_blockingMode)
                {
                    // we are now waiting for a bar
                    _indicatorState = IndicatorState.SentBar;
                    while (_indicatorState != IndicatorState.Error && _indicatorState != IndicatorState.Ready)
                    {
                        WaitForPacket();
                    }

                    // we got a bar message, then display it
                    if (_indicatorState == IndicatorState.Ready)
                    {
                        if (!double.IsNaN(_indicatorData[0]))
                        {
                            Plot1.Set(_indicatorData[0]);
                        }

                        if (!double.IsNaN(_indicatorData[1]))
                        {
                            Plot2.Set(_indicatorData[1]);
                        }

                        if (!double.IsNaN(_indicatorData[2]))
                        {
                            Plot3.Set(_indicatorData[2]);
                        }

                        if (!double.IsNaN(_indicatorData[3]))
                        {
                            Bar1.Set(_indicatorData[3]);
                        }

                        if (!double.IsNaN(_indicatorData[4]))
                        {
                            Bar2.Set(_indicatorData[4]);
                        }

                        if (!double.IsNaN(_indicatorData[5]))
                        {
                            Bar3.Set(_indicatorData[5]);
                        }

                        if (!double.IsNaN(_indicatorData[6]))
                        {
                            IndSell.Set(_indicatorData[6]);
                        }

                        if (!double.IsNaN(_indicatorData[7]))
                        {
                            IndBuy.Set(_indicatorData[7]);
                        }
                    }
                }
                else
                {
                    var hold = this.DrawOnPricePanel;
                    DrawOnPricePanel = false;
                    DrawTextFixed("general msg", "This indicator only sends data, so there is no display.", TextPosition.Center);
                    DrawOnPricePanel = hold;
                }
            }
        }
コード例 #12
0
 public Foo3(Bar3 bar)
 {
     this.LocalBar = bar ?? throw new ArgumentNullException();
 }
コード例 #13
0
 public void Visit(Bar3 foo)
 {
     Console.WriteLine("Bar3 ID:" + foo.Id);
 }