Example #1
0
 public static void Stop()
 {
     Listeners.ForEach(l =>
     {
         l.Stop();
         Helper.Debug("Stop listen: " + l.ToString());
     }
                       );
 }
Example #2
0
 public static void Start()
 {
     Listeners.ForEach(l =>
     {
         l.Start();
         Helper.Debug("Start listen: " + l.ToString());
     }
                       );
     RecycleThread.Start();
 }
Example #3
0
        public void RemoveSnippet(object sender, AbstractSnippet snippet)
        {
            if (Snippets.Remove(snippet))
            {
                AppSettings.PutAndSave(GetKey(snippet), Snippets);

                // Notify listeners that a snippet was removed
                Listeners.ForEach(listener => listener.SnippetRemoved(sender, this, snippet));
            }
        }
Example #4
0
        protected override void UpdateAfterRender()
        {
            base.UpdateAfterRender();
            Listeners.ForEach(x => x.Render3D());

            Matrix.Set(MatrixMode.Modelview);
            Matrix.Identity();
            Viewport.Orthographic(0, 0, Width, Height);
            Listeners.ForEach(x => x.Render2D());
        }
        public void Start()
        {
            Running = true;
            Listeners.ForEach(l => l.Start());

            Utilities.StartThread(ListenLoop);
            Utilities.StartThread(TunEmptyLoop);
            Utilities.StartThread(DataLoop);
            Utilities.StartThread(ResolveAddressesLoop);
        }
Example #6
0
 private static void Recycle()
 {
     while (true)
     {
         Thread.Sleep(TimeSpan.FromSeconds(30));
         Listeners.ForEach(l =>
         {
             l.RecycleClients();
         });
     }
 }
Example #7
0
 protected override void OnStop()
 {
     try
     {
         log.Info("Stop service");
         Listeners.ForEach(x => x.StopListening(x.Configuration.Port));
     }
     catch (Exception ex)
     {
         log.Info(ex.ToString());
     }
 }
Example #8
0
 protected override void InternalEarlyStart()
 {
     if (_rootChild == null)
     {
         _rootChild = InternalBuildStory();
         Children   = new List <AITask>()
         {
             _rootChild
         };
         Listeners.ForEach(c => _rootChild.AddListener(c));
         _rootChild.OwningBot = OwningBot;
     }
 }
Example #9
0
        public bool AddSnippet(object sender, AbstractSnippet snippet)
        {
            // Prevents duplicate sources
            if (Snippets.Contains(snippet))
            {
                return(false);
            }

            Snippets.Add(snippet);

            // Update settings to include newly added snippet
            var snippetsOfType = Snippets.Where(s => s.GetType() == snippet.GetType());

            AppSettings.PutAndSave(GetKey(snippet), snippetsOfType);

            // Notify listeners that a new snippet was added
            Listeners.ForEach(listener => listener.SnippetAdded(sender, this, snippet));

            return(true);
        }
Example #10
0
 protected override void UpdateAfterRender()
 {
     Listeners.ForEach(x => x.Render2D());
     base.UpdateAfterRender();
 }