コード例 #1
0
        protected Location(InfoGatherTask infoGatherTask, MediaFileState state)
        {
            MediaFileState      = state;
            this.infoGatherTask = infoGatherTask;

            //state.NrImportedItemsChanged += new EventHandler<MediaStateChangedEventArgs>(importStateChanged);
        }
コード例 #2
0
ファイル: Location.cs プロジェクト: iejeecee/mediaviewer
        protected Location(InfoGatherTask infoGatherTask, MediaFileState state)
        {
            MediaFileState = state;
            this.infoGatherTask = infoGatherTask;

            //state.NrImportedItemsChanged += new EventHandler<MediaStateChangedEventArgs>(importStateChanged);
                     
        }
コード例 #3
0
        public DirectoryLocation(DirectoryInfo info, InfoGatherTask infoGatherTask, MediaFileState mediaFileState)
            : base(infoGatherTask, mediaFileState)
        {
            Name         = info.Name;
            CreationDate = info.CreationTime;

            VolumeLabel = "";

            //ImageUrl = "pack://application:,,,/Resources/Icons/mediafolder.ico";
            NrImported = 0;

            LazyLoading = true;

            PropertyChanged += propertyChanged;
        }
コード例 #4
0
        public DirectoryLocation(DirectoryInfo info, InfoGatherTask infoGatherTask, MediaFileState mediaFileState)
            : base(infoGatherTask, mediaFileState)
        {        
            Name = info.Name;
            CreationDate = info.CreationTime;
                     
            VolumeLabel = "";

            //ImageUrl = "pack://application:,,,/Resources/Icons/mediafolder.ico";
            NrImported = 0;                    
                                           
            LazyLoading = true;
           
            PropertyChanged += propertyChanged;
        }
コード例 #5
0
        public DirectoryPicker()
        {
            InitializeComponent();

            cancelInfoGatherTaskTokenSource = new CancellationTokenSource();

            infoGatherTask = new InfoGatherTask(cancelInfoGatherTaskTokenSource.Token);
            RootLocation root = new RootLocation(infoGatherTask, MediaFileWatcher.Instance.MediaFileState);

            treeView.Root              = root;
            treeView.IsVisibleChanged += treeView_IsVisibleChanged;
            root.NodePropertyChanged  += root_NodePropertyChanged;

            scrollToNodeOnTreeViewVisible = null;
            //SharpTreeView temp;
        }
コード例 #6
0
        public DirectoryPicker()
        {
            InitializeComponent();

            cancelInfoGatherTaskTokenSource = new CancellationTokenSource();

            infoGatherTask = new InfoGatherTask(cancelInfoGatherTaskTokenSource.Token);
            RootLocation root = new RootLocation(infoGatherTask, MediaFileWatcher.Instance.MediaFileState);
            treeView.Root = root;
            treeView.IsVisibleChanged += treeView_IsVisibleChanged;
            root.NodePropertyChanged += root_NodePropertyChanged;
           
            scrollToNodeOnTreeViewVisible = null;
            //SharpTreeView temp;
         
            
        }
コード例 #7
0
ファイル: RootLocation.cs プロジェクト: yklee0916/mediaviewer
        public RootLocation(InfoGatherTask infoGatherTask, MediaFileState mediaFileState) : base(infoGatherTask, mediaFileState)
        {
            LazyLoading = true;

            mediaFileState.NrImportedItemsChanged += mediaFileState_NrImportedItemsChanged;
        }
コード例 #8
0
ファイル: RootLocation.cs プロジェクト: iejeecee/mediaviewer
 public RootLocation(InfoGatherTask infoGatherTask, MediaFileState mediaFileState) : base(infoGatherTask, mediaFileState)
 {            
     LazyLoading = true;
               
     mediaFileState.NrImportedItemsChanged += mediaFileState_NrImportedItemsChanged;
 }
