Example #1
0
            //public List<arc> arcs;
            public VectorPic copy()
            {
                VectorPic cop = new VectorPic();

                cop.polyLines = new List <List <Point> >();
                foreach (var i in polyLines)
                {
                    cop.polyLines.Add(new List <Point>());
                    foreach (var j in i)
                    {
                        cop.polyLines[cop.polyLines.Count - 1].Add(j.copy());
                    }
                }
                //cop.hatching = new List<Point>();
                //foreach (var i in hatching) cop.hatching.Add(i.copy());

                cop.circles = new List <circle>();
                foreach (var i in circles)
                {
                    cop.circles.Add(i.copy());
                }
                //cop.arcs = new List<arc>();
                //foreach (var i in arcs)
                //    cop.arcs.Add(i.copy());
                return(cop);
            }
Example #2
0
        public Equipment(int id, string name, string description, string preview, Dictionary <string, string> properties, List <Compatibility> compatibilities, List <string> PICS, VectorPic inPlacementScheme, VectorPic inBox, VectorPic inConnectionScheme, VectorPic inStructural, byte[] bytedFile, bool isWire)
        {
            this.id          = id;
            this.name        = name;
            this.description = description;
            this.preview     = preview;

            this.properties      = properties;
            this.compatibilities = compatibilities;
            this.PICS            = PICS;

            this.inPlacementScheme  = inPlacementScheme;
            this.inBox              = inBox;
            this.inConnectionScheme = inConnectionScheme;
            this.inStructural       = inStructural;
            this.bytedFile          = bytedFile;
            this.isWire             = isWire;
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader">id(int),name(string),desc(string),prev(BASE64),prop(Dictionary<string, string>),comp(List<compatibility>),pics(List<BASE64>),place(BASE64),box(BASE64),conn(BASE64),struct(BASE64),file(byte[]),wire(bool)</param>
        /// <param name="full"></param>
        public Equipment(SqlDataReader reader, Stage stage)
        {
            try
            {
                id          = Convert.ToInt32(reader[0].ToString());
                name        = reader[1].ToString();
                description = reader[2].ToString();
                preview     = reader[3].ToString();

                properties      = JsonConvert.DeserializeObject <Dictionary <string, string> >(reader[4].ToString());
                compatibilities = JsonConvert.DeserializeObject <List <Compatibility> >(reader[5].ToString());
                PICS            = JsonConvert.DeserializeObject <List <string> >(reader[6].ToString());

                inPlacementScheme  = JsonConvert.DeserializeObject <VectorPic>(reader[7].ToString());
                inBox              = JsonConvert.DeserializeObject <VectorPic>(reader[8].ToString());
                inConnectionScheme = JsonConvert.DeserializeObject <VectorPic>(reader[9].ToString());
                inStructural       = JsonConvert.DeserializeObject <VectorPic>(reader[10].ToString());
                bytedFile          = JsonConvert.DeserializeObject <byte[]>(reader[11].ToString());
                isWire             = Convert.ToBoolean(reader[12].ToString());
            }
            catch (Exception ex)
            {
            }
        }