Ejemplo n.º 1
0
 /// <summary>
 /// コンストラクタ。
 /// </summary>
 /// <param name="message">メッセージプロバイダのインスタンス。</param>
 /// <param name="project">プロジェクト情報のインスタンス。</param>
 public AccessorDefinitionValidator(
     MessageProvider message,
     WarlockProject project)
     : base(message)
 {
     Project = project;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// コンストラクタ。
 /// </summary>
 /// <param name="message">メッセージプロバイダのインスタンス。</param>
 /// <param name="project">プロジェクト情報のインスタンス。</param>
 public ProjectValidator(
     MessageProvider message,
     WarlockProject project)
     : base(message)
 {
     Project = project;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// コンストラクタ。
 /// </summary>
 /// <param name="message">メッセージプロバイダのインスタンス。</param>
 /// <param name="project">プロジェクト情報のインスタンス。</param>
 /// <param name="definition">スクリプト定義情報のインスタンス。</param>
 public ScriptDefinitionValidator(
     MessageProvider message,
     WarlockProject project,
     ScriptDefinition definition)
     : base(message)
 {
     Project = project;
     Definition = definition;
 }
        /// <summary>
        /// アプリケーションを起動する。
        /// </summary>
        public void Run()
        {
            MainForm = new MainForm();
            MainForm.Command += CommandHandler;
            MainForm.Shown += MainForm_Shown;

            ShowSplashScreen();

            if (!Settings.Default.Upgraded)
            {
                Settings.Default.Upgrade();
                Settings.Default.Upgraded = true;
                Settings.Default.Save();
            }

            Message = new MessageProvider();
            Message.Load(Resources.MessageResource);

            Console = new WarlockConsole();
            Console.Command += CommandHandler;

            using (ScriptWatcher = new FileSystemWatcher())
            {
                ScriptWatcher.SynchronizingObject = MainForm;
                ScriptWatcher.Filter = "*.rb";
                ScriptWatcher.NotifyFilter = NotifyFilters.LastWrite;

                ScriptWatcher.Changed += ScriptWatcher_Changed;
                ScriptWatcher.Deleted += ScriptWatcher_Changed;

                Application.Run(MainForm);

                ScriptWatcher.Deleted -= ScriptWatcher_Changed;
                ScriptWatcher.Changed -= ScriptWatcher_Changed;
            }

            Settings.Default.Save();
        }
Ejemplo n.º 5
0
 /// <summary>
 /// コンストラクタ。
 /// </summary>
 /// <param name="message">メッセージプロバイダのインスタンス。</param>
 public Validator(MessageProvider message)
 {
     Message = message;
 }
Ejemplo n.º 6
0
        /// <summary>
        /// アクセサ定義行のチェックを行う。
        /// </summary>
        /// <param name="message">メッセージプロバイダのインスタンス。</param>
        /// <param name="definedAccessorNames">定義された列名の一覧。</param>
        /// <param name="row">チェック対象のDataRow。</param>
        /// <param name="rowIndex">行インデックス。</param>
        /// <returns>入力チェックOK時はtrue。</returns>
        private bool ValidateAccessorRow(
            MessageProvider message,
            List<string> definedAccessorNames,
            DataRow row,
            int rowIndex)
        {
            var vRow = ctlAccessorList.Rows[rowIndex];

            var validator = new AccessorDefinitionValidator(message, Project);
            ProvidedMessage result;

            // 列名
            result = validator.ValidateName(row.Field<string>("Name"), definedAccessorNames);
            if (result != null)
            {
                ctlAccessorList.CurrentCell = vRow.Cells["ctlAccessorListName"];
                InvokeMessage(result);

                return false;
            }

            // データ型
            result = validator.ValidateValueType(row.Field<string>("ValueType"));
            if (result != null)
            {
                ctlAccessorList.CurrentCell = vRow.Cells["ctlAccessorListValueType"];
                InvokeMessage(result);

                return false;
            }

            return true;
        }