Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel()
        {
            if (IsInDesignMode)
            {
                return;
            }
            //OnUpdateStyles();

            //TODO: replace hard-coded config
            JabberSession = new JabberSession(Dispatcher.CurrentDispatcher);
            ConferencesModels = new ObservableCollection<ConferenceViewModel>();
            JabberSession.BeginAuthentication(new ConnectionConfig
                                                    {
                                                        User = "******",
                                                        Server = "jabber.uruchie.org",
                                                        Password = "******"
                                                    });

            JabberSession.Conferences.Add(new JID("main", "conference.jabber.uruchie.org", "CIA"));
            JabberSession.Conferences.Add(new JID("cyclops", "conference.jabber.uruchie.org", "CIA2"));
            JabberSession.Conferences.Add(new JID("CIA", "conference.jabber.uruchie.org", "CIA2"));
            JabberSession.Conferences.Add(new JID("support", "conference.jabber.uruchie.org", "CIA2"));
            JabberSession.Conferences.SynchronizeWith(ConferencesModels, conference => new ConferenceViewModel(conference));

            UpdateStyles = new RelayCommand(OnUpdateStyles);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            JabberSession session = new JabberSession();
            session.Authenticated += Authenticated;

            Console.WriteLine(@"Connecting...");
            session.BeginAuthentication(new ConnectionConfig {
                                                User = "******",
                                                Server = "jabber.uruchie.org",
                                                Password = "******"
                                            });
            session.Conferences.Add(new jabber.JID("main", "conference.jabber.uruchie.org", "CyclopsIsAlive"));
            Console.ReadKey();
        }