Exemplo n.º 1
0
        /// <summary>
        /// Creates a new point, based on the information stored in the
        /// dialog. It is assumed that validation has already been done (see OnOK).
        /// </summary>
        /// <returns></returns>
        internal PointFeature Save()
        {
            // Handle 3D points some other day
            if (Math.Abs(m_Elevation) > Double.Epsilon)
            {
                throw new NotImplementedException("NewPointForm.Save - 3D points not currently supported");
            }

            try
            {
                NewPointOperation op  = new NewPointOperation();
                IEntity           ent = entityTypeComboBox.SelectedEntityType;
                DisplayId         did = (DisplayId)idComboBox.SelectedItem;
                FeatureId         fid = (did == null ? null : did.CreateId());
                op.Execute(m_Position, ent, fid);
                return(op.Point);
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace, ex.Message);
            }

            return(null);
        }