public static string[] _files(string nUrl) { List <string> result_ = new List <string>(); UrlParser urlParser_ = new UrlParser(nUrl); string urlDir_ = urlParser_._urlDir(); string[] fileUrls_ = Directory.GetFiles(urlDir_); foreach (string i in fileUrls_) { int index_ = i.LastIndexOf(@"\"); string fileName_ = i.Substring(index_ + 1); string urlName_ = nUrl + @"*" + fileName_; result_.Add(urlName_); } return(result_.ToArray()); }
public __t _findInterface <__t>(string nUrl) { if (null == nUrl || "" == nUrl) { return(default(__t)); } __t result_ = default(__t); UrlParser urlParser_ = new UrlParser(nUrl); string assemblyUrl_ = urlParser_._noClassUrl(); string className_ = urlParser_._className(); if (urlParser_._isPlugin()) { if (urlParser_._isFile()) { PluginUfl pluginUlf_ = new PluginUfl(); pluginUlf_._runLoad(assemblyUrl_); result_ = pluginUlf_._findFullClass <__t>(className_); } else { AddinUdl addinUdl_ = new AddinUdl(); addinUdl_._runLoad(assemblyUrl_); result_ = addinUdl_._findFullClass <__t>(className_); } } else { if (urlParser_._isFile()) { AssemblyUfl assemblyUfl_ = new AssemblyUfl(); assemblyUfl_._runLoad(assemblyUrl_); result_ = assemblyUfl_._findFullClass <__t>(className_); } else { AssemblyUdl assemblyUdl_ = new AssemblyUdl(); assemblyUdl_._runLoad(assemblyUrl_); result_ = assemblyUdl_._findFullClass <__t>(className_); } } return(result_); }
public void _newUdl <__t>(__t nT, string nUrl) where __t : IUdl { if (!this._isUdl(nUrl)) { return; } if (this._haveUdl(nUrl)) { return; } UrlParser urlParser_ = new UrlParser(nUrl); string dirUrl_ = urlParser_._urlDir(); Directory.CreateDirectory(dirUrl_); string udlHeadstreamUrl_ = nUrl + @"*$descriptor.xml"; UdlHeadstream udlHeadstream_ = nT._getUdlHeadstream(); this._writeHeadstream(udlHeadstream_, udlHeadstreamUrl_); }
public override void _runLoad(string nUrl) { UrlParser urlParser_ = new UrlParser(nUrl); string assemblyPath_ = urlParser_._returnResult(); AssemblyName assemblyName_ = AssemblyName.GetAssemblyName(assemblyPath_); AppDomain appDomain_ = AppDomain.CurrentDomain; Assembly[] assemblies_ = appDomain_.GetAssemblies(); foreach (Assembly i in assemblies_) { if (string.Compare(i.FullName, assemblyName_.FullName) == 0) { mAssembly = i; } } if (null == mAssembly) { mAssembly = Assembly.LoadFrom(assemblyPath_); } base._runLoad(nUrl); }
public static string[] _fileUrls(string nUrl) { List <string> result_ = new List <string>(); UrlParser urlParser_ = new UrlParser(nUrl); string urlDir_ = urlParser_._urlDir(); string[] dirUrls_ = Directory.GetDirectories(urlDir_); foreach (string i in dirUrls_) { int index_ = i.LastIndexOf(@"\"); string dirName_ = i.Substring(index_ + 1); if (!dirName_.StartsWith(@"^file^")) { continue; } index_ = dirName_.LastIndexOf(@"^"); string fileName_ = dirName_.Substring(index_ + 1); string urlName_ = nUrl + @"\" + fileName_; result_.Add(urlName_); } return(result_.ToArray()); }
bool _udlHaveFile <__t>(__t nT, string nUrl) where __t : IUdl { UdlHeadstream udlHeadstream_ = nT._getUdlHeadstream(); string fileName_ = udlHeadstream_._getFileName(); UrlParser urlParser_ = new UrlParser(nUrl); string archiveDir_ = urlParser_._urlDir(); string[] files_ = Directory.GetFiles(archiveDir_); if (files_.Length > 3) { return(true); } foreach (string i in files_) { int pos_ = i.LastIndexOf("\\"); string temp_ = i.Substring(pos_ + 1); if (temp_ != "$descriptor.xml" && temp_ != fileName_ && temp_ != "$stringTable.xml") { return(true); } } return(false); }
public string _findUrl(string nUrl) { UrlParser urlParser_ = new UrlParser(); return(urlParser_._findUrl(nUrl)); }
public string[] _fileUrls(string nUrl) { return(UrlParser._fileUrls(nUrl)); }
public string[] _dirUrls(string nUrl) { return(UrlParser._dirUrls(nUrl)); }
public string[] _arcs(string nUrl) { return(UrlParser._arcs(nUrl)); }
public string[] _rootUrls() { return(UrlParser._rootUrls()); }
bool _isUdl(string nUrl) { UrlParser urlParser_ = new UrlParser(nUrl); return(urlParser_._isUdl()); }
public override void _runLoad(string nUrl) { base._runLoad(nUrl); string assemblyInfoUrl_ = nUrl + @"*$assembly.xml"; mAssemblyInfo._runLoad(assemblyInfoUrl_); UdlHeadstream udlHeadstream_ = this._getUdlHeadstream(); string fileName_ = udlHeadstream_._getFileName(); UrlParser urlParser_ = new UrlParser(nUrl); string assemblyPath_ = urlParser_._urlFile(fileName_); AssemblyName assemblyName_ = AssemblyName.GetAssemblyName(assemblyPath_); AppDomain appDomain_ = AppDomain.CurrentDomain; Assembly[] assemblies_ = appDomain_.GetAssemblies(); foreach (Assembly i in assemblies_) { if (string.Compare(i.FullName, assemblyName_.FullName) == 0) { mAssembly = i; return; } } UidSingleton uidSingleton_ = __singleton <UidSingleton> ._instance(); IEnumerable <Rid> rids_ = mAssemblyDescriptor._getRids(); foreach (Rid i in rids_) { uidSingleton_._addRid(i); } IEnumerable <string> dependences_ = mAssemblyDescriptor._getDependences(); foreach (string i in dependences_) { this._loadAssemblyUfl(i); } IEnumerable <Uid> uids_ = mAssemblyDescriptor._getUids(); foreach (Uid i in uids_) { uidSingleton_._addUid(i); Uid uid_ = i._getUid(); string uidUrl_ = uid_._getOptimal(); this._loadAssemblyUdl(uidUrl_); } IEnumerable <Uid> addins_ = mAssemblyDescriptor._getAddins(); foreach (Uid i in addins_) { uidSingleton_._addUid(i); Uid uid_ = i._getUid(); string uidUrl_ = uid_._getOptimal(); this._loadAddins(uidUrl_); } IEnumerable <string> plugins_ = mAssemblyDescriptor._getPlugins(); foreach (string i in plugins_) { this._loadPlugins(i); } if (null == mAssembly) { mAssembly = Assembly.LoadFrom(assemblyPath_); } }