예제 #1
0
파일: MediaRule.cs 프로젝트: ru-ace/spark
        public void Evaluate()
        {
            ReflowDocument document = ParentSheet.document;

            // Test the query now:
            bool testQuery = Query.IsTrue(document);

            if (testQuery == PreviousStatus)
            {
                // Unchanged.
                return;
            }

            PreviousStatus = testQuery;

            if (testQuery)
            {
                // This query is now active.
                Activate(document);
            }
            else
            {
                // This query is now no longer active.
                Deactivate(document);
            }
        }
예제 #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);
                }
            }
        }
예제 #3
0
 public override bool IsTrue(ReflowDocument document)
 {
     return(!Input1.IsTrue(document));
 }
예제 #4
0
 public override bool IsTrue(ReflowDocument document)
 {
     // Must both be true:
     return(Input1.IsTrue(document) && Input2.IsTrue(document));
 }