Esempio n. 1
0
        /// <summary>
        /// Creates a feature ID from this ID handle. In order for this to work, a
        /// prior call to <c>IdHandle.ReserveId</c> is needed.
        /// </summary>
        /// <param name="feature">The feature that should get the created feature ID (currently
        /// without any defined ID)</param>
        /// <returns>The created feature ID (if any).</returns>
        internal FeatureId CreateId(Feature feature)
        {
            // Confirm that the feature does not already have an ID.
            if (feature.FeatureId != null)
            {
                throw new ApplicationException("IdHandle.CreateId - Feature already has an ID.");
            }

            // Claim the reserved ID and cross reference to the feature
            FeatureId fid = CreateId();

            fid.Add(feature);
            return(fid);
        }