protected void DisplayQuestionaireInternal(Command command, Service service)
        {
            ServiceCommandExecution serviceCommandExecution = new ServiceCommandExecution(command, service);

            CommandExecute commandExecuteWindow;

            try
            {
                commandExecuteWindow = new CommandExecute(serviceCommandExecution);
                commandExecuteWindow.Show();
            }

            catch (WindowExistsException e)
            {
                commandExecuteWindow = (CommandExecute)e.Control;
                commandExecuteWindow.Redisplay(serviceCommandExecution);
            }

            if (command.Status == Status.canceled)
            {
                EventInfo eventinfo = new EventInfo(string.Format(Resources.Event_CommandCancelled, service.Name));
                Events.Instance.OnEvent(this, eventinfo);

                commandExecuteWindow.Close();
            }
        }
        internal ChooseCommand(Service service)
            : base(_keyBase, service.Jid.Bare)
        {
            InitializeComponent() ;

            DataContext = service;
        }
        public Service ChooseCommand(Service service)
        {
            if (service.Commands.Count == 0)
            {
                return service;
            }

            if (service.Commands.Count == 1)
            {
                return service.Commands[0];
            }

            foreach (Service command in service.Commands)
            {
                if (JidUtil.CompareDiscoItem(command.DiscoItem, service.DiscoItem))
                {
                    return command;
                }
            }

            ChooseCommand chooseCommand = new ChooseCommand(service);
            chooseCommand.Activate();
            chooseCommand.ShowDialog();

            if ((bool) chooseCommand.DialogResult)
            {
                return chooseCommand.Service;
            }
            else
            {
                return null;
            }
        }
Exemplo n.º 4
0
        public MucMark(Service service)
        {
            _jid = service.Jid;
            _name = service.Name;

            _time = DateTime.Now;
        }
Exemplo n.º 5
0
        internal Search( agsXMPP.protocol.iq.search.Search search, Service service )
            : base(_keyBase, service.Jid.Bare)
        {
            InitializeComponent() ;

            _search.Setup( search, service ) ;
        }
Exemplo n.º 6
0
        internal RoomInfo(Service service)
            : base(_keyBase, service.Jid.Bare)
        {
            InitializeComponent();

            DataContext = service;

            _detail.Setup(service);
        }
Exemplo n.º 7
0
        internal void AddMuc(Service service, string nick, string password)
        {
            MucConversation conversation = new MucConversation();
            conversation.MucConversationInit(service, nick, password);

            MultiWin multiWin = new MultiWin(conversation, _keyBase, service.Jid.ToString());

            _multi.MultiWindows.Add(new MultiTabItem(service.Name, multiWin));
        }
Exemplo n.º 8
0
        internal void Setup( Service service )
        {
            Service = service ;

            _xData = ElementUtil.GetData( service.DiscoInfo ) ;

            if ( _xData != null )
            {
                SetupXData( _xData ) ;
            }
        }
Exemplo n.º 9
0
        protected void SearchServiceResult( agsXMPP.protocol.iq.search.Search search, Service service )
        {
            BaseWindow window = WindowManager.Find(WindowManager.MakeKey(UI.Search._keyBase, service.Jid.Bare)) as BaseWindow;

            if (window != null)
            {
                ((UI.Search)window).DisplaySearchResult(search, service);
                window.Show();
                window.Activate();
            }
        }
Exemplo n.º 10
0
        protected static void MucLoginInternal(Service service, string forceNick)
        {
            try
            {
                RoomLogin roomLogin = new RoomLogin(service, forceNick);

                roomLogin.Show();
                roomLogin.Activate();
            }

            catch (WindowExistsException e)
            {
                e.ActivateControl();
            }
        }
Exemplo n.º 11
0
        protected void SearchService( agsXMPP.protocol.iq.search.Search search, Service service )
        {
            try
            {
                UI.Search searchWindow = new UI.Search(search, service);

                searchWindow.Show();
                searchWindow.Activate();
            }

            catch ( WindowExistsException e )
            {
                e.ActivateControl();
            }
        }
Exemplo n.º 12
0
        public void DisplayMucInfo(string jidBare)
        {
            Service service;

            Jid jid = new Jid(jidBare);

            lock (Core.Services.Instance._syncObject)
            {
                service = Core.Services.Instance.FindService(jid);
            }

            if (service == null)
            {
                // not on this server
                service = new Service(new DiscoItem(), false);
                service.DiscoItem.Jid = new Jid(jidBare);
            }

            App.InvokeSafe(App._dispatcherPriority,
                           new DisplayCallback(DisplayMucInfoInternal), service);
        }
        internal void MucConversationInit(Service service, string nick, string password)
        {
            _mucRoom = Account.Instance.JoinMuc(service, nick, password);

            _mucRoom.OnClickMucContact += _mucRoom_OnClickMucContact;

            DataContext = _mucRoom;

            new MucNikcnames(_text, _mucRoom);

            Loaded += MucConversation_Loaded;

            SizeChanged += new SizeChangedEventHandler(MucConversation_SizeChanged);

            _text.Loaded += _text_Loaded;

            Account.Instance.Self.PropertyChanged += Self_PropertyChanged;

            _timer.Interval = new TimeSpan(0,0,0,0,750);
            _timer.Tick += _timer_Tick;
        }
