private void ConstructProperties() { //Can not use String.Split because this method fails //if there are multiple sheet separator strings in file name. SheetSet = NameWithoutExtension.Substring(0, NameWithoutExtension.LastIndexOf(SheetSeparator)); SheetIdentifier = NameWithoutExtension.Substring(NameWithoutExtension.LastIndexOf(SheetSeparator) + SheetSeparator.Length); }
public IEnumerable <IFile> GetRelatedFiles() { if (IsContainer || Parent == null) { return(new List <IFile>()); } var thisName = NameWithoutExtension.ToLower(); return(Parent.GetFiles().Where(file => file.Name.Split('.')[0].ToLower() == thisName)); }