/// <summary>
        /// finds our position element, if we don't have one
        /// creates a new one depending on the fCreate parameter
        /// </summary>
        /// <param name="create">creates the subelements on true</param>
        /// <returns>GeoKmlPosition</returns>
        protected GeoKmlPosition GetPosition(bool create)
        {
            GeoKmlPoint point = FindExtension(GeoNametable.GeoKmlPointElement,
                                              GeoNametable.NSGeoKml) as GeoKmlPoint;

            GeoKmlPosition position = null;

            if (point == null && create == true)
            {
                point = new GeoKmlPoint();
                this.ExtensionElements.Add(point);
            }
            if (point != null)
            {
                position = point.FindExtension(GeoNametable.GeoKmlPositionElement,
                                               GeoNametable.NSGeoKml) as GeoKmlPosition;


                if (position == null && create == true)
                {
                    position = new GeoKmlPosition("0 0");
                    point.ExtensionElements.Add(position);
                }
            }
            return(position);
        }
예제 #2
0
        /// <summary>
        /// finds our position element, if we don't have one
        /// creates a new one depending on the fCreate parameter
        /// </summary>
        /// <param name="create">creates the subelements on true</param> 
        /// <returns>GeoKmlPosition</returns>
        protected GeoKmlPosition GetPosition(bool create) 
        {
            GeoKmlPoint point = FindExtension(GeoNametable.GeoKmlPointElement, 
                                              GeoNametable.NSGeoKml) as GeoKmlPoint;

            GeoKmlPosition position = null;

            if (point == null && create)
            {
                point = new GeoKmlPoint();
                this.ExtensionElements.Add(point);
            }
            if (point != null)
            {
                position = point.FindExtension(GeoNametable.GeoKmlPositionElement,
                                               GeoNametable.NSGeoKml) as GeoKmlPosition;


                if (position == null && create)
                {
                    position = new GeoKmlPosition("0 0");
                    point.ExtensionElements.Add(position);
                }
            }
            return position;
        }