示例#1
0
        static void Main(string[] args)
        {
            //Func<string, string> selector = str => str.ToUpper();

            //Func<int, string> test = t => (t * 2).ToString();

            //Predicate<Employee> premp = new Predicate<Employee>(findEmployee);
            //Employee employee = employees.Find(delegate(Employee x) { return x.Id == 2; });
            //Console.WriteLine(employee.Name);
            //Console.ReadLine();

            DisplayMessage dm = new DisplayMessage(Hello);
            dm("Hello delegate");
            GetMessage gm = new GetMessage(GoodBey);
            Console.WriteLine(gm(" delegate"));
            Console.ReadLine();
        }
示例#2
0
        /// <summary>
        ///  Stop the asynchronous service and Waits to complete all worker thread to complete.
        /// </summary>
        public void StopAsyncProcess()
        {
            // Breaks the infinite loop of Main thread.
            this._infiniteLoop = false;

            // Wait the end of the main thread.
            this._mainThread.Join();

            // Update stop command to all the running asynchronous task
            ApsParameterValue asyncParameterValue = new ApsParameterValue(
                "AsyncProcessingService", "StopAllTask", "StopAllTask", "SQL",
                new MyUserInfo("AsyncProcessingService", "AsyncProcessingService"));

            asyncParameterValue.StatusId  = (int)AsyncStatus.Processing;
            asyncParameterValue.CommandId = (int)AsyncCommand.Stop;

            ApsLayerB      layerB           = new ApsLayerB();
            ApsReturnValue asyncReturnValue = (ApsReturnValue)layerB.DoBusinessLogic(
                (BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted);

            if (asyncReturnValue.ErrorFlag)
            {
                LogIF.ErrorLog("ASYNC-SERVICE",
                               "ErrorMessageID: " + asyncReturnValue.ErrorMessageID +
                               "ErrorMessage: " + asyncReturnValue.ErrorMessage);
            }

            // Wait for all worker thread to be complete
            LogIF.InfoLog("ASYNC-SERVICE", GetMessage.GetMessageDescription("I0004"));

            while (this._workerThreadCount != 0)
            {
                // Wait for the completion of the worker thread.
                Thread.Sleep(this._numberOfSeconds * 1000);
            }

            // Log after completing all worker threads
            LogIF.InfoLog("ASYNC-SERVICE", GetMessage.GetMessageDescription("I0008"));
        }
示例#3
0
        /// <summary>
        /// Sets Asynchronous Processing Service exception flag by checking prerequisites
        /// </summary>
        public void SetServiceException()
        {
            try
            {
                // Checks for successful connection to the database.
                ApsParameterValue asyncParameterValue = new ApsParameterValue(
                    "AsyncProcessingService", "TestConnection", "TestConnection", "SQL",
                    new MyUserInfo("AsyncProcessingService", "AsyncProcessingService"));

                ApsLayerB layerB = new ApsLayerB();
                layerB.DoBusinessLogic((BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.NoTransaction);

                // Asynchronous Processing Service initializes successfully without any errors
                this._isServiceException = false;
            }
            catch (Exception ex)
            {
                // Service Failed due to unexpected exception.
                this._isServiceException = true;
                LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0000"), ex.Message.ToString()));
            }
        }
示例#4
0
 public HubSpotClient(string apiKey, GetMessage getMessage = null)
 {
     _apiKey     = apiKey;
     _getMessage = getMessage;
 }
示例#5
0
 public void DebugMessage(string message)
 {
     GetMessage?.Invoke(message);
 }
示例#6
0
 public void MsgCallback(string msg)
 {
     GetMessage.Items.Add(msg);
     GetMessage.ScrollIntoView(GetMessage.Items[GetMessage.Items.Count - 1]);
 }
示例#7
0
 /// <summary>
 /// メッセージを受信したときに呼び出すイベント
 /// </summary>
 /// <param name="e">message</param>
 protected virtual void OnGetMessage(TextEventArgs e)
 {
     // nullじゃなければ呼び出す
     GetMessage?.Invoke(this, e);
 }
示例#8
0
        /// <summary>業務例外発生時の処理を実装</summary>
        /// <param name="baEx">BusinessApplicationException</param>
        /// <param name="fxEventArgs">イベントハンドラの共通引数</param>
        /// <remarks>画面コード親クラス1から利用される派生の末端</remarks>
        protected override void UOC_ABEND(BusinessApplicationException baEx, FxEventArgs fxEventArgs)
        {
            // 業務例外発生時の処理を実装
            // TODO:

            // ここに、メッセージの組み立てロジックを実装する。

            // メッセージ編集処理 ------------------------------------------

            string messageID          = baEx.messageID;
            string messageDescription = "";

            // メッセージIDから、対応するメッセージを取得する。
            messageDescription = GetMessage.GetMessageDescription(messageID);
            if (messageDescription == "")
            {
                // メッセージが取得できなかった場合
                messageDescription = baEx.Message;
            }
            else
            {
                // メッセージが取得できた場合、
                // 必要なら、メッセージに、可変文字列を組み込む。

                // 方式は、プロジェクト毎に検討のこと。
                messageDescription = messageDescription.Replace("%1", baEx.Message);
                messageDescription = messageDescription.Replace("%2", baEx.Information);
            }

            // -------------------------------------------------------------

            // メッセージ表示処理 ------------------------------------------

            #region メッセージボックスを使用して表示する場合。

            // 「OK」メッセージダイアログの表示処理
            this.ShowOKMessageDialog(
                messageID, messageDescription,
                FxEnum.IconType.Exclamation,
                "BusinessApplicationExceptionを使用したダイアログ表示");

            #endregion

            #region マスタ ページ上のラベルに表示する場合。

            //// 結果表示するメッセージ エリア
            //Label label = (Label)this.GetMasterWebControl("Label1");
            //label.Text = "";

            //// 結果(業務続行可能なエラー)
            //label.Text = "ErrorMessageID:" + baEx.messageID + "\r\n";
            //label.Text += "ErrorMessage:" + baEx.Message + "\r\n";
            //label.Text += "ErrorInfo:" + baEx.Information + "\r\n";

            #endregion

            // -------------------------------------------------------------

            // 性能測定終了

            // イベント処理開始前にエラーが発生した場合は、
            // this.perfRecがnullの場合があるので、null対策コードを挿入する。
            if (this.perfRec == null)
            {
                // nullの場合、新しいインスタンスを生成し、性能測定開始。
                this.perfRec = new PerformanceRecorder();
                perfRec.StartsPerformanceRecord();
            }

            this.perfRec.EndsPerformanceRecord();

            // 認証ユーザ情報を取得する ------------------------------------
            this.GetUserInfo();

            // ACCESSログ出力-----------------------------------------------

            // ------------
            // メッセージ部
            // ------------
            // ユーザ名, IPアドレス,
            // レイヤ, 画面名, コントロール名, 処理名
            // 処理時間(実行時間), 処理時間(CPU時間)
            // エラーメッセージID, エラーメッセージ等
            // ------------
            string strLogMessage =
                "," + UserInfo.UserName +
                "," + Request.UserHostAddress +
                "," + "<-----" +
                "," + this.ContentPageFileNoEx +
                "," + fxEventArgs.ButtonID +
                "," + "" +
                "," + this.perfRec.ExecTime +
                "," + this.perfRec.CpuTime +
                "," + baEx.messageID +
                "," + baEx.Message;

            // Log4Netへログ出力
            LogIF.WarnLog("ACCESS", strLogMessage);

            // -------------------------------------------------------------
        }
示例#9
0
        public async Task <ICollection <MessageGroup> > Handle(GetMessage request, CancellationToken cancellationToken)
        {
            var result = await _chatManager.GetOldMessages(request.Id);

            return(result);
        }
示例#10
0
 private static void Show_Message(GetMessage _del)
 {
     _del.Invoke();
 }
示例#11
0
 protected override void DebugReturn(MessageType messageType, string msg)
 {
     GetMessage?.Invoke(messageType, msg);
 }
示例#12
0
        /// <summary>
        ///  Maintains the single worker thread functionalities.
        /// </summary>
        /// <param name="asyncTask">Selected Asynchronous Task</param>
        private void WorkerThreadCallBack(object asyncTask)
        {
            AsyncProcessingServiceReturnValue selectedAsyncTask = (AsyncProcessingServiceReturnValue)asyncTask;

            // A new worker thread started an Async task
            this._workerThreadCount++;

            try
            {
                // To handle unstable "Register" state, when you invoke [Abort] at this state
                if (selectedAsyncTask.CommandId == (int)AsyncProcessingServiceParameterValue.AsyncCommand.Abort)
                {
                    throw new BusinessSystemException("APSAbortCommand", GetMessage.GetMessageDescription("CTE0004"));
                }

                // Call User Program to execute by using communication control function
                AsyncProcessingServiceParameterValue asyncParameterValue = new AsyncProcessingServiceParameterValue("AsyncProcessingService", "Start", "Start", "SQL",
                                                                                                                    new MyUserInfo(selectedAsyncTask.UserId, selectedAsyncTask.TaskId.ToString()));
                asyncParameterValue.TaskId = selectedAsyncTask.TaskId;
                asyncParameterValue.Data   = selectedAsyncTask.Data;
                CallController callController = new CallController(asyncParameterValue.User);
                AsyncProcessingServiceReturnValue asyncReturnValue = (AsyncProcessingServiceReturnValue)callController.Invoke(selectedAsyncTask.ProcessName, asyncParameterValue);

                if (asyncReturnValue.ErrorFlag == true)
                {
                    if (asyncReturnValue.ErrorMessageID == "APSStopCommand")
                    {
                        string exceptionInfo = "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + Environment.NewLine + "ErrorMessage: " + asyncReturnValue.ErrorMessage;
                        // Asynchronous task is stopped due to user 'stop' command.
                        this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.RETRY, exceptionInfo);
                        LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0001") + asyncReturnValue.ErrorMessage, selectedAsyncTask.TaskId));
                    }
                    else
                    {
                        // Exception occurred by other than BusinessApplicationException

                        if (selectedAsyncTask.NumberOfRetries < this._maxNumberOfRetries)
                        {
                            // Asynchronous task does not exceeds the maximum number of retries
                            // Updated as retry later
                            string exceptionInfo = "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + Environment.NewLine + "ErrorMessage: " + asyncReturnValue.ErrorMessage;
                            selectedAsyncTask.NumberOfRetries += 1;
                            this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.RETRY, exceptionInfo);
                            LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0004"), selectedAsyncTask.TaskId));
                        }
                        else
                        {
                            // Asynchronous task exceeds maximum number of retries
                            // Update task as abort
                            string exceptionInfo = "ErrorMessageID: " + asyncReturnValue.ErrorMessageID + Environment.NewLine + "ErrorMessage: " + asyncReturnValue.ErrorMessage;
                            this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.FAIL, exceptionInfo);
                            LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0005"), selectedAsyncTask.TaskId));
                        }
                    }
                }
                else
                {
                    // Selected Asynchronous task is completed successfully.
                    this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.SUCCESS);
                    LogIF.InfoLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("I0003"), selectedAsyncTask.TaskId));
                }
            }
            catch (BusinessSystemException ex)
            {
                // Asynchronous task is aborted due to BusinessSystemException sent by user program.
                string exceptionInfo = "ErrorMessageID: " + ex.messageID + Environment.NewLine + "ErrorMessage: " + ex.Message;
                this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.FAIL, exceptionInfo);
                LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0006"), selectedAsyncTask.TaskId, ex.Message));
            }
            catch (Exception ex)
            {
                // Asynchronous task is aborted due to unexpected exception.
                string exceptionInfo = "ErrorMessageID: " + ex.GetType().Name + Environment.NewLine + "ErrorMessage: " + ex.Message;
                this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.FAIL, exceptionInfo);
                LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0006"), selectedAsyncTask.TaskId, ex.Message));
            }
            finally
            {
                // Async task is over
                this._workerThreadCount--;
            }
        }
