コード例 #1
0
		private void SetLoaderPath(ExtendedProperties properties)
		{
			string loaderPath = "";
			// TODO: Solve multiple loader path problem in NVelocity
			if (Template.FileName == "")
			{
				loaderPath = BaseFolder;
			}
			else
			{
				loaderPath = Path.GetDirectoryName(Template.GetFullPath());
				if (loaderPath.IndexOf(BaseFolder) < 0 && loaderPath != BaseFolder)
				{
					loaderPath = BaseFolder + "," + loaderPath;
				}
				else if (loaderPath != BaseFolder)
				{
					loaderPath += "," + BaseFolder;
				}
			}
			// HACK: Setting loader path to base folder until loader problem is solved
			//loaderPath = BaseFolder;
			//System.Diagnostics.Debug.WriteLine("NVeleocity:loaderPath=" + loaderPath);
			if (properties.Contains("file.resource.loader.path"))
			{
				properties["file.resource.loader.path"] = loaderPath;
			}
			else
			{
				properties.AddProperty("file.resource.loader.path", loaderPath);
			}
		}
コード例 #2
0
		private void SetMacroLibraries(ExtendedProperties properties)
		{
			string libraries = "";
			foreach (MacroLibrary library in Context.Libraries)
			{
				if (libraries != "")
				{
					libraries += ",";
				}
				libraries += library.Address;
			}
			if (libraries == "")
			{
				return;
			}
			else
			{
				//System.Diagnostics.Debug.WriteLine("NVeleocity:libraries=" + libraries);
			}
			if (libraries.Length > 1)
			{
				if (properties.Contains("velocimacro.library"))
				{
					string library = properties["velocimacro.library"].ToString();
					properties["velocimacro.library"] = library + "," + libraries;
				}
				else
				{
					properties.AddProperty("velocimacro.library", libraries);
				}
			}
		}