예제 #1
0
        private void AttachPointForm_Shown(object sender, EventArgs e)
        {
            // Load the entity combo box with a list for point features.
            m_PointType = entityTypeComboBox.Load(SpatialType.Point);

            // The option to make the selected type the default for
            // this command is ALWAYS set by default
            defaultCheckBox.Checked = true;

            // If there is a default entity for this command (on the
            // current editing layer), select that instead & disable
            // the corresponding checkbox
            int entId = ReadDefaultPointEntityTypeId();

            if (entId > 0)
            {
                IEntity ent = EnvironmentContainer.FindEntityById(entId);
                if (ent != null)
                {
                    entityTypeComboBox.SelectEntity(ent);
                    defaultCheckBox.Enabled = false;
                    m_PointType             = ent;
                }
            }

            // Check auto-repeat option (default is to repeat)
            int repeat = GlobalUserSetting.ReadInt(REPEAT_KEY, 1);

            m_Repeat = (repeat != 0);
            repeatCheckBox.Checked = m_Repeat;
        }
예제 #2
0
        private void addToMapButton_Click(object sender, EventArgs e)
        {
            // Return if there is nothing to add.
            ControlPoint[] cps = GetSavePoints();
            if (cps.Length == 0)
            {
                MessageBox.Show("There is nothing to add.");
                return;
            }

            try
            {
                // Hide this dialog. If you don't, the entity type dialog that's about to get
                // displayed may be obscured, and there's no way to close it.
                this.Hide();

                // Do we have an entity type for control points?
                // This was formerly obtained via the environment variable called CED$ControlEntity
                int entId = GlobalUserSetting.ReadInt("ControlEntityTypeId", 0);

                // Get the desired entity type.
                GetEntityForm dial = new GetEntityForm(m_Cmd.ActiveLayer, SpatialType.Point, entId);
                dial.ShowDialog();
                IEntity ent = dial.SelectedEntity;
                if (ent == null)
                {
                    throw new Exception("An entity type must be specified");
                }

                // Remember the ID of the selected entity type
                GlobalUserSetting.WriteInt("ControlEntityTypeId", ent.Id);

                // Save the control.
                Save(cps, ent);

                // Issue a warning message if points are not currently displayed
                if (!m_Cmd.ArePointsDrawn())
                {
                    MessageBox.Show("Points will not be drawn at the current scale.");
                }

                m_Cmd.DialFinish(this);
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                this.Show();
            }
        }
예제 #3
0
        void ShowSymbologyPage(CadastralMapModel cmm)
        {
            int symScale = GlobalUserSetting.ReadInt("SymbologyScale", 5000);

            symScaleTextBox.Text = String.Format("{0:F0}", symScale);
        }
예제 #4
0
        int ReadDefaultPointEntityTypeId()
        {
            string key = GetDefaultPointEntityTypeIdKey();

            return(GlobalUserSetting.ReadInt(key, 0));
        }