Пример #1
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();
            DfuContext.Init();


            bool hasCapsYo = DfuContext.Current.HasCapability(DfuSharp.Capabilities.HasCapabilityAPI);

            Debug.WriteLine("Has capabilities: " + hasCapsYo.ToString());

            if (hasCapsYo)
            {
                bool hazHotPrug = DfuContext.Current.HasCapability(DfuSharp.Capabilities.SupportsHotplug);
                Debug.WriteLine("Haz Hotprug? " + hazHotPrug.ToString());

                DfuContext.Current.BeginListeningForHotplugEvents();
            }
        }
Пример #2
0
        public MainPage()
        {
            DfuContext.Init();

            InitializeComponent();

            bool hasCapabilities = DfuContext.Current.HasCapability(DfuSharp.Capabilities.HasCapabilityAPI);

            Debug.WriteLine($"Has capabilities: {hasCapabilities}");

            if (hasCapabilities)
            {
                bool hasHotPlug = DfuContext.Current.HasCapability(DfuSharp.Capabilities.SupportsHotplug);

                Debug.WriteLine($"Has hotplug support: {hasHotPlug}");
                DfuContext.Current.BeginListeningForHotplugEvents();
            }
        }