private ImportResult ComputeNameAndKey_Generic(string[] vars, string currentPath) { ImportResult ret = new ImportResult(); string filePath = ""; if (!Utils.TryResolvePathIncludeParameter(vars)) { return(ret); } string[] genParams = vars.Length > 1 ? vars.SubArray(1, vars.Length - 1).ToArray() : new string[0]; string rel = Path.Combine(currentPath, vars[0]); string key = Path.GetFullPath(rel); filePath = key; key += genParams.Length > 0 ? "." + genParams.Unpack(Separator) : ""; if (genParams.Length != 0) { ret.SetValue("genParams", genParams); } ret.SetValue("filename", filePath); ret.SetValue("key", key); ret.SetResult(true); return(ret); }
/// <summary> /// The default implementation of the key matching calculation /// </summary> /// <param name="vars">The import string in a source script</param> /// <param name="currentPath">the current path of the preprocessor</param> /// <returns>A result object.</returns> private ImportResult ComputeFileNameAndKey_Default(string[] vars, string currentPath) { ImportResult ret = new ImportResult(); if (!Utils.TryResolvePathIncludeParameter(vars)) { return(ret); } string rel = Path.Combine(currentPath, vars[0]); string key = Path.GetFullPath(rel); ret.SetValue("definedname", vars[0]); ret.SetValue("filename", key); ret.SetValue("key", key); ret.SetResult(true); return(ret); }
/// <summary> /// Adds a value to the plugin cache to be read later during the processing /// </summary> /// <param name="key">the key</param> /// <param name="value">the value</param> public void AddValueToCache(string key, object value) { importInfo.SetValue(key, value); }