/// <summary>
        /// The set media link attributes.
        /// </summary>
        /// <param name="packet">The packet.</param>
        /// <returns>The set media link attributes.</returns>
        private bool SetMediaLinkAttributes(Packet packet)
        {
            Assert.ArgumentNotNull(packet, "packet");
            Item selectionItem = MediaLinkTreeview.GetSelectionItem();

            if (selectionItem == null)
            {
                Context.ClientPage.ClientResponse.Alert("Select a media item.");
                return(false);
            }
            string linkTargetAttributeFromValue = UltraLinkForm.GetLinkTargetAttributeFromValue(Target.Value, CustomTarget.Value);

            UltraLinkForm.SetAttribute(packet, "target", linkTargetAttributeFromValue);
            UltraLinkForm.SetAttribute(packet, "id", selectionItem.ID.ToString());
            return(true);
        }
        /// <summary>
        /// The set external link attributes.
        /// </summary>
        /// <param name="packet">The packet.</param>
        /// <returns>The set external link attributes.</returns>
        private bool SetExternalLinkAttributes(Packet packet)
        {
            Assert.ArgumentNotNull(packet, "packet");
            string text = Url.Value;

            if (text.Length > 0 && text.IndexOf("://", StringComparison.InvariantCulture) < 0 && !text.StartsWith("/", StringComparison.InvariantCulture))
            {
                text = "http://" + text;
            }
            string linkTargetAttributeFromValue = UltraLinkForm.GetLinkTargetAttributeFromValue(Target.Value, CustomTarget.Value);

            UltraLinkForm.SetAttribute(packet, "url", text);
            UltraLinkForm.SetAttribute(packet, "anchor", string.Empty);
            UltraLinkForm.SetAttribute(packet, "target", linkTargetAttributeFromValue);
            return(true);
        }
        /// <summary>
        /// The set internal link attributes.
        /// </summary>
        /// <param name="packet">The packet.</param>
        /// <returns>The set internal link attributes.</returns>
        private bool SetInternalLinkAttributes(Packet packet)
        {
            Assert.ArgumentNotNull(packet, "packet");
            Item selectionItem = InternalLinkTreeview.GetSelectionItem();

            if (selectionItem == null)
            {
                Context.ClientPage.ClientResponse.Alert("Select an item.");
                return(false);
            }
            string linkTargetAttributeFromValue = UltraLinkForm.GetLinkTargetAttributeFromValue(Target.Value, CustomTarget.Value);
            string text = Querystring.Value;

            if (text.StartsWith("?", StringComparison.InvariantCulture))
            {
                text = text.Substring(1);
            }
            UltraLinkForm.SetAttribute(packet, "anchor", LinkAnchor);
            UltraLinkForm.SetAttribute(packet, "querystring", text);
            UltraLinkForm.SetAttribute(packet, "target", linkTargetAttributeFromValue);
            UltraLinkForm.SetAttribute(packet, "id", selectionItem.ID.ToString());
            return(true);
        }