コード例 #1
0
        private bool AutoAddBuddyTimeout()
        {
            // If I'm Offline Skip
            if (P2PManager.IsListening() == false)
            {
                return(timeoutAddBuddyRet);
            }

            // If Timeout is Ended
            if (timeoutAddBuddyRet != true)
            {
                return(false);
            }

            // Get Offline Users
            UserInfo[] offline = GetOfflineUsers();
            if (offline == null)
            {
                return(timeoutAddBuddyRet);
            }

            // Connect Offline Users
            foreach (UserInfo userInfo in offline)
            {
                UserConnect(userInfo);
                Gtk.Application.Invoke(delegate {
                    AddUserToNetworkViewer(userInfo);
                });
            }

            return(timeoutAddBuddyRet);
        }
コード例 #2
0
        // ============================================
        // PRIVATE (Methods) Event Handlers
        // ============================================
        private void OnMainWindowStarted(object sender)
        {
            // Initialize GUI Components
            InitializeMenu();

            // Initialize Sensitive Menu
            P2PManager.StatusChanged += new BoolEventHandler(OnP2PStatusChanged);
            SetSensitiveMenu(P2PManager.IsListening());
        }
コード例 #3
0
        // ============================================
        // PRIVATE (Methods) Event Handlers
        // ============================================
        private void OnMainWindowStarted(object sender)
        {
            // Initialize Talk Component
            InitializeTalkMenu();
            SetSensitiveTalkMenu(P2PManager.IsListening());

            // Initialize Talk Menu (Network Viewer Right Click Popup)
            NetworkViewer nv = nyFolder.MainWindow.NotebookViewer.NetworkViewer as NetworkViewer;

            nv.RightMenu += new RightMenuHandler(OnInsertNetworkRightMenu);
        }
コード例 #4
0
        // ============================================
        // PROTECTED (Methods) Event Handlers
        // ============================================
        protected void OnMainWindowStarted(object sender)
        {
            // Initialize Talk Component
            InitializeTalkMenu();
            SetSensitiveTalkMenu(P2PManager.IsListening());

            // Initialize Talk Menu (Network Viewer Right Click Popup)
            NetworkViewer nv = nyFolder.Window.NotebookViewer.NetworkViewer as NetworkViewer;

            nv.RightMenu += new RightMenuHandler(OnInsertNetworkRightMenu);

            // Initialize Protocol Events
            NetworkManager.AddProtocolEvent += new SetProtocolEventHandler(OnAddProtocolCmd);
            NetworkManager.DelProtocolEvent += new SetProtocolEventHandler(OnDelProtocolCmd);
        }
コード例 #5
0
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public NetworkManager(MenuManager menu, UserPanel userPanel, NotebookViewer nv)
        {
            this.userPanel      = userPanel;
            this.notebookViewer = nv;
            this.menuManager    = menu;

            // Initialize P2PManager & CMD Manager
            this.p2pManager = P2PManager.GetInstance();
            this.cmdManager = CmdManager.GetInstance();

            // Network
            SetSensitiveNetworkMenu(P2PManager.IsListening());

            // Add Event Handlers
            this.menuManager.Activated += new EventHandler(OnMenuActivated);
            notebookViewer.NetworkViewer.ItemRemoved += new PeerSelectedHandler(OnPeerRemove);
        }
コード例 #6
0
        protected void OnMainAppQuit(object sender)
        {
            if (this.started == false)
            {
                return;
            }

            // Notebook Viewer Events
            this.notebookViewer.FileAdded -= new ObjectEventHandler(OnFileAdded);
            this.notebookViewer            = null;

            // Protocol Events
            P2PManager.StatusChanged -= new BoolEventHandler(OnP2PStatusChanged);
            if (P2PManager.IsListening() == true)
            {
                OnP2PStatusChanged(null, false);
            }
        }
コード例 #7
0
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public NetworkManager(GUI.Window window)
        {
            // Initialize Events (None)
            UserAccept = null;

            // Initialize Components
            this.menuManager    = window.Menu;
            this.userPanel      = window.UserPanel;
            this.notebookViewer = window.NotebookViewer;
            this.networkViewer  = this.notebookViewer.NetworkViewer;

            // Initialize P2PManager & CMD Manager
            this.p2pManager = P2PManager.GetInstance();

            // Network
            SetSensitiveNetworkMenu(P2PManager.IsListening());

            // Add Event Handlers
            menuManager.Activated       += new EventHandler(OnMenuActivated);
            networkViewer.ItemRemoved   += new PeerSelectedHandler(OnPeerRemove);
            CmdManager.AddProtocolEvent += new SetProtocolEventHandler(OnAddProtocolEvent);
            CmdManager.DelProtocolEvent += new SetProtocolEventHandler(OnDelProtocolEvent);
        }