/// <summary>
        /// Copies an embedded UIElement into a ContentContainer.
        /// Returns the next node to examine.
        /// </summary>
        private TextTreeNode CopyObjectNode(TextTreeObjectNode objectNode, out ContentContainer container)
        {
            string xml = XamlWriter.Save(objectNode.EmbeddedElement);

            container = new ObjectContentContainer(xml, objectNode.EmbeddedElement);

            return((TextTreeNode)objectNode.GetNextNode());
        }
 private TextTreeNode CopyObjectNode(TextTreeObjectNode objectNode, out TextTreeDeleteContentUndoUnit.ContentContainer container)
 {
     if (SecurityHelper.CheckUnmanagedCodePermission())
     {
         string xml = XamlWriter.Save(objectNode.EmbeddedElement);
         container = new TextTreeDeleteContentUndoUnit.ObjectContentContainer(xml, objectNode.EmbeddedElement);
     }
     else
     {
         container = new TextTreeDeleteContentUndoUnit.ObjectContentContainer(null, null);
     }
     return((TextTreeNode)objectNode.GetNextNode());
 }
        /// <summary>
        /// Copies an embedded UIElement into a ContentContainer.
        /// Returns the next node to examine.
        /// </summary>
        private TextTreeNode CopyObjectNode(TextTreeObjectNode objectNode, out ContentContainer container)
        {
            // XamlWriter.Save demands unmanaged code permission. Since it's not safe to assert
            // here as custom type converters and value serializers can potentially execute
            // arbitrary code, we block the call to XamlWriter.Save in partial trust.
            if (SecurityHelper.CheckUnmanagedCodePermission())
            {
                string xml;

                xml = XamlWriter.Save(objectNode.EmbeddedElement);

                container = new ObjectContentContainer(xml, objectNode.EmbeddedElement);
            }
            else
            {
                container = new ObjectContentContainer(null, null);
            }

            return((TextTreeNode)objectNode.GetNextNode());
        }
        private TextTreeNode CopyObjectNode(TextTreeObjectNode objectNode, out ContentContainer container)
        {
            // XamlWriter.Save demands unmanaged code permission. Since it's not safe to assert 
            // here as custom type converters and value serializers can potentially execute 
            // arbitrary code, we block the call to XamlWriter.Save in partial trust.
            if (SecurityHelper.CheckUnmanagedCodePermission())
            {
                string xml;

                xml = XamlWriter.Save(objectNode.EmbeddedElement);

                container = new ObjectContentContainer(xml, objectNode.EmbeddedElement);
            }
            else
            {
                container = new ObjectContentContainer(null, null);
            }

            return (TextTreeNode)objectNode.GetNextNode();
        }