示例#13
0
 public void Show_Message(GetMessage _del)   //Mothod using delegate
 {
     _del?.Invoke(2020 - Date);
 }
示例#14
0
 public HttpResult Get(GetMessage request)
 {
     var ds = new DataStore();
     var message = ds.GetMessage(request.Id);
     return new HttpResult(message);
 }
示例#15
0
 private void Client_GetMessage(PlayerInfo infos, string message)
 {
     GetMessage?.Invoke(infos, message);
 }
示例#16
0
 protected abstract void       AssertCorrectUseOfDependencies(GetMessage sut);
示例#17
0
 /// <summary>メッセージ取得(埋め込まれたリソース対応)</summary>
 private void button11_Click(object sender, RoutedEventArgs e)
 {
     this.textBox5.Text = GetMessage.GetMessageDescription(this.textBox4.Text);
 }
示例#18
0
 public GetMessages(String op, GetMessage f)
 {
     OpCode = op;
     Funct = f;
 }
        /// <summary>マニュフェストファイルを生成</summary>
        private void btnCreateManifesto_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.lbxZIPFiles.Items.Count == 0)
                {
                    //throw new Exception(string.Format(GetMessage.GetMessageDescription("E0007"), "ZIPファイル"));
                    //For internationalization, Replaced all the Japanese language exception messages with GetMessage.GetMessageDescription() method call
                    throw new Exception(string.Format(GetMessage.GetMessageDescription("E0007"), GetMessage.GetMessageDescription("M0003")));
                }

                if (string.IsNullOrEmpty(this.txtInsDir.Text))
                {
                    //throw new Exception(string.Format(GetMessage.GetMessageDescription("E0007"), "インストール ディレクトリ"));
                    //For internationalization, Replaced all the Japanese language exception messages with GetMessage.GetMessageDescription() method call
                    throw new Exception(string.Format(GetMessage.GetMessageDescription("E0007"), GetMessage.GetMessageDescription("M0004")));
                }

                if (string.IsNullOrEmpty(this.txtExeName.Text))
                {
                    //throw new Exception(string.Format(GetMessage.GetMessageDescription("E0007"), "EXE名(パス)"));
                    //For internationalization, Replaced all the Japanese language exception messages with GetMessage.GetMessageDescription() method call
                    throw new Exception(string.Format(GetMessage.GetMessageDescription("E0007"), GetMessage.GetMessageDescription("M0005")));
                }

                // 保存
                this.saveFileDialog1.Reset(); // ごみを消去
                this.saveFileDialog1.DefaultExt = "mft";
                this.saveFileDialog1.ShowDialog();

                using (StreamWriter sw = new StreamWriter(
                           saveFileDialog1.FileName, false, Encoding.GetEncoding(CustomEncode.UTF_8)))
                {
                    sw.WriteLine("ins " + this.txtInsDir.Text);
                    sw.WriteLine("exe " + this.txtExeName.Text);

                    foreach (string zipFile in this.lbxZIPFiles.Items)
                    {
                        string[] temp = zipFile.Split('\\');

                        sw.WriteLine("zip " + temp[temp.Length - 1]);
                        sw.WriteLine("md5 " + Program.GetMD5Hash(zipFile));
                    }
                }
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message, "エラーが発生しました。", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //For internationalization, Replaced all the Japanese language to ResourceMgr.GetString() method call
                MessageBox.Show(ex.Message, ResourceMgr.GetString("E0001"), MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        /// <summary>チェック処理</summary>
        private void CheckComp_DeComp()
        {
            if (string.IsNullOrEmpty(this.txtFolder.Text))
            {
                //throw new Exception(string.Format(GetMessage.GetMessageDescription("E0007"), "フォルダ パス"));
                //For internationalization, Replaced all the Japanese language exception messages with GetMessage.GetMessageDescription() method call
                throw new Exception(string.Format(GetMessage.GetMessageDescription("E0007"), GetMessage.GetMessageDescription("M0001")));
            }

            if (string.IsNullOrEmpty(this.txtFile.Text))
            {
                //throw new Exception(string.Format(GetMessage.GetMessageDescription("E0007"), "ファイル パス"));
                //For internationalization, Replaced all the Japanese language exception messages with GetMessage.GetMessageDescription() method call
                throw new Exception(string.Format(GetMessage.GetMessageDescription("E0007"), GetMessage.GetMessageDescription("M0002")));
            }
        }
示例#21
0
 /// <summary>
 /// Shutdown this service with main thread and worker thread..
 /// </summary>
 protected override void OnShutdown()
 {
     // Stop the process of asynchronous service and Waits to complete all worker thread to complete.
     LogIF.InfoLog("ASYNC-SERVICE", GetMessage.GetMessageDescription("I0007"));
     this.StopAsyncProcess();
 }
示例#22
0
 public GetMessages(String op, GetMessage f)
 {
     OpCode = op;
     Funct  = f;
 }
示例#23
0
        /// <summary>
        ///  Maintains the Main thread of the Asynchronous Service
        /// </summary>
        public void MainThreadInvoke()
        {
            // Asynchronous service is started
            LogIF.InfoLog("ASYNC-SERVICE", GetMessage.GetMessageDescription("I0001"));

            // Infinte loop processing for selecting register task.
            while (this._infiniteLoop)
            {
                try
                {
                    // Get asynchronous task from the database.
                    AsyncProcessingServiceParameterValue asyncParameterValue = new AsyncProcessingServiceParameterValue("AsyncProcessingService", "SelectTask", "SelectTask", "SQL",
                                                                                                                        new MyUserInfo("AsyncProcessingService", "AsyncProcessingService"));
                    asyncParameterValue.RegistrationDateTime = DateTime.Now - new TimeSpan(_maxNumberOfHours, 0, 0);
                    asyncParameterValue.NumberOfRetries      = this._maxNumberOfRetries;
                    asyncParameterValue.CompletionDateTime   = DateTime.Now - new TimeSpan(_maxNumberOfHours, 0, 0);
                    LayerB layerB = new LayerB();
                    AsyncProcessingServiceReturnValue selectedAsyncTask = (AsyncProcessingServiceReturnValue)layerB.DoBusinessLogic(
                        (BaseParameterValue)asyncParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted);

                    // Existence check of asynchronous task
                    if (string.IsNullOrEmpty(selectedAsyncTask.UserId))
                    {
                        // Asynchronous task does not exist.

                        // Wait for the asynchronous task to be registered in the database.
                        Thread.Sleep(this._numberOfSeconds * 1000);

                        // Continue to this infinite loop.
                        continue;
                    }
                    // Asynchronous task exists.

                    // Check the number of free worker threads.
                    int freeWorkerThreads     = 0;
                    int completionPortThreads = 0;

                    // Gets the available threads.
                    ThreadPool.GetAvailableThreads(out freeWorkerThreads, out completionPortThreads);

                    while (freeWorkerThreads == 0)
                    {
                        // Wait for the completion of the worker thread.
                        Thread.Sleep(this._numberOfSeconds * 1000);

                        // Get available threads.
                        ThreadPool.GetAvailableThreads(out freeWorkerThreads, out completionPortThreads);
                    }

                    // Selected asynchronous task is assigned to a worker thread
                    this.UpdateAsyncTask(selectedAsyncTask, AsyncTaskUpdate.START);
                    LogIF.InfoLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("I0002"), selectedAsyncTask.TaskId));

                    // Assign the task to the worker thread
                    ThreadPool.QueueUserWorkItem(new WaitCallback(this.WorkerThreadCallBack), (object)selectedAsyncTask);
                }
                catch (Exception ex)
                {
                    // Service Failed due to unexpected exception.
                    this._infiniteLoop = false;
                    LogIF.ErrorLog("ASYNC-SERVICE", string.Format(GetMessage.GetMessageDescription("E0000"), ex.Message.ToString()));
                }
            }
        }
