当前位置: 首页>>代码示例>>C#>>正文


C# IScript类代码示例

本文整理汇总了C#中IScript的典型用法代码示例。如果您正苦于以下问题:C# IScript类的具体用法?C# IScript怎么用?C# IScript使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IScript类属于命名空间,在下文中一共展示了IScript类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ScriptStarting

 public bool ScriptStarting(IScript script)
 {
     if (AskConfirmation(String.Format("Start script '{0}'", script.Name)))
         return scriptRunner.ScriptStarting(script);
     else
         return false;
 }
开发者ID:raltamirano,项目名称:rant,代码行数:7,代码来源:AskConfirmationDecorator.cs

示例2: ScriptSerializer

        /// <summary>
        /// Initializes a new instance of the <see cref="ScriptSerializer"/> class.
        /// </summary>
        /// <param name="script">The script.</param>
        public ScriptSerializer(IScript script)
        {
            if (script == null)
                throw new ArgumentNullException("script");

            m_Script = script;
        }
开发者ID:pavkam,项目名称:school,代码行数:11,代码来源:ScriptSerializer.cs

示例3: ForEachScript

 public ForEachScript(ScriptContext scriptContext, string variable, IFunctionGeneric list, IScript loopScript)
 {
     m_scriptContext = scriptContext;
     m_variable = variable;
     m_list = list;
     m_loopScript = loopScript;
 }
开发者ID:JatinR,项目名称:quest,代码行数:7,代码来源:ForEachScript.cs

示例4: LogPostExecution

 public virtual void LogPostExecution(IScript script)
 {
     if (SimpleSaveExtensions.LogScriptsPostExecution)
     {
         Log(script, "Executed script");
     }
 }
开发者ID:Paymentsense,项目名称:Dapper.SimpleSave,代码行数:7,代码来源:BasicSimpleSaveLogger.cs

示例5: ScriptComponent

 public ScriptComponent(int gameObjectId, String gameObjectkey, IScript script)
 {
     m_ComponentType = ComponentType.Instance(Constant.enumComponent.SCRIPT);
     m_Script = script;
     m_GameObjectId = gameObjectId;
     m_GameObjectkey = gameObjectkey;
 }
开发者ID:kaldhu,项目名称:MyGameEngine,代码行数:7,代码来源:ScriptComponent.cs

示例6: LogBuilt

 public virtual void LogBuilt(IScript script)
 {
     if (SimpleSaveExtensions.LogBuiltScripts && Logger.IsDebugEnabled)
     {
         Logger.Debug(BuildDebugMessage(script, "Built script"));
     }
 }
开发者ID:Paymentsense,项目名称:Dapper.SimpleSave,代码行数:7,代码来源:BasicSimpleSaveLogger.cs

示例7: LogExecutionTime

        public virtual void LogExecutionTime(long executionTimeMilliseconds, IScript script)
        {
            if (executionTimeMilliseconds > SimpleSaveExtensions.ExecutionTimeWarningEmitThresholdMilliseconds)
            {
                if (Logger.IsWarnEnabled)
                {
                    Logger.Warn(string.Format(
                        @"SIMPLESAVE SCRIPT EXECUTED IN {0}ms:
{1}
CALLING STACK TRACE:
{2}",
                        executionTimeMilliseconds,
                        script.Buffer,
                        Environment.StackTrace));
                }
            }
            else
            {
                if (Logger.IsInfoEnabled)
                {
                    Logger.Info(string.Format(
                        "SimpleSave script executed in {0}ms",
                        executionTimeMilliseconds));
                }
            }
        }
开发者ID:Paymentsense,项目名称:Dapper.SimpleSave,代码行数:26,代码来源:BasicSimpleSaveLogger.cs

示例8: GetInputScript

 public GetInputScript(ScriptContext scriptContext, IScriptFactory scriptFactory, IScript callbackScript)
 {
     m_scriptContext = scriptContext;
     m_worldModel = scriptContext.WorldModel;
     m_scriptFactory = scriptFactory;
     m_callbackScript = callbackScript;
 }
开发者ID:JatinR,项目名称:quest,代码行数:7,代码来源:GetInputScript.cs

示例9: Recompile

        public void Recompile()
        {
            if (_compiling)
                return;

            _host.Reset();
            Commands.Clear();
            _script = null;
            _compiling = true;

            Send("Compiling...");

            ThreadPool.QueueUserWorkItem(a =>
            {
                try
                {
                    var type = Compile();
                    if (type == null)
                        return;

                    Send("Done!");

                    SafeInvoke(() =>
                    {
                        _script = (IScript)Activator.CreateInstance(type);
                        _script.Initialize(_host);
                    });
                }
                finally
                {
                    _compiling = false;
                }
            });
        }
