Exemple #1
0
        // ============================================
        // PRIVATE Members
        // ============================================

        // ============================================
        // PUBLIC Constructors
        // ============================================
        public NetworkViewer()
        {
            // Initialize Scrolled Window
            BorderWidth = 0;
            ShadowType  = ShadowType.EtchedIn;
            SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            // Initialize Network Store
            this.store = new NetworkStore();

            // Initialize Icon View
            iconView               = new IconView(store);
            iconView.TextColumn    = NetworkStore.COL_NAME;
            iconView.PixbufColumn  = NetworkStore.COL_PIXBUF;
            iconView.SelectionMode = SelectionMode.Single;

            // Initialize Icon View Events
            iconView.ItemActivated    += new ItemActivatedHandler(OnItemActivated);
            iconView.ButtonPressEvent += new ButtonPressEventHandler(OnItemClicked);

            // Initialize Icon View Drag & Drop
            iconView.EnableModelDragDest(Dnd.TargetTable, Gdk.DragAction.Copy);
            iconView.DragDataReceived += new DragDataReceivedHandler(OnDragDataReceived);

            // Add IconView to ScrolledWindow
            Add(iconView);
        }
Exemple #2
0
        // ============================================
        // PRIVATE Members
        // ============================================

        // ============================================
        // PUBLIC Constructors
        // ============================================
        /// Create New Folder Viewer
        public FolderViewer(UserInfo userInfo)
        {
            // Initialize Scrolled Window
            BorderWidth = 0;
            ShadowType  = ShadowType.EtchedIn;
            SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            // Initialize UserInfo
            this.userInfo = userInfo;
            if (this.userInfo == MyInfo.GetInstance())
            {
                baseDirectory = Paths.UserSharedDirectory(MyInfo.Name);
            }
            else
            {
                baseDirectory = "/";
            }
            currentDirectory = new DirectoryInfo(baseDirectory);

            // Initialize Folder Store
            this.store = new FolderStore();
            this.store.DirectoryAdded += new ObjectEventHandler(OnStoreDirAdded);
            this.store.FileAdded      += new ObjectEventHandler(OnStoreFileAdded);

            // Initialize Icon View
            iconView               = new IconView(store);
            iconView.TextColumn    = FolderStore.COL_NAME;
            iconView.PixbufColumn  = FolderStore.COL_PIXBUF;
            iconView.SelectionMode = SelectionMode.Multiple;

            // Initialize Icon View Events
            iconView.ItemActivated    += new ItemActivatedHandler(OnItemActivated);
            iconView.ButtonPressEvent += new ButtonPressEventHandler(OnItemClicked);

            // Initialize Icon View Drag & Drop
            iconView.EnableModelDragDest(Dnd.TargetTable, Gdk.DragAction.Copy);
            iconView.DragDataReceived += new DragDataReceivedHandler(OnDragDataReceived);

            // Add IconView to ScrolledWindow
            Add(iconView);

            // Refresh Icon View
            Refresh();
        }
        // ============================================
        // PRIVATE Members
        // ============================================
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public NetworkViewer()
        {
            // Initialize Network Store
            this.store = new NetworkStore();

            // Initialize Icon View
            iconView = new IconView(store);
            iconView.TextColumn = NetworkStore.COL_NAME;
            iconView.PixbufColumn = NetworkStore.COL_PIXBUF;
            iconView.SelectionMode = SelectionMode.Single;

            // Initialize Icon View Events
            iconView.ItemActivated += new ItemActivatedHandler(OnItemActivated);
            iconView.ButtonPressEvent += new ButtonPressEventHandler(OnItemClicked);

            // Initialize Icon View Drag & Drop
            iconView.EnableModelDragDest(Dnd.TargetTable, Gdk.DragAction.Copy);
            iconView.DragDataReceived += new DragDataReceivedHandler(OnDragDataReceived);

            // Add IconView to ScrolledWindow
            Add(iconView);
        }
        // ============================================
        // PRIVATE Members
        // ============================================
        // ============================================
        // PUBLIC Constructors
        // ============================================
        /// Create New Folder Viewer
        public FolderViewer(UserInfo userInfo)
        {
            // Initialize Scrolled Window
            BorderWidth = 0;
            ShadowType = ShadowType.EtchedIn;
            SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            // Initialize UserInfo
            this.userInfo = userInfo;
            if (this.userInfo == MyInfo.GetInstance()) {
                baseDirectory = Paths.UserSharedDirectory(MyInfo.Name);
            } else {
                baseDirectory = "/";
            }
            currentDirectory = new DirectoryInfo(baseDirectory);

            // Initialize Folder Store
            this.store = new FolderStore();
            this.store.DirectoryAdded += new ObjectEventHandler(OnStoreDirAdded);
            this.store.FileAdded += new ObjectEventHandler(OnStoreFileAdded);

            // Initialize Icon View
            iconView = new IconView(store);
            iconView.TextColumn = FolderStore.COL_NAME;
            iconView.PixbufColumn = FolderStore.COL_PIXBUF;
            iconView.SelectionMode = SelectionMode.Multiple;

            // Initialize Icon View Events
            iconView.ItemActivated += new ItemActivatedHandler(OnItemActivated);
            iconView.ButtonPressEvent += new ButtonPressEventHandler(OnItemClicked);

            // Initialize Icon View Drag & Drop
            iconView.EnableModelDragDest(Dnd.TargetTable, Gdk.DragAction.Copy);
            iconView.DragDataReceived += new DragDataReceivedHandler(OnDragDataReceived);

            // Add IconView to ScrolledWindow
            Add(iconView);

            // Refresh Icon View
            Refresh();
        }