コード例 #1
0
        /// <summary>
        /// Reload the configuration of RockEngine.
        /// Warning: not thread safe.
        /// </summary>
        public void Reload()
        {
            var configurationString = File.ReadAllText(RockEngineConstants.ConfigurationFilePath);

            this.configuration = RockJsonSerializer.Deserialize <RockConfiguration>(configurationString);
            this.tracer        = new RockTracer(this.configuration);
            this.bot           = new RockEngineBot(this.configuration, this.tracer);
            this.pegasus       = RockPegasusFactory.CreatePegasus(this.tracer);
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RockEngineBot" /> class.
 /// </summary>
 /// <param name="configuration">The RockConfiguration.</param>
 /// <param name="tracer">The RockTracer.</param>
 public RockEngineBot(RockConfiguration configuration, RockTracer tracer)
 {
     this.configuration = configuration;
     this.tracer        = tracer;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RockPegasus" /> class.
 /// </summary>
 /// <param name="tracer">The RockTracer.</param>
 public RockPegasus(RockTracer tracer)
 {
     this.tracer = tracer;
 }
コード例 #4
0
 /// <summary>
 /// The factory method for IRockPegasus.
 /// </summary>
 /// <param name="tracer">The RockTracer.</param>
 /// <returns>A IRockPegasus instance.</returns>
 public static IRockPegasus CreatePegasus(RockTracer tracer)
 {
     return(new RockPegasus(tracer));
 }