开发者ID:ToXIcGaming,项目名称:SteamMobile,代码行数:34,代码来源:ScriptRoom.cs

示例10: IsRemoved

        private bool IsRemoved(IScript script, IEnumerable<IScript> currentScripts, IEnumerable<IScript> scriptLog)
        {
            bool isInLog = scriptLog.Any(s => StrCmp(script.Name, s.Name));
            bool isInCurrent = currentScripts.Any(s => StrCmp(script.Name, s.Name));

            return isInLog && !isInCurrent;
        }
开发者ID:kahlin,项目名称:mongomigrations,代码行数:7,代码来源:ScriptDiff.cs

示例11: IfScript

 public IfScript(IFunction<bool> expression, IScript thenScript, IScript elseScript, WorldModel worldModel)
 {
     m_expression = expression;
     m_thenScript = thenScript;
     m_elseScript = elseScript;
     m_worldModel = worldModel;
 }
开发者ID:Pertex,项目名称:Quest,代码行数:7,代码来源:IfScript.cs

示例12: DoExecute

		/// <summary>
		/// Executes the script.
		/// </summary>
		/// <param name="p_scpScript">The C# Script to execute.</param>
		/// <returns><c>true</c> if the script completes successfully;
		/// <c>false</c> otherwise.</returns>
		/// <exception cref="ArgumentException">Thrown if <paramref name="p_scpScript"/> is not a
		/// <see cref="CSharpScript"/>.</exception>
		public override bool DoExecute(IScript p_scpScript)
		{
			if (!(p_scpScript is CSharpScript))
				throw new ArgumentException("The given script must be of type CSharpScript.", "p_scpScript");

			CSharpScript cscScript = (CSharpScript)p_scpScript;

			byte[] bteScript = Compile(cscScript.Code);
			if (bteScript == null)
				return false;

			AppDomain admScript = CreateSandbox(p_scpScript);
			try
			{
				m_csfFunctions.TaskStarted += new EventHandler<EventArgs<IBackgroundTask>>(Functions_TaskStarted);
				object[] args = { m_csfFunctions };
				AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
				ScriptRunner srnRunner = null;
				try
				{
					srnRunner = (ScriptRunner)admScript.CreateInstanceFromAndUnwrap(typeof(ScriptRunner).Assembly.ManifestModule.FullyQualifiedName, typeof(ScriptRunner).FullName, false, BindingFlags.Default, null, args, null, null);
				}
				finally
				{
					AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve;
				}
				return srnRunner.Execute(bteScript);
			}
			finally
			{
				m_csfFunctions.TaskStarted -= Functions_TaskStarted;
				AppDomain.Unload(admScript);
			}
		}
开发者ID:NexusMods,项目名称:NexusModManager-4.5,代码行数:42,代码来源:CSharpScriptExecutor.cs

示例13: FunctionCallScript

 public FunctionCallScript(GameLoader loader, string procedure, IList<IFunction> parameters, IScript paramFunction)
 {
     m_loader = loader;
     m_procedure = procedure.Replace(" ", Utility.SpaceReplacementString);
     m_parameters = new FunctionCallParameters(parameters);
     m_paramFunction = paramFunction;
 }
开发者ID:jaynabonne,项目名称:quest,代码行数:7,代码来源:FunctionCallScript.cs

示例14: ForEachScript

 public ForEachScript(WorldModel worldModel, string variable, IFunctionGeneric list, IScript loopScript)
 {
     m_worldModel = worldModel;
     m_variable = variable;
     m_list = list;
     m_loopScript = loopScript;
 }
开发者ID:Pertex,项目名称:Quest,代码行数:7,代码来源:ForEachScript.cs

示例15: SqlPlusScript

        public SqlPlusScript(IScript script)
        {
            _script = script;

            _wrappedScriptPath = System.IO.Path.GetTempFileName();

            var reader = new ScriptReader();

            using (var fileStream = File.OpenWrite(_wrappedScriptPath))
            {
                using (var tempFile = new StreamWriter(fileStream, UTF8.WithoutByteOrderMark))
                {
                    tempFile.WriteLine("SET ECHO ON");
                    tempFile.WriteLine("WHENEVER SQLERROR EXIT SQL.SQLCODE");

                    foreach (var scriptLine in reader.GetContents(_script.Path))
                    {
                        tempFile.WriteLine(scriptLine);
                    }

                    tempFile.WriteLine("COMMIT;");
                    tempFile.WriteLine("EXIT");
                }
            }
        }
开发者ID:plmwong,项目名称:soothsayer,代码行数:25,代码来源:SqlPlusScript.cs


注:本文中的IScript类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。