コード例 #1
0
        /// <summary>
        /// Adds a reference from this ID to a row.
        /// </summary>
        /// <param name="row">The row to point to.</param>
        internal void AddReference(Row row)
        {
            m_Rows = (m_Rows == null ? row : m_Rows.Add(row));

            // Check whether any associated features are instances of TextFeature that
            // have RowTextContent geometry (a placeholder class that is meant to exist
            // only during deserialization from the database). If so, see whether the
            // geometry can now be replaced with the "proper" RowTextGeometry.

            if (m_Features != null)
            {
                foreach (Feature f in m_Features)
                {
                    TextFeature tf = (f as TextFeature);
                    if (tf != null)
                    {
                        RowTextContent content = (tf.TextGeometry as RowTextContent);
                        if (content != null && content.TableId == row.Table.Id)
                        {
                            tf.TextGeometry = new RowTextGeometry(row, content);
                        }
                    }
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RowTextGeometry"/> class, using the supplied
        /// content placeholder and the row of attribute data that has been discovered.
        /// </summary>
        /// <param name="row">The row that contains the information to format</param>
        /// <param name="content">The content placeholder read from the database</param>
        /// <remarks>This constructor is utilized during deserialization from the database, which
        /// occurs when an editing project is opened.</remarks>
        internal RowTextGeometry(Row row, RowTextContent content)
            : base(content)
        {
            if (row == null)
            {
                throw new ArgumentNullException();
            }

            m_Row      = row;
            m_Template = EnvironmentContainer.FindTemplateById(content.TemplateId);

            //if (m_Template == null)
            //    throw new ArgumentException("Text template not found");
        }