// ============================================
        // PUBLIC Constructors
        // ============================================
        public ProtocolManager(NotebookViewer nv)
        {
            this.notebookViewer = nv;

            NetworkManager.AddProtocolEvent += new SetProtocolEventHandler(OnAddProtocolEvent);
            NetworkManager.DelProtocolEvent += new SetProtocolEventHandler(OnDelProtocolEvent);
        }
Beispiel #2
0
        // ============================================
        // PUBLIC Constructors
        // ============================================
        /// Create New NyFolder Window
        public Window() : base(Info.Name + " " + Info.Version)
        {
            // Initialize Window
            this.SetDefaultSize(620, 320);
            DefaultIcon       = StockIcons.GetPixbuf("NyFolderIcon");
            this.DeleteEvent += new DeleteEventHandler(OnWindowDelete);

            // Initialize VBox
            this.vboxMain = new Gtk.VBox(false, 2);
            this.Add(this.vboxMain);

            // Initialize Menu Manager
            this.menuManager            = new MenuManager();
            this.menuManager.Activated += new EventHandler(OnMenuActivated);
            this.AddAccelGroup(this.menuManager.AccelGroup);

            // Initialize HBox Menu
            this.hboxMenu = new Gtk.HBox(false, 0);
            this.vboxMain.PackStart(hboxMenu, false, false, 0);

            // Initialize MenuBar
            Gtk.MenuBar menuBar = this.MenuBar;
            this.hboxMenu.PackStart(menuBar, false, false, 0);

            // Initialize HBox
            this.hbox = new Gtk.HBox();
            this.vboxMain.PackStart(this.hbox, true, true, 2);

            // Initialize Left VBox
            this.vboxLeft = new Gtk.VBox(false, 2);
            this.hbox.PackStart(this.vboxLeft, false, false, 2);

            // Initialize User Panel
            this.userPanel = new UserPanel();
            this.vboxLeft.PackStart(this.userPanel, false, false, 2);

            // Initialize Right VBox
            this.vboxRight = new Gtk.VBox(false, 2);
            this.hbox.PackStart(this.vboxRight, true, true, 2);

            // Initialize ToolBar
            Gtk.Toolbar toolBar = this.ToolBar;
            toolBar.ShowArrow    = true;
            toolBar.IconSize     = Gtk.IconSize.LargeToolbar;
            toolBar.ToolbarStyle = ToolbarStyle.Both;
            this.vboxRight.PackStart(toolBar, false, false, 2);

            // Initialize Notebook Viewer
            this.notebookViewer = new NotebookViewer();
            this.vboxRight.PackStart(this.notebookViewer, true, true, 2);

            // Initialize Status Bar
            this.statusBar = new Gtk.Statusbar();
            this.vboxMain.PackEnd(this.statusBar, false, false, 0);

            // Window Show All
            this.ShowAll();
        }
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public ProtocolManager(GUI.Window window)
        {
            // Initialize Components
            this.notebookViewer = window.NotebookViewer;
            this.networkViewer = this.notebookViewer.NetworkViewer;

            // Add Events Handler
            CmdManager.AddProtocolEvent += new SetProtocolEventHandler(OnAddProtocolEvent);
            CmdManager.DelProtocolEvent += new SetProtocolEventHandler(OnDelProtocolEvent);
        }
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public FolderManager(MenuManager menu, UserPanel userPanel, NotebookViewer nv)
        {
            this.userPanel = userPanel;
            this.notebookViewer = nv;
            this.menuManager = menu;

            // Network Viewer Displayed at Start...
            SetSensitiveGoUpMenu(false);
            SetSensitiveGoHomeMenu(false);

            // Add Event Handlers
            this.menuManager.Activated += new EventHandler(OnMenuActivated);
            this.notebookViewer.SwitchPage += new SwitchPageHandler(OnSwitchPage);
            this.notebookViewer.DirChanged += new BoolEventHandler(OnBoolEventHandler);
            this.userPanel.FolderButton.Clicked += new EventHandler(OnMyFolderCliecked);
        }
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public FolderManager(GUI.Window window)
        {
            // Initialize Components
            this.menuManager = window.Menu;
            this.userPanel = window.UserPanel;
            this.notebookViewer = window.NotebookViewer;

            // Network Viewer Displayed at Start...
            SetSensitiveGoUpMenu(false);
            SetSensitiveGoHomeMenu(false);

            // Add Event Handlers
            this.menuManager.Activated += new EventHandler(OnMenuActivated);
            this.notebookViewer.SwitchPage += new SwitchPageHandler(OnSwitchPage);
            this.notebookViewer.DirChanged += new BoolEventHandler(OnDirChanged);
            this.userPanel.FolderButton.Clicked += new EventHandler(OnMyFolderCliecked);
        }
        // ============================================
        // 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);
        }
        // ============================================
        // 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);
        }
 // ============================================
 // PUBLIC Methods
 // ============================================
 public static void Initialize(INyFolder iNyFolder)
 {
     talkFrames = Hashtable.Synchronized(new Hashtable());
     notebookViewer = iNyFolder.MainWindow.NotebookViewer;
     notebookViewer.TabRemoved += new ObjectEventHandler(OnTalkFrameRemoved);
 }
        public static void Uninitialize()
        {
            if (talkFrames == null) return;

            foreach (UserInfo userInfo in talkFrames.Keys) {
                TalkFrame talkFrame = talkFrames[userInfo] as TalkFrame;

                // Remove Page From Notebook Viewer
                notebookViewer.RemoveCustom(talkFrame);
            }
            talkFrames.Clear();
            talkFrames = null;

            // Remove Events From NotebookViewer
            notebookViewer.TabRemoved -= new ObjectEventHandler(OnTalkFrameRemoved);
            notebookViewer = null;
        }
        // ============================================
        // PRIVATE (Methods) Event Handlers
        // ============================================
        private void OnMainWindowStarted(object sender)
        {
            // Initialize GUI Components
            InitializeMenu();

            // Initialize Notebook Viewer
            notebookViewer = this.nyFolder.MainWindow.NotebookViewer;

            LoadSectionImages("customization/wallpaper/apple/");
        }
        // ============================================
        // PROTECTED (Methods) Event Handlers
        // ============================================
        protected void OnMainWindowStarted(object sender)
        {
            // Initialize GUI Components
            InitializeMenu();

            // Initialize Notebook Viewer Events
            this.notebookViewer = this.nyFolder.Window.NotebookViewer;
            this.notebookViewer.FileAdded += new ObjectEventHandler(OnFileAdded);

            // Initialize Protocol Events
            P2PManager.StatusChanged += new BoolEventHandler(OnP2PStatusChanged);
        }
        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);
        }