Exemplo n.º 14
0
        internal RoomLogin(Service service, string forceNick)
            : base(_keyBase, service.Jid.ToString())
        {
            _mucMark = MucMarks.Instance.Find(service);

            if (_mucMark == null)
            {
                _mucMark = new MucMark(service);
            }

            if (!string.IsNullOrEmpty(forceNick))
            {
                _mucMark.Nick = forceNick;
            }

            DataContext = service;

            InitializeComponent();

            if (!string.IsNullOrEmpty(_mucMark.Nick))
            {
                _nick.Text = _mucMark.Nick;
            }
            else
            {
                _nick.Text = Account.Instance.Self.Jid.User;
            }

            if (!service.IsMucPasswordProtected)
            {
                _passwordPanel.Visibility = Visibility.Collapsed;
            }

            if (!string.IsNullOrEmpty(_mucMark.Password))
            {
                _password.Password = _mucMark.Password;
            }
        }
Exemplo n.º 15
0
 protected void DiscoverInfo(Jid jid, Service service)
 {
     Account.Instance.DiscoMan.DiscoverInformation(jid, new IqCB(OnDiscoInfoResultMucRoom), service);
 }
Exemplo n.º 16
0
 public void MucLogin(Service service, string forceNick)
 {
     App.InvokeSafe(App._dispatcherPriority,
                    new MucLoginCallback(MucLoginInternal), service, forceNick);
 }
Exemplo n.º 17
0
 public void DisplayMucInfo(Service service)
 {
     App.InvokeSafe(App._dispatcherPriority,
                    new DisplayCallback(DisplayMucInfoInternal), service);
 }
Exemplo n.º 18
0
        protected void DisplayMucInfoInternal(Service service)
        {
            try
            {
                RoomInfo roomInfo = new RoomInfo(service);
                roomInfo.Show();
                roomInfo.Activate();
            }

            catch (WindowExistsException e)
            {
                e.ActivateControl();
            }
        }
Exemplo n.º 19
0
 public void DisplaySearchResult( agsXMPP.protocol.iq.search.Search Search, Service service )
 {
     App.InvokeSafe(App._dispatcherPriority,
                     new DisplayCallback( SearchServiceResult ), Search, service ) ;
 }
Exemplo n.º 20
0
 public MucMark(Service service, string nick, string password)
     : this(service)
 {
     _nick = nick;
     _password = password;
 }
Exemplo n.º 21
0
 internal void DisplaySearchResult( agsXMPP.protocol.iq.search.Search search, Service service )
 {
     _resultView.ReadSearchResult( search ) ;
 }
        internal void Setup( Register register, Service service )
        {
            _register = register ;
            Service = service ;

            _xData = ElementUtil.GetData( _register ) ;

            if ( _xData == null )
            {
                SetupGatewayRegistration() ;
            }
            else
            {
                SetupXData( _xData ) ;
            }
        }
Exemplo n.º 23
0
        void Build()
        {
            switch (RecentType)
            {
                case RecentType.Chat:
                    {
                        lock (Roster.Instance.Items._syncObject)
                        {
                            Contact contact = Roster.Instance.FindContact(Jid);

                            if (contact != null)
                            {
                                MetaContact metaContact = Roster.Instance.FindMetaContact(contact.Jid);

                                if (metaContact != null)
                                {
                                    _item = metaContact;
                                }
                            }
                        }
                        break;
                    }
                case RecentType.MUC:
                    {
                        Service service = new Service(new DiscoItem(), false);
                        service.DiscoItem.Jid = Jid;

                        _item = service;

                        DiscoverInfo(Jid, service);

                        break;
                    }
                default:
                    {
                        throw new NotImplementedException();
                    }
            }
        }
Exemplo n.º 24
0
 public void DisplayQuestionaire(Command command, Service service)
 {
     App.InvokeSafe(App._dispatcherPriority,
                    new DisplayCallback(DisplayQuestionaireInternal), command, service);
 }
 public ServiceCommandExecution( Command command, Service service )
 {
     _command = command ;
     _service = service ;
 }
Exemplo n.º 26
0
        internal void Setup( Search search, Service service )
        {
            Service = service ;
            _search = search ;

            _xData = ElementUtil.GetData( _search ) ;

            if ( _xData == null )
            {
                SetupSimpleSearch() ;
            }
            else
            {
                SetupXData( _xData ) ;
            }
        }