示例#24
0
 private static void ShowMessage(GetMessage del)
 {
     del?.Invoke();
 }
        public async Task <IHttpActionResult> GetAnswerForUser(GetMessage model)
        {
            var result = await services.GetAnswerForUser(model);

            return(Ok(result));
        }
示例#26
0
        /// <summary>
        /// Main
        /// </summary>
        static void Main(string[] args)
        {
            #region Culture information(Culture and UICulture) is set up here.

            // Specifications changed by a command line argument are good.

            // The resolution of the command line argument is possible in following API.
            //PubCmnFunction.GetCommandArgs(・・・);

            Dictionary <string, string> dic = null;
            List <string> list = null;

            PubCmnFunction.GetCommandArgs('/', out dic, out list);

            if (dic.ContainsKey("/CULTURE"))
            {
                // Use the UICulture.
                Thread.CurrentThread.CurrentUICulture
                    = new System.Globalization.CultureInfo(dic["/CULTURE"]);
            }

            #endregion

            #region A result is written in standard output.

            #region (1) PublicExceptionMessage

            Console.WriteLine("<PublicExceptionMessage>");
            Console.WriteLine("NO_CONFIG:" + PublicExceptionMessage.NO_CONFIG);
            Console.WriteLine("SWITCH_ERROR:" + PublicExceptionMessage.SWITCH_ERROR);
            Console.WriteLine("COMMANDTIMEOUT_ERROR:" + PublicExceptionMessage.COMMANDTIMEOUT_ERROR);
            Console.WriteLine("RESOURCE_FILE_NOT_FOUND:" + PublicExceptionMessage.RESOURCE_FILE_NOT_FOUND);
            Console.WriteLine("XML_DECLARATION_ERROR:" + PublicExceptionMessage.XML_DECLARATION_ERROR);
            Console.WriteLine("XML_ELEMENT_ERROR:" + PublicExceptionMessage.XML_ELEMENT_ERROR);
            Console.WriteLine("XML_ELEMENT_ERROR_LOG4NET:" + PublicExceptionMessage.XML_ELEMENT_ERROR_LOG4NET);
            Console.WriteLine("ZIP_PASSWORD:"******"LATEBIND_ERROR0:" + PublicExceptionMessage.LATEBIND_ERROR0);
            Console.WriteLine("LATEBIND_ERROR1:" + PublicExceptionMessage.LATEBIND_ERROR1);
            Console.WriteLine("LATEBIND_ERROR2:" + PublicExceptionMessage.LATEBIND_ERROR2);
            Console.WriteLine("LATEBIND_ERROR3:" + PublicExceptionMessage.LATEBIND_ERROR3);
            Console.WriteLine("DB_ISO_LEVEL_PARAM_ERROR_UC:" + PublicExceptionMessage.DB_ISO_LEVEL_PARAM_ERROR_UC);
            Console.WriteLine("DB_ISO_LEVEL_PARAM_ERROR_RR:" + PublicExceptionMessage.DB_ISO_LEVEL_PARAM_ERROR_RR);
            Console.WriteLine("DB_ISO_LEVEL_PARAM_ERROR_SS:" + PublicExceptionMessage.DB_ISO_LEVEL_PARAM_ERROR_SS);
            Console.WriteLine("DB_ISO_LEVEL_PARAM_ERROR_USR:"******"DB_ISO_LEVEL_PARAM_ERROR_NC:" + PublicExceptionMessage.DB_ISO_LEVEL_PARAM_ERROR_NC);
            Console.WriteLine("THIS_DPQ_TAG_IS_UNKNOWN:" + PublicExceptionMessage.THIS_DPQ_TAG_IS_UNKNOWN);
            Console.WriteLine("DPQ_TAG_FORMAT_ERROR:" + PublicExceptionMessage.DPQ_TAG_FORMAT_ERROR);
            Console.WriteLine("DPQ_TAG_NAME_ATTR_NOT_EXIST:" + PublicExceptionMessage.DPQ_TAG_NAME_ATTR_NOT_EXIST);
            Console.WriteLine("DPQ_TAG_NAME_ATTR_VALUE_IS_EMPTY:" + PublicExceptionMessage.DPQ_TAG_NAME_ATTR_VALUE_IS_EMPTY);
            Console.WriteLine("DPQ_TAG_VALUE_ATTR_NOT_EXIST:" + PublicExceptionMessage.DPQ_TAG_VALUE_ATTR_NOT_EXIST);
            Console.WriteLine("DPQ_TAG_INNER_PARAM_NOT_EXIST:" + PublicExceptionMessage.DPQ_TAG_INNER_PARAM_NOT_EXIST);
            Console.WriteLine("PARAM_TAG_ERROR:" + PublicExceptionMessage.PARAM_TAG_ERROR);
            Console.WriteLine("PARAM_TAG_TYPE_ERROR:" + PublicExceptionMessage.PARAM_TAG_TYPE_ERROR);
            Console.WriteLine("PARAM_TAG_VALUE_ERROR:" + PublicExceptionMessage.PARAM_TAG_VALUE_ERROR);
            Console.WriteLine("DPQ_SET_ONLY_NULL_OR_BOOL_TO_INNER_PARAM_VALUE:" + PublicExceptionMessage.DPQ_SET_ONLY_NULL_OR_BOOL_TO_INNER_PARAM_VALUE);
            Console.WriteLine("DPQ_ELSE_TAG_DOESNT_EXIST_WHEN_TEXT_PARAM_OF_IF_TAG_IS_NULL:" + PublicExceptionMessage.DPQ_ELSE_TAG_DOESNT_EXIST_WHEN_TEXT_PARAM_OF_IF_TAG_IS_NULL);
            Console.WriteLine("DPQ_ELSE_TAG_DOESNT_EXIST_WHEN_INNER_PARAM_OF_IF_TAG_IS_NULL:" + PublicExceptionMessage.DPQ_ELSE_TAG_DOESNT_EXIST_WHEN_INNER_PARAM_OF_IF_TAG_IS_NULL);
            Console.WriteLine("DPQ_ELSE_TAG_DOESNT_EXIST_WHEN_INNER_PARAM_OF_IF_TAG_IS_FALSE:" + PublicExceptionMessage.DPQ_ELSE_TAG_DOESNT_EXIST_WHEN_INNER_PARAM_OF_IF_TAG_IS_FALSE);
            Console.WriteLine("ORDER_BIND_ERROR_PARAMETER_NOT_FOUND:" + PublicExceptionMessage.ORDER_BIND_ERROR_PARAMETER_NOT_FOUND);
            Console.WriteLine("PROP_STRING_FORMAT_ERROR:" + PublicExceptionMessage.PROP_STRING_FORMAT_ERROR);
            Console.WriteLine("PROP_STRING_FORMAT_ERROR_START_CHARACTER:" + PublicExceptionMessage.PROP_STRING_FORMAT_ERROR_START_CHARACTER);
            Console.WriteLine("PROP_STRING_FORMAT_ERROR_ESCAPE_CHARACTER:" + PublicExceptionMessage.PROP_STRING_FORMAT_ERROR_ESCAPE_CHARACTER);
            Console.WriteLine("PROP_STRING_FORMAT_ERROR_CURLY_BRACE:" + PublicExceptionMessage.PROP_STRING_FORMAT_ERROR_CURLY_BRACE);
            Console.WriteLine("PROP_STRING_FORMAT_ERROR_PROPERTY_NAME_IS_EMPTY:" + PublicExceptionMessage.PROP_STRING_FORMAT_ERROR_PROPERTY_NAME_IS_EMPTY);
            Console.WriteLine("PROP_STRING_FORMAT_ERROR_PROPERTY_VALUE_IS_EMPTY:" + PublicExceptionMessage.PROP_STRING_FORMAT_ERROR_PROPERTY_VALUE_IS_EMPTY);
            Console.WriteLine("PROP_STRING_FORMAT_ERROR_DELIMITER_OF_PROPERTY_NAME:" + PublicExceptionMessage.PROP_STRING_FORMAT_ERROR_DELIMITER_OF_PROPERTY_NAME);
            Console.WriteLine("PROP_STRING_FORMAT_ERROR_DELIMITER_OF_PROPERTY_VALUE:" + PublicExceptionMessage.PROP_STRING_FORMAT_ERROR_DELIMITER_OF_PROPERTY_VALUE);
            Console.WriteLine("ARGUMENT_INJUSTICE:" + PublicExceptionMessage.ARGUMENT_INJUSTICE);
            Console.WriteLine("PARAM_IS_NULL:" + PublicExceptionMessage.PARAM_IS_NULL);
            Console.WriteLine("NOT_IMPLEMENTED:" + PublicExceptionMessage.NOT_IMPLEMENTED);

            Console.WriteLine("\r\n");

            #endregion

            #region (2) FrameworkExceptionMessage

            Console.WriteLine("<FrameworkExceptionMessage>");
            Console.WriteLine("ASYNC_EVENT_ENTRY_CALLBACK_CHECK_ERROR:");

            /*1*/
            foreach (var item in FrameworkExceptionMessage.MESSAGE_XML_FORMAT_ERROR)
            {
                Console.WriteLine("MESSAGE_XML_FORMAT_ERROR: " + item);
            }

            /*2*/
            Console.WriteLine("MESSAGE_XML_FORMAT_ERROR_ATTR: " + FrameworkExceptionMessage.MESSAGE_XML_FORMAT_ERROR_ATTR);

            /*3*/
            foreach (var item in FrameworkExceptionMessage.SHAREDPROPERTY_XML_FORMAT_ERROR)
            {
                Console.WriteLine("SHAREDPROPERTY_XML_FORMAT_ERROR: " + item);
            }

            /*4*/
            Console.WriteLine("SHAREDPROPERTY_XML_FORMAT_ERROR_ATTR: " + FrameworkExceptionMessage.SHAREDPROPERTY_XML_FORMAT_ERROR_ATTR);

            /*5*/
            foreach (var item in FrameworkExceptionMessage.SCREEN_CONTROL_XML_FORMAT_ERROR)
            {
                Console.WriteLine("SCREEN_CONTROL_XML_FORMAT_ERROR: " + item);
            }

            /*6*/
            Console.WriteLine("SCREEN_CONTROL_XML_FORMAT_ERROR_value: " + FrameworkExceptionMessage.SCREEN_CONTROL_XML_FORMAT_ERROR_value);

            /*7*/
            Console.WriteLine("SCREEN_CONTROL_XML_FORMAT_ERROR_label: " + FrameworkExceptionMessage.SCREEN_CONTROL_XML_FORMAT_ERROR_label);

            /*8*/
            Console.WriteLine("SCREEN_CONTROL_XML_FORMAT_ERROR_dl1: " + FrameworkExceptionMessage.SCREEN_CONTROL_XML_FORMAT_ERROR_dl1);

            /*9*/
            Console.WriteLine("SCREEN_CONTROL_XML_FORMAT_ERROR_dl2: " + FrameworkExceptionMessage.SCREEN_CONTROL_XML_FORMAT_ERROR_dl2);

            /*10*/
            Console.WriteLine("SCREEN_CONTROL_XML_FORMAT_ERROR_mode: " + FrameworkExceptionMessage.SCREEN_CONTROL_XML_FORMAT_ERROR_mode);

            /*11*/
            foreach (var item in FrameworkExceptionMessage.TRANSACTION_CONTROL_XML_FORMAT_ERROR)
            {
                Console.WriteLine("TRANSACTION_CONTROL_XML_FORMAT_ERROR: " + item);
            }

            /*12*/
            Console.WriteLine("TRANSACTION_CONTROL_XML_FORMAT_ERROR_tp: " + FrameworkExceptionMessage.TRANSACTION_CONTROL_XML_FORMAT_ERROR_tp);

            /*13*/
            Console.WriteLine("TRANSACTION_CONTROL_XML_FORMAT_ERROR_iso1: " + FrameworkExceptionMessage.TRANSACTION_CONTROL_XML_FORMAT_ERROR_iso1);

            /*14*/
            Console.WriteLine("TRANSACTION_CONTROL_XML_FORMAT_ERROR_iso2: " + FrameworkExceptionMessage.TRANSACTION_CONTROL_XML_FORMAT_ERROR_iso2);

            /*15*/
            Console.WriteLine("TRANSACTION_CONTROL_XML_FORMAT_ERROR_tg: " + FrameworkExceptionMessage.TRANSACTION_CONTROL_XML_FORMAT_ERROR_tg);

            /*16*/
            Console.WriteLine("TRANSACTION_CONTROL_XML_FORMAT_ERROR_tgval: " + FrameworkExceptionMessage.TRANSACTION_CONTROL_XML_FORMAT_ERROR_tgval);

            /*17*/
            foreach (var item in FrameworkExceptionMessage.IPR_NAMESERVICE_XML_FORMAT_ERROR)
            {
                Console.WriteLine("IPR_NAMESERVICE_XML_FORMAT_ERROR: " + item);
            }

            /*18*/
            Console.WriteLine("IPR_NAMESERVICE_XML_FORMAT_ERROR_asmName1: " + FrameworkExceptionMessage.IPR_NAMESERVICE_XML_FORMAT_ERROR_asmName1);

            /*19*/
            Console.WriteLine("IPR_NAMESERVICE_XML_FORMAT_ERROR_asmName2: " + FrameworkExceptionMessage.IPR_NAMESERVICE_XML_FORMAT_ERROR_asmName2);

            /*20*/
            Console.WriteLine("IPR_NAMESERVICE_XML_FORMAT_ERROR_clsName1: " + FrameworkExceptionMessage.IPR_NAMESERVICE_XML_FORMAT_ERROR_clsName1);

            /*21*/
            Console.WriteLine("IPR_NAMESERVICE_XML_FORMAT_ERROR_clsName2: " + FrameworkExceptionMessage.IPR_NAMESERVICE_XML_FORMAT_ERROR_clsName2);

            /*22*/
            foreach (var item in FrameworkExceptionMessage.PRT_NAMESERVICE_XML_FORMAT_ERROR)
            {
                Console.WriteLine("PRT_NAMESERVICE_XML_FORMAT_ERROR: " + item);
            }

            /*23*/
            Console.WriteLine("PRT_NAMESERVICE_XML_FORMAT_ERROR_prt1: " + FrameworkExceptionMessage.PRT_NAMESERVICE_XML_FORMAT_ERROR_prt1);

            /*24*/
            Console.WriteLine("PRT_NAMESERVICE_XML_FORMAT_ERROR_prt2: " + FrameworkExceptionMessage.PRT_NAMESERVICE_XML_FORMAT_ERROR_prt2);

            /*25*/
            Console.WriteLine("PRT_NAMESERVICE_XML_FORMAT_ERROR_url1: " + FrameworkExceptionMessage.PRT_NAMESERVICE_XML_FORMAT_ERROR_url1);

            /*26*/
            Console.WriteLine("PRT_NAMESERVICE_XML_FORMAT_ERROR_url2: " + FrameworkExceptionMessage.PRT_NAMESERVICE_XML_FORMAT_ERROR_url2);

            /*27*/
            Console.WriteLine("PRT_NAMESERVICE_XML_FORMAT_ERROR_url3: " + FrameworkExceptionMessage.PRT_NAMESERVICE_XML_FORMAT_ERROR_url3);

            /*28*/
            Console.WriteLine("PRT_NAMESERVICE_XML_FORMAT_ERROR_url4: " + FrameworkExceptionMessage.PRT_NAMESERVICE_XML_FORMAT_ERROR_url4);

            /*29*/
            Console.WriteLine("PRT_NAMESERVICE_XML_FORMAT_ERROR_to: " + FrameworkExceptionMessage.PRT_NAMESERVICE_XML_FORMAT_ERROR_to);

            /*30*/
            Console.WriteLine("PRT_NAMESERVICE_XML_FORMAT_ERROR_prop1: " + FrameworkExceptionMessage.PRT_NAMESERVICE_XML_FORMAT_ERROR_prop1);

            /*31*/
            Console.WriteLine("PRT_NAMESERVICE_XML_FORMAT_ERROR_prop2: " + FrameworkExceptionMessage.PRT_NAMESERVICE_XML_FORMAT_ERROR_prop2);

            /*32*/
            Console.WriteLine("NAMESERVICE_XML_FORMAT_ERROR_tm: " + FrameworkExceptionMessage.NAMESERVICE_XML_FORMAT_ERROR_tm);

            /*33*/
            foreach (var item in FrameworkExceptionMessage.NO_FX_HIDDEN)
            {
                Console.WriteLine("NO_FX_HIDDEN: " + item);
            }

            /*34*/
            foreach (var item in FrameworkExceptionMessage.ERROR_IN_WRITING_OF_FX_NUMVAL)
            {
                Console.WriteLine("ERROR_IN_WRITING_OF_FX_NUMVAL: " + item);
            }

            /*35*/
            foreach (var item in FrameworkExceptionMessage.ERROR_IN_WRITING_OF_FX_PATH1)
            {
                Console.WriteLine("ERROR_IN_WRITING_OF_FX_PATH1: " + item);
            }

            /*36*/
            foreach (var item in FrameworkExceptionMessage.ERROR_IN_WRITING_OF_FX_PATH2)
            {
                Console.WriteLine("ERROR_IN_WRITING_OF_FX_PATH2: " + item);
            }

            /*37*/
            foreach (var item in FrameworkExceptionMessage.ERROR_IN_WRITING_OF_FX_SWITCH1)
            {
                Console.WriteLine("ERROR_IN_WRITING_OF_FX_SWITCH1: " + item);
            }

            /*38*/
            foreach (var item in FrameworkExceptionMessage.ERROR_IN_WRITING_OF_FX_SWITCH2)
            {
                Console.WriteLine("ERROR_IN_WRITING_OF_FX_SWITCH2: " + item);
            }

            /*39*/
            foreach (var item in FrameworkExceptionMessage.PARAMETER_CHECK_ERROR)
            {
                Console.WriteLine("PARAMETER_CHECK_ERROR: " + item);
            }

            /*40*/
            Console.WriteLine("PARAMETER_CHECK_ERROR_null: " + FrameworkExceptionMessage.PARAMETER_CHECK_ERROR_null);

            /*41*/
            Console.WriteLine("PARAMETER_CHECK_ERROR_empty: " + FrameworkExceptionMessage.PARAMETER_CHECK_ERROR_empty);

            /*42*/
            Console.WriteLine("PARAMETER_CHECK_ERROR_length: " + FrameworkExceptionMessage.PARAMETER_CHECK_ERROR_length);

            /*43*/
            foreach (var item in FrameworkExceptionMessage.ASYNC_FUNC_CHECK_ERROR)
            {
                Console.WriteLine("ASYNC_FUNC_CHECK_ERROR: " + item);
            }

            /*44*/
            foreach (var item in FrameworkExceptionMessage.ASYNC_MSGBOX_ERROR)
            {
                Console.WriteLine("ASYNC_MSGBOX_ERROR: " + item);
            }

            /*45*/
            foreach (var item in FrameworkExceptionMessage.ASYNC_EVENT_ENTRY_CHECK_ERROR)
            {
                Console.WriteLine("ASYNC_EVENT_ENTRY_CHECK_ERROR: " + item);
            }

            /*46*/
            foreach (var item in FrameworkExceptionMessage.ASYNC_EVENT_ENTRY_CONTROL_CHECK_ERROR)
            {
                Console.WriteLine("ASYNC_EVENT_ENTRY_CONTROL_CHECK_ERROR: " + item);
            }

            /*47*/
            foreach (var item in FrameworkExceptionMessage.ASYNC_EVENT_ENTRY_CALLBACK_CHECK_ERROR)
            {
                Console.WriteLine("ASYNC_EVENT_ENTRY_CALLBACK_CHECK_ERROR: " + item);
            }

            /*48*/
            foreach (var item in FrameworkExceptionMessage.CONTROL_TYPE_ERROR)
            {
                Console.WriteLine("48. CONTROL_TYPE_ERROR: " + item);
            }

            /*49*/
            foreach (var item in FrameworkExceptionMessage.CONTROL_REPETITION_ERROR1)
            {
                Console.WriteLine("CONTROL_REPETITION_ERROR1: " + item);
            }

            /*50*/
            foreach (var item in FrameworkExceptionMessage.CONTROL_REPETITION_ERROR2)
            {
                Console.WriteLine("CONTROL_REPETITION_ERROR2: " + item);
            }

            /*51*/
            foreach (var item in FrameworkExceptionMessage.NO_MASTER_PAGE)
            {
                Console.WriteLine("NO_MASTER_PAGE: " + item);
            }

            /*52*/
            foreach (var item in FrameworkExceptionMessage.MASTER_PAGE_TYPE_ERROR)
            {
                Console.WriteLine("MASTER_PAGE_TYPE_ERROR: " + item);
            }

            /*53*/
            foreach (var item in FrameworkExceptionMessage.SESSION_TIMEOUT)
            {
                Console.WriteLine("SESSION_TIMEOUT: " + item);
            }

            /*54*/
            foreach (var item in FrameworkExceptionMessage.ILLEGAL_OPERATION_CHECK_ERROR)
            {
                Console.WriteLine("ILLEGAL_OPERATION_CHECK_ERROR: " + item);
            }

            /*55*/
            foreach (var item in FrameworkExceptionMessage.SCREEN_CONTROL_CHECK_ERROR)
            {
                Console.WriteLine("SCREEN_CONTROL_CHECK_ERROR: " + item);
            }

            /*56*/
            Console.WriteLine("SCREEN_CONTROL_CHECK_ERROR_get: " + FrameworkExceptionMessage.SCREEN_CONTROL_CHECK_ERROR_get);

            /*57*/
            Console.WriteLine("SCREEN_CONTROL_CHECK_ERROR_naked: " + FrameworkExceptionMessage.SCREEN_CONTROL_CHECK_ERROR_naked);

            /*58*/
            Console.WriteLine("SCREEN_CONTROL_CHECK_ERROR_nolbl: " + FrameworkExceptionMessage.SCREEN_CONTROL_CHECK_ERROR_nolbl);

            /*59*/
            foreach (var item in FrameworkExceptionMessage.FX_PROCESSING_STATUS_ERROR)
            {
                Console.WriteLine("FX_PROCESSING_STATUS_ERROR: " + item);
            }

            /*60*/
            Console.WriteLine("FX_PROCESSING_STATUS_ERROR_NO_BH_QUEUE: " + FrameworkExceptionMessage.FX_PROCESSING_STATUS_ERROR_NO_BH_QUEUE);

            /*61*/
            foreach (var item in FrameworkExceptionMessage.DIALOG_AFTER_PROCESSING_STATUS_ERROR)
            {
                Console.WriteLine("DIALOG_AFTER_PROCESSING_STATUS_ERROR: " + item);
            }

            /*62*/
            foreach (var item in FrameworkExceptionMessage.DIALOG_CLOSING_STATUS_ERROR)
            {
                Console.WriteLine("DIALOG_CLOSING_STATUS_ERROR: " + item);
            }

            /*63*/
            Console.WriteLine("DIALOG_CLOSING_STATUS_ERROR1: " + FrameworkExceptionMessage.DIALOG_CLOSING_STATUS_ERROR1);

            /*64*/
            Console.WriteLine("DIALOG_CLOSING_STATUS_ERROR2: " + FrameworkExceptionMessage.DIALOG_CLOSING_STATUS_ERROR2);

            /*65*/
            foreach (var item in FrameworkExceptionMessage.LB_ILLEGAL_CALL_CHECK_ERROR)
            {
                Console.WriteLine("LB_ILLEGAL_CALL_CHECK_ERROR: " + item);
            }

            Console.WriteLine("\r\n");

            #endregion

            #region (3) MyBusinessSystemExceptionMessage

            Console.WriteLine("<MyBusinessSystemExceptionMessage>");

            Console.WriteLine("SAMPLE_ERROR:");
            foreach (string s in MyBusinessSystemExceptionMessage.SAMPLE_ERROR)
            {
                Console.WriteLine(" - " + s);
            }

            Console.WriteLine("CMN_DAO_ERROR:");
            foreach (string s in MyBusinessSystemExceptionMessage.CMN_DAO_ERROR)
            {
                Console.WriteLine(" - " + s);
            }

            Console.WriteLine("CMN_DAO_ERROR_SQL:" + MyBusinessSystemExceptionMessage.CMN_DAO_ERROR_SQL);

            Console.WriteLine("\r\n");

            #endregion

            #region (4) MyBusinessApplicationExceptionMessage

            Console.WriteLine("<MyBusinessApplicationExceptionMessage>");

            Console.WriteLine("SAMPLE_ERROR:");
            foreach (string s in MyBusinessApplicationExceptionMessage.SAMPLE_ERROR)
            {
                Console.WriteLine(" - " + s);
            }

            Console.WriteLine("\r\n");

            #endregion

            #region (5) GetMessage

            Console.WriteLine("<GetMessage>");

            Console.WriteLine(GetMessage.GetMessageDescription("I0001"));
            Console.WriteLine(GetMessage.GetMessageDescription("I0002"));
            Console.WriteLine(GetMessage.GetMessageDescription("I0003"));
            Console.WriteLine(GetMessage.GetMessageDescription("I0004"));
            Console.WriteLine(GetMessage.GetMessageDescription("I0005"));

            Console.WriteLine(GetMessage.GetMessageDescription("E0001"));
            Console.WriteLine(GetMessage.GetMessageDescription("E0002"));
            Console.WriteLine(GetMessage.GetMessageDescription("E0003"));
            Console.WriteLine(GetMessage.GetMessageDescription("E0004"));
            Console.WriteLine(GetMessage.GetMessageDescription("E0005"));

            #endregion

            #endregion

            // As notes, when you translate into English from Japanese,
            // the turn of {0} and {1} used by String.Format be reversed.

            Console.ReadKey();
        }
