Beispiel #1
0
        private void Fill <TObject>(
            IFiller <TObject> filler,
            PdfDictionary node
            )
        {
            PdfArray kidsObject = (PdfArray)node.Resolve(PdfName.Kids);

            if (kidsObject == null) // Leaf node.
            {
                PdfArray namesObject = (PdfArray)node.Resolve(pairsKey);
                for (
                    int index = 0,
                    length = namesObject.Count;
                    index < length;
                    index += 2
                    )
                {
                    filler.Add(namesObject, index);
                }
            }
            else // Intermediate node.
            {
                foreach (PdfDirectObject kidObject in kidsObject)
                {
                    Fill(filler, (PdfDictionary)kidObject.Resolve());
                }
            }
        }
Beispiel #2
0
        public override int Subtract(IFiller other)
        {
            if (other is NumberFiller o)
            {
                return((int)(value - o.Value));
            }

            return(0);
        }
Beispiel #3
0
        public override int Subtract(IFiller other)
        {
            if (other is DateFiller o)
            {
                return(value.Subtract(o.Value).Days);
            }

            return(0);
        }
        public override int Subtract(IFiller other)
        {
            if (other is AlphaNumericFiller o)
            {
                return(value - o.Value);
            }

            return(0);
        }
Beispiel #5
0
 //fill method
 public DataContext(IFiller filler) //interface //pass value bool (1)
 {
     // if (1) nie można utworzyć typów, bo są nieznane, bo tworzyłyby odniesienia do warstwy wyżej (referencja)
     Books       = new List <tBook>();
     Clients     = new List <tClient>();
     Suppliers   = new List <tSupplier>();
     Events      = new List <tEvent>();
     this.Filler = filler;
     Fill();
 }
Beispiel #6
0
        /// <summary>
        /// Provider Contstrutor
        /// </summary>
        /// <param name="uri">Uri to get Feeds</param>
        /// <param name="filler">filler that fill feed data to other object</param>
        protected Provider(Uri uri, IFiller filler)
        {
            if (filler == null)
            {
                throw new ArgumentNullException("filler");
            }

            // TODO: Complete member initialization
            this.Uri = uri;
            this.Filler = filler;
        }
Beispiel #7
0
        /// <summary>
        /// Provider Contstrutor
        /// </summary>
        /// <param name="uri">Uri to get Feeds</param>
        /// <param name="filler">filler that fill feed data to other object</param>
        protected Provider(Uri uri, IFiller filler)
        {
            if (filler == null)
            {
                throw new ArgumentNullException("filler");
            }

            // TODO: Complete member initialization
            this.Uri    = uri;
            this.Filler = filler;
        }
        public void RSSProvider_ConstructorTest()
        {
            Provider provider = new RSSProvider(new Uri("rss://"), new FillerMock(new ObservableCollection <int>()));

            Assert.IsNotNull(provider);
            Assert.AreEqual <string>(new Uri("rss://").AbsolutePath, provider.Uri.AbsolutePath);

            Parser parser = provider.Parser;

            Assert.IsNotNull(parser);

            IFiller filler = provider.Filler;

            Assert.IsNotNull(filler);
        }
        private static TimeSpan MeasureFill(IFiller filler, byte[] array, byte value)
        {
            // measure
            var elapsed = Measure(() => filler.Fill(array, value));

#if DEBUG
            // validate
            var equalityComparer = EqualityComparer <byte> .Default;
            for (var i = 0; i < array.Length; i++)
            {
                if (!equalityComparer.Equals(array[i], value))
                {
                    throw new Exception("Validation failed.");
                }
            }
#endif

            return(elapsed);
        }
Beispiel #10
0
        private void Fill <TObject>(
            IFiller <TObject> filler,
            PdfReference nodeReference
            )
        {
            PdfDictionary node = (PdfDictionary)nodeReference.DataObject;

            File.ResolvedObject <PdfArray> kidsObject = File.Resolve <PdfArray>(
                node[PdfName.Kids],
                nodeReference
                );
            if (kidsObject == null) // Leaf node.
            {
                File.ResolvedObject <PdfArray> namesObject = File.Resolve <PdfArray>(
                    node[PdfName.Names],
                    nodeReference
                    );
                for (
                    int index = 0,
                    length = namesObject.DataObject.Count;
                    index < length;
                    index += 2
                    )
                {
                    filler.Add(
                        namesObject.DataObject,
                        index,
                        namesObject.Container
                        );
                }
            }
            else // Intermediate node.
            {
                foreach (PdfDirectObject kidObject in kidsObject.DataObject)
                {
                    Fill(filler, (PdfReference)kidObject);
                }
            }
        }
