Пример #1
0
        /// <summary>
        /// Get the information relating to a single new label. This will be
        /// called after the attribute schema, annotation template and polygon
        /// entity type has been defined. It gets re-called after each label has
        /// been positioned.
        /// </summary>
        /// <returns>True if info supplied. False if command is done.</returns>
        bool GetLabelInfo()
        {
            // Ensure the normal cursor is displayed
            SetNormalCursor();

            // Ask the base class to return the entity type for the labels.
            IEntity ent = base.Entity;

            // Get the polygon ID ...

            // If we are auto-numbering, just get the next ID. Otherwise
            // ask for it, showing the default.

            if (EditingController.Current.IsAutoNumber)
            {
                m_PolygonId.ReserveId(ent, 0);
            }
            else
            {
                GetIdForm dial = new GetIdForm(ent, m_PolygonId);
                if (dial.ShowDialog() != DialogResult.OK)
                {
                    DialFinish(null);
                    return(false);
                }
            }

            // Start by assuming the text is the key.
            string str = m_PolygonId.FormattedKey;

            // Get any attributes.
            if (m_Schema != null)
            {
                if (!GetAttributes(str) || m_LastRow == null)
                {
                    DialFinish(null);
                    return(false);
                }

                // If an annotation template has been specified, use that
                // to get the text from the row
                if (m_Template != null)
                {
                    str = RowTextGeometry.GetText(m_LastRow, m_Template);
                }
            }

            // Tell the base class.
            if (!SetDimensions(str))
            {
                DialFinish(null);
                return(false);
            }

            // Switch on the command cursor (we won't add anything until
            // the user left clicks inside a polygon).
            SetCommandCursor();
            return(true);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RowTextContent"/> class.
 /// </summary>
 /// <param name="copy">The copy.</param>
 internal RowTextContent(RowTextGeometry copy)
     : base(copy)
 {
     m_TableId = copy.Row.Table.Id;
     m_TemplateId = copy.Template.Id;
 }