コード例 #1
0
        public void AddReference(string resourcePath)
        {
            var module = moduleContainer.FindModuleContainingResource(resourcePath)
                         ?? moduleContainer.FindModule(resourcePath.TrimEnd('/', '*'));

            if (module == null)
            {
                // The resourcePath may be an external URL.
                Uri url;
                if (Uri.TryCreate(resourcePath, UriKind.Absolute, out url))
                {
                    modules.Add(Module.CreateExternalModule(resourcePath, location: ""));
                }
                else
                {
                    throw new ArgumentException("Resource not found: " + resourcePath);
                }
            }
            else
            {
                modules.Add(module);
            }
        }
コード例 #2
0
 public void Module_lib_has_2_scripts()
 {
     container.FindModule("lib").Resources.Length.ShouldEqual(2);
 }