Exemple #1
0
        public frmMain()
        {
            InitializeComponent();
            string m = ChatLog.SmileyPart.Match;

            chatForms = new List <frmChat> ();
            channels  = new Dictionary <string, frmChat> ();
            frmLogin frmLogin = new frmLogin();

            if (frmLogin.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                this.Close();
                Application.Exit();
                return;
            }
            session = new LivecodingSession(LiveCodingChat.LoginFactory.Instance.CreateInstance(frmLogin.LoginMethod), frmLogin.Username);
            session.PasswordRequested   += (object sender, ref string Password) => Password = frmLogin.Password;
            session.SessionAutenticated += Session_SessionAutenticated;
            session.FollowedChanged     += Session_FollowedChanged;;
            session.EnsureAuthenticated();
        }
Exemple #2
0
        public static void Main(string[] args)
        {
            string dir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);

            try
            {
                player = new System.Media.SoundPlayer(System.IO.Path.Combine(dir, "sound.wav"));
                player.Load();
            }
            catch (Exception) { player = null; }
            run = true;

            ILoginMethod loginMethod = ReadLoginMethod();
            string       username    = ReadUsername();

            session = new LiveCodingChat.Livecoding.LivecodingSession(loginMethod, username);
            session.PasswordRequested   += Session_PasswordRequested;
            session.SessionAutenticated += Session_SessionAutenticated;
            session.EnsureAuthenticated();
            while (run)
            {
                System.Threading.Thread.Sleep(10);
            }
        }