public MetaListItemInfo(MetaData data)
        {
            if (data == null)
                throw new ArgumentNullException("data");

            Title = data.Name;
            _path = data.Path;
            _idDir = data.IsDir;

            Icon = ThemeData.GetImage(
                data.IsDir ? "folder" : "entry");
        }
Exemple #2
0
        private void OnListComplete(MetaData data)
        {
            var dispatcher = Dispatcher;

            try
            {
                if (data == null)
                {
                    dispatcher.BeginInvoke(() => MessageBox.Show(
                        DropBoxResources.ListError,
                        DropBoxResources.ListTitle,
                        MessageBoxButton.OK));

                    return;
                }

                dispatcher.BeginInvoke(
                    () => _items.Clear());

                foreach (var child in data.Contents
                    .OrderBy(x => !x.IsDir)
                    .ThenBy(x => x.Name))
                {
                    var meta = child;
                    dispatcher.BeginInvoke(() => _items
                        .Add(new MetaListItemInfo(meta)));

                    Thread.Sleep(50);
                }
            }
            finally
            {
                dispatcher.BeginInvoke(() =>
                {
                    progList.IsLoading = false;
                    _cmdRefresh.IsEnabled = true;
                });
            }
        }