コード例 #1
0
 void symbolForm_SymbolSelected(object sender, SymbolInfo selectedSymbol)
 {
     this.symbolForm.DialogResult = DialogResult.OK;
 }
コード例 #2
0
 void categoryForm_SymbolSelected(object sender, SymbolInfo selectedSymbol)
 {
     this.selectedCategory          = selectedSymbol;
     this.categoryForm.DialogResult = DialogResult.OK;
 }
コード例 #3
0
ファイル: SymbolListForm.cs プロジェクト: nakijun/adasg
        private void LoadData(ThreadExecuteTask threadExecute)
        {
            try
            {
                this.symbolList.Clear();

                for (int i = 0; i < countPerPage; i++)
                {
                    //If an abort has been requested, we should quit
                    if (threadExecute != null && threadExecute.State ==
                        ThreadExecuteTask.ProcessingState.requestAbort)
                    {
                        threadExecute.setProcessingState(ThreadExecuteTask.ProcessingState.aborted);
                        System.Windows.Forms.MessageBox.Show("aborted");
                        return;
                    }

                    bool ok;
                    if (i == 0)
                    {
                        ok = this.resultSet.ReadAbsolute(this.firstRecordindex);
                        Debug.Assert(ok, "Failed to seek to position: " + this.firstRecordindex);
                    }
                    else
                    {
                        ok = resultSet.Read();
                    }

                    if (ok)
                    {
                        SymbolInfo info = new SymbolInfo();

                        info.Id = resultSet.GetInt32(0);

                        object image = resultSet.GetValue(1);
                        using (MemoryStream ms = new MemoryStream(image as byte[]))
                        {
                            info.Image = ResizeImage(new Bitmap(ms), this.imageSize);
                        }

                        info.Sound = resultSet.GetValue(2) as byte[];

                        info.Text = resultSet.GetString(3);

                        symbolList.Add(info);
                    }
                    else
                    {
                        break;
                    }
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(e);
            }

            if (this.DataLoaded != null)
            {
                this.DataLoaded();
            }
        }