コード例 #1
0
        public List <StreamRule> getPresetRules()
        {
            List <StreamRule> rules = new List <StreamRule>();

            try
            {
                RuleApi ruleApi             = new RuleApi(session.GetApiClient());
                GetPresetRulesResult result = ruleApi.GetPresetRules("activities");
                if (result.Hdr.Rc == 0)
                {
                    List <RuleRecord> ruleRecords = result.Rules;
                    foreach (RuleRecord ruleRecord in ruleRecords)
                    {
                        StreamRule rule = new StreamRule();
                        rule.RuleRecord = ruleRecord;
                        rule.Key        = ruleRecord.Key;
                        rule.Name       = ruleRecord.Name;
                        rules.Add(rule);
                    }
                    return(rules);
                }
                else
                {
                    throw new Exception("Error getting preset rules");
                }
            }
            catch (ApiException ex)
            {
                throw new Exception("Error getting preset rules", ex);
            }
        }
コード例 #2
0
        public List <StreamItem> GetStream(StreamRule rule, String query)
        {
            List <StreamRule> rules = new List <StreamRule>();

            rules.Add(rule);
            return(GetStream(rules, query));
        }