示例#1
0
        protected bool IsFileExist(string path)
        {
            if (mTPManager.IsMTPPath(path))
            {
                return(mTPManager.IsFileExist(path));
            }

            return(File.Exists(path));
        }
示例#2
0
        internal void OpenInitialDirectory()
        {
            if (!manager.IsMTPPath(initialDirectory))
            {
                return;
            }

            var names = initialDirectory.Split(Path.DirectorySeparatorChar);

            var queue = new Queue <string>();

            for (int i = 1; i < names.Length; i++)
            {
                queue.Enqueue(names[i]);
            }

            ObservableCollection <DirectoryItemsViewModel> parent = Drives;

            while (queue.Count > 0)
            {
                var currentItem = queue.Dequeue();

                var nextItem = parent.Where(i => i.Name.Equals(currentItem)).FirstOrDefault();

                if (nextItem == null)
                {
                    return;
                }

                SelectedItem            = nextItem;
                SelectedItem.IsSelected = true;

                nextItem.IsExpanded = true;

                parent = nextItem.ChildrenDirectory;
            }
        }