Beispiel #1
0
 internal void Update(DateTime now, string value, PointState pointState, FeedState feedState = Models.FeedState.OK)
 {
     RealDate  = now;
     RealValue = value;
     RealState = (int)pointState;
     FeedState = (int)feedState;
 }
Beispiel #2
0
        public int Delete(FeedState feed)
        {
            List <FeedState> lst = new List <FeedState>();

            lst.Add(feed);

            return(Delete(lst));
        }
Beispiel #3
0
        public int Save(FeedState feed)
        {
            List <FeedState> lstfeed = new List <FeedState>();

            lstfeed.Add(feed);

            return(Save(lstfeed));
        }
Beispiel #4
0
        public async Task <FeedState> GetCurrentStateAsync(Uri uri)
        {
            var contentsCurrentHtml = await _webRepository.GetContents(uri);

            var contentsCurrentText = await _html2TextConverter.Html2TextAsync(contentsCurrentHtml);

            var contentThumbprint = MakeThumbprint(contentsCurrentText);
            var feedState         =
                new FeedState
            {
                ContentTextThumbprint = contentThumbprint,
                ContentText           = contentsCurrentText
            };

            return(feedState);
        }
Beispiel #5
0
        public virtual void Validate(FeedState item)
        {
            string strMsg = string.Empty;

            if (item.ID < 0)
            {
                strMsg += "Feedi Id nao pode ser menor ou igual a zero." + Environment.NewLine;
            }

            if (String.IsNullOrEmpty(item.Name))
            {
                strMsg += "Feed Name nao pode ser nulo." + Environment.NewLine;
            }

            if (strMsg != string.Empty)
            {
                throw new TebaldiMarketDataException(strMsg);
            }
        }
Beispiel #6
0
        public Task SetFeedFlags(string location, FeedState feedState)
        {
            var response = Event<GetResponseInterface>.RaiseFirst();

            if (CancellationRequested) {
                response.OperationCanceled("set-feed");
                return FinishedSynchronously;
            }

            if (Event<CheckForPermission>.RaiseFirst(PermissionPolicy.EditSystemFeeds)) {
                PackageManagerSettings.PerPackageSettings[location, "state"].SetEnumValue(feedState);
            }
            return FinishedSynchronously;
        }
Beispiel #7
0
 public void FeedDetails(string location, DateTime lastScanned, bool session, bool suppressed, bool validated, FeedState state)
 {
     _feeds.Value.Add(new Feed {
         Location     = location,
         LastScanned  = lastScanned,
         IsSession    = session,
         IsSuppressed = suppressed,
         FeedState    = state
     });
 }
Beispiel #8
0
        public FeedState GetFeed(int Id)
        {
            FeedState feed = GetFeeds(Id).Find(f => f.ID == Id);

            return(feed);
        }
Beispiel #9
0
 public Task SetFeed(string feedLocation, FeedState state)
 {
     return(Remote.SetFeedFlags(feedLocation, state));
 }
 public void FeedDetails(string location, DateTime lastScanned, bool session, bool suppressed, bool validated, FeedState state)
 {
     _feeds.Value.Add(new Feed {
         Location = location,
         LastScanned = lastScanned,
         IsSession = session,
         IsSuppressed = suppressed,
         FeedState = state
     });
 }
Beispiel #11
0
 public void RemoveFeedState(FeedState feedState)
 {
     _unitOfWork.FeedState.Remove(feedState);
 }