コード例 #1
0
        private ISampleTypeConfiguration GetValueBuilder(SampleBasicType sampleType, string format, string formatParameters)
        {
            TypeFormatInfo           key = new TypeFormatInfo(sampleType, format, formatParameters);
            ISampleTypeConfiguration configuration;

            if (!this.valueBuilders.TryGetValue(key, out configuration))
            {
                configuration           = SampleDataPropertyConfiguration.CreateConfiguration(this.dataSet, sampleType, format, formatParameters);
                this.valueBuilders[key] = configuration;
            }
            return(configuration);
        }
コード例 #2
0
        public static string NormalizeFormatParameters(SampleBasicType sampleType, string formatParameters, bool nullPreferred)
        {
            if (sampleType == null)
            {
                return(formatParameters);
            }
            TypeFormatInfo typeFormatInfo = SampleDataFormatHelper.defaults.Find((Predicate <TypeFormatInfo>)(info => info.SampleType == sampleType));

            if (nullPreferred && (formatParameters == null || typeFormatInfo.FormatParameters == formatParameters))
            {
                return((string)null);
            }
            if (!nullPreferred && formatParameters == null)
            {
                return(typeFormatInfo.FormatParameters);
            }
            return(formatParameters);
        }