public static IImageDetails AnalyseImageDetails( string path, ILocationManager locationManager, IClsNmbManager clsNmbManager, IFaultManager faultManager) { IImageDetails image; string imageName = System.IO.Path.GetFileName(path); string[] filenameArray = imageName.Split(extensionSeparator); string[] inputArray = filenameArray[0].Split(majorTick); if (inputArray.Length < 2 || inputArray.Length > 4) { faultManager.AddFault( "Can't split into nmb and stn", imageName); } string[] nmbsArray = inputArray[0].Split(minorTick); ILocation stn = locationManager.GetStn( inputArray[1]); string year = inputArray.Length > 2 ? inputArray[2] : string.Empty; string multipleNote = inputArray.Length > 3 ? inputArray[3] : string.Empty; image = new ImageDetails( path, year, stn, multipleNote); ClsClass clss = ImageDetailFactory.GetCls( nmbsArray.ToList(), path, faultManager, clsNmbManager); image.SetClss( clss.Clss, clss.PresentNmbs); return(image); }