Ejemplo n.º 1
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();
        }
Ejemplo n.º 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();
        }