public void MoveTo(XYZ point, AlignType alignType)
        {
            if (!Parent.Pinned)
            {
                XYZ displacementVector = new XYZ();

                switch (alignType)
                {
                case AlignType.Left:
                    displacementVector = point - UpLeft;
                    break;

                case AlignType.Right:
                    displacementVector = point - UpRight;
                    break;

                case AlignType.Up:
                    displacementVector = point - UpRight;
                    break;

                case AlignType.Down:
                    displacementVector = point - DownRight;
                    break;

                case AlignType.Center:
                    displacementVector = point - Center;
                    break;

                case AlignType.Middle:
                    displacementVector = point - Center;
                    break;

                case AlignType.Vertically:
                    displacementVector = point - Center;
                    break;

                case AlignType.Horizontally:
                    displacementVector = point - Center;
                    break;

                case AlignType.UntangleVertically:
                    displacementVector = point - UpLeft;
                    break;

                case AlignType.UntangleHorizontally:
                    displacementVector = point - UpLeft;
                    break;

                default:
                    break;
                }

                if (!displacementVector.IsAlmostEqualTo(new XYZ(0, 0, 0)))
                {
                    Transform tr = Transform.CreateTranslation(_ownerView.CropBox.Transform.OfVector(displacementVector));

                    if (Parent.GetType() == typeof(IndependentTag))
                    {
                        IndependentTag tag    = Parent as IndependentTag;
                        CustomLeader   leader = new CustomLeader();
                        if (tag.HasLeader && tag.LeaderEndCondition == LeaderEndCondition.Free)
                        {
                            leader = new CustomLeader(tag.LeaderEnd, new XYZ(0, 0, 0));
                        }

                        tag.TagHeadPosition = tr.OfPoint(tag.TagHeadPosition);

                        if (tag.HasLeader && tag.LeaderEndCondition == LeaderEndCondition.Free)
                        {
                            tag.LeaderEnd = leader.End;
                        }
                    }
                    else if (Parent.GetType() == typeof(TextNote))
                    {
                        List <CustomLeader> leaders = new List <CustomLeader>();
                        TextNote            note    = Parent as TextNote;
                        if (note.LeaderCount != 0)
                        {
                            foreach (Leader leader in note.GetLeaders())
                            {
                                leaders.Add(new CustomLeader(leader));
                            }
                        }

                        note.Coord = tr.OfPoint(note.Coord);

                        if (leaders.Count != 0)
                        {
                            int i = 0;
                            foreach (Leader leader in note.GetLeaders())
                            {
                                leader.End   = leaders[i].End;
                                leader.Elbow = leaders[i].Elbow;
                                i++;
                            }
                        }
                    }
                    else if (Parent.GetType().IsSubclassOf(typeof(SpatialElementTag)))
                    {
                        SpatialElementTag tag = Parent as SpatialElementTag;

                        CustomLeader leader = new CustomLeader();
                        if (tag.HasLeader)
                        {
                            leader = new CustomLeader(tag.LeaderEnd, new XYZ(0, 0, 0));
                        }

                        Parent.Location.Move(_ownerView.CropBox.Transform.OfVector(displacementVector));

                        if (tag.HasLeader)
                        {
                            tag.LeaderEnd = leader.End;
                        }
                    }
                    else
                    {
                        Parent.Location.Move(_ownerView.CropBox.Transform.OfVector(displacementVector));
                    }
                }
            }
        }
        public void MoveTo(XYZ point, AlignType alignType)
        {
            XYZ xyz = new XYZ();

            switch (alignType)
            {
            case AlignType.Left:
                xyz = XYZ.op_Subtraction(point, this.UpLeft);
                break;

            case AlignType.Right:
                xyz = XYZ.op_Subtraction(point, this.UpRight);
                break;

            case AlignType.Up:
                xyz = XYZ.op_Subtraction(point, this.UpRight);
                break;

            case AlignType.Down:
                xyz = XYZ.op_Subtraction(point, this.DownRight);
                break;

            case AlignType.Center:
                xyz = XYZ.op_Subtraction(point, this.Center);
                break;

            case AlignType.Middle:
                xyz = XYZ.op_Subtraction(point, this.Center);
                break;

            case AlignType.Vertically:
                xyz = XYZ.op_Subtraction(point, this.Center);
                break;

            case AlignType.Horizontally:
                xyz = XYZ.op_Subtraction(point, this.Center);
                break;

            case AlignType.UntangleVertically:
                xyz = XYZ.op_Subtraction(point, this.UpLeft);
                break;

            case AlignType.UntangleHorizontally:
                xyz = XYZ.op_Subtraction(point, this.UpLeft);
                break;
            }
            Transform translation = Transform.CreateTranslation(this._ownerView.get_CropBox().get_Transform().OfVector(xyz));

            if (((object)this.Parent).GetType() == typeof(IndependentTag))
            {
                IndependentTag parent       = this.Parent as IndependentTag;
                CustomLeader   customLeader = new CustomLeader();
                if (parent.get_HasLeader() && parent.get_LeaderEndCondition() == 1)
                {
                    customLeader = new CustomLeader(parent.get_LeaderEnd(), new XYZ(0.0, 0.0, 0.0));
                }
                parent.set_TagHeadPosition(translation.OfPoint(parent.get_TagHeadPosition()));
                if (!parent.get_HasLeader() || parent.get_LeaderEndCondition() != 1)
                {
                    return;
                }
                parent.set_LeaderEnd(customLeader.End);
            }
            else if (((object)this.Parent).GetType() == typeof(TextNote))
            {
                List <CustomLeader> customLeaderList = new List <CustomLeader>();
                TextNote            parent           = this.Parent as TextNote;
                if ((uint)parent.get_LeaderCount() > 0U)
                {
                    using (IEnumerator <Leader> enumerator = ((IEnumerable <Leader>)parent.GetLeaders()).GetEnumerator())
                    {
                        while (((IEnumerator)enumerator).MoveNext())
                        {
                            Leader current = enumerator.Current;
                            customLeaderList.Add(new CustomLeader(current));
                        }
                    }
                }
                ((TextElement)parent).set_Coord(translation.OfPoint(((TextElement)parent).get_Coord()));
                if ((uint)customLeaderList.Count <= 0U)
                {
                    return;
                }
                int index = 0;
                using (IEnumerator <Leader> enumerator = ((IEnumerable <Leader>)parent.GetLeaders()).GetEnumerator())
                {
                    while (((IEnumerator)enumerator).MoveNext())
                    {
                        Leader current = enumerator.Current;
                        current.set_End(customLeaderList[index].End);
                        current.set_Elbow(customLeaderList[index].Elbow);
                        ++index;
                    }
                }
            }
            else if (((object)this.Parent).GetType().IsSubclassOf(typeof(SpatialElementTag)))
            {
                SpatialElementTag parent       = this.Parent as SpatialElementTag;
                CustomLeader      customLeader = new CustomLeader();
                if (parent.get_HasLeader())
                {
                    customLeader = new CustomLeader(parent.get_LeaderEnd(), new XYZ(0.0, 0.0, 0.0));
                }
                parent.set_TagHeadPosition(translation.OfPoint(parent.get_TagHeadPosition()));
                if (!parent.get_HasLeader())
                {
                    return;
                }
                parent.set_LeaderEnd(customLeader.End);
            }
            else
            {
                this.Parent.get_Location().Move(this._ownerView.get_CropBox().get_Transform().OfVector(xyz));
            }
        }