Пример #1
0
        /// <summary>
        /// Displays the tag HoloLens dialog.
        /// </summary>
        /// <returns>Task object used for tracking method completion.</returns>
        private async Task TagHoloLensAsync()
        {
            TagInformation tagInfo = new TagInformation();

            tagInfo.Name = this.Name;
            float.TryParse(this.Ipd, out tagInfo.Ipd);

            ContentDialog       dialog = new TagHoloLensDialog(tagInfo);
            ContentDialogResult result = await dialog.ShowAsync().AsTask <ContentDialogResult>();;

            // Primary button == "Ok"
            if (result == ContentDialogResult.Primary)
            {
                this.Name = tagInfo.Name;

                // Update the IPD on the HoloLens
                try
                {
                    await this.holoLensMonitor.SetIpd(tagInfo.Ipd);
                }
                catch (Exception e)
                {
                    this.StatusMessage = string.Format(
                        "Unable to update the IPD - {0}",
                        e.Message);
                }

                this.holoLensMonitorControl.NotifyTagChanged();
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TagHoloLensDialogViewModel" /> class.
 /// </summary>
 /// <param name="address">The address of the HoloLens.</param>
 /// <param name="tagInfo">TagInformation object containing information associated with the HoloLens.</param>
 public TagHoloLensDialogViewModel(
     string address,
     TagInformation tagInfo)
 {
     this.DeviceAddress = address;
     this.Name          = tagInfo.Name;
 }
Пример #3
0
        /// <summary>
        /// Displays the tag device dialog.
        /// </summary>
        /// <returns>Task object used for tracking method completion.</returns>
        private async Task TagDeviceAsync()
        {
            TagInformation tagInfo = new TagInformation();

            tagInfo.Name = this.Name;

            ContentDialog dialog = new TagDeviceDialog(
                this.deviceMonitor.Address,
                tagInfo);
            ContentDialogResult result = await dialog.ShowAsync().AsTask <ContentDialogResult>();;

            // Primary button == "Ok"
            if (result == ContentDialogResult.Primary)
            {
                this.Name = tagInfo.Name;

                if (tagInfo.DeployNameToDevice)
                {
                    // Set the device name.
                    if (await this.deviceMonitor.SetDeviceNameAsync(this.Name))
                    {
                        // Reboot the device so the name change takes effect.
                        await this.deviceMonitor.RebootAsync();
                    }
                }

                this.deviceMonitorControl.NotifyTagChanged();
            }
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TagHoloLensDialog" /> class.
        /// </summary>
        /// <param name="monitor">The HoloLensMonitor that is responsible for communication with the HoloLens.</param>
        public TagHoloLensDialog(TagInformation tagInfo)
        {
            this.tagInformation = tagInfo;

            this.DataContext = new TagHoloLensDialogViewModel(tagInfo);
            this.InitializeComponent();
        }
Пример #5
0
        /// <summary>
        /// Update's the user selected install files data.
        /// </summary>
        /// <param name="tagInfo">The information which is to be associated with the HoloLens.</param>
        internal void UpdateUserData(TagInformation tagInfo)
        {
            tagInfo.Name = this.Name;

            // NOTE: The TagHoloLensDialogViewModel.Ipd property is a string. The
            // TagHoloLensDialogViewModel.ipd field is a float. We return the float
            // value as that is what is expected of the caller.
            tagInfo.Ipd = this.ipd;
        }
Пример #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TagDeviceDialog" /> class.
        /// </summary>
        /// <param name="address">The address of device.</param>
        /// <param name="tagInfo">TagInformation object containing information associated with the device.</param>
        public TagDeviceDialog(
            string address,
            TagInformation tagInfo)
        {
            this.tagInformation = tagInfo;

            this.DataContext = new TagDeviceDialogViewModel(
                address,
                tagInfo);
            this.InitializeComponent();
        }
Пример #7
0
        /// <summary>
        /// Displays the tag device dialog.
        /// </summary>
        /// <returns>Task object used for tracking method completion.</returns>
        private async Task TagDeviceAsync()
        {
            TagInformation tagInfo = new TagInformation();

            tagInfo.Name = this.Name;

            ContentDialog dialog = new TagDeviceDialog(
                this.deviceMonitor.Address,
                tagInfo);
            ContentDialogResult result = await dialog.ShowAsync().AsTask <ContentDialogResult>();;

            // Primary button == "Ok"
            if (result == ContentDialogResult.Primary)
            {
                this.Name = tagInfo.Name;
                this.deviceMonitorControl.NotifyTagChanged();
            }
        }
 /// <summary>
 /// Update's the user selected data.
 /// </summary>
 /// <param name="tagInfo">The information which is to be associated with the HoloLens.</param>
 internal void UpdateUserData(TagInformation tagInfo)
 {
     tagInfo.Name = this.Name;
 }
Пример #9
0
 /// <summary>
 /// Update's the user selected data.
 /// </summary>
 /// <param name="tagInfo">The information which is to be associated with the device.</param>
 internal void UpdateUserData(TagInformation tagInfo)
 {
     tagInfo.Name = this.Name;
     tagInfo.DeployNameToDevice = this.DeployNameToDevice;
 }
Пример #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TagHoloLensDialogViewModel" /> class.
 /// </summary>
 /// <param name="tagInfo">Information that has been associated with this HoloLens.</param>
 public TagHoloLensDialogViewModel(TagInformation tagInfo)
 {
     this.Name = tagInfo.Name;
     this.Ipd  = tagInfo.Ipd.ToString();
 }