Beispiel #1
0
        /// <summary>
        /// Convenience wrapper to create a source script without knowing the actual type of the script.
        /// </summary>
        /// <param name="separator"></param>
        /// <param name="file"></param>
        /// <param name="key"></param>
        /// <param name="pluginCache"></param>
        /// <returns></returns>
        public bool CreateScript(out ISourceScript script, string separator, string file, string key, Dictionary <string, object> pluginCache)
        {
            if (LockScriptCreation)
            {
                script = null;
                this.Log(DebugLevel.WARNINGS, Verbosity.LEVEL1, "A Plugin is trying to add a file outside of the main stage. Is the configuration correct?");
                return(false);
            }

            script = new SourceScript(separator, file, key, pluginCache);
            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Convenience wrapper to create a source script without knowing the actual type of the script.
        /// </summary>
        /// <param name="separator">the separator used.</param>
        /// <param name="file">the path of the file</param>
        /// <param name="key">the key of the file</param>
        /// <param name="importInfo">the import info of the key and path importation</param>
        /// <returns>the success state of the operation</returns>
        public bool TryCreateScript(out ISourceScript script, string separator, IFileContent file, ImportResult importInfo)
        {
            if (LockScriptCreation)
            {
                script = null;
                this.Warning("A Plugin is trying to add a file outside of the main stage. Is the configuration correct?");
                return(false);
            }

            script = new SourceScript(separator, file, importInfo);
            return(true);
        }