/// <summary>
        /// Parses an XML-content and returns the <see cref="ExportConfiguration"/> from it.
        /// </summary>
        /// <param name="value">The XML-contents to parse.</param>
        /// <returns></returns>
        public static ExportConfiguration Parse(string value)
        {
            ExportConfiguration configuration = new ExportConfiguration();
            ((IStringSettingConvertible)configuration).Convert(value);

            return configuration;
        }
Esempio n. 2
0
        /// <summary>
        /// Parses an XML-content and returns the <see cref="ExportConfiguration"/> from it.
        /// </summary>
        /// <param name="value">The XML-contents to parse.</param>
        /// <returns></returns>
        public static ExportConfiguration Parse(string value)
        {
            ExportConfiguration configuration = new ExportConfiguration();

            ((IStringSettingConvertible)configuration).Convert(value);

            return(configuration);
        }
            private static ExportEntryViewModel GetEntryViewModel(ExportConfiguration.ExportEntry entry, IList<ExportedType> validExports)
            {
                Type myType = validExports.Single(e => e.Attribute.Alias == entry.Name).Type;

                ExportEntryViewModel vm = new ExportEntryViewModel();
                vm.IsEnabled = entry.IsEnabled;
                vm.Name = entry.Name;
                vm.DisplayName = InformationAttribute.GetDisplayName(myType);
                vm.Description = InformationAttribute.GetDescription(myType);
                if (string.IsNullOrWhiteSpace(vm.Description))
                {
                    // If there is no useful description, set it to null to make TargetNullValue in binding effective.
                    vm.Description = null;
                }

                return vm;
            }