Split Service2 into two implementations

This commit is contained in:
Yoshi Askharoun
2022-06-23 23:08:56 -05:00
parent 43f67cbbee
commit 7081c9a32c
10 changed files with 1006 additions and 541 deletions
+497
View File
@@ -0,0 +1,497 @@
using Microsoft.Zune.Util;
using System;
using System.Collections;
using System.Globalization;
using System.Linq;
using System.Text;
using ZuneUI;
namespace Microsoft.Zune.Service
{
internal class CommunityService : IService
{
private bool disposedValue;
public EListType ContentTypeToListType(EContentType contentType)
{
switch (contentType)
{
case EContentType.MusicTrack:
return EListType.eTrackList;
case EContentType.MusicAlbum:
return EListType.eAlbumList;
case EContentType.Video:
return EListType.eVideoList;
case EContentType.Artist:
return EListType.eArtistList;
case EContentType.PodcastEpisode:
return EListType.ePodcastEpisodeList;
case EContentType.PodcastSeries:
return EListType.ePodcastList;
case EContentType.App:
return EListType.eAppList;
case EContentType.Playlist:
return EListType.ePlaylistList;
default:
case EContentType.Unknown:
return EListType.eListInvalid;
}
}
public string GetEndPointUri(EServiceEndpointId eServiceEndpointId)
{
// Allow override from registry, like the internal dogfood version did
string keyName = eServiceEndpointId.ToString().Substring(5) + "Endpoint";
var key = Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Zune\Service");
var keyVal = key?.GetValue(keyName);
if (keyVal is string keyValUri)
return keyValUri;
string uri = null;
string culture = CultureInfo.CurrentCulture.ToString();
switch (eServiceEndpointId)
{
case EServiceEndpointId.SEID_RootCatalog:
uri = "http://catalog.zunes.me/v3.2/" + culture;
break;
case EServiceEndpointId.SEID_RootCatalogSSL:
uri = "https://catalog.zunes.me/v3.2/" + culture;
break;
case EServiceEndpointId.SEID_Stats:
uri = "https://stat.zunes.me";
break;
case EServiceEndpointId.SEID_ImageCatalog:
uri = "https://image.catalog.zunes.me/" + culture;
break;
case EServiceEndpointId.SEID_Comments:
uri = "https://comments.zunes.me";
break;
case EServiceEndpointId.SEID_QuickMixSecure:
uri = "http://mix.zunes.me";
break;
case EServiceEndpointId.SEID_QuickMix:
uri = "https://mix.zunes.me";
break;
case EServiceEndpointId.SEID_Commerce:
case EServiceEndpointId.SEID_CommerceV3:
uri = "https://commerce.zunes.me/v3.2/" + culture;
break;
case EServiceEndpointId.SEID_CommerceV2:
uri = "https://stat.zunes.me/v2.0/" + culture;
break;
case EServiceEndpointId.SEID_WindowsLiveSignup:
uri = "https://login.zunes.me";
break;
case EServiceEndpointId.SEID_WMISEndpoints:
uri = "https://metaservices.zunes.me/endpoints";
break;
case EServiceEndpointId.SEID_WMISRedirEndpoint:
uri = "https://metaservices.zunes.me/redir";
break;
case EServiceEndpointId.SEID_WMISImageEndpoint:
uri = "https://metaservices.zunes.me/image";
break;
case EServiceEndpointId.SEID_Tuners:
uri = "https://tuners.zunes.me/" + culture;
break;
case EServiceEndpointId.SEID_Resources:
uri = "https://resources.zunes.me";
break;
case EServiceEndpointId.SEID_ZuneNet:
uri = "https://zunes.me/" + culture;
break;
case EServiceEndpointId.SEID_Messaging:
uri = "https://messaging.zunes.me";
break;
case EServiceEndpointId.SEID_SocialApi:
uri = "https://socialapi.zunes.me/" + culture;
break;
case EServiceEndpointId.SEID_Forums:
uri = "https://forums.zunes.me/" + culture;
break;
};
return uri ?? Service.GetEndPointUri(eServiceEndpointId);
}
public int AddPaymentInstrument(PaymentInstrument paymentInstrument,
AddPaymentInstrumentCompleteCallback completeCallback,
AddPaymentInstrumentErrorCallback errorCallback)
{
return Service.Instance.AddPaymentInstrument(paymentInstrument, completeCallback, errorCallback);
}
public int AddPaymentInstrument(PaymentInstrument paymentInstrument, out string paymentId, out ServiceError serviceError)
{
return Service.Instance.AddPaymentInstrument(paymentInstrument, out paymentId, out serviceError);
}
public HRESULT AuthenticatePassport(string username, string password, EPassportPolicyId ePassportPolicyId, out PassportIdentity passportIdentity)
{
return Service.Instance.AuthenticatePassport(username, password, ePassportPolicyId, out passportIdentity);
}
public bool BlockExplicitContent()
{
return Service.Instance.BlockExplicitContent();
}
public bool BlockRatedContent(string system, string rating)
{
return Service.Instance.BlockRatedContent(system, rating);
}
public void CancelDownload(Guid guidMediaId, EContentType eContentType)
{
Service.Instance.CancelDownload(guidMediaId, eContentType);
}
public void CancelSignIn()
{
Service.Instance.CancelSignIn();
}
public bool CanDownloadSubscriptionContent()
{
return Service.Instance.CanDownloadSubscriptionContent();
}
public bool CanSignedInUserPostUsageData()
{
return Service.Instance.CanSignedInUserPostUsageData();
}
public bool ClearLastSignedInUser()
{
return Service.Instance.ClearLastSignedInUser();
}
public AppOfferCollection CreateEmptyAppCollection()
{
return Service.Instance.CreateEmptyAppCollection();
}
public bool DeleteSubscriptionDownloads(AsyncCompleteHandler eventHandler)
{
return Service.Instance.DeleteSubscriptionDownloads(eventHandler);
}
public void Download(IList items, EDownloadFlags eDownloadFlags, string deviceEndpointId, EDownloadContextEvent clientContextEvent, string clientContextEventData, DownloadEventHandler eventHandler, DownloadEventProgressHandler progressHandler, EventHandler allPendingHandler)
{
Service.Instance.Download(items, eDownloadFlags, deviceEndpointId, clientContextEvent, clientContextEventData, eventHandler, progressHandler, allPendingHandler);
}
public bool GetAlbumIdFromCompId(string compId, out Guid guidAlbum)
{
return Service.Instance.GetAlbumIdFromCompId(compId, out guidAlbum);
}
public void GetBalances(GetBalancesCompleteCallback completeCallback, GetBalancesErrorCallback errorCallback)
{
Service.Instance.GetBalances(completeCallback, errorCallback);
}
public EContentType GetContentType(string contentTypeStr)
{
return Service.Instance.GetContentType(contentTypeStr);
}
public HRESULT GetContentUri(Guid guidMediaId, EContentType eContentType, EContentUriFlags eContentUriFlags, bool fIsHD, bool fIsRental, out string uriOut)
{
return Service.Instance.GetContentUri(guidMediaId, eContentType, eContentUriFlags, fIsHD, fIsRental, out uriOut);
}
public HRESULT GetContentUri(Guid guidMediaId, EContentType eContentType, EContentUriFlags eContentUriFlags, out string uriOut, out Guid mediaInstanceIdOut)
{
return Service.Instance.GetContentUri(guidMediaId, eContentType, eContentUriFlags, out uriOut, out mediaInstanceIdOut);
}
public HRESULT GetContentUri(Guid guidMediaId, EContentType eContentType, EContentUriFlags eContentUriFlags, EMediaFormat eMediaFormat, EMediaRights eMediaRights, out string uriOut, out Guid mediaInstanceIdOut)
{
throw new NotImplementedException();
//return Service.Instance.GetContentUri(guidMediaId, eContentType, eContentUriFlags, eMediaFormat, eMediaRights, out uriOut, out mediaInstanceIdOut);
}
public CountryBaseDetails[] GetCountryDetails()
{
return Service.Instance.GetCountryDetails();
}
public DRMInfo GetFileDRMInfo(string filePath)
{
return Service.Instance.GetFileDRMInfo(filePath);
}
public bool GetLastSignedInUserGuid(out int iUserId, out Guid guidUserGuid)
{
return Service.Instance.GetLastSignedInUserGuid(out iUserId, out guidUserGuid);
}
public void GetLastSignedInUserSubscriptionState(out bool activeSubscription, out ulong subscriptionId)
{
Service.Instance.GetLastSignedInUserSubscriptionState(out activeSubscription, out subscriptionId);
}
public string GetLocale()
{
return Service.Instance.GetLocale();
}
public string GetMachineId()
{
return Service.Instance.GetMachineId();
}
public DRMInfo GetMediaDRMInfo(Guid mediaId, EContentType eContentType)
{
return Service.Instance.GetMediaDRMInfo(mediaId, eContentType);
}
public EMediaStatus GetMediaStatus(Guid guidMediaId, EContentType eContentType)
{
return Service.Instance.GetMediaStatus(guidMediaId, eContentType);
}
public bool GetMusicVideoIdFromCompId(string compId, out Guid guidMusicVideo)
{
return Service.Instance.GetMusicVideoIdFromCompId(compId, out guidMusicVideo);
}
public HRESULT GetOfferDetails(Guid offerId, GetOfferDetailsCompleteCallback completeCallback, GetOfferDetailsErrorCallback errorCallback, object state)
{
return Service.Instance.GetOfferDetails(offerId, completeCallback, errorCallback, state);
}
public void GetOffers(IList albumGuids, IList trackGuids, IList videoGuids, IList appGuids, IDictionary mapIdToContext, EGetOffersFlags eGetOffersFlags, string deviceEndpointId, GetOffersCompleteCallback completeCallback, GetOffersErrorCallback errorCallback)
{
Service.Instance.GetOffers(albumGuids, trackGuids, videoGuids, appGuids, mapIdToContext, eGetOffersFlags, deviceEndpointId, completeCallback, errorCallback);
}
public ulong GetPassportPuid()
{
return Service.Instance.GetPassportPuid();
}
public string GetPassportTicket(EPassportPolicyId ePassportPolicy)
{
return Service.Instance.GetPassportTicket(ePassportPolicy);
}
public void GetPaymentInstruments(GetPaymentInstrumentsCompleteCallback completeCallback, GetPaymentInstrumentsErrorCallback errorCallback)
{
Service.Instance.GetPaymentInstruments(completeCallback, errorCallback);
}
public IList GetPersistedUsernames()
{
return Service.Instance.GetPersistedUsernames();
}
public string GetPhoneClientType(string strPhoneOsVersion)
{
return Service.Instance.GetPhoneClientType(strPhoneOsVersion);
}
public int GetPointsBalance() => Service.Instance.GetPointsBalance();
public void GetPointsOffers(GetBillingOffersCompleteCallback completeCallback, GetBillingOffersErrorCallback errorCallback)
=> Service.Instance.GetPointsOffers(completeCallback, errorCallback);
public RatingSystemBase[] GetRatingSystems() => Service.Instance.GetRatingSystems();
public int GetRentalTermDays(string strStudio) => Service.Instance.GetRentalTermDays(strStudio);
public int GetRentalTermHours(string strStudio) => Service.Instance.GetRentalTermHours(strStudio);
public uint GetSignedInGeoId() => Service.Instance.GetSignedInGeoId();
public string GetSignedInUsername() => Escargot.Username;
public string GetSignInAtStartupUsername() => Service.Instance.GetSignInAtStartupUsername();
public void GetSubscriptionDetails(ulong offerId, GetBillingOffersCompleteCallback completeCallback, GetBillingOffersErrorCallback errorCallback)
=> Service.Instance.GetSubscriptionDetails(offerId, completeCallback, errorCallback);
public string GetSubscriptionDirectory() => Service.Instance.GetSubscriptionDirectory();
public DateTime GetSubscriptionEndDate() => Service.Instance.GetSubscriptionEndDate();
public int GetSubscriptionFreeTrackBalance() => Service.Instance.GetSubscriptionFreeTrackBalance();
public DateTime GetSubscriptionFreeTrackExpiration() => Service.Instance.GetSubscriptionFreeTrackExpiration();
public ulong GetSubscriptionOfferId() => Service.Instance.GetSubscriptionOfferId();
public void GetSubscriptionOffers(GetBillingOffersCompleteCallback completeCallback, GetBillingOffersErrorCallback errorCallback)
=> Service.Instance.GetSubscriptionOffers(completeCallback, errorCallback);
public ulong GetSubscriptionRenewalOfferId() => Service.Instance.GetSubscriptionRenewalOfferId();
public int GetSubscriptionTrialDuration() => Service.Instance.GetSubscriptionTrialDuration();
public ValueType GetUserGuid() => Service.Instance.GetUserGuid();
public bool GetUserRating(int iUserId, Guid guidMediaId, EContentType eContentType, ref int piRating)
=> Service.Instance.GetUserRating(iUserId, guidMediaId, eContentType, ref piRating);
public string GetWMISEndPointUri(string strEndPointName)
=> Service.Instance.GetWMISEndPointUri(strEndPointName);
public string GetXboxPuid() => Service.Instance.GetXboxPuid();
public string GetXboxTicket() => Service.Instance.GetXboxTicket();
public string GetZuneTag() => Service.Instance.GetZuneTag();
public bool HasSignInBillingViolation() => Service.Instance.HasSignInBillingViolation();
public bool HasSignInLabelTakedown() => Service.Instance.HasSignInLabelTakedown();
public bool InCompleteCollection(Guid guidMediaId, EContentType eContentType, string strDeviceEndpointId)
=> Service.Instance.InCompleteCollection(guidMediaId, eContentType, strDeviceEndpointId);
public bool InCompleteCollection(Guid guidMediaId, EContentType eContentType, out int dbMediaId, out bool fHidden)
=> Service.Instance.InCompleteCollection(guidMediaId, eContentType, out dbMediaId, out fHidden);
public bool InCompleteCollection(Guid guidMediaId, EContentType eContentType, string strDeviceEndpointId, out int dbMediaId, out bool fHidden)
=> Service.Instance.InCompleteCollection(guidMediaId, eContentType, strDeviceEndpointId, out dbMediaId, out fHidden);
public bool InCompleteCollection(Guid guidMediaId, EContentType eContentType)
=> Service.Instance.InCompleteCollection(guidMediaId, eContentType);
public bool InHiddenCollection(Guid guidMediaId, EContentType eContentType)
=> Service.Instance.InHiddenCollection(guidMediaId, eContentType);
public int InitializeWMISEndpointCollection()
=> Service.Instance.InitializeWMISEndpointCollection();
public bool InVisibleCollection(Guid guidMediaId, EContentType eContentType)
=> Service.Instance.InVisibleCollection(guidMediaId, eContentType);
public bool InVisibleCollection(Guid guidMediaId, EContentType eContentType, out int dbMediaId)
=> Service.Instance.InVisibleCollection(guidMediaId, eContentType, out dbMediaId);
public bool IsDownloading(Guid guidMediaId, EContentType eContentType, out bool fIsDownloadPending, out bool fIsHidden)
=> Service.Instance.IsDownloading(guidMediaId, eContentType, out fIsDownloadPending, out fIsHidden);
public bool IsLightWeight() => Service.Instance.IsLightWeight();
public bool IsParentallyControlled() => Service.Instance.IsParentallyControlled();
public bool IsSignedIn() => Escargot.HasToken;
public bool IsSignedInWithSubscription() => Service.Instance.IsSignedInWithSubscription();
public bool IsSigningIn() => Service.Instance.IsSigningIn();
public bool LaunchBrowserForExternalUrl(string strUrl, EPassportPolicyId ePassportPolicy)
=> Service.Instance.LaunchBrowserForExternalUrl(strUrl, ePassportPolicy);
public int Phase3Initialize() => Service.Instance.Phase3Initialize();
public bool PostAppReview(Guid mediaId, string title, string comment, int rating, AsyncCompleteHandler callback)
=> Service.Instance.PostAppReview(mediaId, title, comment, rating, callback);
public int PurchaseBillingOffer(BillingOffer offer, PaymentInstrument paymentInstrument, AsyncCompleteHandler callback)
=> Service.Instance.PurchaseBillingOffer(offer, paymentInstrument, callback);
public int PurchaseBillingOffer(BillingOffer offer, PaymentInstrument paymentInstrument)
=> Service.Instance.PurchaseBillingOffer(offer, paymentInstrument);
public void PurchaseOffers(PaymentInstrument payment, AlbumOfferCollection albumOffers, TrackOfferCollection trackOffers, VideoOfferCollection videoOffers, AppOfferCollection appOffers, EPurchaseOffersFlags ePurchaseOffersFlags, PurchaseOffersCompleteHandler purchaseOffersHandler)
=> Service.Instance.PurchaseOffers(payment, albumOffers, trackOffers, videoOffers, appOffers, ePurchaseOffersFlags, purchaseOffersHandler);
public void RefreshAccount(AsyncCompleteHandler eventHandler) => Service.Instance.RefreshAccount(eventHandler);
public void RegisterForDownloadNotification(DownloadEventHandler eventHandler, DownloadEventProgressHandler progressHandler, EventHandler allPendingHandler)
=> Service.Instance.RegisterForDownloadNotification(eventHandler, progressHandler, allPendingHandler);
public void RemovePersistedUsername(string strUsername)
=> Service.Instance.RemovePersistedUsername(strUsername);
public bool ReportAConcern(EConcernType concernType, EContentType contentType, Guid mediaId, string message, AsyncCompleteHandler callback)
=> Service.Instance.ReportAConcern(concernType, contentType, mediaId, message, callback);
public bool ReportFavouriteArtists(Guid userId, IList artists, AsyncCompleteHandler callback)
=> Service.Instance.ReportFavouriteArtists(userId, artists, callback);
public void ReportStreamingAction(EStreamingActionType eStreamingActionType, Guid guidMediaInstanceId, AsyncCompleteHandler eventHandler)
=> Service.Instance.ReportStreamingAction(eStreamingActionType, guidMediaInstanceId, eventHandler);
public int ResumePurchase(string resumeHandle, string authorizationToken, AsyncCompleteHandler callback)
=> Service.Instance.ResumePurchase(resumeHandle, authorizationToken, callback);
public bool SetLastSignedInUserGuid(ref Guid guidUserGuid, out int iUserId)
=> Service.Instance.SetLastSignedInUserGuid(ref guidUserGuid, out iUserId);
public bool SetUserArtistRating(int iUserId, int iRating, Guid guidArtistMediaId, string strTitle)
=> Service.Instance.SetUserArtistRating(iUserId, iRating, guidArtistMediaId, strTitle);
public bool SetUserTrackRating(int iUserId, int iRating, Guid guidTrackMediaId, Guid guidAlbumMediaId, int iTrackNumber, string strTitle, int msDuration, string strAlbum, string strArtist, string strGenre, string strServiceContext)
=> Service.Instance.SetUserTrackRating(iUserId, iRating, guidTrackMediaId, guidAlbumMediaId, iTrackNumber, strTitle, msDuration, strAlbum, strArtist, strGenre, strServiceContext);
public void SignIn(string strUsername, string strPassword, bool fRememberUsername, bool fRememberPassword, bool fAutomaticallySignInAtStartup, AsyncCompleteHandler eventHandler)
{
bool success = Escargot.TrySignIn(strUsername, strPassword);
if (success && fRememberPassword)
{
Escargot.CacheToken();
}
int hr = success ? 0 : unchecked((int)0x80070057);
eventHandler(hr);
}
public bool SignInAtStartup(string strUsername) => Service.Instance.SignInAtStartup(strUsername);
public bool SignInPasswordRequired(string strUsername)
=> Service.Instance.SignInPasswordRequired(strUsername);
public void SignOut()
{
Escargot.ClearToken();
}
public bool SubscriptionPendingCancel() => Service.Instance.SubscriptionPendingCancel();
public int VerifyToken(string token, out TokenDetails tokenDetails)
=> Service.Instance.VerifyToken(token, out tokenDetails);
protected virtual void Dispose(bool disposing)
{
if (!disposedValue)
{
if (disposing)
{
// TODO: dispose managed state (managed objects)
}
// TODO: free unmanaged resources (unmanaged objects) and override finalizer
// TODO: set large fields to null
disposedValue = true;
}
}
// Override finalizer only if 'Dispose(bool disposing)' has code to free unmanaged resources
~CommunityService()
{
// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
Dispose(disposing: false);
}
public void Dispose()
{
// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
}
}
+109
View File
@@ -0,0 +1,109 @@
using Microsoft.Zune.Util;
using System;
using System.Collections;
using ZuneUI;
namespace Microsoft.Zune.Service
{
public interface IService
{
int AddPaymentInstrument(PaymentInstrument paymentInstrument, AddPaymentInstrumentCompleteCallback completeCallback, AddPaymentInstrumentErrorCallback errorCallback);
int AddPaymentInstrument(PaymentInstrument paymentInstrument, out string paymentId, out ServiceError serviceError);
HRESULT AuthenticatePassport(string username, string password, EPassportPolicyId ePassportPolicyId, out PassportIdentity passportIdentity);
bool BlockExplicitContent();
bool BlockRatedContent(string system, string rating);
void CancelDownload(Guid guidMediaId, EContentType eContentType);
void CancelSignIn();
bool CanDownloadSubscriptionContent();
bool CanSignedInUserPostUsageData();
bool ClearLastSignedInUser();
AppOfferCollection CreateEmptyAppCollection();
bool DeleteSubscriptionDownloads(AsyncCompleteHandler eventHandler);
void Dispose();
void Download(IList items, EDownloadFlags eDownloadFlags, string deviceEndpointId, EDownloadContextEvent clientContextEvent, string clientContextEventData, DownloadEventHandler eventHandler, DownloadEventProgressHandler progressHandler, EventHandler allPendingHandler);
bool GetAlbumIdFromCompId(string compId, out Guid guidAlbum);
void GetBalances(GetBalancesCompleteCallback completeCallback, GetBalancesErrorCallback errorCallback);
EContentType GetContentType(string contentTypeStr);
HRESULT GetContentUri(Guid guidMediaId, EContentType eContentType, EContentUriFlags eContentUriFlags, bool fIsHD, bool fIsRental, out string uriOut);
HRESULT GetContentUri(Guid guidMediaId, EContentType eContentType, EContentUriFlags eContentUriFlags, EMediaFormat eMediaFormat, EMediaRights eMediaRights, out string uriOut, out Guid mediaInstanceIdOut);
HRESULT GetContentUri(Guid guidMediaId, EContentType eContentType, EContentUriFlags eContentUriFlags, out string uriOut, out Guid mediaInstanceIdOut);
CountryBaseDetails[] GetCountryDetails();
string GetEndPointUri(EServiceEndpointId eServiceEndpointId);
DRMInfo GetFileDRMInfo(string filePath);
bool GetLastSignedInUserGuid(out int iUserId, out Guid guidUserGuid);
void GetLastSignedInUserSubscriptionState(out bool activeSubscription, out ulong subscriptionId);
string GetLocale();
string GetMachineId();
DRMInfo GetMediaDRMInfo(Guid mediaId, EContentType eContentType);
EMediaStatus GetMediaStatus(Guid guidMediaId, EContentType eContentType);
bool GetMusicVideoIdFromCompId(string compId, out Guid guidMusicVideo);
HRESULT GetOfferDetails(Guid offerId, GetOfferDetailsCompleteCallback completeCallback, GetOfferDetailsErrorCallback errorCallback, object state);
void GetOffers(IList albumGuids, IList trackGuids, IList videoGuids, IList appGuids, IDictionary mapIdToContext, EGetOffersFlags eGetOffersFlags, string deviceEndpointId, GetOffersCompleteCallback completeCallback, GetOffersErrorCallback errorCallback);
ulong GetPassportPuid();
string GetPassportTicket(EPassportPolicyId ePassportPolicy);
void GetPaymentInstruments(GetPaymentInstrumentsCompleteCallback completeCallback, GetPaymentInstrumentsErrorCallback errorCallback);
IList GetPersistedUsernames();
string GetPhoneClientType(string strPhoneOsVersion);
int GetPointsBalance();
void GetPointsOffers(GetBillingOffersCompleteCallback completeCallback, GetBillingOffersErrorCallback errorCallback);
RatingSystemBase[] GetRatingSystems();
int GetRentalTermDays(string strStudio);
int GetRentalTermHours(string strStudio);
uint GetSignedInGeoId();
string GetSignedInUsername();
string GetSignInAtStartupUsername();
void GetSubscriptionDetails(ulong offerId, GetBillingOffersCompleteCallback completeCallback, GetBillingOffersErrorCallback errorCallback);
string GetSubscriptionDirectory();
DateTime GetSubscriptionEndDate();
int GetSubscriptionFreeTrackBalance();
DateTime GetSubscriptionFreeTrackExpiration();
ulong GetSubscriptionOfferId();
void GetSubscriptionOffers(GetBillingOffersCompleteCallback completeCallback, GetBillingOffersErrorCallback errorCallback);
ulong GetSubscriptionRenewalOfferId();
int GetSubscriptionTrialDuration();
ValueType GetUserGuid();
bool GetUserRating(int iUserId, Guid guidMediaId, EContentType eContentType, ref int piRating);
string GetWMISEndPointUri(string strEndPointName);
string GetXboxPuid();
string GetXboxTicket();
string GetZuneTag();
bool HasSignInBillingViolation();
bool HasSignInLabelTakedown();
bool InCompleteCollection(Guid guidMediaId, EContentType eContentType);
bool InCompleteCollection(Guid guidMediaId, EContentType eContentType, out int dbMediaId, out bool fHidden);
bool InCompleteCollection(Guid guidMediaId, EContentType eContentType, string strDeviceEndpointId);
bool InCompleteCollection(Guid guidMediaId, EContentType eContentType, string strDeviceEndpointId, out int dbMediaId, out bool fHidden);
bool InHiddenCollection(Guid guidMediaId, EContentType eContentType);
int InitializeWMISEndpointCollection();
bool InVisibleCollection(Guid guidMediaId, EContentType eContentType);
bool InVisibleCollection(Guid guidMediaId, EContentType eContentType, out int dbMediaId);
bool IsDownloading(Guid guidMediaId, EContentType eContentType, out bool fIsDownloadPending, out bool fIsHidden);
bool IsLightWeight();
bool IsParentallyControlled();
bool IsSignedIn();
bool IsSignedInWithSubscription();
bool IsSigningIn();
bool LaunchBrowserForExternalUrl(string strUrl, EPassportPolicyId ePassportPolicy);
int Phase3Initialize();
bool PostAppReview(Guid mediaId, string title, string comment, int rating, AsyncCompleteHandler callback);
int PurchaseBillingOffer(BillingOffer offer, PaymentInstrument paymentInstrument);
int PurchaseBillingOffer(BillingOffer offer, PaymentInstrument paymentInstrument, AsyncCompleteHandler callback);
void PurchaseOffers(PaymentInstrument payment, AlbumOfferCollection albumOffers, TrackOfferCollection trackOffers, VideoOfferCollection videoOffers, AppOfferCollection appOffers, EPurchaseOffersFlags ePurchaseOffersFlags, PurchaseOffersCompleteHandler purchaseOffersHandler);
void RefreshAccount(AsyncCompleteHandler eventHandler);
void RegisterForDownloadNotification(DownloadEventHandler eventHandler, DownloadEventProgressHandler progressHandler, EventHandler allPendingHandler);
void RemovePersistedUsername(string strUsername);
bool ReportAConcern(EConcernType concernType, EContentType contentType, Guid mediaId, string message, AsyncCompleteHandler callback);
bool ReportFavouriteArtists(Guid userId, IList artists, AsyncCompleteHandler callback);
void ReportStreamingAction(EStreamingActionType eStreamingActionType, Guid guidMediaInstanceId, AsyncCompleteHandler eventHandler);
int ResumePurchase(string resumeHandle, string authorizationToken, AsyncCompleteHandler callback);
bool SetLastSignedInUserGuid(ref Guid guidUserGuid, out int iUserId);
bool SetUserArtistRating(int iUserId, int iRating, Guid guidArtistMediaId, string strTitle);
bool SetUserTrackRating(int iUserId, int iRating, Guid guidTrackMediaId, Guid guidAlbumMediaId, int iTrackNumber, string strTitle, int msDuration, string strAlbum, string strArtist, string strGenre, string strServiceContext);
void SignIn(string strUsername, string strPassword, bool fRememberUsername, bool fRememberPassword, bool fAutomaticallySignInAtStartup, AsyncCompleteHandler eventHandler);
bool SignInAtStartup(string strUsername);
bool SignInPasswordRequired(string strUsername);
void SignOut();
bool SubscriptionPendingCancel();
int VerifyToken(string token, out TokenDetails tokenDetails);
}
}
+381
View File
@@ -0,0 +1,381 @@
using Microsoft.Zune.Util;
using System;
using System.Collections;
using ZuneUI;
namespace Microsoft.Zune.Service
{
internal class ProxyService : IService
{
private bool disposedValue;
public EListType ContentTypeToListType(EContentType contentType)
=> Service.ContentTypeToListType(contentType);
public string GetEndPointUri(EServiceEndpointId eServiceEndpointId)
=> Service.GetEndPointUri(eServiceEndpointId);
public int AddPaymentInstrument(PaymentInstrument paymentInstrument,
AddPaymentInstrumentCompleteCallback completeCallback,
AddPaymentInstrumentErrorCallback errorCallback)
{
return Service.Instance.AddPaymentInstrument(paymentInstrument, completeCallback, errorCallback);
}
public int AddPaymentInstrument(PaymentInstrument paymentInstrument, out string paymentId, out ServiceError serviceError)
{
return Service.Instance.AddPaymentInstrument(paymentInstrument, out paymentId, out serviceError);
}
public HRESULT AuthenticatePassport(string username, string password, EPassportPolicyId ePassportPolicyId, out PassportIdentity passportIdentity)
{
return Service.Instance.AuthenticatePassport(username, password, ePassportPolicyId, out passportIdentity);
}
public bool BlockExplicitContent()
{
return Service.Instance.BlockExplicitContent();
}
public bool BlockRatedContent(string system, string rating)
{
return Service.Instance.BlockRatedContent(system, rating);
}
public void CancelDownload(Guid guidMediaId, EContentType eContentType)
{
Service.Instance.CancelDownload(guidMediaId, eContentType);
}
public void CancelSignIn()
{
Service.Instance.CancelSignIn();
}
public bool CanDownloadSubscriptionContent()
{
return Service.Instance.CanDownloadSubscriptionContent();
}
public bool CanSignedInUserPostUsageData()
{
return Service.Instance.CanSignedInUserPostUsageData();
}
public bool ClearLastSignedInUser()
{
return Service.Instance.ClearLastSignedInUser();
}
public AppOfferCollection CreateEmptyAppCollection()
{
return Service.Instance.CreateEmptyAppCollection();
}
public bool DeleteSubscriptionDownloads(AsyncCompleteHandler eventHandler)
{
return Service.Instance.DeleteSubscriptionDownloads(eventHandler);
}
public void Download(IList items, EDownloadFlags eDownloadFlags, string deviceEndpointId, EDownloadContextEvent clientContextEvent, string clientContextEventData, DownloadEventHandler eventHandler, DownloadEventProgressHandler progressHandler, EventHandler allPendingHandler)
{
Service.Instance.Download(items, eDownloadFlags, deviceEndpointId, clientContextEvent, clientContextEventData, eventHandler, progressHandler, allPendingHandler);
}
public bool GetAlbumIdFromCompId(string compId, out Guid guidAlbum)
{
return Service.Instance.GetAlbumIdFromCompId(compId, out guidAlbum);
}
public void GetBalances(GetBalancesCompleteCallback completeCallback, GetBalancesErrorCallback errorCallback)
{
Service.Instance.GetBalances(completeCallback, errorCallback);
}
public EContentType GetContentType(string contentTypeStr)
{
return Service.Instance.GetContentType(contentTypeStr);
}
public HRESULT GetContentUri(Guid guidMediaId, EContentType eContentType, EContentUriFlags eContentUriFlags, bool fIsHD, bool fIsRental, out string uriOut)
{
return Service.Instance.GetContentUri(guidMediaId, eContentType, eContentUriFlags, fIsHD, fIsRental, out uriOut);
}
public HRESULT GetContentUri(Guid guidMediaId, EContentType eContentType, EContentUriFlags eContentUriFlags, out string uriOut, out Guid mediaInstanceIdOut)
{
return Service.Instance.GetContentUri(guidMediaId, eContentType, eContentUriFlags, out uriOut, out mediaInstanceIdOut);
}
public HRESULT GetContentUri(Guid guidMediaId, EContentType eContentType, EContentUriFlags eContentUriFlags, EMediaFormat eMediaFormat, EMediaRights eMediaRights, out string uriOut, out Guid mediaInstanceIdOut)
{
throw new NotImplementedException();
//return Service.Instance.GetContentUri(guidMediaId, eContentType, eContentUriFlags, eMediaFormat, eMediaRights, out uriOut, out mediaInstanceIdOut);
}
public CountryBaseDetails[] GetCountryDetails()
{
return Service.Instance.GetCountryDetails();
}
public DRMInfo GetFileDRMInfo(string filePath)
{
return Service.Instance.GetFileDRMInfo(filePath);
}
public bool GetLastSignedInUserGuid(out int iUserId, out Guid guidUserGuid)
{
return Service.Instance.GetLastSignedInUserGuid(out iUserId, out guidUserGuid);
}
public void GetLastSignedInUserSubscriptionState(out bool activeSubscription, out ulong subscriptionId)
{
Service.Instance.GetLastSignedInUserSubscriptionState(out activeSubscription, out subscriptionId);
}
public string GetLocale()
{
return Service.Instance.GetLocale();
}
public string GetMachineId()
{
return Service.Instance.GetMachineId();
}
public DRMInfo GetMediaDRMInfo(Guid mediaId, EContentType eContentType)
{
return Service.Instance.GetMediaDRMInfo(mediaId, eContentType);
}
public EMediaStatus GetMediaStatus(Guid guidMediaId, EContentType eContentType)
{
return Service.Instance.GetMediaStatus(guidMediaId, eContentType);
}
public bool GetMusicVideoIdFromCompId(string compId, out Guid guidMusicVideo)
{
return Service.Instance.GetMusicVideoIdFromCompId(compId, out guidMusicVideo);
}
public HRESULT GetOfferDetails(Guid offerId, GetOfferDetailsCompleteCallback completeCallback, GetOfferDetailsErrorCallback errorCallback, object state)
{
return Service.Instance.GetOfferDetails(offerId, completeCallback, errorCallback, state);
}
public void GetOffers(IList albumGuids, IList trackGuids, IList videoGuids, IList appGuids, IDictionary mapIdToContext, EGetOffersFlags eGetOffersFlags, string deviceEndpointId, GetOffersCompleteCallback completeCallback, GetOffersErrorCallback errorCallback)
{
Service.Instance.GetOffers(albumGuids, trackGuids, videoGuids, appGuids, mapIdToContext, eGetOffersFlags, deviceEndpointId, completeCallback, errorCallback);
}
public ulong GetPassportPuid()
{
return Service.Instance.GetPassportPuid();
}
public string GetPassportTicket(EPassportPolicyId ePassportPolicy)
{
return Service.Instance.GetPassportTicket(ePassportPolicy);
}
public void GetPaymentInstruments(GetPaymentInstrumentsCompleteCallback completeCallback, GetPaymentInstrumentsErrorCallback errorCallback)
{
Service.Instance.GetPaymentInstruments(completeCallback, errorCallback);
}
public IList GetPersistedUsernames()
{
return Service.Instance.GetPersistedUsernames();
}
public string GetPhoneClientType(string strPhoneOsVersion)
{
return Service.Instance.GetPhoneClientType(strPhoneOsVersion);
}
public int GetPointsBalance() => Service.Instance.GetPointsBalance();
public void GetPointsOffers(GetBillingOffersCompleteCallback completeCallback, GetBillingOffersErrorCallback errorCallback)
=> Service.Instance.GetPointsOffers(completeCallback, errorCallback);
public RatingSystemBase[] GetRatingSystems() => Service.Instance.GetRatingSystems();
public int GetRentalTermDays(string strStudio) => Service.Instance.GetRentalTermDays(strStudio);
public int GetRentalTermHours(string strStudio) => Service.Instance.GetRentalTermHours(strStudio);
public uint GetSignedInGeoId() => Service.Instance.GetSignedInGeoId();
public string GetSignedInUsername() => Service.Instance.GetSignedInUsername();
public string GetSignInAtStartupUsername() => Service.Instance.GetSignInAtStartupUsername();
public void GetSubscriptionDetails(ulong offerId, GetBillingOffersCompleteCallback completeCallback, GetBillingOffersErrorCallback errorCallback)
=> Service.Instance.GetSubscriptionDetails(offerId, completeCallback, errorCallback);
public string GetSubscriptionDirectory() => Service.Instance.GetSubscriptionDirectory();
public DateTime GetSubscriptionEndDate() => Service.Instance.GetSubscriptionEndDate();
public int GetSubscriptionFreeTrackBalance() => Service.Instance.GetSubscriptionFreeTrackBalance();
public DateTime GetSubscriptionFreeTrackExpiration() => Service.Instance.GetSubscriptionFreeTrackExpiration();
public ulong GetSubscriptionOfferId() => Service.Instance.GetSubscriptionOfferId();
public void GetSubscriptionOffers(GetBillingOffersCompleteCallback completeCallback, GetBillingOffersErrorCallback errorCallback)
=> Service.Instance.GetSubscriptionOffers(completeCallback, errorCallback);
public ulong GetSubscriptionRenewalOfferId() => Service.Instance.GetSubscriptionRenewalOfferId();
public int GetSubscriptionTrialDuration() => Service.Instance.GetSubscriptionTrialDuration();
public ValueType GetUserGuid() => Service.Instance.GetUserGuid();
public bool GetUserRating(int iUserId, Guid guidMediaId, EContentType eContentType, ref int piRating)
=> Service.Instance.GetUserRating(iUserId, guidMediaId, eContentType, ref piRating);
public string GetWMISEndPointUri(string strEndPointName)
=> Service.Instance.GetWMISEndPointUri(strEndPointName);
public string GetXboxPuid() => Service.Instance.GetXboxPuid();
public string GetXboxTicket() => Service.Instance.GetXboxTicket();
public string GetZuneTag() => Service.Instance.GetZuneTag();
public bool HasSignInBillingViolation() => Service.Instance.HasSignInBillingViolation();
public bool HasSignInLabelTakedown() => Service.Instance.HasSignInLabelTakedown();
public bool InCompleteCollection(Guid guidMediaId, EContentType eContentType, string strDeviceEndpointId)
=> Service.Instance.InCompleteCollection(guidMediaId, eContentType, strDeviceEndpointId);
public bool InCompleteCollection(Guid guidMediaId, EContentType eContentType, out int dbMediaId, out bool fHidden)
=> Service.Instance.InCompleteCollection(guidMediaId, eContentType, out dbMediaId, out fHidden);
public bool InCompleteCollection(Guid guidMediaId, EContentType eContentType, string strDeviceEndpointId, out int dbMediaId, out bool fHidden)
=> Service.Instance.InCompleteCollection(guidMediaId, eContentType, strDeviceEndpointId, out dbMediaId, out fHidden);
public bool InCompleteCollection(Guid guidMediaId, EContentType eContentType)
=> Service.Instance.InCompleteCollection(guidMediaId, eContentType);
public bool InHiddenCollection(Guid guidMediaId, EContentType eContentType)
=> Service.Instance.InHiddenCollection(guidMediaId, eContentType);
public int InitializeWMISEndpointCollection()
=> Service.Instance.InitializeWMISEndpointCollection();
public bool InVisibleCollection(Guid guidMediaId, EContentType eContentType)
=> Service.Instance.InVisibleCollection(guidMediaId, eContentType);
public bool InVisibleCollection(Guid guidMediaId, EContentType eContentType, out int dbMediaId)
=> Service.Instance.InVisibleCollection(guidMediaId, eContentType, out dbMediaId);
public bool IsDownloading(Guid guidMediaId, EContentType eContentType, out bool fIsDownloadPending, out bool fIsHidden)
=> Service.Instance.IsDownloading(guidMediaId, eContentType, out fIsDownloadPending, out fIsHidden);
public bool IsLightWeight() => Service.Instance.IsLightWeight();
public bool IsParentallyControlled() => Service.Instance.IsParentallyControlled();
public bool IsSignedIn() => Service.Instance.IsSignedIn();
public bool IsSignedInWithSubscription() => Service.Instance.IsSignedInWithSubscription();
public bool IsSigningIn() => Service.Instance.IsSigningIn();
public bool LaunchBrowserForExternalUrl(string strUrl, EPassportPolicyId ePassportPolicy)
=> Service.Instance.LaunchBrowserForExternalUrl(strUrl, ePassportPolicy);
public int Phase3Initialize() => Service.Instance.Phase3Initialize();
public bool PostAppReview(Guid mediaId, string title, string comment, int rating, AsyncCompleteHandler callback)
=> Service.Instance.PostAppReview(mediaId, title, comment, rating, callback);
public int PurchaseBillingOffer(BillingOffer offer, PaymentInstrument paymentInstrument, AsyncCompleteHandler callback)
=> Service.Instance.PurchaseBillingOffer(offer, paymentInstrument, callback);
public int PurchaseBillingOffer(BillingOffer offer, PaymentInstrument paymentInstrument)
=> Service.Instance.PurchaseBillingOffer(offer, paymentInstrument);
public void PurchaseOffers(PaymentInstrument payment, AlbumOfferCollection albumOffers, TrackOfferCollection trackOffers, VideoOfferCollection videoOffers, AppOfferCollection appOffers, EPurchaseOffersFlags ePurchaseOffersFlags, PurchaseOffersCompleteHandler purchaseOffersHandler)
=> Service.Instance.PurchaseOffers(payment, albumOffers, trackOffers, videoOffers, appOffers, ePurchaseOffersFlags, purchaseOffersHandler);
public void RefreshAccount(AsyncCompleteHandler eventHandler) => Service.Instance.RefreshAccount(eventHandler);
public void RegisterForDownloadNotification(DownloadEventHandler eventHandler, DownloadEventProgressHandler progressHandler, EventHandler allPendingHandler)
=> Service.Instance.RegisterForDownloadNotification(eventHandler, progressHandler, allPendingHandler);
public void RemovePersistedUsername(string strUsername)
=> Service.Instance.RemovePersistedUsername(strUsername);
public bool ReportAConcern(EConcernType concernType, EContentType contentType, Guid mediaId, string message, AsyncCompleteHandler callback)
=> Service.Instance.ReportAConcern(concernType, contentType, mediaId, message, callback);
public bool ReportFavouriteArtists(Guid userId, IList artists, AsyncCompleteHandler callback)
=> Service.Instance.ReportFavouriteArtists(userId, artists, callback);
public void ReportStreamingAction(EStreamingActionType eStreamingActionType, Guid guidMediaInstanceId, AsyncCompleteHandler eventHandler)
=> Service.Instance.ReportStreamingAction(eStreamingActionType, guidMediaInstanceId, eventHandler);
public int ResumePurchase(string resumeHandle, string authorizationToken, AsyncCompleteHandler callback)
=> Service.Instance.ResumePurchase(resumeHandle, authorizationToken, callback);
public bool SetLastSignedInUserGuid(ref Guid guidUserGuid, out int iUserId)
=> Service.Instance.SetLastSignedInUserGuid(ref guidUserGuid, out iUserId);
public bool SetUserArtistRating(int iUserId, int iRating, Guid guidArtistMediaId, string strTitle)
=> Service.Instance.SetUserArtistRating(iUserId, iRating, guidArtistMediaId, strTitle);
public bool SetUserTrackRating(int iUserId, int iRating, Guid guidTrackMediaId, Guid guidAlbumMediaId, int iTrackNumber, string strTitle, int msDuration, string strAlbum, string strArtist, string strGenre, string strServiceContext)
=> Service.Instance.SetUserTrackRating(iUserId, iRating, guidTrackMediaId, guidAlbumMediaId, iTrackNumber, strTitle, msDuration, strAlbum, strArtist, strGenre, strServiceContext);
public void SignIn(string strUsername, string strPassword, bool fRememberUsername, bool fRememberPassword, bool fAutomaticallySignInAtStartup, AsyncCompleteHandler eventHandler)
{
Service.Instance.SignIn(strUsername, strPassword, fRememberUsername, fRememberPassword, fAutomaticallySignInAtStartup, eventHandler);
}
public bool SignInAtStartup(string strUsername) => Service.Instance.SignInAtStartup(strUsername);
public bool SignInPasswordRequired(string strUsername)
=> Service.Instance.SignInPasswordRequired(strUsername);
public void SignOut() => Service.Instance.SignOut();
public bool SubscriptionPendingCancel() => Service.Instance.SubscriptionPendingCancel();
public int VerifyToken(string token, out TokenDetails tokenDetails)
=> Service.Instance.VerifyToken(token, out tokenDetails);
protected virtual void Dispose(bool disposing)
{
if (!disposedValue)
{
if (disposing)
{
// TODO: dispose managed state (managed objects)
}
// TODO: free unmanaged resources (unmanaged objects) and override finalizer
// TODO: set large fields to null
disposedValue = true;
}
}
// Override finalizer only if 'Dispose(bool disposing)' has code to free unmanaged resources
~ProxyService()
{
// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
Dispose(disposing: false);
}
public void Dispose()
{
// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
}
}
File diff suppressed because it is too large Load Diff
@@ -67,7 +67,7 @@ namespace Microsoft.Zune.Shell
public static ZuneLibrary ZuneLibrary => _zuneLibrary; public static ZuneLibrary ZuneLibrary => _zuneLibrary;
public static Service.Service Service => Zune.Service.Service.Instance; public static Service.Service Service => Zune.Service.Service.Instance;
public static Service.Service2 Service2 => Zune.Service.Service2.Instance; public static IService Service2 => Zune.Service.Service2.Instance;
#if OPENZUNE #if OPENZUNE
public static IStrixDataRoot DataRoot { get; private set; } public static IStrixDataRoot DataRoot { get; private set; }
@@ -189,7 +189,7 @@ namespace Microsoft.Zune.Shell
if (hasTracks) if (hasTracks)
{ {
var track = tracks[0]; var track = tracks[0];
await track.PlayArtistCollectionAsync(); //await track.PlayArtistCollectionAsync();
//await PlaybackHandler.PlayAsync(track, dataRoot.Library, track); //await PlaybackHandler.PlayAsync(track, dataRoot.Library, track);
} }
}); });
+3 -2
View File
@@ -40,7 +40,7 @@ namespace ZuneUI
public bool Send(Attachment attachment) public bool Send(Attachment attachment)
{ {
string endPointUri = Microsoft.Zune.Service.Service2.GetEndPointUri(Microsoft.Zune.Service.EServiceEndpointId.SEID_Messaging); string endPointUri = Microsoft.Zune.Shell.ZuneApplication.Service2.GetEndPointUri(Microsoft.Zune.Service.EServiceEndpointId.SEID_Messaging);
string zuneTag = SignIn.Instance.ZuneTag; string zuneTag = SignIn.Instance.ZuneTag;
Uri.EscapeDataString(","); Uri.EscapeDataString(",");
string errorMessage = null; string errorMessage = null;
@@ -211,7 +211,8 @@ namespace ZuneUI
{ {
if (string.IsNullOrEmpty(zuneTagOrGuid)) if (string.IsNullOrEmpty(zuneTagOrGuid))
return null; return null;
string endPointUri = Microsoft.Zune.Service.Service2.GetEndPointUri(operation == "comments" ? Microsoft.Zune.Service.EServiceEndpointId.SEID_Comments : Microsoft.Zune.Service.EServiceEndpointId.SEID_SocialApi); string endPointUri = Microsoft.Zune.Shell.ZuneApplication.Service2.GetEndPointUri(
operation == "comments" ? Microsoft.Zune.Service.EServiceEndpointId.SEID_Comments : Microsoft.Zune.Service.EServiceEndpointId.SEID_SocialApi);
if (string.IsNullOrEmpty(endPointUri)) if (string.IsNullOrEmpty(endPointUri))
return null; return null;
zuneTagOrGuid = Uri.EscapeUriString(zuneTagOrGuid); zuneTagOrGuid = Uri.EscapeUriString(zuneTagOrGuid);
+1 -1
View File
@@ -30,7 +30,7 @@ namespace ZuneUI
private static string GetViewUri(string id, string type) private static string GetViewUri(string id, string type)
{ {
string endPointUri = Microsoft.Zune.Service.Service2.GetEndPointUri(Microsoft.Zune.Service.EServiceEndpointId.SEID_Lynx); string endPointUri = Microsoft.Zune.Shell.ZuneApplication.Service2.GetEndPointUri(Microsoft.Zune.Service.EServiceEndpointId.SEID_Lynx);
string str = FeatureEnablement.IsFeatureEnabled(Features.eSocial) ? "View" : "ViewUnsupportedMarket"; string str = FeatureEnablement.IsFeatureEnabled(Features.eSocial) ? "View" : "ViewUnsupportedMarket";
return "Web\\" + UrlHelper.MakeUrlEx(endPointUri + "/redirect", nameof(type), type, nameof(id), id, "target", "web", "action", str); return "Web\\" + UrlHelper.MakeUrlEx(endPointUri + "/redirect", nameof(type), type, nameof(id), id, "target", "web", "action", str);
} }
@@ -29,7 +29,7 @@ namespace ZuneXml
string property1 = (string)this.Query.GetProperty("Prefix"); string property1 = (string)this.Query.GetProperty("Prefix");
if (!Search.Instance.IsValidKeyword(property1)) if (!Search.Instance.IsValidKeyword(property1))
return null; return null;
string endPointUri = Microsoft.Zune.Service.Service2.GetEndPointUri(this._endPoint); string endPointUri = Microsoft.Zune.Shell.ZuneApplication.Service2.GetEndPointUri(this._endPoint);
StringBuilder stringBuilder = new StringBuilder(128); StringBuilder stringBuilder = new StringBuilder(128);
stringBuilder.Append(endPointUri); stringBuilder.Append(endPointUri);
stringBuilder.Append("/?prefix="); stringBuilder.Append("/?prefix=");
@@ -30,7 +30,7 @@ namespace ZuneXml
string property2 = (string)this.Query.GetProperty("Keywords"); string property2 = (string)this.Query.GetProperty("Keywords");
if (string.IsNullOrEmpty(property1) || string.IsNullOrEmpty(property2)) if (string.IsNullOrEmpty(property1) || string.IsNullOrEmpty(property2))
return null; return null;
string endPointUri = Microsoft.Zune.Service.Service2.GetEndPointUri(this._endPoint); string endPointUri = ZuneApplication.Service2.GetEndPointUri(this._endPoint);
StringBuilder stringBuilder = new StringBuilder(128); StringBuilder stringBuilder = new StringBuilder(128);
stringBuilder.Append(endPointUri); stringBuilder.Append(endPointUri);
stringBuilder.Append("/"); stringBuilder.Append("/");
@@ -65,7 +65,7 @@ namespace ZuneXml
string representation = (string)this.Query.GetProperty("Representation"); string representation = (string)this.Query.GetProperty("Representation");
if (this.RequireResource && resourceType == null || this.RequireRepresentation && representation == null) if (this.RequireResource && resourceType == null || this.RequireRepresentation && representation == null)
return null; return null;
string endPointUri = Service2.GetEndPointUri(this._endPoint); string endPointUri = ZuneApplication.Service2.GetEndPointUri(this._endPoint);
requestUri.Append(endPointUri); requestUri.Append(endPointUri);
requestUri.Append("/"); requestUri.Append("/");
if (!string.IsNullOrEmpty(resourceType)) if (!string.IsNullOrEmpty(resourceType))