Example #1
0
        /// <summary>
        /// Initialises the stat ticker.
        /// </summary>
        /// <param name="statListener">The stat listener.</param>
        public void InitialiseStatTicker()
        {
            try
            {
                Pointel.Statistics.Core.Utility.OutputValues Output = new Pointel.Statistics.Core.Utility.OutputValues();

                if (((_configContainer.AllKeys.Contains("statistics.enable-mystat-aid") &&
                      ((string)_configContainer.GetValue("statistics.enable-mystat-aid")).ToLower().Equals("true")) ||
                     (_configContainer.AllKeys.Contains("statistics.enable-ccstat-aid") &&
                      ((string)_configContainer.GetValue("statistics.enable-ccstat-aid")).ToLower().Equals("true"))))
                {
                    _logger.Debug("Window_Loaded : StatTicker Plugin Subscription Started");
                    statTickerListener = this;
                    statSubscribe.Subscribe("AID", statTickerListener);
                    _logger.Debug("Window_Loaded : StatTicker Plugin Subscriptn Completed");

                    List <CfgAgentGroup> agentGroup = new List <CfgAgentGroup>();
                    if (_configContainer.AllKeys.Contains("CfgAgentGroup"))
                    {
                        agentGroup = _configContainer.GetValue("CfgAgentGroup");
                    }
                    Output = statSubscribe.ConfigConnectionEstablish(_dataContext.ApplicationName, _configContainer.ConfServiceObject, _dataContext.UserName, _dataContext.UserName, "StatServer", agentGroup);

                    if (Output.MessageCode == "200")
                    {
                        statSubscribe.StartStatistics(_dataContext.UserName, _dataContext.ApplicationName, 0, 0, true, false);
                    }
                }
            }
            catch (Exception commonException)
            {
                _logger.Error("InitialiseStatTicker : " + commonException.Message.ToString());
            }
        }
 /// <summary>
 /// Subscribes the specified listener.
 /// </summary>
 /// <param name="listener">The listener.</param>
 public void Subscribe(IStatTicker listener)
 {
     ToClient.Add(listener);
 }
 /// <summary>
 /// Receives the message to client object.
 /// </summary>
 /// <param name="Listener">The listener.</param>
 public void ReceiveMessageToClientObject(IStatTicker Listener)
 {
     messageToClient = Listener;
 }