Пример #1
0
        /// <summary>Checks if the stylesheet for the namespace the
        /// given namespace is in is included in the document.</summary>
        public void RequireStyleSheet(Element e)
        {
            if (e.Namespace == Namespace)
            {
                // Same namespace as the document - already included.
                return;
            }

            if (EmbeddedNamespaces == null)
            {
                EmbeddedNamespaces = new Dictionary <MLNamespace, StyleSheet>();
            }

            // Try and obtain it:
            if (EmbeddedNamespaces.ContainsKey(e.Namespace))
            {
                return;
            }

            // Get the sheet:
            StyleSheet sheet = e.Namespace.DefaultStyleSheet;

            // Add it in:
            EmbeddedNamespaces[e.Namespace] = sheet;
            sheet.ReAddSheet(this);
        }
Пример #2
0
        public void AddToDocument(ReflowDocument document)
        {
            if (Query == null || Query.IsTrue(document))
            {
                if (ImportedSheet == null)
                {
                    DownloadNow();

                    // Add it:
                    ParentSheet.document.AddStyle(ImportedSheet, null);
                }
                else
                {
                    ImportedSheet.ReAddSheet(document);
                }
            }
        }