private IObjecOptions ProcessSingleFile(string fileName) { CheckFile(fileName); FileExtensions fileExtension = Containers.GetFileExtension(fileName); IObjecOptions objectOptions = new ObjectOptions(fileName, containers.Find(fileExtension).ObjectType); foreach (var item in optionParams) { if (item.Value) { try { objectOptions.Options.SetProperty(item.Key); } catch (ArgumentException ex) { string message = String.Format(Properties.Resources.InvalidOption, item.Key); throw new CommandLineException(String.Format("{0} {1}", message, Properties.Resources.ForThisObjectType), ex); } } } return(objectOptions); }
private ObjectTypeExtension GetObjectTypeExtension(string fileName, List <ObjectTypeExtension> objectTypes) { FileExtensions extension = Containers.GetFileExtension(fileName); return(objectTypes.Find(x => x.FileExtension == extension)); }