예제 #1
0
        /// <summary>
        /// Applies changes to this editing operation.
        /// </summary>
        /// <param name="ctx">The editing context (null if the model is being deserialized)</param>
        /// <param name="data">The changes to apply</param>
        void ApplyUpdateItems(EditingContext ctx, UpdateItemCollection data)
        {
            double        x  = data.ExchangeValue <double>(DataField.X, m_NewPoint.Easting.Meters);
            double        y  = data.ExchangeValue <double>(DataField.Y, m_NewPoint.Northing.Meters);
            PointGeometry pg = new PointGeometry(x, y);

            m_NewPoint.ApplyPointGeometry(ctx, pg);
        }
예제 #2
0
        /// <summary>
        /// Applies changes to this editing operation.
        /// </summary>
        /// <param name="ctx">The editing context (null if the model is being deserialized)</param>
        /// <param name="data">The changes to apply</param>
        void ApplyUpdateItems(EditingContext ctx, UpdateItemCollection data)
        {
            // Locate the specific point that was modified
            //string id = data.GetValue<string>(DataField.Id);
            //InternalIdValue iid = new InternalIdValue(id);
            //PointFeature p = this.MapModel.Find<PointFeature>(iid);
            PointFeature  p  = data.GetValue <PointFeature>(DataField.UpdatedPoint);
            double        x  = data.ExchangeValue <double>(DataField.X, p.Easting.Meters);
            double        y  = data.ExchangeValue <double>(DataField.Y, p.Northing.Meters);
            PointGeometry pg = new PointGeometry(x, y);

            p.ApplyPointGeometry(ctx, pg);
        }
        /// <summary>
        /// Exchanges update items that were previously generated via
        /// a call to <see cref="GetUpdateItems"/>.
        /// </summary>
        /// <param name="data">The update data to apply to the edit (modified to
        /// hold the values that were previously defined for the edit)</param>
        public override void ExchangeData(UpdateItemCollection data)
        {
            m_Direction = data.ExchangeObservation <Direction>(this, DataField.Direction, m_Direction);
            m_Distance  = data.ExchangeObservation <Observation>(this, DataField.Distance, m_Distance);
            m_From      = data.ExchangeFeature <PointFeature>(this, DataField.From, m_From);
            m_Default   = data.ExchangeValue <bool>(DataField.Default, m_Default);

            AssignObservedLengths();
        }
예제 #4
0
        /// <summary>
        /// Exchanges update items that were previously generated via
        /// a call to <see cref="GetUpdateItems"/>.
        /// </summary>
        /// <param name="data">The update data to apply to the edit (modified to
        /// hold the values that were previously defined for the edit)</param>
        public override void ExchangeData(UpdateItemCollection data)
        {
            m_IsExtendFromEnd = data.ExchangeValue <bool>(DataField.ExtendFromEnd, m_IsExtendFromEnd);
            m_Length          = data.ExchangeObservation <Distance>(this, DataField.Distance, m_Length);

            if (m_NewLine != null)
            {
                m_NewLine.ObservedLength = m_Length;
            }
        }
예제 #5
0
        /// <summary>
        /// Exchanges update items that were previously generated via
        /// a call to <see cref="GetUpdateItems"/>.
        /// </summary>
        /// <param name="data">The update data to apply to the edit (modified to
        /// hold the values that were previously defined for the edit)</param>
        public override void ExchangeData(UpdateItemCollection data)
        {
            m_Distance1 = data.ExchangeObservation <Observation>(this, DataField.Distance1, m_Distance1);
            m_From1     = data.ExchangeFeature <PointFeature>(this, DataField.From1, m_From1);
            m_Distance2 = data.ExchangeObservation <Observation>(this, DataField.Distance2, m_Distance2);
            m_From2     = data.ExchangeFeature <PointFeature>(this, DataField.From2, m_From2);
            m_Default   = data.ExchangeValue <bool>(DataField.Default, m_Default);

            AssignObservedLengths();
        }
        /// <summary>
        /// Modifies this edit by applying the values in the supplied update items
        /// (as produced via a prior call to <see cref="GetUpdateItems"/>).
        /// </summary>
        /// <param name="data">The update items to apply to this edit.</param>
        /// <returns>The original values for the update items.</returns>
        public override void ExchangeData(UpdateItemCollection data)
        {
            m_Distance  = data.ExchangeObservation <Distance>(this, DataField.Distance, m_Distance);
            m_IsFromEnd = data.ExchangeValue <bool>(DataField.EntryFromEnd, m_IsFromEnd);

            if (m_IsFromEnd)
            {
                m_NewLine2.ObservedLength = m_Distance;
            }
            else
            {
                m_NewLine1.ObservedLength = m_Distance;
            }
        }
