static void AddCustomDependencies(Dictionary <string, Depend> references, string path, string spritePackingTag) { string[] allFiles = System.IO.Directory.GetFiles(path, "*", System.IO.SearchOption.AllDirectories); foreach (var dependPath in allFiles) { AssetImporter assetImporter = AssetImporter.GetAtPath(dependPath); if (assetImporter && assetImporter is TextureImporter) { var textureImporter = assetImporter as TextureImporter; if (textureImporter.textureType == TextureImporterType.Sprite) { if (textureImporter.spritePackingTag == spritePackingTag) { if (references.ContainsKey(dependPath) == false) { Depend depend = new Depend(); depend.owner = "common/" + System.IO.Path.GetFileName(dependPath); depend.path = dependPath; references.Add(dependPath, depend); } } } } } }
static void GetDependencies(string file, Dictionary <string, Depend> references, List <string> rawResources) { string[] dependencies = AssetDatabase.GetDependencies(file); for (int i = 0; i < dependencies.Length; i++) { string dependPath = dependencies[i]; if (references.ContainsKey(dependPath)) { //公用资源 references[dependPath].owner = "common/" + System.IO.Path.GetFileName(references[dependPath].path); } else { Depend depend = new Depend(); depend.owner = null; depend.path = dependPath; references.Add(dependPath, depend); } if (rawResources.Contains(dependPath)) { references[dependPath].owner = dependPath; } } }
private void readPodMeta(FStore.Input input) { // handle sys bootstrap specially using just java.util.Properties string metaName; if ("sys" == m_podName) { Properties props = new Properties(); props.load(input); input.Close(); metaName = props.getProperty("pod.name"); m_podVersion = props.getProperty("pod.version"); m_fcodeVersion = props.getProperty("fcode.version"); m_depends = new Depend[0]; return; } else { SysInStream sysIn = new SysInStream(input); this.m_meta = (Map)sysIn.readProps().toImmutable(); sysIn.close(); metaName = meta("pod.name"); m_podVersion = meta("pod.version"); m_fcodeVersion = meta("fcode.version"); string dependsStr = meta("pod.depends").Trim(); if (dependsStr.Length == 0) { m_depends = new Depend[0]; } else { string[] toks = dependsStr.Split(';'); m_depends = new Depend[toks.Length]; for (int i = 0; i < m_depends.Length; ++i) { m_depends[i] = Depend.fromStr(toks[i].Trim()); } } } // check meta name matches podName passed to ctor if (m_podName == null) { m_podName = metaName; } if (m_podName != metaName) { throw new System.IO.IOException("Pod name mismatch " + m_podName + " != " + metaName); } // sanity checking if (FConst.FCodeVersion != m_fcodeVersion) { throw new System.IO.IOException("Invalid fcode version " + m_fcodeVersion); } }
/** * Adds a dependency. */ public void addDepend(Path path) { Depend depend = new Depend(path); depend.setRequireSource(_quercus.isRequireSource()); _dependList.add(depend); _depend.add(depend); }
public void ManufactureType_Class_With_Despendecies_Dependency_Passed_In_Created_Successfully() { IClassFactory testClassFactory = new JunctionPointer.Helpers.OCInject.ClassFactory(); testClassFactory.RegisterType <IDepend, Depend>(); testClassFactory.RegisterType <ITestClassWithDepend, TestClassWithDepend>(); IDepend newDepend = new Depend(); ITestClassWithDepend manufacturedType = testClassFactory.ManufactureType <ITestClassWithDepend>(newDepend); Assert.AreSame(newDepend, manufacturedType.Depend); }
/// <summary> /// Gets output data for the default values for GCSolar, /// equivalent to the third option on the windows start form. /// </summary> /// <returns></returns> public Dictionary <string, object> GetOutput() { DataTable dtDay = new DataTable(); DataTable dtKL = new DataTable(); Depend dp = new Depend(); dp.CalculatePhotolysisRatesHalfLivesTDay(out dtDay, out dtKL, common); object[] t1 = ToOutputArray(dtDay); object[] t2 = ToOutputArray(dtKL); Dictionary <string, object> result = new Dictionary <string, object> { ["dtDay"] = t1, ["dtKL"] = t2 }; return(result); }
public void ManufactureType_Class_With_Despendecies_Dependency_Passed_In_Created_Successfully() { IClassFactory testClassFactory = new JunctionPointer.Helpers.OCInject.ClassFactory(); testClassFactory.RegisterType<IDepend, Depend>(); testClassFactory.RegisterType<ITestClassWithDepend, TestClassWithDepend>(); IDepend newDepend = new Depend(); ITestClassWithDepend manufacturedType = testClassFactory.ManufactureType<ITestClassWithDepend>(newDepend); Assert.AreSame(newDepend, manufacturedType.Depend); }