• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IScript类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: LogPostExecution

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


示例17: LogBuilt

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


示例18: ContentChanged

 public YesNoResponse ContentChanged(IScript script)
 {
     using (ColorScope.WithColor(ConsoleColor.Red))
     {
         Console.Out.WriteLine("{0,35} : *** WARNING: Content changed", script.Name);
     }
     return YesNoResponse.Yes;
 }
开发者ID:kahlin,项目名称:mongomigrations,代码行数:8,代码来源:ConsoleInteraction.cs


示例19: ShowMenuScript

 public ShowMenuScript(IScriptFactory scriptFactory, IFunction caption, IFunction options, IFunction allowCancel, IScript callbackScript)
 {
     m_scriptFactory = scriptFactory;
     m_caption = caption;
     m_options = options;
     m_allowCancel = allowCancel;
     m_callbackScript = callbackScript;
 }
开发者ID:jaynabonne,项目名称:quest,代码行数:8,代码来源:ShowMenuScript.cs


示例20: AskScript

 public AskScript(ScriptContext scriptContext, IScriptFactory scriptFactory, IFunction<string> caption, IScript callbackScript)
 {
     m_scriptContext = scriptContext;
     m_worldModel = scriptContext.WorldModel;
     m_scriptFactory = scriptFactory;
     m_caption = caption;
     m_callbackScript = callbackScript;
 }
开发者ID:JatinR,项目名称:quest,代码行数:8,代码来源:AskScript.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IScriptContext类代码示例发布时间:2022-05-24
下一篇:
C# IScreenManager类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap