winmd

How to read a winmd (WinRT metadata file)?

橙三吉。 提交于 2019-12-23 07:00:40
问题 A WinMD is a binary medadata file, that contains everything you need to learn about namespaces, types, classes, methods, parameters available in a native WinRT dll. From Windows Runtime design : The Windows Runtime is exposed using API metadata (.winmd files). This is the same format used by the .NET framework (Ecma-335). The underlying binary contract makes it easy for you to access the Windows Runtime APIs directly in the development language of your choice. Each .winmd file exposes one or

UWP - binding Enum differences

只愿长相守 提交于 2019-12-19 09:24:00
问题 I have come across a very interesting issue. Suppose you have the following XAML page content in a UWP app: <ContentControl Content="{x:Bind ApplicationDataLocalityEnum}" /> <ContentControl Content="{x:Bind FontStyleEnum}" /> And in the code-behind of the page contains the following properties: public ApplicationDataLocality ApplicationDataLocalityEnum { get; } = ApplicationDataLocality.Local; public FontStyle FontStyleEnum { get; } = FontStyle.Normal; Expected result would be, that the app

Inheritance impossible in Windows Runtime Component?

こ雲淡風輕ζ 提交于 2019-12-13 14:11:59
问题 Scenario: I have 3 classes (A,B,C) in my Windows Runtime Component project. class A{} public sealed class B : A {} public sealed class C : A {} On compiling the above code, I get the following error : "Inconsistent accessibility: base class 'A' is less accessible than class 'C'." If I make class A public, it gives a compile error : "Exporting unsealed types is not supported. Please mark type 'MyProject.A' as sealed." But now, if I make A as sealed, then B and C cannot inherit from it.

How to get an enumeration value when using IMetadataImport

让人想犯罪 __ 提交于 2019-12-08 10:49:11
问题 Short version How to you get the numeric value associated with an enum from a *.winmd file when using IMetadataImport ? A good example is ApplicationHighContrastAdjustment enumeration: //Windows.UI.Xaml.ApplicationContrastMode (@020000006) public enum ApplicationHighContrastAdjustment : uint { None = 0u, Auto = 4294967295u } Most enumerations are 0, 1, 2, ... . But this one has other values specified on the enum members: 0 4294967295 How do i read get those UInt32 values Note : The question

BuildManager to use another version of MSBuild

心不动则不痛 提交于 2019-11-27 14:28:17
The following code tries to build a Solution programmatically, using BuildManager : ProjectCollection pc = new ProjectCollection(); pc.DefaultToolsVersion = "12.0"; pc.Loggers.Add(fileLogger); Dictionary<string, string> globalProperty = new Dictionary<string, string>(); BuildRequestData buildRequest = new BuildRequestData(solutionName, globalProperty, null, new[] { "Build" }, null); BuildParameters buildParameters = new BuildParameters(pc) { DefaultToolsVersion = "12.0", OnlyLogCriticalEvents = false, DetailedSummary = true, Loggers = new List<Microsoft.Build.Framework.ILogger> { fileLogger }

BuildManager to use another version of MSBuild

让人想犯罪 __ 提交于 2019-11-26 16:45:23
问题 The following code tries to build a Solution programmatically, using BuildManager : ProjectCollection pc = new ProjectCollection(); pc.DefaultToolsVersion = "12.0"; pc.Loggers.Add(fileLogger); Dictionary<string, string> globalProperty = new Dictionary<string, string>(); BuildRequestData buildRequest = new BuildRequestData(solutionName, globalProperty, null, new[] { "Build" }, null); BuildParameters buildParameters = new BuildParameters(pc) { DefaultToolsVersion = "12.0", OnlyLogCriticalEvents