コード例 #1
0
        public void TestTask2_4()
        {
            Figure4    figure    = new Figure4(4, 6);
            Square4    square    = new Square4(3, 4);
            Rectangle4 rectangle = new Rectangle4(5, 7);

            Assert.AreEqual(figure.Draw(), figure.GetType().Name);
            Assert.AreEqual(square.Draw(), square.GetType().Name);
            Assert.AreEqual(rectangle.Draw(), rectangle.GetType().Name);
        }
コード例 #2
0
        private void btn5_MouseEnter(object sender, MouseEventArgs e)
        {
            StackPanel1.Visibility = Visibility.Hidden;
            StackPanel2.Visibility = Visibility.Hidden;
            StackPanel3.Visibility = Visibility.Hidden;
            StackPanel4.Visibility = Visibility.Visible;
            czy_otwarta_pierwsza   = false;
            czy_otwarta_druga      = false;
            czy_otwarta_trzecia    = false;
            czy_otwarta_czwarta    = true;

            Rectangle4.BeginAnimation(WidthProperty, BorderAnimation1);
        }
コード例 #3
0
 private void btn4_MouseEnter(object sender, MouseEventArgs e)
 {
     if (StackPanel4.Visibility == Visibility.Hidden)
     {
         StackPanel4.BeginAnimation(HeightProperty, DropDownAnimation);
         StackPanel4.BeginAnimation(OpacityProperty, DropDownOpacityAnimation);
         StackPanel4.Effect.BeginAnimation(OpacityProperty, DropDownOpacityAnimation);
     }
     StackPanel1.Visibility = Visibility.Hidden;
     StackPanel2.Visibility = Visibility.Hidden;
     StackPanel3.Visibility = Visibility.Hidden;
     StackPanel4.Visibility = Visibility.Visible;
     Rectangle4.BeginAnimation(WidthProperty, BorderAnimation1);
 }
コード例 #4
0
        public void Task_17()
        {
            Console.Write("Imput side1: ");
            double side1 = double.Parse(Console.ReadLine());

            Console.Write("Imput side2: ");
            double     side2 = double.Parse(Console.ReadLine());
            Rectangle4 rect  = new Rectangle4(side1, side2);

            Console.WriteLine($"Area is: {rect.Area}\nPerimetr is{rect.Perimetr}");

            Console.ForegroundColor = ConsoleColor.Green;
            Console.Write("\n\n\t\t\t\t\t       Press any Key to continue..");
            Console.ReadKey();
            Console.ResetColor();
        }
コード例 #5
0
        public override bool DrawPlot(Layer layer, ChartProperty property, bool onlyUpdateLastBar)
        {
            AxisX      cAxisX     = layer.AxisX;
            Rectangle  cRectY     = this.AxisY.AxisRectangle;
            Rectangle4 cLayerRect = new Rectangle4(layer.LayerRectangleWithoutAxisY);

            __cGDI.SaveDC();
            __cGDI.ClipRectangle(layer.LayerRectangleWithoutAxisY);

            int    iOldMode  = __cGDI.SelectTransparent();
            IntPtr iOldFont  = __cGDI.SelectFont(__cSymbolFont);
            IntPtr iOldPen   = __cGDI.SelectPen(new PowerLanguage.PenStyle(property.TradeLineColor, 1, (int)__uPattern));
            IntPtr iNameFont = __cLegendFont.ToHfont();

            if (onlyUpdateLastBar)
            {
                if (__cPrevTrade != null)
                {
                    DrawTradeInfo(__cPrevTrade, cAxisX, property, iNameFont, cLayerRect, cRectY.Top);
                }
            }
            else
            {
                this.RefreshAxisY(property);

                int iStartIndex          = cAxisX.BarNumber;
                int iEndIndex            = iStartIndex + cAxisX.BarCount - 1;
                HashSet <ITrade> cTrades = __cTrades.GetTradeObjects(iStartIndex, iEndIndex);
                foreach (ITrade cTrade in cTrades)
                {
                    DrawTradeInfo(cTrade, cAxisX, property, iNameFont, cLayerRect, cRectY.Top);
                    __cPrevTrade = cTrade;
                }
            }

            __cGDI.RemoveObject(iNameFont);
            __cGDI.RemoveObject(__cGDI.SelectPen(iOldPen));
            __cGDI.RemoveObject(__cGDI.SelectFont(iOldFont));

            if (layer.Drawable)
            {
                this.DrawLegend(layer.LegendIndex, property);
            }
            __cGDI.ClearTransparent(iOldMode);
            __cGDI.RestoreDC();
            return(true);
        }
コード例 #6
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            var compositor = Window.Current.Compositor;

            var rotationAnimation = compositor.CreateScalarKeyFrameAnimation();
            var linear            = compositor.CreateLinearEasingFunction();

            rotationAnimation.InsertKeyFrame(1.0f, 360, linear);
            rotationAnimation.Duration          = TimeSpan.FromSeconds(9);
            rotationAnimation.Target            = nameof(Rectangle1.Rotation);
            rotationAnimation.IterationBehavior = AnimationIterationBehavior.Forever;

            Rectangle1.StartAnimation(rotationAnimation);
            Rectangle3.StartAnimation(rotationAnimation);

            rotationAnimation.Duration = TimeSpan.FromSeconds(8);

            Rectangle2.StartAnimation(rotationAnimation);
            Rectangle4.StartAnimation(rotationAnimation);
        }
コード例 #7
0
        private void DrawTradeInfo(ITrade trade, AxisX axisX, ChartProperty property, IntPtr font, Rectangle4 layerRect, int top)
        {
            ITradeOrder cEntry  = trade.EntryOrder;
            Point       cPoint1 = new Point(axisX.ConvertBarNumberToWidth(cEntry.BarNumber).CenterPoint, top + this.AxisY.ConvertValueToHeight(cEntry.Price));

            __cGDI.DrawString("▸", property.TradeSymbolColor, cPoint1.X - 7, cPoint1.Y - 7);
            DrawTradeName(cEntry.Name, font, property.ForeColor, cPoint1, true);

            ITradeOrder cExit = trade.ExitOrder;

            if (cExit != null)
            {
                Point cPoint2 = new Point(axisX.ConvertBarNumberToWidth(cExit.BarNumber).CenterPoint, top + this.AxisY.ConvertValueToHeight(cExit.Price));
                __cGDI.DrawString("◂", property.TradeSymbolColor, cPoint2.X + 1, cPoint2.Y - 7);
                DrawTradeName(cExit.Name, font, property.ForeColor, cPoint2, false);

                if (Boundary.BoundFix(ref cPoint1, ref cPoint2, layerRect))
                {
                    __cGDI.DrawLine(cPoint1.X, cPoint1.Y, cPoint2.X, cPoint2.Y);
                }
            }
        }
コード例 #8
0
 private void btn5_MouseLeave(object sender, MouseEventArgs e)
 {
     Rectangle4.BeginAnimation(WidthProperty, BorderAnimation2);
 }