Beispiel #13
0
        // ============================================
        // PUBLIC Constructors
        // ============================================
        /// Create New NyFolder Window
        public Window()
            : base(Info.Name + " " + Info.Version)
        {
            // Initialize Window
            this.SetDefaultSize(620, 320);
            DefaultIcon = StockIcons.GetPixbuf("NyFolderIcon");
            this.DeleteEvent += new DeleteEventHandler(OnWindowDelete);

            // Initialize VBox
            this.vboxMain = new Gtk.VBox(false, 2);
            this.Add(this.vboxMain);

            // Initialize Menu Manager
            this.menuManager = new MenuManager();
            this.menuManager.Activated += new EventHandler(OnMenuActivated);
            this.AddAccelGroup(this.menuManager.AccelGroup);

            // Initialize HBox Menu
            this.hboxMenu = new Gtk.HBox(false, 0);
            this.vboxMain.PackStart(hboxMenu, false, false, 0);

            // Initialize MenuBar
            Gtk.MenuBar menuBar = this.MenuBar;
            this.hboxMenu.PackStart(menuBar, false, false, 0);

            // Initialize HBox
            this.hbox = new Gtk.HBox();
            this.vboxMain.PackStart(this.hbox, true, true, 2);

            // Initialize Left VBox
            this.vboxLeft = new Gtk.VBox(false, 2);
            this.hbox.PackStart(this.vboxLeft, false, false, 2);

            // Initialize User Panel
            this.userPanel = new UserPanel();
            this.vboxLeft.PackStart(this.userPanel, false, false, 2);

            // Initialize Right VBox
            this.vboxRight = new Gtk.VBox(false, 2);
            this.hbox.PackStart(this.vboxRight, true, true, 2);

            // Initialize ToolBar
            Gtk.Toolbar toolBar = this.ToolBar;
            toolBar.ShowArrow = true;
            toolBar.IconSize = Gtk.IconSize.LargeToolbar;
            toolBar.ToolbarStyle = ToolbarStyle.Both;
            this.vboxRight.PackStart(toolBar, false, false, 2);

            // Initialize Notebook Viewer
            this.notebookViewer = new NotebookViewer();
            this.vboxRight.PackStart(this.notebookViewer, true, true, 2);

            // Initialize Status Bar
            this.statusBar = new Gtk.Statusbar();
            this.vboxMain.PackEnd(this.statusBar, false, false, 0);

            // Window Show All
            this.ShowAll();
        }