this.CustomMessage = string.Format(GetMessage(exceptionKey), args);
 public GetHelloWorldControllerImpl(GetMessage getMessage)
 {
     GetMessage = getMessage;
 }
示例#29
0
 /// <summary>メッセージ取得(埋め込まれたリソース対応)</summary>
 /// <param name="rcFxEventArgs">イベントハンドラの共通引数</param>
 protected void UOC_btnButton11_Click(RcFxEventArgs rcFxEventArgs)
 {
     this.textBox5.Text = GetMessage.GetMessageDescription(this.textBox4.Text);
 }
示例#30
0
        /// <summary>
        ///  Updates the progress rate and handles abnormal termination of the process.
        /// </summary>
        /// <param name="taskID">Task ID</param>
        /// <param name="returnValue">user parameter value</param>
        private void Update(int taskID, ApsReturnValue returnValue)
        {
            // Place the following statements in the loop, till the completion of task.
            // タスクが完了するまで、ループ内の処理を実行する。

            while (true)
            {
                // Get command information from database to check for retry.
                // データベースからコマンド情報を取得して、CommandIdを確認。
                ApsUtility.GetCommandValue(taskID, returnValue, this.GetDam(this.DamKeyforAMT));

                switch (returnValue.CommandId)
                {
                case (int)AsyncCommand.Stop:

                    // If you want to retry, then throw the following exception.
                    // 処理の途中で停止する場合は、次の例外をスロー。

                    throw new BusinessApplicationException(
                              AsyncErrorMessageID.APSStopCommand.ToString(),
                              GetMessage.GetMessageDescription("CTE0003"), "");

                case (int)AsyncCommand.Abort:

                    // Implement code to forcefully Abort the task.
                    // If the task is abnormal terminated, then throw the exception.
                    // 強制的にタスクを中断する場合は、例外をスロー。

                    throw new BusinessSystemException(
                              AsyncErrorMessageID.APSAbortCommand.ToString(),
                              GetMessage.GetMessageDescription("CTE0004"));

                default:
                    // Generates new progress rate of the task.
                    // 進捗率をインクリメント
                    ProgressRate = this.GenerateProgressRate(ProgressRate);

                    // Update the progress rate in database.
                    // データベースの進捗率を更新。
                    ApsUtility.UpdateProgressRate(
                        taskID, returnValue, ProgressRate, this.GetDam(this.DamKeyforAMT));

                    // 非同期タスクのシミュレーション
                    if (this.Fortune(this.AbortPercentage))
                    {
                        // Update ABORT command to database
                        // データベースのコマンドをABORTに更新。
                        ApsUtility.UpdateTaskCommand(
                            taskID, (int)AsyncCommand.Abort,
                            returnValue, this.GetDam(this.DamKeyforAMT));
                    }
                    else if (this.Fortune(this.StopPercentage))
                    {
                        // Update STOP command to database
                        // データベースのコマンドをSTOPに更新。
                        ApsUtility.UpdateTaskCommand(
                            taskID, (int)AsyncCommand.Stop,
                            returnValue, this.GetDam(this.DamKeyforAMT));
                    }
                    else if (SUCCESS_STATE <= ProgressRate)
                    {
                        // Task is completed sucessfully.
                        // タスクは正常に完了
                        return;
                    }
                    else
                    {
                        // タスクは継続する。
                        Thread.Sleep(this.NumberOfSeconds * 1000);
                    }

                    break;
                }
            }
        }
