Example #1
0
        /// <summary>スクリプトの実行を要求します。</summary>
        /// <param name="scriptName">実行してほしいスクリプトの名前</param>
        /// <param name="requestPriority">実行の優先度</param>
        public void Request(string scriptName, ScriptPriority requestPriority)
        {
			if(requestPriority > _currentPriority)
            {
                RequestedScriptName = scriptName;
                RequestedScriptPriority = requestPriority;
                IsScriptRequested = true;
                ScriptReader.CancelRead();
                ScriptRequested?.Invoke(this, EventArgs.Empty);
            }
        }
Example #2
0
 /// <summary>スクリプトの実行を要求します。</summary>
 /// <param name="scriptName">実行してほしいスクリプトの名前</param>
 /// <param name="requestPriority">実行の優先度</param>
 public void Request(string scriptName, ScriptPriority requestPriority)
 {
     if (requestPriority > _currentPriority)
     {
         RequestedScriptName     = scriptName;
         RequestedScriptPriority = requestPriority;
         IsScriptRequested       = true;
         ScriptReader.CancelRead();
         ScriptRequested?.Invoke(this, EventArgs.Empty);
     }
 }
Example #3
0
 /// <summary>ブロッキングしてスクリプトを実行します。</summary>
 /// <param name="scriptName">実行するスクリプト名</param>
 /// <param name="priority">スクリプトの優先度</param>
 public void Read(string scriptName, ScriptPriority priority)
 {
     try
     {
         _currentPriority = priority;
         ScriptReader.ReadAsync(GetScriptPath(scriptName)).Wait();
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count == 1 && ex.InnerExceptions[0] is OperationCanceledException)
         {
         }
     }
     finally
     {
         //待ち状態にしとかないとリクエストが通らない事に注意
         _currentPriority = ScriptPriority.Idle;
     }
 }
Example #4
0
        /// <summary>ブロッキングしてスクリプトを実行します。</summary>
        /// <param name="scriptName">実行するスクリプト名</param>
        /// <param name="priority">スクリプトの優先度</param>
        public void Read(string scriptName, ScriptPriority priority)
        {
            try
            {
                _currentPriority = priority;
                ScriptReader.ReadAsync(GetScriptPath(scriptName)).Wait();
            }
            catch (AggregateException ex)
            {
                if (ex.InnerExceptions.Count == 1 && ex.InnerExceptions[0] is OperationCanceledException)
                {

                }
            }
            finally
            {
                //待ち状態にしとかないとリクエストが通らない事に注意
                _currentPriority = ScriptPriority.Idle;
            }
        }
 public ScriptResource ScriptPriority(ScriptPriority scriptPriority)
 {
     _scriptPriority = scriptPriority;
     //+
     return this;
 }
 private ScriptResource()
 {
     _scriptPriority = Nalarium.Client.ScriptPriority.Normal;
 }
Example #7
0
 /// <summary>リクエスト内容でインスタンスを初期化します。</summary>
 /// <param name="scriptName">実行したいスクリプト名</param>
 /// <param name="priority">実行の優先度</param>
 public ScriptRequestorEventArgs(string scriptName, ScriptPriority priority=ScriptPriority.Normal)
 {
     ScriptName = scriptName;
     Priority = priority;
 }
Example #8
0
 /// <summary>スクリプトの実行を要求します。</summary>
 /// <param name="scriptName">実行したいスクリプト名</param>
 /// <param name="priority">実行の優先度</param>
 public void Request(string scriptName, ScriptPriority priority = ScriptPriority.Normal)
 {
     ScriptRequested?.Invoke(this, new ScriptRequestorEventArgs(scriptName, priority));
 }
Example #9
0
 /// <summary>リクエスト内容でインスタンスを初期化します。</summary>
 /// <param name="scriptName">実行したいスクリプト名</param>
 /// <param name="priority">実行の優先度</param>
 public ScriptRequestorEventArgs(string scriptName, ScriptPriority priority = ScriptPriority.Normal)
 {
     ScriptName = scriptName;
     Priority   = priority;
 }
Example #10
0
 /// <summary>スクリプトの実行を要求します。</summary>
 /// <param name="scriptName">実行したいスクリプト名</param>
 /// <param name="priority">実行の優先度</param>
 public void Request(string scriptName, ScriptPriority priority = ScriptPriority.Normal)
 {
     ScriptRequested?.Invoke(this, new ScriptRequestorEventArgs(scriptName, priority));
 }
Example #11
0
 public void Request(string scriptName, ScriptPriority priority) 
     => _scriptStateManager.Request(scriptName, priority);
Example #12
0
 public void Request(string scriptName, ScriptPriority priority)
 => _scriptStateManager.Request(scriptName, priority);