public UWPAssemblyResolver(string projectLockFile) { if (string.IsNullOrEmpty(projectLockFile)) { throw new Exception("Project lock file not specified."); } NuGetPackageResolver resolver1 = new NuGetPackageResolver { ProjectLockFile = projectLockFile }; resolver1.Resolve(); string[] resolvedReferences = resolver1.ResolvedReferences; this._resolvedReferences = new Dictionary <string, string>(resolvedReferences.Length, StringComparer.InvariantCultureIgnoreCase); foreach (string str in resolvedReferences) { string fileName = Path.GetFileName(str); if (this._resolvedReferences.ContainsKey(fileName)) { throw new Exception(string.Format("Reference \"{0}\" already added as \"{1}\".", str, this._resolvedReferences[fileName])); } this._resolvedReferences.Add(fileName, str); } foreach (string str3 in UWPReferences.GetReferences()) { string key = Path.GetFileName(str3); if (this._winmdReferences.ContainsKey(key)) { throw new Exception(string.Format("Reference \"{0}\" already added as \"{1}\".", str3, this._winmdReferences[key])); } this._winmdReferences.Add(key, str3); } }
public MetroBuildWindowExtension(TargetExtension targetExtension) { WSAUWPBuildType[] typeArray1 = new WSAUWPBuildType[2]; typeArray1[1] = WSAUWPBuildType.D3D; this.uwpBuildTypes = typeArray1; this.uwpBuildTypeStrings = new GUIContent[] { EditorGUIUtility.TextContent("XAML"), EditorGUIUtility.TextContent("D3D") }; WSABuildAndRunDeployTarget[] targetArray1 = new WSABuildAndRunDeployTarget[3]; targetArray1[1] = WSABuildAndRunDeployTarget.WindowsPhone; targetArray1[2] = WSABuildAndRunDeployTarget.LocalMachineAndWindowsPhone; this.wsaBuildAndRunDeployTargets = targetArray1; WSABuildAndRunDeployTarget[] targetArray2 = new WSABuildAndRunDeployTarget[2]; targetArray2[1] = WSABuildAndRunDeployTarget.WindowsPhone; this.wsaUWPBuildAndRunDeployTargets = targetArray2; this.wsaBuildAndRunDeployTargetStrings = new GUIContent[] { EditorGUIUtility.TextContent("Local Machine"), EditorGUIUtility.TextContent("Windows Phone"), EditorGUIUtility.TextContent("Local Machine and Windows Phone") }; Dictionary <WSASDK, GUIContent> dictionary = new Dictionary <WSASDK, GUIContent> { { WSASDK.SDK81, EditorGUIUtility.TextContent("8.1") }, { WSASDK.PhoneSDK81, EditorGUIUtility.TextContent("Phone 8.1") }, { WSASDK.UniversalSDK81, EditorGUIUtility.TextContent("Universal 8.1") }, { WSASDK.UWP, EditorGUIUtility.TextContent("Universal 10") } }; this.wsaSDKs = new WSASDK[] { WSASDK.SDK81 }; this.wsaSDKStrings = new GUIContent[this.wsaSDKs.Length]; for (int i = 0; i < this.wsaSDKs.Length; i++) { this.wsaSDKStrings[i] = dictionary[this.wsaSDKs[i]]; } Version[] versionArray = UWPReferences.GetInstalledSDKVersions().ToArray <Version>(); this.uwpSDKs = new string[versionArray.Length + 1]; this.uwpSDKStrings = new GUIContent[versionArray.Length + 1]; this.uwpSDKs[0] = string.Empty; this.uwpSDKStrings[0] = EditorGUIUtility.TextContent("Latest installed"); for (int j = 0; j < versionArray.Length; j++) { this.uwpSDKs[j + 1] = versionArray[j].ToString(); this.uwpSDKStrings[j + 1] = EditorGUIUtility.TextContent(this.uwpSDKs[j + 1]); } this.targetExtension = targetExtension; }
internal static Version GetDesiredUWPSDK() => UWPReferences.GetDesiredSDKVersion();