Exemple #1
0
 /// <summary>
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmElement_Load(object sender, EventArgs e)
 {
     Common.Utility.FillComberWithEnum(cmbDataType, typeof(BsonValueEx.BasicType), true);
     if (_isUpdateMode)
     {
         txtElName.Visible  = true;
         txtElName.Enabled  = false;
         lblElement.Visible = true;
         if (_selectNode.Tag.GetType() == typeof(BsonElement))
         {
             var El = (BsonElement)_selectNode.Tag;
             txtElName.Text = (El).Name;
             ctlBsonValue1.SetValue(El.Value);
             cmbDataType.SelectedIndex = (int)BsonValueEx.GetBsonValueBasicType(El.Value);
         }
         else
         {
             var value = (BsonValue)_selectNode.Tag;
             ctlBsonValue1.SetValue(value);
             cmbDataType.SelectedIndex = (int)BsonValueEx.GetBsonValueBasicType(value);
         }
     }
     if (!_isElement)
     {
         //TODO:在这个模式,数组里面暂时不能添加数组或者文档
         txtElName.Visible  = false;
         lblElement.Visible = false;
     }
     IsLoaded = true;
     if (!GuiConfig.IsUseDefaultLanguage)
     {
         cmdOK.Text     = GuiConfig.GetText(TextType.CommonOk);
         cmdCancel.Text = GuiConfig.GetText(TextType.CommonCancel);
     }
 }
 /// <summary>
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmElement_Load(object sender, EventArgs e)
 {
     Common.UIAssistant.FillComberWithEnum(cmbDataType, typeof(BsonValueEx.BasicType), true);
     if (_isUpdateMode)
     {
         txtElName.Visible  = true;
         txtElName.Enabled  = false;
         lblElement.Visible = true;
         if (_selectNode.Tag.GetType() == typeof(BsonElement))
         {
             var El = (BsonElement)_selectNode.Tag;
             txtElName.Text = (El).Name;
             ctlBsonValue1.SetValue(El.Value);
             cmbDataType.SelectedIndex = (int)BsonValueEx.GetBsonValueBasicType(El.Value);
         }
         else
         {
             var value = (BsonValue)_selectNode.Tag;
             ctlBsonValue1.SetValue(value);
             cmbDataType.SelectedIndex = (int)BsonValueEx.GetBsonValueBasicType(value);
             txtElName.Text            = _selectNode.Text;
             txtElName.ReadOnly        = true;
         }
     }
     IsLoaded = true;
     GuiConfig.Translateform(this);
 }