/// <summary>
        /// タブ選択イベント
        /// </summary>
        private void myTabControl_Selected(object sender, TabControlEventArgs e)
        {
            // 共通の初期化
            currentStroke = null;
            roughStroke   = null;
            resultName    = string.Empty;

            // 選択されたタブに応じた初期化
            if (myTabControl.SelectedTab == testPage)
            {
                // 登録済みテンプレート画像の更新
                UpdateTemplateImagePanel();
            }
            else if (myTabControl.SelectedTab == addPage)
            {
                // 登録ボタンを無効化
                addInfoLabel.Text = string.Empty;
                addInfoLabel.Refresh();
                addButton.Enabled = false;
            }
            else if (myTabControl.SelectedTab == managePage)
            {
                // テンプレートリストの更新
                UpdateTemplateList();
                selectedLabel        = null;
                deleteButton.Enabled = false;
            }
        }
示例#2
0
        public async Task <int> AddOrUpdate(TemplateLabel input)
        {
            var all = await GetAll(0, Int32.MaxValue);

            if (input.Id == 0 && all.Data.Any(x => x.Name.Equals(input.Name)))
            {
                throw new ValidationException(Error.AlreadyAdd);
            }

            var sql = Sql.SqlQueryCach["TemplateLabels.Add"];
            int id  = 0;

            if (input.Id == 0)
            {
                id = (await _db.Connection.QueryAsync <int>(sql, new { name = input.Name, template = input.Template }))
                     .FirstOrDefault();
            }
            else
            {
                sql = Sql.SqlQueryCach["TemplateLabels.Update"];
                id  = (await _db.Connection.QueryAsync <int>(sql,
                                                             new { name = input.Name, template = input.Template, id = input.Id })).FirstOrDefault();
            }

            return(id);
        }
        public async Task Delete([FromBody] TemplateLabel equipment)
        {
            await CheckPermission();

            var er = new TemplateLabelsRepository();
            await er.Delete(equipment.Id);

            er.Dispose();
        }
        public async Task AddOrUpdate([FromBody] TemplateLabel input)
        {
            await CheckPermission();

            var sqlR = new TemplateLabelsRepository();
            await sqlR.AddOrUpdate(input);

            sqlR.Dispose();
        }
        /// <summary>
        /// テンプレート整理 > 削除ボタン
        /// </summary>
        private void deleteButton_Click(object sender, EventArgs e)
        {
            // 選択されているテンプレートを削除
            deleteButton.Enabled = false;
            strokeRecognizer.RemoveTemplate(selectedLabel.Name);
            selectedLabel = null;

            // テンプレートリスト更新
            UpdateTemplateList();
        }
 /// <summary>
 /// ラベルの選択
 /// </summary>
 private void templateLabel_Click(object sender, EventArgs e)
 {
     if (selectedLabel != null)
     {
         selectedLabel.Selected = false;
     }
     selectedLabel          = (TemplateLabel)sender;
     selectedLabel.Selected = true;
     deleteButton.Enabled   = true;
     templatePanel.Refresh();
 }
 /// <summary>
 /// テンプレートリストを更新する。
 /// </summary>
 private void UpdateTemplateList()
 {
     // リスト更新
     templatePanel.Controls.Clear();
     StrokeRecognizer.Template[] templates = strokeRecognizer.Templates;
     for (int i = 0; i < templates.Length; i++)
     {
         TemplateLabel label = new TemplateLabel(templates[i].Name);
         label.Click += new EventHandler(templateLabel_Click);
         templatePanel.Controls.Add(label);
     }
 }
示例#8
0
        public List<TemplateLabel> GetTemplateLabels()
        {
            List<TemplateLabel> lstTemplateLabels = new List<TemplateLabel>();
            DbCommand oDbCommand = DbProviderHelper.CreateCommand("SELECTTemplateLabels",CommandType.StoredProcedure);
            DbDataReader oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand);
            while (oDbDataReader.Read())
            {
                TemplateLabel oTemplateLabel = new TemplateLabel();
                oTemplateLabel.TemplateLabelId = Convert.ToInt32(oDbDataReader["TemplateLabelId"]);
                oTemplateLabel.TemplateLabelGuid = (Guid) oDbDataReader["TemplateLabelGuid"];
                oTemplateLabel.TemplateLabelName = Convert.ToString(oDbDataReader["TemplateLabelName"]);
                oTemplateLabel.TemplateLabelValue = Convert.ToString(oDbDataReader["TemplateLabelValue"]);

                if(oDbDataReader["Description"] != DBNull.Value)
                    oTemplateLabel.Description = Convert.ToString(oDbDataReader["Description"]);
                oTemplateLabel.DateCreated = Convert.ToDateTime(oDbDataReader["DateCreated"]);
                lstTemplateLabels.Add(oTemplateLabel);
            }
            oDbDataReader.Close();
            return lstTemplateLabels;
        }
示例#9
0
        void ReleaseDesignerOutlets()
        {
            if (ClientLabel != null)
            {
                ClientLabel.Dispose();
                ClientLabel = null;
            }

            if (CloseButton != null)
            {
                CloseButton.Dispose();
                CloseButton = null;
            }

            if (ColorCircleView != null)
            {
                ColorCircleView.Dispose();
                ColorCircleView = null;
            }

            if (ColorPickerOpeningView != null)
            {
                ColorPickerOpeningView.Dispose();
                ColorPickerOpeningView = null;
            }

            if (DoneButton != null)
            {
                DoneButton.Dispose();
                DoneButton = null;
            }

            if (ErrorLabel != null)
            {
                ErrorLabel.Dispose();
                ErrorLabel = null;
            }

            if (NameTextField != null)
            {
                NameTextField.Dispose();
                NameTextField = null;
            }

            if (PrivateProjectSwitch != null)
            {
                PrivateProjectSwitch.Dispose();
                PrivateProjectSwitch = null;
            }

            if (PrivateProjectSwitchContainer != null)
            {
                PrivateProjectSwitchContainer.Dispose();
                PrivateProjectSwitchContainer = null;
            }

            if (ProjectNameUsedErrorTextHeight != null)
            {
                ProjectNameUsedErrorTextHeight.Dispose();
                ProjectNameUsedErrorTextHeight = null;
            }

            if (ProjectNameUsedErrorView != null)
            {
                ProjectNameUsedErrorView.Dispose();
                ProjectNameUsedErrorView = null;
            }

            if (TemplateLabel != null)
            {
                TemplateLabel.Dispose();
                TemplateLabel = null;
            }

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }

            if (WorkspaceLabel != null)
            {
                WorkspaceLabel.Dispose();
                WorkspaceLabel = null;
            }

            if (PrivateProjectLabel != null)
            {
                PrivateProjectLabel.Dispose();
                PrivateProjectLabel = null;
            }
        }
 static extern void templateMatchingManager(System.IntPtr ir_data, ushort[] depth_data, TemplateLabel[] Label, int labelNum, int desk_pos_y, int desk_pos_z);