Exemplo n.º 1
0
 public void AddReads(List <SeqRead> _reads)
 {
     if (Reads == null)
     {
         Reads = new List <SeqRead> ();
     }
     lock (Reads) {
         Reads.AddRange(_reads);
     }
 }
Exemplo n.º 2
0
 public void AddRead(SeqRead _read)
 {
     if (Reads == null)
     {
         Reads = new List <SeqRead> ();
     }
     MainData.LoadedSeqs++;
     lock (Reads) {
         Reads.Add(_read);
     }
 }
Exemplo n.º 3
0
        public DocTitlePageType TitlePage { get; set; } // 

        public bool CalcRating(out long r) {

            r = 0;
            if ((Likes != null) && (Reads != null))
            {
                r = Likes.Count * 100 + Reads.GroupBy(read => read.UserId).Count();
                return true;
            }

            return false;
        }
Exemplo n.º 4
0
 private void Init(RedisClientSection section)
 {
     if (!string.IsNullOrEmpty(section.Cached))
     {
         mCached = new KCached.CacheManager(section.Cached);
     }
     foreach (HostItem item in section.Writes)
     {
         Writes.Add(new RedisHost(item.Host, item.Connections));
     }
     foreach (HostItem item in section.Reads)
     {
         Reads.Add(new RedisHost(item.Host, item.Connections));
     }
     DB = section.DB;
 }
        public void ContentCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            try
            {
                TotalReadings = Reads.Count().ToString();

                duration    = (DateTime.UtcNow - startedDateTime).ToString();
                Duration    = duration;
                UniqueReads = GetUniqueReads();
                LastRead    = e.NewItems.Cast <Read>().FirstOrDefault();//SyncRoot;
                dataGrid.ScrollIntoView(LastRead);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(string.Format("{0}:  {1}\n{2}", nameof(ContentCollectionChanged), ex.Message, ex.StackTrace));
            }
        }
Exemplo n.º 6
0
        public object Read(Reads a_ReadType, DatabaseModel.Maps a_Map, DatabaseModel.Photos a_Photo)
        {
            switch (a_ReadType)
            {
            case Reads.FULLPHOTOPATH:
                return(GetPhotoPath(a_Photo));

            case Reads.ALLPHOTOSFROMMAP:
                return(GetAllPhotosFromMap(a_Map));

            case Reads.ALLPHOTOS:
                return(GetAllPhotos());

            case Reads.DATACONTEXT:
            default:
                return(null);
            }
        }
        private void Init(Reading reading)
        {
            try
            {
                Reads    = reading.Reads;
                LastRead = Reads.LastOrDefault();

                Started  = Consts.UNKNOWN;
                Duration = Consts.UNKNOWN;
                if (reading.StartedDateTime != null)
                {
                    startedDateTime = (DateTime)reading.StartedDateTime;
                    Started         = startedDateTime.ToString("dd.MM.yy HH:mm:ss:fff", CultureInfo.InvariantCulture);
                }

                if (reading.Reads.Count == 0)
                {
                    TimingPoint = Consts.UNKNOWN;
                }

                if (reading.Reads.Count > 0)
                {
                    TimingPoint = reading.TimingPoint;
                }

                TotalReadings = reading.TotalReadings.ToString();
                IP            = reading.Reader.Host;

                if (reading.IsConnected == true)
                {
                    Status = "Connected";
                }
                else if (reading.IsConnected == false)
                {
                    Status = "Disconnected";
                }
                else
                {
                    Status = "Waiting for the BOX...";
                }

                Task.Run(() =>
                {
                    while (true)
                    {
                        if (Started != Consts.UNKNOWN)
                        {
                            var tempDuration = DateTime.UtcNow.AddTicks(-startedDateTime.Ticks);
                            Application.Current.Dispatcher.Invoke((Action)(() =>
                            {
                                if (reading.IsConnected == true)
                                {
                                    Duration = tempDuration.ToString("HH:mm:ss:fff", CultureInfo.InvariantCulture);
                                }
                            }));
                        }

                        Thread.Sleep(100);
                    }
                });

                if (string.IsNullOrEmpty(reading.FileName))
                {
                    RecoveryFile = Consts.UNKNOWN;
                }
                else
                {
                    RecoveryFile = reading.FileName;
                }

                UniqueReads = GetUniqueReads();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(string.Format("{0}:  {1}\n{2}", nameof(this.Init), ex.Message, ex.StackTrace));
            }
        }
 public ReadsAttribute(Reads desc)
 {
 }
 public ReadsAttribute(Reads desc) { }