Add project files.

This commit is contained in:
Joshua Askharoun
2021-02-21 21:52:41 -06:00
parent 9b83770356
commit ba52467ed7
826 changed files with 79224 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security.Permissions;
[assembly: AssemblyCompany("Microsoft Corporation")]
//[assembly: AssemblyKeyFile("e:\\temp\\471135\\public.amd64fre\\internal\\strongnamekeys\\fake\\36MSApp1024.snk")]
[assembly: ComVisible(false)]
[assembly: AssemblyProduct("Microsoft (R) Windows (R) Operating System")]
[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("4.8.2345.0")]
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyVersion("4.7.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
+66
View File
@@ -0,0 +1,66 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.MemoryFonts
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
using System;
using System.Runtime.InteropServices;
namespace Microsoft.Zune
{
internal class MemoryFonts
{
public const uint LOAD_LIBRARY_AS_DATAFILE = 2;
public const int RT_DATA = 10;
public static bool TryLoadFromResource(string resourceDllName, string fontResourceName)
{
IntPtr instanceHandle = IntPtr.Zero;
try
{
instanceHandle = MemoryFonts.LoadLibraryEx(resourceDllName, IntPtr.Zero, 2U);
if (instanceHandle == IntPtr.Zero)
return false;
IntPtr resource = MemoryFonts.FindResource(instanceHandle, fontResourceName, (IntPtr)10);
if (resource == IntPtr.Zero)
return false;
IntPtr resourceHandle = MemoryFonts.LoadResource(instanceHandle, resource);
return !(resourceHandle == IntPtr.Zero) && !(MemoryFonts.AddFontMemResourceEx(MemoryFonts.LockResource(resourceHandle), MemoryFonts.SizeofResource(instanceHandle, resource), IntPtr.Zero, out uint _) == IntPtr.Zero);
}
finally
{
if (instanceHandle != IntPtr.Zero)
MemoryFonts.FreeLibrary(instanceHandle);
}
}
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr LoadLibraryEx(string moduleName, IntPtr reserved, uint flags);
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern bool FreeLibrary(IntPtr instanceHandle);
[DllImport("kernel32.dll", EntryPoint = "FindResourceW", CharSet = CharSet.Unicode)]
public static extern IntPtr FindResource(
IntPtr instanceHandle,
string resource,
IntPtr type);
[DllImport("kernel32.dll")]
public static extern IntPtr LoadResource(IntPtr instanceHandle, IntPtr resourceHandle);
[DllImport("kernel32.dll")]
public static extern int SizeofResource(IntPtr instanceHandle, IntPtr resourceHandle);
[DllImport("kernel32.dll")]
public static extern IntPtr LockResource(IntPtr resourceHandle);
[DllImport("gdi32.dll")]
public static extern IntPtr AddFontMemResourceEx(
IntPtr fontBuffer,
int fontButtonSize,
IntPtr reserved,
out uint fontsInstalled);
}
}
+16
View File
@@ -0,0 +1,16 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.PerfTrace.ActionType
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
namespace Microsoft.Zune.PerfTrace
{
internal static class ActionType
{
internal const byte Info = 0;
internal const byte StartEvent = 1;
internal const byte EndEvent = 2;
internal const byte Checkpoint = 8;
}
}
File diff suppressed because it is too large Load Diff
+91
View File
@@ -0,0 +1,91 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.PerfTrace.PerfTrace
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
using System;
namespace Microsoft.Zune.PerfTrace
{
public sealed class PerfTrace
{
private static readonly EtwTraceProvider _EventProvider;
internal static readonly Guid ZUNE_ETW_CONTROL_GUID = new Guid(1496399467U, (ushort)53017, (ushort)20072, (byte)142, (byte)243, (byte)135, (byte)107, (byte)12, (byte)8, (byte)232, (byte)1);
internal static readonly Guid PERFTRACE_LAUNCHEVENT_GUID = new Guid(1815200785, (short)23272, (short)18087, (byte)190, (byte)166, (byte)76, (byte)236, (byte)117, (byte)51, (byte)196, (byte)218);
internal static readonly Guid PerftraceUICollectionGuid = new Guid(235915657U, (ushort)37778, (ushort)18043, (byte)146, (byte)252, (byte)128, (byte)212, (byte)193, (byte)153, (byte)154, (byte)151);
private PerfTrace()
{
}
static PerfTrace() => Microsoft.Zune.PerfTrace.PerfTrace._EventProvider = new EtwTraceProvider(Microsoft.Zune.PerfTrace.PerfTrace.ZUNE_ETW_CONTROL_GUID, "SOFTWARE\\Microsoft\\Zune");
internal static bool IsEnabled(
EtwTraceProvider provider,
Microsoft.Zune.PerfTrace.PerfTrace.Flags flag,
Microsoft.Zune.PerfTrace.PerfTrace.Level level)
{
return (uint)level <= (uint)provider.Level && provider.IsEnabled && (flag & (Microsoft.Zune.PerfTrace.PerfTrace.Flags)provider.Flags) > ~Microsoft.Zune.PerfTrace.PerfTrace.Flags.All;
}
internal static bool IsEnabled(Microsoft.Zune.PerfTrace.PerfTrace.Flags flags, Microsoft.Zune.PerfTrace.PerfTrace.Level level) => Microsoft.Zune.PerfTrace.PerfTrace.IsEnabled(Microsoft.Zune.PerfTrace.PerfTrace._EventProvider, flags, level);
internal static bool IsEnabled(Microsoft.Zune.PerfTrace.PerfTrace.Flags flags) => Microsoft.Zune.PerfTrace.PerfTrace.IsEnabled(Microsoft.Zune.PerfTrace.PerfTrace._EventProvider, flags, Microsoft.Zune.PerfTrace.PerfTrace.Level.Normal);
public static void PERFTRACE_LAUNCHEVENT(Microsoft.Zune.PerfTrace.PerfTrace.LAUNCH_EVENT launchEvent, uint data)
{
if (!Microsoft.Zune.PerfTrace.PerfTrace.IsEnabled(Microsoft.Zune.PerfTrace.PerfTrace.Flags.Launch, Microsoft.Zune.PerfTrace.PerfTrace.Level.Normal))
return;
Microsoft.Zune.PerfTrace.PerfTrace._EventProvider.TraceEvent((byte)4, Microsoft.Zune.PerfTrace.PerfTrace.PERFTRACE_LAUNCHEVENT_GUID, (byte)launchEvent, (object)data);
}
public static void TraceUICollectionEvent(UICollectionEvent traceEvent, string eventDetail)
{
if (!Microsoft.Zune.PerfTrace.PerfTrace.IsEnabled(Microsoft.Zune.PerfTrace.PerfTrace.Flags.Collection, Microsoft.Zune.PerfTrace.PerfTrace.Level.Normal))
return;
Microsoft.Zune.PerfTrace.PerfTrace._EventProvider.TraceEvent((byte)4, Microsoft.Zune.PerfTrace.PerfTrace.PerftraceUICollectionGuid, (byte)traceEvent, (object)eventDetail);
}
[System.Flags]
internal enum Flags : uint
{
DB_Mutex = 1,
Launch = 2,
QRS = 4,
Collection = 16, // 0x00000010
All = 4294967295, // 0xFFFFFFFF
}
internal enum Level : byte
{
Fatal = 1,
Error = 2,
Warning = 3,
Normal = 4,
Verbose = 5,
}
internal enum Tag
{
COMPONENT1 = 1129270577, // 0x434F4D31
COMPONENT2 = 1129270578, // 0x434F4D32
}
public enum LAUNCH_EVENT
{
LAUNCHER_AT_WINMAIN = 1,
WINMAIN_ABOUT_TO_LAUNCH = 2,
START_PHASE2_INIT = 3,
END_PHASE2_INIT = 4,
ZUNENATIVELIB_STARTUP = 5,
LAUNCHING_MANAGED_APP = 6,
IN_MANAGED_LAUNCH = 7,
REQUEST_UI_LOAD = 8,
REQUEST_UI_LOAD_COMPLETE = 9,
QUERYDB_BEGIN = 10, // 0x0000000A
QUERYDB_END = 11, // 0x0000000B
DEVICE_CONNECTED = 12, // 0x0000000C
}
}
}
@@ -0,0 +1,50 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.PerfTrace.UICollectionEvent
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
namespace Microsoft.Zune.PerfTrace
{
public enum UICollectionEvent
{
LibraryQueryIssued = 1,
LibraryQueryResultsAvailable = 2,
LibraryQueryResultsVisible = 3,
MusicLibraryViewCommandInvoked = 4,
DeviceIconItemDropped = 5,
SearchQueryIssued = 6,
SearchQueryResultsAvailable = 7,
SearchQueryResultsVisible = 8,
MarketplaceQueriesIssued = 9,
MarketplaceQueriesResultsAvailable = 10, // 0x0000000A
MarketplaceQueriesResultsVisible = 11, // 0x0000000B
PlayRequestIssued = 12, // 0x0000000C
PlayRequestComplete = 13, // 0x0000000D
BulkEventsPushBegin = 14, // 0x0000000E
BulkEventsPushEnd = 15, // 0x0000000F
RecommendationQueriesIssued = 16, // 0x00000010
RecommendationQueriesResultsAvailable = 17, // 0x00000011
RecommendationQueriesResultsVisible = 18, // 0x00000012
SocialQueriesIssued = 19, // 0x00000013
SocialQueriesResultsAvailable = 20, // 0x00000014
SocialQueriesResultsVisible = 21, // 0x00000015
MixQueriesIssued = 22, // 0x00000016
MixQueriesResultsAvailable = 23, // 0x00000017
MixQueriesResultsVisible = 24, // 0x00000018
QuickplayQueriesIssued = 25, // 0x00000019
QuickplayQueriesResultsAvailable = 26, // 0x0000001A
QuickplayQueriesResultsVisible = 27, // 0x0000001B
DataProviderQueryBegin = 28, // 0x0000001C
DataProviderQueryComplete = 29, // 0x0000001D
QuickMixBegin = 30, // 0x0000001E
QuickMixUpdate = 31, // 0x0000001F
QuickMixComplete = 32, // 0x00000020
MarketplaceSearchResultArtistClicked = 33, // 0x00000021
SearchHintCollectionQueryArtistBegin = 34, // 0x00000022
SearchHintCollectionQueryArtistComplete = 35, // 0x00000023
SearchHintMarketplaceQueryPrefixBegin = 36, // 0x00000024
SearchHintMarketplaceQueryPrefixComplete = 37, // 0x00000025
SyncStatusVisible = 38, // 0x00000026
}
}
@@ -0,0 +1,110 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.Shell.AggregateDataProviderQuery
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
using Microsoft.Iris;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
namespace Microsoft.Zune.Shell
{
public class AggregateDataProviderQuery : DataProviderQuery
{
private List<DataProviderQuery> _currentQueries = new List<DataProviderQuery>();
internal static void Register() => Application.RegisterDataProvider("Aggregate", new DataProviderQueryFactory(AggregateDataProviderQuery.ConstructAggregateDataProviderQuery));
internal static DataProviderQuery ConstructAggregateDataProviderQuery(
object queryTypeCookie)
{
return (DataProviderQuery)new AggregateDataProviderQuery(queryTypeCookie);
}
protected AggregateDataProviderQuery(object queryTypeCookie)
: base(queryTypeCookie)
{
}
protected override void BeginExecute()
{
this.InitializeCurrentQueries();
this.RefreshCurrentQueries();
}
private void InitializeCurrentQueries()
{
this.Result = (object)null;
this.UnsubscribeFromCurrentQueries();
this._currentQueries.Clear();
if (this.GetProperty("Queries") is IList property)
{
foreach (object obj in (IEnumerable)property)
{
if (obj is DataProviderQuery dataProviderQuery)
this._currentQueries.Add(dataProviderQuery);
}
}
this.SubscribeToCurrentQueries();
}
private void RefreshCurrentQueries()
{
foreach (DataProviderQuery currentQuery in this._currentQueries)
currentQuery.Refresh();
}
private void SubscribeToCurrentQueries()
{
foreach (DataProviderQuery currentQuery in this._currentQueries)
currentQuery.PropertyChanged += new PropertyChangedEventHandler(this.OnQueryPropertyChanged);
}
private void UnsubscribeFromCurrentQueries()
{
foreach (DataProviderQuery currentQuery in this._currentQueries)
currentQuery.PropertyChanged -= new PropertyChangedEventHandler(this.OnQueryPropertyChanged);
}
private void OnQueryPropertyChanged(object sender, PropertyChangedEventArgs args)
{
if (!("Status" == args.PropertyName))
return;
this.UpdateStatusAndResult();
}
private void UpdateStatusAndResult()
{
int num = 0;
bool flag = false;
foreach (DataProviderQuery currentQuery in this._currentQueries)
{
if (DataProviderQueryStatus.Complete == currentQuery.Status || DataProviderQueryStatus.Error == currentQuery.Status)
{
++num;
if (DataProviderQueryStatus.Error == currentQuery.Status)
flag = true;
}
}
if (this._currentQueries.Count == num)
{
this.Status = DataProviderQueryStatus.ProcessingData;
ArrayList arrayList = new ArrayList();
foreach (DataProviderQuery currentQuery in this._currentQueries)
arrayList.Add(currentQuery.Result);
this.Result = (object)arrayList;
this.Status = flag ? DataProviderQueryStatus.Error : DataProviderQueryStatus.Complete;
}
else
this.Status = DataProviderQueryStatus.RequestingData;
}
protected override void OnDispose()
{
this.UnsubscribeFromCurrentQueries();
base.OnDispose();
}
}
}
+13
View File
@@ -0,0 +1,13 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.Shell.CanAddMediaArgs
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
namespace Microsoft.Zune.Shell
{
internal class CanAddMediaArgs
{
public bool Aborted;
}
}
@@ -0,0 +1,53 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.Shell.CommandLineArgument
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
using System;
using System.Collections.Generic;
using System.Globalization;
namespace Microsoft.Zune.Shell
{
internal struct CommandLineArgument
{
public string Name;
public string Value;
public CommandLineArgument(string name, string value)
{
this.Name = name != null ? name.ToLower(CultureInfo.InvariantCulture) : throw new ArgumentNullException(nameof(name));
this.Value = value;
}
public static CommandLineArgument[] ParseArgs(
string[] arArgs,
string stDefaultName)
{
List<CommandLineArgument> commandLineArgumentList = new List<CommandLineArgument>();
foreach (string arArg in arArgs)
{
if (string.IsNullOrEmpty(arArg))
throw new ArgumentException(nameof(arArgs));
string str = (string)null;
string name;
if (arArg[0] == '-' || arArg[0] == '/')
name = arArg.Substring(1, arArg.Length - 1);
else if (stDefaultName != null)
name = stDefaultName + ":" + arArg;
else
continue;
int length = name.IndexOf(':');
if (length != -1)
{
str = name.Substring(length + 1).Trim('"');
name = name.Substring(0, length);
}
CommandLineArgument commandLineArgument = new CommandLineArgument(name, str);
commandLineArgumentList.Add(commandLineArgument);
}
return commandLineArgumentList.ToArray();
}
}
}
+25
View File
@@ -0,0 +1,25 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.Shell.ILaunchZuneShell
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
using System;
using System.Runtime.InteropServices;
namespace Microsoft.Zune.Shell
{
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("79493c51-2a79-410c-ab77-da1ead887f11")]
[ComImport]
internal interface ILaunchZuneShell
{
IntPtr GetLaunchDelegate(string args, IntPtr hWndSplashScreen);
IntPtr GetRenderWindow();
void ProcessMessageFromCommandLine(string cmdLine);
void SetDesktopLockState(bool locked);
}
}
@@ -0,0 +1,52 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.Shell.InitializationFailsafe
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
using Microsoft.Iris;
using System.Threading;
namespace Microsoft.Zune.Shell
{
internal class InitializationFailsafe
{
private bool _complete;
private DeferredInvokeHandler _onCompleteHandler;
private System.Threading.Timer _failsafeTimer;
public void Initialize(DeferredInvokeHandler onCompleteHandler)
{
if (this._complete)
{
Application.DeferredInvoke(onCompleteHandler, DeferredInvokePriority.Low);
}
else
{
int dueTime = 30000;
this._onCompleteHandler = onCompleteHandler;
this._failsafeTimer = new System.Threading.Timer(new TimerCallback(this.FailsafeCallback), (object)null, dueTime, -1);
}
}
public void Complete()
{
if (this._complete)
return;
this._complete = true;
if (this._onCompleteHandler != null)
Application.DeferredInvoke(this._onCompleteHandler, DeferredInvokePriority.Low);
if (this._failsafeTimer == null)
return;
this._failsafeTimer.Change(-1, -1);
}
private void FailsafeCallback(object state)
{
if (this._complete)
return;
this._complete = true;
Application.DeferredInvoke(this._onCompleteHandler, DeferredInvokePriority.Low);
}
}
}
+41
View File
@@ -0,0 +1,41 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.Shell.LaunchZuneShell
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
using System;
using System.Runtime.InteropServices;
namespace Microsoft.Zune.Shell
{
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
[Guid("53048eb3-0906-4bd2-890d-48daf1f25413")]
[ComDefaultInterface(typeof(ILaunchZuneShell))]
public sealed class LaunchZuneShell : ILaunchZuneShell
{
private static LaunchZuneShell.LaunchDelegate s_launch;
private static string s_args;
private static IntPtr s_hWndSplashScreen;
[STAThread]
public IntPtr GetLaunchDelegate(string args, IntPtr hWndSplashScreen)
{
LaunchZuneShell.s_args = args;
LaunchZuneShell.s_hWndSplashScreen = hWndSplashScreen;
LaunchZuneShell.s_launch = new LaunchZuneShell.LaunchDelegate(this.LaunchZuneShellHelper);
return Marshal.GetFunctionPointerForDelegate((Delegate)LaunchZuneShell.s_launch);
}
private int LaunchZuneShellHelper() => ZuneApplication.Launch(LaunchZuneShell.s_args, LaunchZuneShell.s_hWndSplashScreen);
public IntPtr GetRenderWindow() => ZuneApplication.GetRenderWindow();
public void ProcessMessageFromCommandLine(string args) => ZuneApplication.ProcessMessageFromCommandLine(args);
public void SetDesktopLockState(bool locked) => ZuneApplication.SetDesktopLockState(locked);
private delegate int LaunchDelegate();
}
}
@@ -0,0 +1,14 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.Shell.SetupInstallContext
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
namespace Microsoft.Zune.Shell
{
public enum SetupInstallContext
{
Zune,
WindowsPhone,
}
}
+151
View File
@@ -0,0 +1,151 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.Shell.StandAlone
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
using Microsoft.Iris;
using Microsoft.Win32;
using Microsoft.Zune.Configuration;
using Microsoft.Zune.Util;
using System;
using System.Collections;
namespace Microsoft.Zune.Shell
{
internal class StandAlone
{
public static Hashtable Startup(string[] args, string defaultCommandLineSwitch)
{
WindowSize windowSize = new WindowSize(1012, 693);
string str = (string)null;
bool flag1 = false;
bool flag2 = false;
Hashtable hashtable = new Hashtable();
bool flag3 = false;
if (args != null)
{
foreach (CommandLineArgument commandLineArgument in CommandLineArgument.ParseArgs(args, defaultCommandLineSwitch))
{
switch (commandLineArgument.Name)
{
case "gdi":
Application.RenderingType = RenderingType.GDI;
flag3 = true;
break;
case "switchtogdi":
ClientConfiguration.GeneralSettings.RenderingType = 0;
break;
case "dx9":
Application.RenderingType = RenderingType.DX9;
flag3 = true;
break;
case "size":
try
{
windowSize = StandAlone.ParseSize(commandLineArgument.Value);
break;
}
catch (FormatException ex)
{
break;
}
catch (ArgumentException ex)
{
break;
}
case "minimized":
flag2 = true;
break;
case "nativeframe":
flag1 = true;
break;
case "animations":
try
{
Application.AnimationsEnabled = bool.Parse(commandLineArgument.Value);
break;
}
catch (FormatException ex)
{
break;
}
default:
hashtable[(object)commandLineArgument.Name] = (object)commandLineArgument.Value;
break;
}
}
}
if (ClientConfiguration.GeneralSettings.UseGDI)
{
ClientConfiguration.GeneralSettings.RenderingType = 0;
ClientConfiguration.GeneralSettings.UseGDI = false;
}
if (!flag3)
{
Application.RenderingType = (RenderingType)ClientConfiguration.GeneralSettings.RenderingType;
Application.RenderingQuality = (RenderingQuality)ClientConfiguration.GeneralSettings.RenderingQuality;
}
if (str != null)
{
if (str == "ltr")
Application.IsRTL = false;
else if (str == "rtl")
Application.IsRTL = true;
}
Application.AnimationsEnabled = ClientConfiguration.GeneralSettings.AnimationsEnabled;
Application.Initialize();
Application.Window.InitialClientSize = windowSize;
object obj = Registry.GetValue(ZuneUI.Shell.SettingsRegistryPath, "WindowPosition", (object)null);
if (obj != null)
{
if (obj is string)
{
try
{
if (!flag2)
Application.Window.SetSavedInitialPosition((string)obj);
else
Application.Window.SetSavedInitialPosition((string)obj, WindowState.Minimized);
}
catch (ArgumentException ex)
{
}
}
}
Application.Window.RespectsStartupSettings = true;
Application.Window.InitialPositionPolicy = WindowPositionPolicy.CenterOnWorkArea | WindowPositionPolicy.ConstrainToWorkArea;
Application.Window.ShowWindowFrame = flag1;
Application.Window.SetBackgroundColor(ZuneUI.Shell.WindowColorFromRGB(ClientConfiguration.Shell.BackgroundColor));
if (!flag2)
Application.DeferredInvoke((DeferredInvokeHandler)delegate
{
Windowing.ForceSetForegroundWindow(Application.Window.Handle);
}, DeferredInvokePriority.Low);
return hashtable;
}
private static WindowSize ParseSize(string argument)
{
int width = 0;
int height = 0;
string[] strArray = argument.Split(',');
if (strArray.Length == 2)
{
width = int.Parse(strArray[0]);
height = int.Parse(strArray[1]);
}
return new WindowSize(width, height);
}
public static void Run(DeferredInvokeHandler initialLoadComplete)
{
Application.Run(initialLoadComplete);
if (TaskbarPlayer.Instance.ToolbarVisible)
return;
Registry.SetValue(ZuneUI.Shell.SettingsRegistryPath, "WindowPosition", (object)Application.Window.GetSavedPosition(true));
}
public static void Shutdown() => Application.Shutdown();
}
}
+45
View File
@@ -0,0 +1,45 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.Shell.TraceSwitches
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
namespace Microsoft.Zune.Shell
{
internal static class TraceSwitches
{
private static ZuneTraceSwitch collectionSwitch;
private static ZuneTraceSwitch shellSwitch;
private static ZuneTraceSwitch dataProviderSwitch;
public static ZuneTraceSwitch CollectionSwitch
{
get
{
if (TraceSwitches.collectionSwitch == null)
TraceSwitches.collectionSwitch = new ZuneTraceSwitch("Collection", "Collection page traces");
return TraceSwitches.collectionSwitch;
}
}
public static ZuneTraceSwitch ShellSwitch
{
get
{
if (TraceSwitches.shellSwitch == null)
TraceSwitches.shellSwitch = new ZuneTraceSwitch("Shell", "Shell traces");
return TraceSwitches.shellSwitch;
}
}
public static ZuneTraceSwitch DataProviderSwitch
{
get
{
if (TraceSwitches.dataProviderSwitch == null)
TraceSwitches.dataProviderSwitch = new ZuneTraceSwitch("DataProvider", "Data provider traces");
return TraceSwitches.dataProviderSwitch;
}
}
}
}
+102
View File
@@ -0,0 +1,102 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.Shell.ViewTimeLogger
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
using Microsoft.Zune.Util;
using System;
namespace Microsoft.Zune.Shell
{
public class ViewTimeLogger
{
private bool _inCompactMode;
private bool _shutdown;
private ViewTimeLogger.LogHelper _compactModeLog = new ViewTimeLogger.LogHelper(SQMDataId.CompactModeViewTime);
private ViewTimeLogger.LogHelper _mixViewLog = new ViewTimeLogger.LogHelper(SQMDataId.MixViewTime);
private ViewTimeLogger.LogHelper _collectionViewLog;
private static ViewTimeLogger _viewTimeLogger;
private ViewTimeLogger()
{
}
public void Shutdown()
{
this._compactModeLog.Stop();
this._mixViewLog.Stop();
if (this._collectionViewLog != null)
this._collectionViewLog.Stop();
this._shutdown = true;
}
public static ViewTimeLogger Instance
{
get
{
if (ViewTimeLogger._viewTimeLogger == null)
ViewTimeLogger._viewTimeLogger = new ViewTimeLogger();
return ViewTimeLogger._viewTimeLogger;
}
}
public void ViewChanged(SQMDataId viewSQMId)
{
if (this._collectionViewLog != null && viewSQMId != this._collectionViewLog.LogId)
{
this._collectionViewLog.Stop();
this._collectionViewLog = (ViewTimeLogger.LogHelper)null;
}
if (viewSQMId == SQMDataId.Invalid || this._collectionViewLog != null)
return;
this._collectionViewLog = new ViewTimeLogger.LogHelper(viewSQMId);
if (this._inCompactMode)
return;
this._collectionViewLog.Start();
}
public void InCompactMode(bool inCompactMode)
{
this._inCompactMode = inCompactMode;
if (this._inCompactMode)
{
this._compactModeLog.Start();
if (this._collectionViewLog == null)
return;
this._collectionViewLog.Stop();
}
else
{
this._compactModeLog.Stop();
if (this._collectionViewLog == null)
return;
this._collectionViewLog.Start();
}
}
public void EnterMixView() => this._mixViewLog.Start();
public void LeaveMixView() => this._mixViewLog.Stop();
private class LogHelper
{
private readonly SQMDataId _logId;
private DateTime _start;
public LogHelper(SQMDataId logId) => this._logId = logId;
public void Start() => this._start = DateTime.Now;
public void Stop()
{
if (!(this._start != DateTime.MinValue))
return;
SQMLog.Log(this._logId, (int)DateTime.Now.Subtract(this._start).TotalSeconds);
this._start = DateTime.MinValue;
}
public SQMDataId LogId => this._logId;
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,35 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.Shell.ZuneShellException
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
using System;
using System.Runtime.Serialization;
namespace Microsoft.Zune.Shell
{
[Serializable]
internal class ZuneShellException : InvalidOperationException
{
private string _context;
public ZuneShellException(string message)
: this(message, (string)null)
{
}
public ZuneShellException(string message, string context)
: base(ZuneShellException.PrepareMessage(message, context))
=> this._context = context;
protected ZuneShellException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
public string Context => this._context;
private static string PrepareMessage(string message, string context) => message;
}
}
+39
View File
@@ -0,0 +1,39 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.Shell.ZuneTraceSwitch
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
using System;
using System.Diagnostics;
namespace Microsoft.Zune.Shell
{
internal class ZuneTraceSwitch : TraceSwitch
{
public ZuneTraceSwitch(string displayName, string description)
: base(displayName, description)
{
}
protected override void OnValueChanged()
{
try
{
this.SwitchSetting = (int)Enum.Parse(typeof(TraceLevel), this.Value, true);
}
catch (ArgumentException ex)
{
this.SwitchSetting = 0;
}
catch (FormatException ex)
{
this.SwitchSetting = 0;
}
catch (OverflowException ex)
{
this.SwitchSetting = 0;
}
}
}
}
+332
View File
@@ -0,0 +1,332 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Zune.Util.SQMLog
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
using System;
using System.Runtime.InteropServices;
using ZuneUI;
namespace Microsoft.Zune.Util
{
public static class SQMLog
{
private static SQMStreamPositionType[] c_rgSPTArrayAllStrings = new SQMStreamPositionType[9]
{
SQMStreamPositionType.sptString,
SQMStreamPositionType.sptString,
SQMStreamPositionType.sptString,
SQMStreamPositionType.sptString,
SQMStreamPositionType.sptString,
SQMStreamPositionType.sptString,
SQMStreamPositionType.sptString,
SQMStreamPositionType.sptString,
SQMStreamPositionType.sptString
};
public static void Log(SQMDataId sqmDataId, int nData)
{
SQMDataPoint dataPoint = SQMLog.FindDataPoint(sqmDataId);
if (dataPoint.id == SQMDataId.Invalid)
return;
switch (dataPoint.action)
{
case SQMAction.Add:
SQMLog.SQMAddWrapper(dataPoint.GetName(), nData);
break;
case SQMAction.Inc:
SQMLog.SQMAddWrapper(dataPoint.GetName(), 1);
break;
case SQMAction.SetFlag:
SQMLog.SQMSetFlagWrapper(dataPoint.GetName(), nData != 0);
break;
case SQMAction.SetBits:
SQMLog.SQMSetBitsWrapper(dataPoint.GetName(), (uint)nData);
break;
default:
throw new ArgumentException("Datapoint " + dataPoint.GetName() + " is not a simple DWORD-type datapoint. Use LogToStream for stream-type datapoints.");
}
Telemetry.Instance.ReportEvent(dataPoint, nData);
}
public static void LogToStream(SQMDataId sqmDataId, params string[] args)
{
SQMDataPoint dataPoint = SQMLog.FindDataPoint(sqmDataId);
if (dataPoint.id == SQMDataId.Invalid)
return;
if (dataPoint.action != SQMAction.MixedStream)
throw new ArgumentException("Datapoint " + dataPoint.GetName() + " is not a MixedStream-type datapoint. Error in parameters/paramtypes, or in datapoint declaration.");
if (args.Length > 9)
throw new ArgumentException("Too many (or too few) number params. SQM only allows up to 9 params. Datapoint: " + dataPoint.GetName(), "args.Length");
if (args.Length != dataPoint.argCount)
throw new ArgumentException("Passed-in arg count doesn't match datapoint declaration: " + dataPoint.GetName(), "args.Length");
if (args.Length == 1)
SQMLog.SQMAddToStream(dataPoint.GetName(), SQMLog.c_rgSPTArrayAllStrings, (uint)args.Length, args[0]);
else if (args.Length == 2)
SQMLog.SQMAddToStream(dataPoint.GetName(), SQMLog.c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1]);
else if (args.Length == 3)
SQMLog.SQMAddToStream(dataPoint.GetName(), SQMLog.c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1], args[2]);
else if (args.Length == 4)
SQMLog.SQMAddToStream(dataPoint.GetName(), SQMLog.c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1], args[2], args[3]);
else if (args.Length == 5)
SQMLog.SQMAddToStream(dataPoint.GetName(), SQMLog.c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1], args[2], args[3], args[4]);
else if (args.Length == 6)
SQMLog.SQMAddToStream(dataPoint.GetName(), SQMLog.c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1], args[2], args[3], args[4], args[5]);
else if (args.Length == 7)
SQMLog.SQMAddToStream(dataPoint.GetName(), SQMLog.c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
else if (args.Length == 8)
{
SQMLog.SQMAddToStream(dataPoint.GetName(), SQMLog.c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
}
else
{
if (args.Length != 9)
return;
SQMLog.SQMAddToStream(dataPoint.GetName(), SQMLog.c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
}
}
public static void LogToStream(SQMDataId sqmDataId, params uint[] args)
{
SQMDataPoint dataPoint = SQMLog.FindDataPoint(sqmDataId);
if (dataPoint.id == SQMDataId.Invalid)
return;
if (dataPoint.action != SQMAction.NumStream)
throw new ArgumentException("Datapoint " + dataPoint.GetName() + " is not a NumStream-type datapoint. Error in parameters or in datapoint declaration.");
if (args.Length < 1 || args.Length > 9)
throw new ArgumentException("Too many (or too few) number params. SQM only allows up to 9 params. Datapoint: " + dataPoint.GetName(), "args.Length");
if (args.Length != dataPoint.argCount)
throw new ArgumentException("Passed-in arg count doesn't match datapoint declaration: " + dataPoint.GetName(), "args.Length");
if (args.Length == 1)
SQMLog.SQMAddNumbersToStream(dataPoint.GetName(), (uint)args.Length, args[0]);
else if (args.Length == 2)
SQMLog.SQMAddNumbersToStream(dataPoint.GetName(), (uint)args.Length, args[0], args[1]);
else if (args.Length == 3)
SQMLog.SQMAddNumbersToStream(dataPoint.GetName(), (uint)args.Length, args[0], args[1], args[2]);
else if (args.Length == 4)
SQMLog.SQMAddNumbersToStream(dataPoint.GetName(), (uint)args.Length, args[0], args[1], args[2], args[3]);
else if (args.Length == 5)
SQMLog.SQMAddNumbersToStream(dataPoint.GetName(), (uint)args.Length, args[0], args[1], args[2], args[3], args[4]);
else if (args.Length == 6)
SQMLog.SQMAddNumbersToStream(dataPoint.GetName(), (uint)args.Length, args[0], args[1], args[2], args[3], args[4], args[5]);
else if (args.Length == 7)
SQMLog.SQMAddNumbersToStream(dataPoint.GetName(), (uint)args.Length, args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
else if (args.Length == 8)
{
SQMLog.SQMAddNumbersToStream(dataPoint.GetName(), (uint)args.Length, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
}
else
{
if (args.Length != 9)
return;
SQMLog.SQMAddNumbersToStream(dataPoint.GetName(), (uint)args.Length, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
}
}
private static SQMDataPoint FindDataPoint(SQMDataId sqmDataId)
{
foreach (SQMDataPoint rgSqmDataPoint in SQMData.s_rgSQMDataPoints)
{
if (rgSqmDataPoint.id == sqmDataId)
return rgSqmDataPoint;
}
return SQMData.s_sqmDataPointInvalid;
}
[DllImport("ZuneNativeLib", CharSet = CharSet.Unicode)]
private static extern void SQMAddWrapper(string sqmDataId, int nData);
[DllImport("ZuneNativeLib", CharSet = CharSet.Unicode)]
private static extern void SQMSetFlagWrapper(string sqmDataId, bool fSet);
[DllImport("ZuneNativeLib", CharSet = CharSet.Unicode)]
private static extern void SQMSetBitsWrapper(string sqmDataId, uint dwBits);
[DllImport("ZuneNativeLib", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddNumbersToStream(string sqmDataId, uint countTotal, uint dw1);
[DllImport("ZuneNativeLib", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddNumbersToStream(
string sqmDataId,
uint countTotal,
uint dw1,
uint dw2);
[DllImport("ZuneNativeLib", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddNumbersToStream(
string sqmDataId,
uint countTotal,
uint dw1,
uint dw2,
uint dw3);
[DllImport("ZuneNativeLib", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddNumbersToStream(
string sqmDataId,
uint countTotal,
uint dw1,
uint dw2,
uint dw3,
uint dw4);
[DllImport("ZuneNativeLib", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddNumbersToStream(
string sqmDataId,
uint countTotal,
uint dw1,
uint dw2,
uint dw3,
uint dw4,
uint dw5);
[DllImport("ZuneNativeLib", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddNumbersToStream(
string sqmDataId,
uint countTotal,
uint dw1,
uint dw2,
uint dw3,
uint dw4,
uint dw5,
uint dw6);
[DllImport("ZuneNativeLib", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddNumbersToStream(
string sqmDataId,
uint countTotal,
uint dw1,
uint dw2,
uint dw3,
uint dw4,
uint dw5,
uint dw6,
uint dw7);
[DllImport("ZuneNativeLib", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddNumbersToStream(
string sqmDataId,
uint countTotal,
uint dw1,
uint dw2,
uint dw3,
uint dw4,
uint dw5,
uint dw6,
uint dw7,
uint dw8);
[DllImport("ZuneNativeLib", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddNumbersToStream(
string sqmDataId,
uint countTotal,
uint dw1,
uint dw2,
uint dw3,
uint dw4,
uint dw5,
uint dw6,
uint dw7,
uint dw8,
uint dw9);
[DllImport("ZuneNativeLib", EntryPoint = "SQMAddToStreamWsz", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddToStream(
string sqmDataId,
[MarshalAs(UnmanagedType.LPArray)] SQMStreamPositionType[] sptTypes,
uint countTotal,
string s1);
[DllImport("ZuneNativeLib", EntryPoint = "SQMAddToStreamWsz", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddToStream(
string sqmDataId,
[MarshalAs(UnmanagedType.LPArray)] SQMStreamPositionType[] sptTypes,
uint countTotal,
string s1,
string s2);
[DllImport("ZuneNativeLib", EntryPoint = "SQMAddToStreamWsz", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddToStream(
string sqmDataId,
[MarshalAs(UnmanagedType.LPArray)] SQMStreamPositionType[] sptTypes,
uint countTotal,
string s1,
string s2,
string s3);
[DllImport("ZuneNativeLib", EntryPoint = "SQMAddToStreamWsz", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddToStream(
string sqmDataId,
[MarshalAs(UnmanagedType.LPArray)] SQMStreamPositionType[] sptTypes,
uint countTotal,
string s1,
string s2,
string s3,
string s4);
[DllImport("ZuneNativeLib", EntryPoint = "SQMAddToStreamWsz", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddToStream(
string sqmDataId,
[MarshalAs(UnmanagedType.LPArray)] SQMStreamPositionType[] sptTypes,
uint countTotal,
string s1,
string s2,
string s3,
string s4,
string s5);
[DllImport("ZuneNativeLib", EntryPoint = "SQMAddToStreamWsz", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddToStream(
string sqmDataId,
[MarshalAs(UnmanagedType.LPArray)] SQMStreamPositionType[] sptTypes,
uint countTotal,
string s1,
string s2,
string s3,
string s4,
string s5,
string s6);
[DllImport("ZuneNativeLib", EntryPoint = "SQMAddToStreamWsz", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddToStream(
string sqmDataId,
[MarshalAs(UnmanagedType.LPArray)] SQMStreamPositionType[] sptTypes,
uint countTotal,
string s1,
string s2,
string s3,
string s4,
string s5,
string s6,
string s7);
[DllImport("ZuneNativeLib", EntryPoint = "SQMAddToStreamWsz", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddToStream(
string sqmDataId,
[MarshalAs(UnmanagedType.LPArray)] SQMStreamPositionType[] sptTypes,
uint countTotal,
string s1,
string s2,
string s3,
string s4,
string s5,
string s6,
string s7,
string s8);
[DllImport("ZuneNativeLib", EntryPoint = "SQMAddToStreamWsz", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
private static extern void SQMAddToStream(
string sqmDataId,
[MarshalAs(UnmanagedType.LPArray)] SQMStreamPositionType[] sptTypes,
uint countTotal,
string s1,
string s2,
string s3,
string s4,
string s5,
string s6,
string s7,
string s8,
string s9);
}
}

Some files were not shown because too many files have changed in this diff Show More