Example #1
0
        static void Main(string[] args)
        {
            Console.CancelKeyPress += Console_CancelKeyPress;

            if (File.Exists("Bot/ConnectionConfig.suixml"))
            {
                bot = new SuiBot();
                bot.Connect();


                while (bot.IsRunning)
                {
                    System.Threading.Thread.Sleep(1);
                }
            }
            else
            {
                var configFile = new SuiBot_Core.Storage.ConnectionConfig();
                configFile.Save();
                Console.WriteLine("No connection config was found, so a new file was created.");

                if (!File.Exists("Bot/Config.xml"))
                {
                    var coreConfig = new SuiBot_Core.Storage.CoreConfig();
                    coreConfig.ChannelsToJoin.Add("ExampleChannel");
                    coreConfig.Save();
                    Console.WriteLine("No core config was found, so a new file was created.");
                }

                Console.ReadKey();
            }
        }
        public ConnectionSettingsWindow(SuiBot_Core.Storage.ConnectionConfig connectionConfig)
        {
            InitializeComponent();
            this.ConnectionConfig = connectionConfig;
            this.DataContext      = ConnectionConfig;

            //For whatever reason (security?) you need to jump through hoops and loops to do binding on password, so here is plain old manual way
            this.PassBox_Password.Password    = ConnectionConfig.Password;
            this.PassBox_ImgBBApiKey.Password = ConnectionConfig.ImgBBApiKey;
        }
Example #3
0
        public MainWindow()
        {
            DataContext = this;
            ChannelTabs = new Dictionary <string, RichTextBox>();


            InitializeComponent();
            if (!SuiBot_Core.Storage.ConnectionConfig.ConfigExists())
            {
                var tmpConfig = new SuiBot_Core.Storage.ConnectionConfig();
                tmpConfig.Save();
            }
            IsBotRunning   = false;
            MinimizeToTray = false;
            SuiBotInstance = new SuiBot_Core.SuiBot();

            ReloadActiveChannels();
            RichBox_Log.IsReadOnly = true;
            LogRB_AppendLine(new Run("Welcome to SuiBot V2.")
            {
                Foreground = new SolidColorBrush(Colors.Black)
            });
        }