1using System.Globalization;
20 public const string fName =
"ExternalContentScreen";
33 m_directoryList.ItemWidgetFactory = delegate(
object item) {
40 ? $
"{ExternalContentManager.GetEntryTypeDescription(externalContentEntry2.Type)} | {DataSizeFormatter.Format(externalContentEntry2.Size)} | {externalContentEntry2.Time:dd-MMM-yyyy HH:mm}{text}"
44 containerWidget.Children.Find<
LabelWidget>(
"ExternalContentItem.Text").Text = fileName;
45 containerWidget.Children.Find<
LabelWidget>(
"ExternalContentItem.Details").Text = text2;
46 return containerWidget;
48 m_directoryList.ItemClicked += delegate(
object item) {
52 SetPath(externalContentEntry.Path);
58 public override void Enter(
object[] parameters) {
73 if (externalContentEntry !=
null) {
74 m_actionButton.IsVisible =
true;
77 m_actionButton.IsEnabled =
true;
78 m_copyLinkButton.IsEnabled =
false;
85 m_actionButton.IsEnabled =
true;
86 m_copyLinkButton.IsEnabled =
true;
89 m_actionButton.IsEnabled =
false;
90 m_copyLinkButton.IsEnabled =
false;
95 m_actionButton.IsVisible =
false;
96 m_copyLinkButton.IsVisible =
false;
98 m_directoryLabel.Text = m_externalContentProvider.IsLoggedIn
103 m_upDirectoryButton.IsEnabled = m_externalContentProvider.IsLoggedIn && !(m_path.Length == 2 &&
m_path[1] ==
':');
105 m_upDirectoryButton.IsEnabled = m_externalContentProvider.IsLoggedIn &&
m_path !=
"/storage/emulated/0";
107 m_upDirectoryButton.IsEnabled = m_externalContentProvider.IsLoggedIn &&
m_path !=
"/";
112 m_copyLinkButton.IsEnabled = externalContentEntry !=
null
133 && externalContentEntry !=
null) {
142 && externalContentEntry !=
null
147 externalContentEntry.
Path,
149 delegate(
string link) {
153 delegate(Exception error) {
207 if (
string.IsNullOrEmpty(path)) {
214 path = path.Replace(
'\\',
'/');
215 if (path.Length > 1 && path.EndsWith(
"/")) {
216 path = path.Substring(0, path.Length - 1);
239 string.Compare(e1.Path, e2.Path, CultureInfo.InvariantCulture, CompareOptions.None)
245 delegate(Exception error) {
259 delegate(Stream stream) {
267 DialogsManager.HideDialog(busyDialog);
268 if (entry.Type != ExternalContentType.Mod) {
269 DialogsManager.ShowDialog(
272 LanguageControl.Success,
273 string.Format(LanguageControl.Get(
"ContentScreen",
"4"), Storage.GetFileName(entry.Path)),
281 delegate(Exception error) {
288 delegate(Exception error) {
static string GetSystemPath(string path)
static string GetExtension(string path)
static string GetDirectoryName(string path)
static string GetFileName(string path)
CancellableProgress Progress
static object Get(Type type, string name)
static void HideDialog(Dialog dialog)
static void ShowDialog(ContainerWidget parentWidget, Dialog dialog)
List< ExternalContentEntry > ChildEntries
static void ImportExternalContent(Stream stream, ExternalContentType type, string name, Action< string > success, Action< Exception > failure)
static bool IsEntryTypeDownloadSupported(ExternalContentType type)
static ExternalContentType ExtensionToType(string extension)
static void ShowLoginUiIfNeeded(IExternalContentProvider provider, bool showWarningDialog, Action handler)
static Subtexture GetEntryTypeIcon(ExternalContentType type)
static string GetEntryTypeDescription(ExternalContentType type)
static IExternalContentProvider DefaultProvider
static bool EntryFilter(ExternalContentEntry entry)
virtual void UpdateList()
LabelWidget m_providerNameLabel
ButtonWidget m_upDirectoryButton
Dictionary< string, bool > m_downloadedFiles
ButtonWidget m_copyLinkButton
void DownloadEntry(ExternalContentEntry entry)
LabelWidget m_directoryLabel
IExternalContentProvider m_externalContentProvider
ButtonWidget m_changeProviderButton
ListPanelWidget m_directoryList
ButtonWidget m_actionButton
void SetPath(string path)
ButtonWidget m_loginLogoutButton
override void Enter(object[] parameters)
static string Get(string className, int key)
获取在当前语言类名键对应的字符串
static void SwitchScreen(string name, params object[] parameters)