static StackObject *EnumerateFileSystemInfos_32(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.IO.SearchOption @searchOption = (System.IO.SearchOption) typeof(System.IO.SearchOption).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.String @searchPattern = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); System.IO.DirectoryInfo instance_of_this_method = (System.IO.DirectoryInfo) typeof(System.IO.DirectoryInfo).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.EnumerateFileSystemInfos(@searchPattern, @searchOption); object obj_result_of_this_method = result_of_this_method; if (obj_result_of_this_method is CrossBindingAdaptorType) { return(ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance)); } return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method)); }
/// <summary> /// Get the Last Known TypeScript Version /// </summary> /// <returns></returns> static string WhereTsc() { var LastKnownTypeScriptVersion = "3.0"; var root = @"C:\Program Files (x86)\Microsoft SDKs\TypeScript"; var path = System.IO.Path.Combine(root, @"versions"); var di = new System.IO.DirectoryInfo(path); if (di.Exists) { LastKnownTypeScriptVersion = System.Xml.Linq.XDocument.Load (di.EnumerateFileSystemInfos("*.props").Last().FullName).Root?.Value; } return(System.IO.Path.Combine(root, LastKnownTypeScriptVersion, "tsc.exe")); }
private static string getMostRecentSchemaPath(string databaseName) { string executingPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); System.IO.DirectoryInfo directoryInfo = new System.IO.DirectoryInfo(executingPath); string mostRecentSchemaPath = (from fileInfos in directoryInfo.EnumerateFileSystemInfos( string.Format("{0}_schema_*", databaseName), System.IO.SearchOption.AllDirectories) orderby fileInfos.CreationTimeUtc descending select fileInfos.FullName).FirstOrDefault(); return(mostRecentSchemaPath); }
public override IEnumerator <FileSystemInfo> GetEnumerator() { foreach (var item in Info.EnumerateFileSystemInfos()) { if (item is System.IO.FileInfo) { yield return(new FileSystemFileInfo(PathRoot, item as System.IO.FileInfo)); } if (item is System.IO.DirectoryInfo) { yield return(new FileSystemDirectoryInfo(PathRoot, item as System.IO.DirectoryInfo)); } } }
IEnumerable <FolderItem> GetFiles(string path) { var directory = new System.IO.DirectoryInfo(path); if (!directory.Exists) { yield break; } if ((directory.Parent != null) && directory.Parent.Exists) { yield return(new ParentFolder(directory.Parent.FullName)); } foreach (var file in directory.EnumerateFileSystemInfos()) { yield return(new FolderItem(file.FullName, CalcIsDirectory(file))); } }