예제 #7
0
        /// <summary>
        /// Modifies this edit by applying the values in the supplied update items
        /// (as produced via a prior call to <see cref="GetUpdateItems"/>).
        /// </summary>
        /// <param name="data">The update items to apply to this edit.</param>
        /// <returns>The original values for the update items.</returns>
        public override void ExchangeData(UpdateItemCollection data)
        {
            m_RefLine = data.ExchangeFeature <LineFeature>(this, DataField.RefLine, m_RefLine);
            m_Offset  = data.ExchangeObservation <Observation>(this, DataField.Offset, m_Offset);
            m_Term1   = data.ExchangeFeature <LineFeature>(this, DataField.Term1, m_Term1);
            m_Term2   = data.ExchangeFeature <LineFeature>(this, DataField.Term2, m_Term2);

            // Alter arc direction if necessary.
            bool isArcReversed = data.ExchangeValue <bool>(DataField.ReverseArc, this.IsArcReversed);

            if (isArcReversed)
            {
                m_Flags = 1;
            }
            else
            {
                m_Flags = 0;
            }
        }
예제 #8
0
 /// <summary>
 /// Applies changes to this editing operation.
 /// </summary>
 /// <param name="ctx">The editing context (null if the model is being deserialized)</param>
 /// <param name="data">The changes to apply</param>
 void ApplyUpdateItems(EditingContext ctx, UpdateItemCollection data)
 {
     double x = data.ExchangeValue<double>(DataField.X, m_NewPoint.Easting.Meters);
     double y = data.ExchangeValue<double>(DataField.Y, m_NewPoint.Northing.Meters);
     PointGeometry pg = new PointGeometry(x, y);
     m_NewPoint.ApplyPointGeometry(ctx, pg);
 }
        /// <summary>
        /// Modifies this edit by applying the values in the supplied update items
        /// (as produced via a prior call to <see cref="GetUpdateItems"/>).
        /// </summary>
        /// <param name="data">The update items to apply to this edit.</param>
        /// <returns>The original values for the update items.</returns>
        public override void ExchangeData(UpdateItemCollection data)
        {
            m_Distance = data.ExchangeObservation<Distance>(this, DataField.Distance, m_Distance);
            m_IsFromEnd = data.ExchangeValue<bool>(DataField.EntryFromEnd, m_IsFromEnd);

            if (m_IsFromEnd)
                m_NewLine2.ObservedLength = m_Distance;
            else
                m_NewLine1.ObservedLength = m_Distance;
        }
        /// <summary>
        /// Exchanges update items that were previously generated via
        /// a call to <see cref="GetUpdateItems"/>.
        /// </summary>
        /// <param name="data">The update data to apply to the edit (modified to
        /// hold the values that were previously defined for the edit)</param>
        public override void ExchangeData(UpdateItemCollection data)
        {
            m_IsExtendFromEnd = data.ExchangeValue<bool>(DataField.ExtendFromEnd, m_IsExtendFromEnd);
            m_Length = data.ExchangeObservation<Distance>(this, DataField.Distance, m_Length);

            if (m_NewLine != null)
                m_NewLine.ObservedLength = m_Length;
        }
        /// <summary>
        /// Exchanges update items that were previously generated via
        /// a call to <see cref="GetUpdateItems"/>.
        /// </summary>
        /// <param name="data">The update data to apply to the edit (modified to
        /// hold the values that were previously defined for the edit)</param>
        public override void ExchangeData(UpdateItemCollection data)
        {
            m_Direction = data.ExchangeObservation<Direction>(this, DataField.Direction, m_Direction);
            m_Distance = data.ExchangeObservation<Observation>(this, DataField.Distance, m_Distance);
            m_From = data.ExchangeFeature<PointFeature>(this, DataField.From, m_From);
            m_Default = data.ExchangeValue<bool>(DataField.Default, m_Default);

            AssignObservedLengths();
        }
        /// <summary>
        /// Exchanges update items that were previously generated via
        /// a call to <see cref="GetUpdateItems"/>.
        /// </summary>
        /// <param name="data">The update data to apply to the edit (modified to
        /// hold the values that were previously defined for the edit)</param>
        public override void ExchangeData(UpdateItemCollection data)
        {
            m_Distance1 = data.ExchangeObservation<Observation>(this, DataField.Distance1, m_Distance1);
            m_From1 = data.ExchangeFeature<PointFeature>(this, DataField.From1, m_From1);
            m_Distance2 = data.ExchangeObservation<Observation>(this, DataField.Distance2, m_Distance2);
            m_From2 = data.ExchangeFeature<PointFeature>(this, DataField.From2, m_From2);
            m_Default = data.ExchangeValue<bool>(DataField.Default, m_Default);

            AssignObservedLengths();
        }
예제 #13
0
 /// <summary>
 /// Applies changes to this editing operation.
 /// </summary>
 /// <param name="ctx">The editing context (null if the model is being deserialized)</param>
 /// <param name="data">The changes to apply</param>
 void ApplyUpdateItems(EditingContext ctx, UpdateItemCollection data)
 {
     // Locate the specific point that was modified
     //string id = data.GetValue<string>(DataField.Id);
     //InternalIdValue iid = new InternalIdValue(id);
     //PointFeature p = this.MapModel.Find<PointFeature>(iid);
     PointFeature p = data.GetValue<PointFeature>(DataField.UpdatedPoint);
     double x = data.ExchangeValue<double>(DataField.X, p.Easting.Meters);
     double y = data.ExchangeValue<double>(DataField.Y, p.Northing.Meters);
     PointGeometry pg = new PointGeometry(x, y);
     p.ApplyPointGeometry(ctx, pg);
 }