override public void Subscribe(Subscription Sub)
    {
        base.Subscribe(Sub);
        TopicMap NewMap;

        //Search through all mappings
        foreach (TopicMap tm in TopicMapping)
        {
            if (Sub.MatchesTopic(tm.Topic))
            {
                tm.Subscribers.Add(Sub);

                //Send last data recived
                if (tm.LastDataPoint != null)
                {
                    Sub.TimeDataUpdate(tm.LastDataPoint);
                }

                return;
            }
        }

        NewMap       = new TopicMap();
        NewMap.Topic = Sub.Topic;
        NewMap.Subscribers.Add(Sub);
        NewMap.Subscribed = SubscribeTopic(Sub.Topic);
        TopicMapping.Add(NewMap);
    }
Exemple #2
0
        public TopicMap BuildFromRow(DataRow row)
        {
            var returnRecord = TopicMap.BuildTopicMapFromRow(row);

            returnRecord = this.BuildExtraFromRow <TopicMap>(returnRecord, row);
            return(returnRecord);
        }
Exemple #3
0
        public TopicMap Insert(TopicMap record)
        {
            DataRow row = this.dataSet.ttbltopicMap.NewttbltopicMapRow();

            this.UpdateToRow(ref row, record);
            this.ExtraUpdateToRow(ref row, record);
            this.dataSet.ttbltopicMap.AddttbltopicMapRow((pdstopicMapDataSet.ttbltopicMapRow)row);
            this.SaveChanges();
            return(this.dataSet.ttbltopicMap.Rows.Count > 0 ? this.BuildFromRow(this.dataSet.ttbltopicMap.Rows[0]) : null);
        }
Exemple #4
0
        public TopicMap GetByRowId(string rowId, string fldList)
        {
            var      row      = this.GetRowByRowId(rowId, fldList);
            TopicMap topicMap = null;

            if (row != null)
            {
                topicMap = this.BuildFromRow(row);
            }
            return(topicMap);
        }
Exemple #5
0
        protected TopicMap Fetch(string where, int batchsize, string fldList)
        {
            this.FetchWhere(where, batchsize, fldList);
            var      row      = this.dataSet.ttbltopicMap.AsEnumerable().SingleOrDefault();
            TopicMap topicMap = null;

            if (row != null)
            {
                topicMap = this.BuildFromRow(row);
            }
            return(topicMap);
        }
Exemple #6
0
        protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
        {
            var category = new CategoryMap();
            var author   = new AuthorMap();
            var topic    = new TopicMap();

            _cryptographyConfiguration = new CryptographyConfiguration(
                new AesEncryptionProvider(new PassphraseKeyGenerator("SuperSecretPass", new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 })),
                new DefaultHmacProvider(new PassphraseKeyGenerator("UberSuperSecure", new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 })));

            base.ApplicationStartup(container, pipelines);
        }
Exemple #7
0
        public void Delete(TopicMap record)
        {
            var row = this.GetRowByRowId(record.rowID, string.Empty);

            if (row == null)
            {
                row = this.dataSet.ttbltopicMap.NewttbltopicMapRow();
                TopicMap.BuildMinimalRow(ref row, record);
                this.dataSet.ttbltopicMap.AddttbltopicMapRow((pdstopicMapDataSet.ttbltopicMapRow)row);
            }
            row.Delete();
            this.SaveChanges();
        }
Exemple #8
0
 protected override void OnModelCreating(ModelBuilder builder)
 {
     UserMap.Configure(builder);
     PersonMap.Configure(builder);
     PersonCheckListItemMap.Configure(builder);
     PersonCheckListMap.Configure(builder);
     QuizMap.Configure(builder);
     QuestionMap.Configure(builder);
     AnswerMap.Configure(builder);
     TopicCategoryMap.Configure(builder);
     TopicMap.Configure(builder);
     SupportingScriptureMap.Configure(builder);
     PersonAnswerMap.Configure(builder);
 }
Exemple #9
0
        public TopicMap Update(TopicMap record)
        {
            var row = this.GetRowByRowId(record.rowID, string.Empty);

            if (row != null)
            {
                this.UpdateToRow(ref row, record);
                this.ExtraUpdateToRow(ref row, record);
                this.SaveChanges();
                return(this.dataSet.ttbltopicMap.Rows.Count > 0 ? this.BuildFromRow(this.dataSet.ttbltopicMap.Rows[0]) : null);
            }
            ErrorReportingHelper.ReportErrors("global.update.doesnotexist", 421);
            return(null);
        }
Exemple #10
0
 public void Delete(TopicMap record)
 {
     this.repository.Delete(record);
 }
Exemple #11
0
 public TopicMap Update(TopicMap record)
 {
     return(this.repository.Update(record));
 }
Exemple #12
0
 public TopicMap Insert(TopicMap record)
 {
     return(this.repository.Insert(record));
 }
Exemple #13
0
 public void Delete(TopicMap record)
 {
     this.adapter.Delete(record);
 }
Exemple #14
0
 public TopicMap Update(TopicMap record)
 {
     return(this.adapter.Update(record));
 }
Exemple #15
0
 public TopicMap Insert(TopicMap record)
 {
     return(this.adapter.Insert(record));
 }
Exemple #16
0
 public void UpdateToRow(ref DataRow row, TopicMap record)
 {
     TopicMap.UpdateRowFromTopicMap(ref row, record);
     this.ExtraUpdateToRow(ref row, record);
 }