Started reimplementing LibraryDataProvider

This commit is contained in:
Yoshi Askharoun
2022-06-19 13:10:44 -05:00
parent df4764307b
commit 3447869d92
8 changed files with 719 additions and 1 deletions
+63
View File
@@ -0,0 +1,63 @@
#if OPENZUNE
using Microsoft.Iris;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Microsoft.Zune.Library
{
internal class LibraryVirtualList : VirtualList, ISearchableList
{
private StrixLibraryDataProviderQuery m_owner;
private ZuneQueryList m_pQueryList;
private string m_itemTypeName;
private object m_itemTypeCookie;
private bool m_autoRefresh;
private bool m_useSlowDataRequests;
private bool m_antialiasImageEdges;
public LibraryVirtualList(StrixLibraryDataProviderQuery owner, ZuneQueryList pQueryList,
bool autoRefresh, bool antialiasEdges)
: base(true)
{
try
{
this.m_owner = owner;
base.StoreQueryResults = true;
this.m_pQueryList = pQueryList;
//pQueryList.AddRef();
//this.m_fBlockChanges = false;
//this.m_fEndBulkArrivedDuringBlock = false;
this.m_antialiasImageEdges = antialiasEdges;
this.m_autoRefresh = autoRefresh;
if (autoRefresh)
{
//this.m_pQueryList.Advise(this);
}
//base.Count = this.m_pQueryList.Count;
Add("Howdy there!");
}
catch
{
base.Dispose(ModelItemDisposeMode.KeepOwnerReference);
throw;
}
}
internal void SetItemTypeCookie(string itemTypeName, object itemTypeCookie)
{
this.m_itemTypeName = itemTypeName;
this.m_itemTypeCookie = itemTypeCookie;
}
public int SearchForString(string searchString)
{
throw new NotImplementedException();
}
}
}
#endif
@@ -0,0 +1,21 @@
#if OPENZUNE
using Microsoft.Iris;
namespace Microsoft.Zune.Library
{
public static class StrixLibraryDataProvider
{
public static void Register()
{
Application.RegisterDataProvider("Library", new DataProviderQueryFactory(ConstructQuery));
}
private static DataProviderQuery ConstructQuery(object queryTypeCookie)
{
return new StrixLibraryDataProviderQuery(queryTypeCookie);
}
}
}
#endif
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,67 @@
#if OPENZUNE
using System;
using System.Runtime.InteropServices;
using Microsoft.Iris;
namespace Microsoft.Zune.Library
{
// Token: 0x02000271 RID: 625
internal class StrixLibraryDataProviderQueryResult : DataProviderObject
{
// Token: 0x06000F6A RID: 3946 RVA: 0x000E90D0 File Offset: 0x000E84D0
public StrixLibraryDataProviderQueryResult(StrixLibraryDataProviderQuery owner, LibraryVirtualList virtualListResultSet, object resultTypeCookie) : base(owner, resultTypeCookie)
{
this.m_virtualListResultSet = virtualListResultSet;
if (virtualListResultSet != null)
{
foreach (DataProviderMapping dataProviderMapping in base.Mappings.Values)
{
if (dataProviderMapping.UnderlyingCollectionTypeCookie != null)
{
this.m_virtualListResultSet.SetItemTypeCookie(dataProviderMapping.UnderlyingCollectionTypeName, dataProviderMapping.UnderlyingCollectionTypeCookie);
}
}
}
}
// Token: 0x06000F6B RID: 3947 RVA: 0x000E9160 File Offset: 0x000E8560
public override object GetProperty(string propertyName)
{
DataProviderMapping dataProviderMapping = null;
if (propertyName == "IsEmpty")
{
return this.m_isEmpty;
}
if (base.Mappings.TryGetValue(propertyName, out dataProviderMapping))
{
return this.m_virtualListResultSet;
}
return null;
}
// Token: 0x06000F6C RID: 3948 RVA: 0x00101710 File Offset: 0x00100B10
public override void SetProperty(string propertyName, object value)
{
throw new NotSupportedException();
}
// Token: 0x06000F6D RID: 3949 RVA: 0x000E91A8 File Offset: 0x000E85A8
public void SetIsEmpty([MarshalAs(UnmanagedType.U1)] bool isEmpty)
{
if (this.m_isEmpty != isEmpty)
{
this.m_isEmpty = isEmpty;
base.FirePropertyChanged("IsEmpty");
}
}
// Token: 0x04000B3C RID: 2876
protected LibraryVirtualList m_virtualListResultSet;
// Token: 0x04000B3D RID: 2877
protected bool m_isEmpty;
}
}
#endif
+26
View File
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Microsoft.Zune.Library
{
public class ZuneQueryList : IDisposable
{
internal ZuneQueryList(EQueryType queryType)
{
}
public bool IsEmpty { get; protected set; }
public bool IsDisposed { get; protected set; }
public int Count { get; protected set; }
public void Dispose()
{
IsDisposed = true;
}
}
}
+2
View File
@@ -25,6 +25,8 @@
<!-- This is the last version of NAudio to support net35 and net6.0 -->
<PackageReference Include="NAudio" Version="1.10.0" />
<ProjectReference Include="..\libs\MicrosoftIris\UIX\UIX.csproj" />
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
@@ -451,7 +451,11 @@ namespace Microsoft.Zune.Shell
DialogHelper.DialogNo = ZuneUI.Shell.LoadString(StringId.IDS_DIALOG_NO);
DialogHelper.DialogOk = ZuneUI.Shell.LoadString(StringId.IDS_DIALOG_OK);
XmlDataProviders.Register();
#if false//OPENZUNE
Library.StrixLibraryDataProvider.Register();
#else
LibraryDataProvider.Register();
#endif
SubscriptionDataProvider.Register();
StaticLibraryDataProvider.Register();
AggregateDataProviderQuery.Register();