コード例 #1
0
        private async void AddClientAction()
        {
            MetroDialogSettings settings = AppearanceManager.MetroDialog;

            settings.AffirmativeButtonText = Application.Current.Resources["String_Button_Add"] as string;
            settings.NegativeButtonText    = Application.Current.Resources["String_Button_Cancel"] as string;
            settings.DefaultButtonFocus    = MessageDialogResult.Affirmative;

            string hostname = await dialogCoordinator.ShowInputAsync(this, Application.Current.Resources["String_Header_AddClient"] as string, Application.Current.Resources["String_EnterHostnameForClient"] as string, settings);

            if (string.IsNullOrEmpty(hostname))
            {
                return;
            }

            WakeOnLANClientInfo client = new WakeOnLANClientInfo
            {
                Hostname   = hostname.ToUpper(),
                MACAddress = MACAddressHelper.GetDefaultFormat(MACAddress),
                Broadcast  = Broadcast,
                Port       = Port
            };

            WakeOnLANClientManager.AddClient(client);
        }
コード例 #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return(string.Empty);
            }

            return(MACAddressHelper.GetDefaultFormat((PhysicalAddress)value));
        }
コード例 #3
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!(value is PhysicalAddress physicalAddress))
            {
                return(string.Empty);
            }

            string macAddress = physicalAddress.ToString();

            return(string.IsNullOrEmpty(macAddress) ? string.Empty : MACAddressHelper.GetDefaultFormat(macAddress));
        }
コード例 #4
0
 private void CopySelectedMACAddressAction()
 {
     Clipboard.SetText(MACAddressHelper.GetDefaultFormat(SelectedARPTableInfo.MACAddress.ToString()));
 }
コード例 #5
0
 private void CopySelectedMACAddressAction()
 {
     Clipboard.SetText(MACAddressHelper.GetDefaultFormat(SelectedIPScanResult.MACAddress.ToString()));
 }