private void LoadCacheAssembly() { if (!Directory.Exists(_chcheDir)) { Directory.CreateDirectory(_chcheDir); } foreach (var path in "*.dll;*.exe".Split(';').SelectMany(g => Directory.EnumerateFiles(_chcheDir, g))) { string assembleName = Path.GetFileNameWithoutExtension(path); ClassRelation relation = new ClassRelation(); relation.LoadFromAssemblyFile(path); _assembleFiles[assembleName] = relation; } }
private void AssembleTree_DragDrop(object sender, DragEventArgs e) { var paths = ((System.Array)e.Data.GetData(DataFormats.FileDrop)) as string[]; foreach (var path in paths) { string assembleName = Path.GetFileNameWithoutExtension(path); ClassRelation relation = new ClassRelation(); relation.LoadFromAssemblyFile(path); _assembleFiles[assembleName] = relation; try { File.Copy(path, Path.Combine(_chcheDir, Path.GetFileName(path)), true); } catch { } } BindTreeView(); }
void LoadInitialAssemblies() { System.Reflection.Assembly[] initialAssemblies = { typeof(object).Assembly, typeof(System.IO.File).Assembly, typeof(Uri).Assembly, typeof(System.Linq.Enumerable).Assembly, typeof(System.Xml.XmlDocument).Assembly, typeof(System.Drawing.Bitmap).Assembly, typeof(System.Net.Cookie).Assembly, }; foreach (System.Reflection.Assembly asm in initialAssemblies) { var assembleName = asm.GetName(); string key = string.Format("{0}({1})", assembleName.Name, assembleName.Version); ClassRelation classR = new ClassRelation(); classR.LoadFromAssemblyFile(asm.Location); _assembleFiles[key] = classR; } LoadCacheAssembly(); BindTreeView(); }