Exemplo n.º 1
0
        /// <summary>
        /// Constructor  for server manager
        /// </summary>
        /// <param name="connection">The connection to the server this will manage</param>
        public ServerManager(string connection)
        {
            connection = FixProvider(connection);

            ASMan   = new ASCommands(connection);
            RuleMan = new RuleManager();

            //set up rule delegates to server functions
            RuleMan.getData     = new DataDel(ASMan.DiscoverSessions);
            RuleMan.kill        = new ActionDel(CancelSessionForRule);
            RuleMan.alert       = new ActionDel(AddAlertForRule);
            RuleMan.ruleGetData = new QueryToData(ASMan.DataTableFromQuery);

            this.alerts = new List <Alert>();
            this.Name   = DataSourceFromConnString(connection);
        }
Exemplo n.º 2
0
        public ServerManager(string connection, int refresh)
        {
            dataRefreshInterval = refresh;
            connection = FixProvider(connection);

            ASMan = new ASCommands(connection);
            RuleMan = new RuleManager();

            //set up rule delegates to server functions
            RuleMan.getData = new DataDel(ASMan.DiscoverSessions);
            RuleMan.kill = new ActionDel(CancelSessionForRule);
            RuleMan.alert = new ActionDel(AddAlertForRule);
            RuleMan.ruleGetData = new QueryToData(ASMan.DataTableFromQuery);

            this.alerts = new List<Alert>();
            this.Name = DataSourceFromConnString(connection);
        }