private async void OnPredefinedServiceSelectionIsEnabledChanged(object sender, IsEnabledChangedEventArgs e) { var disabledServices = new V1DisabledServices(); disabledServices.Guids.AddRange(m_predefinedServiceSelections.Where(x => !x.IsEnabled).Select(x => x.Service.Guid)); await NetworkServiceConfigurator.WriteDisabledServicesAsync(disabledServices); }
public void Services_should_match_expected() { V1DisabledServices temp; V1DisabledServices.TryCreateFromXml(Xml, out temp); m_output.Guids.ShouldEqual(temp.Guids); }
protected override void BecauseOf() { V1DisabledServices source; V1DisabledServices.TryCreateFromXml(Xml, out source); var temp = source.ToXml(); V1DisabledServices.TryCreateFromXml(temp, out m_output); }
private static async Task <V1DisabledServices> ReadDisabledServicesAsync() { var file = await ApplicationData.Current.LocalFolder.CreateFileAsync(V1DisabledServicesFileName, CreationCollisionOption.OpenIfExists); var xml = await FileIO.ReadTextAsync(file); V1DisabledServices output; V1DisabledServices.TryCreateFromXml(xml, out output); return(output); }
public static async Task WriteDisabledServicesAsync(V1DisabledServices input) { if (input == null) { throw new ArgumentNullException("input"); } var file = await ApplicationData.Current.LocalFolder.CreateFileAsync(V1DisabledServicesFileName, CreationCollisionOption.OpenIfExists); await FileIO.WriteTextAsync(file, input.ToXml()); }
protected override void BecauseOf() { m_result = V1DisabledServices.TryCreateFromXml(Xml, out m_output); }
protected override void BecauseOf() { m_exception = Catch(() => V1DisabledServices.TryCreateFromXml(null, out m_output)); }