Ejemplo n.º 1
0
        /// <summary>
        /// Saves the current IP Configuration
        /// </summary>
        public async void SaveIPInformation()
        {
            EnableControl = false;
            StatusBarText = "Saving IP Configuration";
            IPConfigurationList ipInfoList = new IPConfigurationList();

            if (!string.IsNullOrWhiteSpace(IPConfigurationItem.IPConfigurationName))
            {
                var item = IPConfigurationList.FirstOrDefault(x => x.IPConfigurationName == IPConfigurationItem.IPConfigurationName);

                if (item == null)
                {
                    IPConfigurationList.Add(IPConfigurationItem);
                }

                foreach (var ipInfo in IPConfigurationList)
                {
                    ipInfoList.IPConfList.Add(ipInfo);
                }

                await Tools.SaveIPInformationListAsync(ipInfoList);

                GetIPInformationList();
                IPConfigurationItem = new IPConfiguration();
                StatusBarText       = "IP Configuration Saved";
            }
            else
            {
                await _dialogMessageService.ShowAsync("Error", "You must enter a valid IP Configuration name");
            }

            EnableControl = true;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the entries on the XML file containing the IP Configuration information
        /// </summary>
        public async void GetIPInformationList()
        {
            StatusBarText = "Getting saved IP Configurations";
            IPConfigurationList.Clear();
            var ipListFromFile = await Tools.GetIPInformationListAsync();

            ipListFromFile.IPConfList.ForEach(ip => IPConfigurationList.Add(ip));
            RaisePropertyChanged(IPConfigurationListPropertyName);
            GetConnectedNetworkInterfaces();
            StatusBarText = "Ready";
        }