コード例 #1
0
		public string GetAppropriateFormatKeyForType(CsvFieldType type) {
			string ret = null;
			foreach (string key in this.CsvFieldTypeFormatsAvailable.Keys) {
				if (key.Contains(type.ToString()) == false) continue;
				ret = key;
				break;
			}
			return ret;
		}
コード例 #2
0
        public string GetAppropriateFormatKeyForType(CsvFieldType type)
        {
            string ret = null;

            foreach (string key in this.CsvFieldTypeFormatsAvailable.Keys)
            {
                if (key.Contains(type.ToString()) == false)
                {
                    continue;
                }
                ret = key;
                break;
            }
            return(ret);
        }
コード例 #3
0
        public void AddFormatForTypeUnique(string selectedFormat, CsvFieldType csvFieldType)
        {
            string storedUnderKey = this.GetAppropriateFormatKeyForType(csvFieldType);

            if (storedUnderKey == null)
            {
                //throw new Exception("CANT_GUESS_KEY_FOR_FORMATS_AVAILABLE_FOR_TYPE dataSnapshot.GetAppropriateFormatKeyForType(" + iCatcherEdited.Parser.CsvType + ")=null");
                storedUnderKey = csvFieldType.ToString();
                this.CsvFieldTypeFormatsAvailable.Add(storedUnderKey, new List <string>());
            }
            List <string> typeFormats = this.CsvFieldTypeFormatsAvailable[storedUnderKey];

            if (typeFormats.Contains(selectedFormat) == false)
            {
                typeFormats.Add(selectedFormat);
                typeFormats.Sort();
            }
        }
コード例 #4
0
		public void AddFormatForTypeUnique(string selectedFormat, CsvFieldType csvFieldType) {
			string storedUnderKey = this.GetAppropriateFormatKeyForType(csvFieldType);
			if (storedUnderKey == null) {
				//throw new Exception("CANT_GUESS_KEY_FOR_FORMATS_AVAILABLE_FOR_TYPE dataSnapshot.GetAppropriateFormatKeyForType(" + iCatcherEdited.Parser.CsvType + ")=null");
				storedUnderKey = csvFieldType.ToString();
				this.CsvFieldTypeFormatsAvailable.Add(storedUnderKey, new List<string>());
			}
			List<string> typeFormats = this.CsvFieldTypeFormatsAvailable[storedUnderKey];
			if (typeFormats.Contains(selectedFormat) == false) {
				typeFormats.Add(selectedFormat);
				typeFormats.Sort();
			}
		}