コード例 #9
0
        public DriveLocation(DriveInfo info, InfoGatherTask infoGatherTask, MediaFileState mediaFileState)
            : base(infoGatherTask, mediaFileState)
        {
            switch (info.DriveType)
            {
            case DriveType.CDRom:
            {
                ImageUrl    = "pack://application:,,,/Resources/Icons/CD_Drive.ico";
                VolumeLabel = "CD ROM";
                break;
            }

            case DriveType.Fixed:
            {
                ImageUrl = "pack://application:,,,/Resources/Icons/Hard_Drive.ico";

                try
                {
                    VolumeLabel = !String.IsNullOrEmpty(info.VolumeLabel) ? info.VolumeLabel : "Local Disk";
                }
                catch (Exception)
                {
                }

                break;
            }

            case DriveType.Network:
            {
                ImageUrl    = "pack://application:,,,/Resources/Icons/Network_Drive.ico";
                VolumeLabel = "Network Drive";
                break;
            }

            case DriveType.NoRootDirectory:
            {
                break;
            }

            case DriveType.Ram:
            {
                ImageUrl    = "pack://application:,,,/Resources/Icons/ram.ico";
                VolumeLabel = "Ram Drive";
                break;
            }

            case DriveType.Removable:
            {
                ImageUrl    = "pack://application:,,,/Resources/Icons/Removable_Drive.ico";
                VolumeLabel = "Removable Drive";
                break;
            }

            case DriveType.Unknown:
            {
                ImageUrl    = "pack://application:,,,/Resources/Icons/UnknownDrive.ico";
                VolumeLabel = "Unknown Drive";
                break;
            }
            }

            Name = info.Name.TrimEnd(new char[] { '\\' });

            if (driveIdleMonitor.DrivesMonitored.Contains(Name))
            {
                FreeSpaceBytes = info.TotalFreeSpace;
                driveIdleMonitor.DriveInUse += new EventHandler <string>(driveIdleMonitor_driveInUse);
            }
            else
            {
                FreeSpaceBytes = 0;
            }

            infoGatherTask.addLocation(this);

            LazyLoading = true;
        }
コード例 #10
0
ファイル: DriveLocation.cs プロジェクト: iejeecee/mediaviewer
        public DriveLocation(DriveInfo info, InfoGatherTask infoGatherTask, MediaFileState mediaFileState)
            : base(infoGatherTask, mediaFileState)
        {
           
            switch (info.DriveType)
            {
                case DriveType.CDRom:
                    {
                        ImageUrl = "pack://application:,,,/Resources/Icons/CD_Drive.ico";
                        VolumeLabel = "CD ROM";
                        break;
                    }
                case DriveType.Fixed:
                    {
                        ImageUrl = "pack://application:,,,/Resources/Icons/Hard_Drive.ico";

                        try
                        {
                            VolumeLabel = !String.IsNullOrEmpty(info.VolumeLabel) ? info.VolumeLabel : "Local Disk";
                        }
                        catch (Exception)
                        {

                        }

                        break;
                    }
                case DriveType.Network:
                    {
                        ImageUrl = "pack://application:,,,/Resources/Icons/Network_Drive.ico";
                        VolumeLabel = "Network Drive";
                        break;
                    }
                case DriveType.NoRootDirectory:
                    {
                        break;
                    }
                case DriveType.Ram:
                    {
                        ImageUrl = "pack://application:,,,/Resources/Icons/ram.ico";
                        VolumeLabel = "Ram Drive";
                        break;
                    }
                case DriveType.Removable:
                    {
                        ImageUrl = "pack://application:,,,/Resources/Icons/Removable_Drive.ico";
                        VolumeLabel = "Removable Drive";
                        break;
                    }
                case DriveType.Unknown:
                    {
                        ImageUrl = "pack://application:,,,/Resources/Icons/UnknownDrive.ico";
                        VolumeLabel = "Unknown Drive";
                        break;
                    }
            }

            Name = info.Name.TrimEnd(new char[] { '\\' });
          
            if (driveIdleMonitor.DrivesMonitored.Contains(Name))
            {
                FreeSpaceBytes = info.TotalFreeSpace;
                driveIdleMonitor.DriveInUse += new EventHandler<string>(driveIdleMonitor_driveInUse);
            }
            else
            {
                FreeSpaceBytes = 0;
            }

            infoGatherTask.addLocation(this);
          
            LazyLoading = true;


        }