wmib.Extensions.InfobotWriter.Init C# (CSharp) Метод

Init() публичный Метод

public Init ( ) : void
Результат void
        public void Init()
        {
            thread = new Thread(Worker) { Name = "Module:Infobot/Worker" };
            Core.ThreadManager.RegisterThread(thread);
            thread.Start();
        }

Usage Example

Пример #1
0
        public override bool Hook_OnRegister()
        {
            bool success = true;

            DebugLog("Registering channels");
            try
            {
                if (!Directory.Exists(SnapshotsDirectory))
                {
                    Syslog.Log("Creating snapshot directory for infobot");
                    Directory.CreateDirectory(SnapshotsDirectory);
                }
            }
            catch (Exception fail)
            {
                Snapshots = false;
                Core.HandleException(fail, "infobot");
            }
            writer = new InfobotWriter();
            writer.Init();
            lock (Configuration.Channels)
            {
                foreach (Channel channel in Configuration.Channels)
                {
                    Channel curr = channel;
                    bool    cs   = GetConfig(curr, "Infobot.Case", true);
                    if (!channel.RegisterObject(new Infobot(getDB(ref curr), channel, this, cs), "Infobot"))
                    {
                        success = false;
                    }
                    if (Snapshots)
                    {
                        try
                        {
                            if (Directory.Exists(SnapshotsDirectory + Path.DirectorySeparatorChar + channel.Name) == false)
                            {
                                Syslog.Log("Creating directory for infobot for " + channel.Name);
                                Directory.CreateDirectory(SnapshotsDirectory + Path.DirectorySeparatorChar + channel.Name);
                            }
                        }
                        catch (Exception fail)
                        {
                            Core.HandleException(fail, "infobot");
                        }
                    }
                }
            }
            RegisterCommand(new GenericCommand("infobot-keys", this.list_keys));
            if (!success)
            {
                Syslog.Log("Failed to register infobot objects in some channels", true);
            }
            return(success);
        }
All Usage Examples Of wmib.Extensions.InfobotWriter::Init