示例#31
0
        protected virtual bool OnGetMessage(GetMessageEventArgs e)
        {
            GetMessage?.Invoke(this, e);

            return(!e.Cancel);
        }
示例#32
0
 public object Get(GetMessage request)
 {
     return(_repository.Get(request.Id));
 }
示例#33
0
 private static void ShowMessage(GetMessage getMessage)
 {
     getMessage.Invoke();
 }
        public void Test_PostAndGetMessage()
        {
            // Create message
            var postRequest = new CreateMessage
            {
                ApplicationId = 1,
                Bcc = new[] { "*****@*****.**" },
                Body = "This is a test email.",
                Cc = new[] { "*****@*****.**" },
                Connection = new Connection
                {
                    EnableSsl = false,
                    Host = "localhost",
                    Port = 25
                },
                Credential = new Credential(),
                From = "*****@*****.**",
                ReplyTo = new[] { "*****@*****.**" },
                Sender = "*****@*****.**",
                Subject = "Test Message",
                To = new[] { "*****@*****.**" }
            };
            var client = new JsonServiceClient("http://localhost:59200/");
            var postResponse = client.Post(postRequest);

            // Get message
            var getRequest = new GetMessage
            {
                Id = postResponse.Id
            };
            var getResponse = client.Get(getRequest);

            Assert.Equal(2, getResponse.Status.TypeMessageStatusId);
            Assert.Equal(postResponse.Id, getResponse.Id);
        }