Esempio n. 1
0
        /// <summary>
        /// Возвращает строку описания, соответствующую заданному значению перечисления.
        /// </summary>
        /// <param name="stationType">Предоставленное значение перечисления.</param>
        /// <returns>Соответствующий строка описания.</returns>
        public static string GetString(VeloType veloType)
        {
            switch (veloType)
            {
            case VeloType.Type1:
                return(STR_Type1);

            case VeloType.Type2:
                return(STR_Type2);

            case VeloType.Type3:
                return(STR_Type3);

            case VeloType.Type4:
                return(STR_Type4);

            case VeloType.Type5:
                return(STR_Type5);

            case VeloType.Type6:
                return(STR_Type6);

            case VeloType.Type7:
                return(STR_Type7);

            case VeloType.Type8:
                return(STR_Type8);

            case VeloType.None:
            default:
                return(STR_None);
            }
        }
Esempio n. 2
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 101;
         hash += hash * 31 + VeloSection.GetHashCode();
         hash += hash * 31 + VeloType.GetHashCode();
         hash += hash * 31 + VeloView.GetHashCode();
         hash += hash * 31 + VeloObjectStatus.GetHashCode();
         hash += hash * 31 + VeloLength.GetHashCode();
         hash += hash * 31 + VeloWidth.GetHashCode();
         hash += hash * 31 + DataSet.GetHashCode();
         hash += hash * 31 + DataCheck.GetHashCode();
         hash += hash * 31 + Angle.GetHashCode();
         hash += hash * 31 + (FeatureObject != null ? FeatureObject.GetHashCode() : string.Empty.GetHashCode());
         return(hash);
     }
 }
        //protected void DrawVeloObject(Graphics g, IFeature feature)
        //{
        //    var VeloObject = GetVeloObjectByFeature(feature);
        //    if (VeloObject == null) return;

        //    var ls = feature.Geometry;
        //    if (ls == null) return;

        //    if (!IsVisible(VeloObject))
        //        return;

        //    if (ls.GeometryType == "Point")
        //    {
        //        var img = GetImage(VeloObject.VeloView, VeloObject.VeloType);

        //        double ratio = 0.5;     // множитель размера отрисовываемого изображения
        //        int imgWidth = (int)Math.Round(img.Width * ratio);
        //        int imgHeight = (int)Math.Round(img.Height * ratio);

        //        if (imgWidth < 1) imgWidth = 1;
        //        if (imgHeight < 1) imgHeight = 1;

        //        IPicture pic = new Picture(ls.Coordinate.X - imgWidth / 2, ls.Coordinate.Y - imgHeight / 2,
        //            imgWidth, imgHeight, img);
        //        PointF[] destPoints = { pic.P1, pic.P2, pic.P3 };
        //        g.DrawImage(pic.Image, destPoints);
        //    }
        //    else if (ls.GeometryType == "LineString")
        //    {
        //        Paint(VeloObject.FeatureObject.Geometry, g, new LineStyle(Color.Purple, 2f, DashStyle.Dash));
        //    }
        //    else if (ls.GeometryType == "Polygon")
        //    {
        //        Paint(VeloObject.FeatureObject.Geometry, g, new AreaStyle(new InteriorStyle(Color.BlueViolet), new LineStyle(Color.Purple, 1f)));
        //    }
        //}

        protected Image GetImage(VeloView VeloView, VeloType VeloType)
        {
            switch (VeloView)
            {
            case (VeloView.View1):
                switch (VeloType)
                {
                case (VeloType.Type1):
                    return(Resources.k1);

                case (VeloType.Type2):
                    return(Resources.k2);

                case (VeloType.Type3):
                    return(Resources.k3);

                case (VeloType.Type4):
                    return(Resources.k4);

                case (VeloType.Type5):
                    return(Resources.k5);

                case (VeloType.Type6):
                    return(Resources.k6);

                case (VeloType.Type7):
                    return(Resources.k7);

                case (VeloType.Type8):
                    return(Resources.k8);

                default:
                    return(Resources.knone);
                }

            case (VeloView.View2):

                switch (VeloType)
                {
                case (VeloType.Type1):
                    return(Resources.d1);

                case (VeloType.Type2):
                    return(Resources.d2);

                case (VeloType.Type3):
                    return(Resources.d3);

                case (VeloType.Type4):
                    return(Resources.d4);

                case (VeloType.Type5):
                    return(Resources.d5);

                case (VeloType.Type6):
                    return(Resources.d6);

                case (VeloType.Type7):
                    return(Resources.d7);

                case (VeloType.Type8):
                    return(Resources.d8);

                default:
                    return(Resources.dnone);
                }

            case (VeloView.None):

                switch (VeloType)
                {
                case (VeloType.Type1):
                    return(Resources.n1);

                case (VeloType.Type2):
                    return(Resources.n2);

                case (VeloType.Type3):
                    return(Resources.n3);

                case (VeloType.Type4):
                    return(Resources.n4);

                case (VeloType.Type5):
                    return(Resources.n5);

                case (VeloType.Type6):
                    return(Resources.n6);

                case (VeloType.Type7):
                    return(Resources.n7);

                case (VeloType.Type8):
                    return(Resources.n8);

                default:
                    return(Resources.none1);
                }

            default:
                return(Resources.none1);
            }
        }