/// <summary>
 /// Initializes a new instance of <c>MLineStyleElementChangeEventArgs</c>.
 /// </summary>
 /// <param name="item">The item that is being added or removed from the MLineStyle elements list.</param>
 public MLineStyleElementChangeEventArgs(MLineStyleElement item)
 {
     this.item = item;
 }
Ejemplo n.º 2
0
 private void MLineStyleElement_LinetypeChanged(MLineStyleElement sender, TableObjectChangedEventArgs<Linetype> e)
 {
     e.NewValue = this.OnMLineStyleElementLinetypeChangedEvent(e.OldValue, e.NewValue);
 }
Ejemplo n.º 3
0
 protected virtual void OnMLineStyleElementRemovedEvent(MLineStyleElement item)
 {
     MLineStyleElementRemovedEventHandler ae = this.MLineStyleElementRemoved;
     if (ae != null)
         ae(this, new MLineStyleElementChangeEventArgs(item));
 }
Ejemplo n.º 4
0
        private List<MLineStyleElement> ReadMLineStyleElements(short numElements)
        {
            List<MLineStyleElement> elements = new List<MLineStyleElement>();

            this.chunk.Next();

            for (short i = 0; i < numElements; i++)
            {
                double offset = this.chunk.ReadDouble(); // code 49
                this.chunk.Next();

                AciColor color = AciColor.FromCadIndex(this.chunk.ReadShort());
                this.chunk.Next();

                if (this.chunk.Code == 420)
                {
                    color = AciColor.FromTrueColor(this.chunk.ReadInt()); // code 420
                    this.chunk.Next();
                }

                string linetypeName = this.DecodeEncodedNonAsciiCharacters(this.chunk.ReadString()); // code 6
                Linetype linetype = this.GetLinetype(linetypeName);
                this.chunk.Next();

                MLineStyleElement element = new MLineStyleElement(offset)
                {
                    Color = color,
                    Linetype = linetype
                };

                elements.Add(element);
            }

            return elements;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of <c>MLineStyleElementChangeEventArgs</c>.
 /// </summary>
 /// <param name="item">The item that is being added or removed from the MLineStyle elements list.</param>
 public MLineStyleElementChangeEventArgs(MLineStyleElement item)
 {
     this.item = item;
 }
Ejemplo n.º 6
0
        private List<MLineStyleElement> ReadMLineStyleElements(short numElements)
        {
            List<MLineStyleElement> elements = new List<MLineStyleElement>();

            this.chunk.Next();

            for (short i = 0; i < numElements; i++)
            {
                double offset = this.chunk.ReadDouble(); // code 49
                this.chunk.Next();

                AciColor color = AciColor.FromCadIndex(this.chunk.ReadShort());
                this.chunk.Next();

                if (this.chunk.Code == 420)
                {
                    color = AciColor.FromTrueColor(this.chunk.ReadInt()); // code 420
                    this.chunk.Next();
                }

                // the line type names ByLayer or ByBlock are case insensitive
                string lineTypeName = this.DecodeEncodedNonAsciiCharacters(this.chunk.ReadString()); // code 6
                if (string.Compare(lineTypeName, LineType.ByLayerName, StringComparison.OrdinalIgnoreCase) == 0)
                    lineTypeName = LineType.ByLayerName;
                if (string.Compare(lineTypeName, LineType.ByBlockName, StringComparison.OrdinalIgnoreCase) == 0)
                    lineTypeName = LineType.ByBlockName;
                LineType lineType = this.GetLineType(lineTypeName);
                this.chunk.Next();

                MLineStyleElement element = new MLineStyleElement(offset)
                {
                    Color = color,
                    LineType = lineType
                };

                elements.Add(element);
            }

            return elements;
        }