Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
            public void Services_should_match_expected()
            {
                V1DisabledServices temp;

                V1DisabledServices.TryCreateFromXml(Xml, out temp);
                m_output.Guids.ShouldEqual(temp.Guids);
            }
Ejemplo n.º 3
0
            protected override void BecauseOf()
            {
                V1DisabledServices source;

                V1DisabledServices.TryCreateFromXml(Xml, out source);
                var temp = source.ToXml();

                V1DisabledServices.TryCreateFromXml(temp, out m_output);
            }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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());
        }
Ejemplo n.º 6
0
 protected override void BecauseOf()
 {
     m_result = V1DisabledServices.TryCreateFromXml(Xml, out m_output);
 }
Ejemplo n.º 7
0
 protected override void BecauseOf()
 {
     m_exception = Catch(() => V1DisabledServices.TryCreateFromXml(null, out m_output));
 }