GetArrayName() static private method

static private GetArrayName ( string fieldName, int index ) : string
fieldName string
index int
return string
Beispiel #1
0
        public string AddMsRun(string filePath)
        {
            if (MsRunLocations == null)
            {
                MsRunLocations = new List <string>();
            }

            MsRunLocations.Add(filePath);

            return(MzTab.GetArrayName(Fields.MsRun, MsRunLocations.Count - 1 + MzTab.IndexBased));
        }
 public IEnumerable <KeyValuePair <string, string> > GetKeyValuePairs(string baseName)
 {
     foreach (KeyValuePair <int, List <T> > values in _data)
     {
         int index1 = values.Key;
         for (int index2 = 0; index2 < values.Value.Count; index2++)
         {
             string name  = MzTab.GetArrayName(baseName, index1, index2 + MzTab.IndexBased);
             string value = values.Value[index2].ToString();
             yield return(new KeyValuePair <string, string>(name, value));
         }
     }
 }
Beispiel #3
0
        public IEnumerable <KeyValuePair <string, string> > GetKeyValuePairs()
        {
            int    i, j;
            string name;

            yield return(new KeyValuePair <string, string>(Fields.Version, Version));

            yield return(new KeyValuePair <string, string>(Fields.Mode, Mode.ToString()));

            yield return(new KeyValuePair <string, string>(Fields.Type, Type.ToString()));

            yield return(new KeyValuePair <string, string>(Fields.Description, Description));

            i = MzTab.IndexBased;
            foreach (string msrunlocation in MsRunLocations)
            {
                name = MzTab.GetArrayName(Fields.MsRunLocation, i);
                yield return(new KeyValuePair <string, string>(name, msrunlocation));

                i++;
            }

            i = MzTab.IndexBased;
            foreach (MzTabSoftware software in Software)
            {
                name = MzTab.GetArrayName(Fields.Software, i);
                yield return(new KeyValuePair <string, string>(name, software.ToString()));

                j = MzTab.IndexBased;
                foreach (string setting in software.Settings)
                {
                    name = MzTab.GetArrayName(Fields.SoftwareSettings, i, j);
                    yield return(new KeyValuePair <string, string>(name, setting));

                    j++;
                }
                i++;
            }
        }