Beispiel #11
0
        private int Analyze(TableCell first, TableCell second, out IFiller filler)
        {
            filler = GetFiller(first);
            if (filler == null)
            {
                return(0);
            }

            var filler2 = GetFiller(second);

            if (filler2 == null)
            {
                return(1);
            }

            if (filler2.Type != filler.Type)
            {
                return(0);
            }

            // filler..filler2 is presumed progression
            return(filler2.Subtract(filler));
        }
 public DataRepository(IFiller filler)
 {
     _filler = filler;
     filler.Fill(_kontekstDanych);
 }
 public TEDBlogProvider(IFiller filler)
     : base(new Uri("http://feeds.feedburner.com/tedblog"), filler)
 {
 }
 /// <summary>
 /// Constrcutor
 /// </summary>
 /// <param name="uri">uri of RSS feed</param>
 /// <param name="filler">filler fills collection</param>
 public AtomFeedProvider(Uri uri, IFiller filler)
     : base(uri, filler)
 {
 }
Beispiel #15
0
        internal static void Register <T>(IFiller entityBuilder) where T : struct, IEntityComponent
        {
            var location = EntityComponentID <T> .ID.Data = GlobalTypeID.NextID <T>();

            TYPE_IDS.AddAt(location, entityBuilder);
        }
Beispiel #16
0
 public abstract int Subtract(IFiller other);
 public BalloonsGameEngine GameFieldFiller(IFiller matrixFiller)
 {
     this.engineContext.GameFieldFiller = matrixFiller;
     return this;
 }
Beispiel #18
0
 public DataRepository(IFiller filler)
 {
     data        = new DataContext();
     this.filler = filler;
     this.filler.Fill(this);
 }
Beispiel #19
0
 public TEDVideoProvider(IFiller filler)
     : base(new Uri("http://feeds.feedburner.com/TEDTalks_video"), filler)
 {
 }
 public MyExecutorService(IFiller filler, ITestDataModelRetriever retriever, IExecutor executor)
 {
     _filler    = filler;
     _retriever = retriever;
     _executor  = executor;
 }
 public Baza(IFiller fillIt)
     : this()
 {
     this.Filler = fillIt;
     UseFiller();
 }
 public TEDBlogProvider(IFiller filler)
     : base(new Uri("http://feeds.feedburner.com/tedblog"), filler)
 {
 }
Beispiel #23
0
 /// <summary>
 /// Constrcutor
 /// </summary>
 /// <param name="uri">uri of RSS feed</param>
 /// <param name="filler">filler fills collection</param>
 public RSSProvider(Uri uri, IFiller filler)
     : base(uri, filler)
 {
 }
 public ControlWindow(IFiller filler)
 {
     InitializeComponent();
     this.filler = filler;
 }
Beispiel #25
0
 public void SetFiller(IFiller filler)
 {
     this.Filler = filler;
 }
Beispiel #26
0
 public override int Subtract(IFiller other)
 {
     return(0);
 }
 public Baza(IFiller fillIt, ISerializer serial)
     : this(fillIt)
 {
     Serializer = serial;
 }
Beispiel #28
0
 /// <summary>
 /// Constrcutor
 /// </summary>
 /// <param name="uri">uri of RSS feed</param>
 /// <param name="filler">filler fills collection</param>
 public AtomFeedProvider(Uri uri, IFiller filler)
     : base(uri, filler)
 {
 }
 public PopupHandler(IFiller filler)
 {
     this.filler = filler;
 }
 public UserProfileManager()
 {
     _matrixManager = new MatrixManager();
 }
Beispiel #31
0
 public DataRepository(IFiller filler)
 {
     filler.FillData(DataContext);
 }