/// <summary> /// コンストラクタ /// </summary> public GLEvaluationElementSettingDialog(GLEvaluationElement element) { if (element == null) { throw new ArgumentNullException("element"); } InitializeComponent(); this.bindings = new B.BindingsCollection(this); this.targetElement = element; // 古い値の保存 this.oldImageSet = element.ImageSet; this.oldIsVisibleValue = element.IsVisibleValue; this.oldIsValueFullWidth = element.IsValueFullWidth; // コンボボックスに画像セットの一覧を設定します。 this.imageSetListComboBox.DataSource = element.ImageSetList; // コンボボックスの選択アイテムと、評価値エレメントの選択画像セットを // バインディングさせます。 this.bindings.Add( this.imageSetListComboBox, "SelectedItem", element, "ImageSet", OnImageSetChanged); this.bindings.Add( this.visibleValueCheckBox, "Checked", element, "IsVisibleValue"); this.bindings.Add( this.valueFullWidthCheckBox, "Checked", element, "IsValueFullWidth"); }
/// <summary> /// 評価値画像などを描画する内部オブジェクトを作成します。 /// </summary> private GLEvaluationElementInternal CreateInternal(ImageSetInfo imageSet) { try { if (imageSet == null) { return null; } var internalType = FindInternalType(imageSet.TypeId); if (internalType == null) { return null; } // internalType型を実体化します。 var obj = Activator.CreateInstance(internalType) as GLEvaluationElementInternal; if (obj == null) { return null; } obj.Initialize(imageSet); return obj; } catch (Exception ex) { Util.ThrowIfFatal(ex); return null; } }
/// <summary> /// オブジェクトの初期化を行います。 /// </summary> public virtual void Initialize(ImageSetInfo imageSet) { ImageSet = imageSet; }