Make library compile

This commit is contained in:
Joshua Askharoun
2021-02-21 22:52:00 -06:00
parent ba52467ed7
commit c920dff448
13 changed files with 59 additions and 54 deletions
+3 -1
View File
@@ -41,13 +41,15 @@ namespace ZuneUI
public static bool CanCreateAttachment(object obj)
{
DataProviderObject dataProviderObject = null;
MediaType mediaType = MediaType.Undefined;
Guid guid = Guid.Empty;
int num = -1;
bool flag = false;
switch (obj)
{
case DataProviderObject dataProviderObject:
case DataProviderObject _:
dataProviderObject = (DataProviderObject)obj;
object property1 = dataProviderObject.GetProperty("ZuneMediaId");
if (property1 != null)
guid = (Guid)property1;
+5 -5
View File
@@ -221,7 +221,7 @@ namespace ZuneUI
this._hasIncrementedSkipCount = false;
this._lastStoredBookmark = 0L;
this._duration = playbackWrapper.Duration;
if (this._mediaType == MediaType.PodcastEpisode || this._mediaType == MediaType.Video)
if (this._mediaType == ZuneUI.MediaType.PodcastEpisode || this._mediaType == ZuneUI.MediaType.Video)
{
LibraryPlaybackTrack.PodcastVideoLengthGroup videoLengthGroup = LibraryPlaybackTrack.PodcastVideoLengthGroup.Long;
while (videoLengthGroup > LibraryPlaybackTrack.PodcastVideoLengthGroup.Short && this._duration <= LibraryPlaybackTrack.c_podcastVideoLengths[(int)videoLengthGroup])
@@ -236,7 +236,7 @@ namespace ZuneUI
if (this._lastStoredBookmark > 200000000L)
this._hasIncrementedPlayCount = true;
}
if (this._mediaType == MediaType.PodcastEpisode)
if (this._mediaType == ZuneUI.MediaType.PodcastEpisode)
{
if (this.IsVideo)
SQMLog.Log(SQMDataId.PodcastVideoEpisodePlayed, 1);
@@ -247,13 +247,13 @@ namespace ZuneUI
EMediaTypes MediaType;
switch (this.MediaType)
{
case MediaType.Track:
case ZuneUI.MediaType.Track:
MediaType = EMediaTypes.eMediaTypeAudio;
break;
case MediaType.Video:
case ZuneUI.MediaType.Video:
MediaType = EMediaTypes.eMediaTypeVideo;
break;
case MediaType.PodcastEpisode:
case ZuneUI.MediaType.PodcastEpisode:
MediaType = EMediaTypes.eMediaTypePodcastEpisode;
break;
default:
+4 -4
View File
@@ -38,10 +38,10 @@ namespace ZuneUI
public override void Cancel()
{
if (this.CurrentPage is MobileWirelessSyncWizardPage currentPage)
currentPage.OnCancel();
if (this.CurrentPage is MobileWirelessSyncErrorPage currentPage)
currentPage.OnCancel();
if (this.CurrentPage is MobileWirelessSyncWizardPage currentWizardPage)
currentWizardPage.OnCancel();
if (this.CurrentPage is MobileWirelessSyncErrorPage currentErrorPage)
currentErrorPage.OnCancel();
base.Cancel();
}
}
+6 -6
View File
@@ -549,7 +549,7 @@ namespace ZuneUI
private void ShowContentTypesChanged(object sender, EventArgs e)
{
if (!this.ShowContentTypes.Value)
this.DrmStateMask = DrmStateMask.All();
this.DrmStateMask = ZuneUI.DrmStateMask.All();
ClientConfiguration.Shell.ShowContentTypes = this.ShowContentTypes.Value;
}
@@ -640,7 +640,7 @@ namespace ZuneUI
{
if (!(ZuneShell.DefaultInstance.CurrentPage is LibraryPage currentPage))
return;
currentPage.DrmStateMask = DrmStateMask.All();
currentPage.DrmStateMask = ZuneUI.DrmStateMask.All();
SQMLog.Log(SQMDataId.LibraryContentTypeAllClicks, 1);
}
@@ -648,7 +648,7 @@ namespace ZuneUI
{
if (!(ZuneShell.DefaultInstance.CurrentPage is LibraryPage currentPage))
return;
currentPage.DrmStateMask = DrmStateMask.Personal();
currentPage.DrmStateMask = ZuneUI.DrmStateMask.Personal();
SQMLog.Log(SQMDataId.LibraryContentTypePersonalClicks, 1);
}
@@ -656,7 +656,7 @@ namespace ZuneUI
{
if (!(ZuneShell.DefaultInstance.CurrentPage is LibraryPage currentPage))
return;
currentPage.DrmStateMask = DrmStateMask.Protected();
currentPage.DrmStateMask = ZuneUI.DrmStateMask.Protected();
SQMLog.Log(SQMDataId.LibraryContentTypeProtectedClicks, 1);
}
@@ -664,7 +664,7 @@ namespace ZuneUI
{
if (!(ZuneShell.DefaultInstance.CurrentPage is LibraryPage currentPage))
return;
currentPage.DrmStateMask = DrmStateMask.ZunePass();
currentPage.DrmStateMask = ZuneUI.DrmStateMask.ZunePass();
SQMLog.Log(SQMDataId.LibraryContentTypeZunePassClicks, 1);
}
@@ -710,7 +710,7 @@ namespace ZuneUI
if (this.NavigationArguments != null)
{
MusicLibraryPage._preferredContentType = MusicLibraryPage._showContentTypesAll;
this.DrmStateMask = DrmStateMask.All();
this.DrmStateMask = ZuneUI.DrmStateMask.All();
if (this.NavigationArguments.Contains((object)"ViewOverrideId"))
{
MusicLibraryView navigationArgument = (MusicLibraryView)this.NavigationArguments[(object)"ViewOverrideId"];
+6 -6
View File
@@ -349,20 +349,20 @@ namespace ZuneUI
if (count <= 0)
return;
MediaType mediaType1 = MediaType.Undefined;
if (items[0] is LibraryDataProviderItemBase providerItemBase)
if (items[0] is LibraryDataProviderItemBase providerItemBaseA)
{
if (providerItemBase.TypeName == "Artist")
if (providerItemBaseA.TypeName == "Artist")
mediaType1 = MediaType.Artist;
else if (providerItemBase.TypeName == "Album")
else if (providerItemBaseA.TypeName == "Album")
mediaType1 = MediaType.Album;
else if (providerItemBase.TypeName == "Genre")
else if (providerItemBaseA.TypeName == "Genre")
mediaType1 = MediaType.Genre;
}
if (mediaType1 == MediaType.Artist || mediaType1 == MediaType.Genre || mediaType1 == MediaType.Album)
{
IList list = (IList)new ArrayList(count);
foreach (LibraryDataProviderItemBase providerItemBase in (IEnumerable)items)
list.Add((object)(int)providerItemBase.GetProperty("LibraryId"));
foreach (LibraryDataProviderItemBase providerItemBaseB in (IEnumerable)items)
list.Add((int)providerItemBaseB.GetProperty("LibraryId"));
bool singleAlbum = list.Count == 1;
if ((mediaType1 == MediaType.Artist || mediaType1 == MediaType.Genre) && list.Count == 1)
{
+1 -1
View File
@@ -57,7 +57,7 @@ namespace ZuneUI
this._inputDialog.Dispose();
this._inputDialog = (PodcastSignIn)null;
}
this._inputDialog = new PodcastSignIn((SubscriptonCredentialRequestArguments)args, new EventHandler(((NetworkSignInCredentials)this).OnDialogSignIn), new EventHandler(((NetworkSignInCredentials)this).OnDialogCanceled));
this._inputDialog = new PodcastSignIn((SubscriptonCredentialRequestArguments)args, new EventHandler(OnDialogSignIn), new EventHandler(OnDialogCanceled));
this._inputDialog.Show();
}
+1 -1
View File
@@ -38,7 +38,7 @@ namespace ZuneUI
: base(signInHandler, cancelHandler, "res://ZuneShellResources!PodcastDialogs.uix#PodcastSignInDialogUI")
{
this._credentials = credentials;
this.Cancel.Invoked += new EventHandler(((NetworkSignInDialogHelper)this).OnInvoked);
this.Cancel.Invoked += new EventHandler(this.OnInvoked);
this._seriesTitle = this._credentials.SubscriptionMediaId <= 0 ? string.Empty : PlaylistManager.GetFieldValue<string>(this._credentials.SubscriptionMediaId, EListType.ePodcastList, 344, string.Empty);
this._title = Shell.LoadString(StringId.IDS_PODCAST_SIGN_IN_TITLE);
Uri uri = new Uri(this._credentials.TargetUrl);
+4 -4
View File
@@ -75,10 +75,10 @@ namespace ZuneUI
if (this._inputDialog != null)
{
this._inputDialog.Dispose();
this._inputDialog = (ProxySignIn)null;
this._inputDialog = null;
}
this._credentials = (UserCredentialRequestArguments)args;
this._inputDialog = new ProxySignIn(this._credentials, new EventHandler(((NetworkSignInCredentials)this).OnDialogSignIn), new EventHandler(((NetworkSignInCredentials)this).OnDialogCanceled));
this._inputDialog = new ProxySignIn(this._credentials, new EventHandler(OnDialogSignIn), new EventHandler(OnDialogCanceled));
this._inputDialog.Show();
this._lastUIPathPrompted = ZuneShell.DefaultInstance.CurrentPage.UIPath;
}
@@ -92,11 +92,11 @@ namespace ZuneUI
public override void Dispose()
{
UserCredentialManager.Instance.SetCredentialHandler((UserCredentialHandler)null);
UserCredentialManager.Instance.SetCredentialHandler(null);
if (this._inputDialog != null)
{
this._inputDialog.Dispose();
this._inputDialog = (ProxySignIn)null;
this._inputDialog = null;
}
base.Dispose();
}
+3 -3
View File
@@ -74,9 +74,9 @@ namespace ZuneUI
public static int GetKeyValueInt(IDictionary dictionary, object key, int defaultValue)
{
num = defaultValue;
if (dictionary == null || !dictionary.Contains(key) || !(dictionary[key] is int num))
;
int num = defaultValue;
if (dictionary != null && dictionary.Contains(key) && dictionary[key] is int val)
num = val;
return num;
}
+2 -1
View File
@@ -24,7 +24,8 @@ namespace ZuneUI
this._gauge.CategorySpaceUsedUpdatedEvent += new CategorySpaceUsedUpdatedHandler(this.OnCategorySpaceUpdated);
this._gauge.ReservedSpaceUpdatedEvent += new ReservedSpaceUpdatedHandler(this.OnReservedSpaceUpdated);
}
if (!(owner is UIDevice uiDevice) && owner is SyncGroupList syncGroupList)
UIDevice uiDevice = owner as UIDevice;
if (uiDevice == null && owner is SyncGroupList syncGroupList)
uiDevice = syncGroupList.Device;
if (uiDevice == null)
return;