コード例 #1
0
        public void Transformers_Overlayer_Familes()
        {
            Overlayer overlayer = new Overlayer(true, false, false);
            Document  docA      = new Document("1", null, null, new Dictionary <string, string>()
            {
                { "VOLUME", "test" }
            }, null);
            Document docB = new Document("1", null, null, new Dictionary <string, string>()
            {
                { "VOLUME", "overlay" }
            }, null);
            Document child = new Document("2", null, null, null, null);

            child.SetParent(docB);
            docB.Children.Add(child);

            Assert.IsFalse(child.Parent == docA);
            Assert.IsTrue(docA.Children == null);
            Assert.IsTrue(docB.Children.Contains(child));
            docA = overlayer.Overlay(docA, docB);

            Assert.IsTrue(docA.Children.Contains(child));
            Assert.IsTrue(child.Parent == docA);
            Assert.AreEqual("overlay", docB.Metadata["VOLUME"]);
            Assert.AreEqual("test", docA.Metadata["VOLUME"]);
        }
コード例 #2
0
        public void Transformers_Overlayer_Exception()
        {
            Overlayer overlayer = new Overlayer(true, true, true);
            Document  docA      = new Document("1", null, null, null, null);
            Document  docB      = new Document("2", null, null, null, null);

            overlayer.Overlay(docA, docB);
        }
コード例 #3
0
        private void ConfigureOverlay()
        {
            Overlay overlay = _serviceProvider.GetService <Overlay>();
            IOptions <ApplicationSettings> settings = _serviceProvider.GetService <IOptions <ApplicationSettings> >();
            var overlayer = new Overlayer(settings.Value.Process, overlay, OverlayPosition.Top | OverlayPosition.Left);

            var timer = new DispatcherTimer {
                Interval = TimeSpan.FromMilliseconds(100)
            };

            timer.Tick += (s, e) => overlayer.Update();

            timer.Start();
        }
コード例 #4
0
        public void Transformers_Overlayer_MetaData()
        {
            Overlayer overlayer = new Overlayer(false, true, false);
            Document  docA      = new Document("1", null, null, new Dictionary <string, string>()
            {
                { "VOLUME", "test" }
            }, null);
            Document docB = new Document("1", null, null, new Dictionary <string, string>()
            {
                { "VOLUME", "overlay" }, { "DOC", "meh" }
            }, null);

            Assert.AreEqual("test", docA.Metadata["VOLUME"]);
            docA = overlayer.Overlay(docA, docB);

            Assert.AreEqual("overlay", docA.Metadata["VOLUME"]);
            Assert.AreEqual("meh", docA.Metadata["DOC"]);
        }
コード例 #5
0
        public void Transformers_Overlayer_Representatives()
        {
            Overlayer overlayer = new Overlayer(false, false, true);
            Document  docA      = new Document("1", null, null, null,
                                               new HashSet <Representative>()
            {
                new Representative(
                    Representative.FileType.Text,
                    new SortedDictionary <string, string>()
                {
                    { "1", "x:\\path\\1.txt" }
                }
                    )
            }
                                               );
            Document docB = new Document("1", null, null, null,
                                         new HashSet <Representative>()
            {
                new Representative(
                    Representative.FileType.Native,
                    new SortedDictionary <string, string>()
                {
                    { "1", "x:\\path\\file.ext" }
                }
                    )
            }
                                         );

            Assert.AreEqual(1, docA.Representatives.Count);
            docA = overlayer.Overlay(docA, docB);
            Assert.AreEqual(2, docA.Representatives.Count);

            foreach (var file in docA.Representatives)
            {
                if (file.Type.Equals(Representative.FileType.Native))
                {
                    Assert.AreEqual("x:\\path\\file.ext", file.Files.First().Value);
                }
                else
                {
                    Assert.AreEqual("x:\\path\\1.txt", file.Files.First().Value);
                }
            }
        }
コード例 #6
0
        /// <summary>
        /// Adds a series of documents to the collection.
        /// </summary>
        /// <param name="documents">The documents to add to the collection.</param>
        public void AddRange(IEnumerable <Document> documents)
        {
            foreach (Document document in documents)
            {
                if (this.documentGlossary.ContainsKey(document.Key))
                {
                    Overlayer overlayer = new Overlayer(true, true, true);
                    Document  original  = this.documentGlossary[document.Key];
                    Document  newDoc    = overlayer.Overlay(original, document);
                    int       index     = this.documentList.BinarySearch(original);
                    this.documentList[index]            = newDoc;
                    this.documentGlossary[document.Key] = newDoc;
                }
                else
                {
                    this.documentList.Add(document);
                    this.documentGlossary.Add(document.Key, document);
                }
            }

            propertyReset();
        }
コード例 #7
0
 public OldAnalysis(Overlayer overlayer)
 {
     this.overlayer = overlayer;
 }
コード例 #8
0
ファイル: ControlSave.cs プロジェクト: scsi110/FormDesigner-4
 /// <summary>
 /// 保存
 /// </summary>
 /// <param name="controls"></param>
 public ControlSave(Overlayer overlayer)
 {
     this.overlayer = overlayer;
 }