当前位置: 首页>>代码示例>>C#>>正文


C# Forms.CurrencyManager类代码示例

本文整理汇总了C#中System.Windows.Forms.CurrencyManager的典型用法代码示例。如果您正苦于以下问题:C# CurrencyManager类的具体用法?C# CurrencyManager怎么用?C# CurrencyManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CurrencyManager类属于System.Windows.Forms命名空间,在下文中一共展示了CurrencyManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Commit

 /// <summary>
 /// Standard override
 /// </summary>
 /// <param name="dataSource"></param>
 /// <param name="rowNum"></param>
 /// <returns></returns>
 protected override bool Commit(CurrencyManager dataSource, int rowNum)
 {
     if (!_inEdit)
     {
         return true;
     }
     try
     {
         object _value = _comboBox.SelectedValue;
         if (NullText.Equals(_value))
         {
             _value = System.Convert.DBNull;
         }
         this.SetColumnValueAtRow(dataSource, rowNum, _value);
     }
     catch
     {
         return false;
     }
     finally
     {
         _inEdit = false;
         _comboBox.Hide();
     }
     return true;
 }
开发者ID:hayrettinbebek,项目名称:e-cafe,代码行数:32,代码来源:CellStyles.cs

示例2: Edit

        /// <summary>
        /// Method Edit()
        /// </summary>
        /// <remarks>
        /// On edit, add scroll event handler, and display combobox
        /// </remarks>
        /// <param name="source"></param>
        /// <param name="rowNum"></param>
        /// <param name="bounds"></param>
        /// <param name="readOnly"></param>
        /// <param name="instantText"></param>
        /// <param name="cellIsVisible"></param>
        protected override void Edit(System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Rectangle bounds, bool readOnly, string instantText, bool cellIsVisible)
        {
            base.Edit(source, rowNum, bounds, readOnly, instantText,cellIsVisible);

            if (!readOnly && cellIsVisible)
            {
                // Save current row in the DataGrid and currency manager
                // associated with the data source for the DataGrid
                this.iCurrentRow = rowNum;
                this.currencyManager = source;

                // Add event handler for DataGrid scroll notification
                this.DataGridTableStyle.DataGrid.Scroll += new EventHandler(DataGrid_Scroll);

                // Site the combobox control within the current cell
                this.comboBox.Parent = this.TextBox.Parent;
                Rectangle rect = this.DataGridTableStyle.DataGrid.GetCurrentCellBounds();
                this.comboBox.Location = rect.Location;
                this.comboBox.Size = new Size(this.TextBox.Size.Width,this.comboBox.Size.Height);

                // Set combobox selection to given text
                this.comboBox.SelectedIndex = this.comboBox.FindStringExact(this.TextBox.Text);

                // Make the combobox visible and place on top textbox control
                this.comboBox.Show();
                this.comboBox.BringToFront();
                this.comboBox.Focus();
            }
        }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:41,代码来源:DataGridComboBoxColumn.cs

示例3: Edit

        protected override void Edit(CurrencyManager source, int rowNum, Rectangle bounds, bool readOnly,	string instantText, bool cellIsVisible)
        {
            DateTime value = DateTime.Today;
            try
            {
                value = (DateTime) GetColumnValueAtRow(source, rowNum);
            }
            catch {}

              if (cellIsVisible)
            {
                myDateTimePicker.Bounds = new Rectangle(bounds.X + 2, bounds.Y + 2, bounds.Width - 4, bounds.Height - 4);
                myDateTimePicker.Value = value;
                myDateTimePicker.Visible = true;
                myDateTimePicker.ValueChanged += new EventHandler(TimePickerValueChanged);
            }
            else
            {
                myDateTimePicker.Value = value;
                myDateTimePicker.Visible = false;
            }

            if (myDateTimePicker.Visible)
                DataGridTableStyle.DataGrid.Invalidate(bounds);
        }
开发者ID:infobook,项目名称:Tools4,代码行数:25,代码来源:DataGridTimePickerColumn.cs

示例4: Edit

        protected override void Edit(CurrencyManager source, int rowNum, Rectangle bounds, bool readOnly,	string instantText, bool cellIsVisible)
        {
            if (isEditing)
                return;

            object value = GetColumnValueAtRow(source, rowNum);
            if (value != null && value != System.DBNull.Value && value.ToString().Equals("+"))
                    mCB.Checked = true;
            else
                    mCB.Checked = false;

            if (cellIsVisible)
            {
                mCB.Bounds = new Rectangle(bounds.X+2, bounds.Y+2 , bounds.Width-2, bounds.Height-2);
                mCB.Visible = true;
                isEditing = true;
                base.ColumnStartedEditing(mCB);
                AddEventHandlerCheckBoxChanged();
            }
            else
            {
                mCB.Visible = false;
            }

            if (mCB.Visible)
            {
                DataGridTableStyle.DataGrid.Invalidate(bounds);
                mCB.Focus();
            }
        }
开发者ID:infobook,项目名称:Tools4,代码行数:30,代码来源:DataGridCheckBoxColumn.cs

示例5: Edit

        protected override void Edit(CurrencyManager source, int rowNum, Rectangle bounds, bool readOnly,	string instantText, bool cellIsVisible)
        {
            if (isEditing)
                return;

            object value = GetColumnValueAtRow(source, rowNum);
            if (value != null && value != System.DBNull.Value && value.ToString().Length > 0)
                mME.Text = value.ToString();
            else
                mME.Text = mME.EditMask; //string.Empty;

            if (cellIsVisible)
            {
                mME.Bounds = new Rectangle(bounds.X+2, bounds.Y+2 , bounds.Width-2, bounds.Height-2);
                mME.Visible = true;
                isEditing = true;
                base.ColumnStartedEditing(mME);
                AddEventHandlerMaskEditChanged();
            }
            else
            {
                mME.Visible = false;
            }

            if (mME.Visible)
            {
                DataGridTableStyle.DataGrid.Invalidate(bounds);
                mME.Select(0,1);
                mME.Focus();
            }
        }
开发者ID:infobook,项目名称:Tools4,代码行数:31,代码来源:DataGridMaskEditColumn.cs

示例6: filterChanged

 private void filterChanged(object sender, EventArgs e)
 {
     FilterControl component = (FilterControl)base.Component;
     CurrencyManager manager = null;
     if ((component.DataSource != null) && (component.BindingContext != null))
     {
         manager = (CurrencyManager)component.BindingContext[component.DataSource, component.DataMember];
     }
     if (manager != this.cm)
     {
         if (this.cm != null)
         {
             this.cm.MetaDataChanged -= new EventHandler(this.dataGridViewMetaDataChanged);
         }
         this.cm = manager;
         if (this.cm != null)
         {
             this.cm.MetaDataChanged += new EventHandler(this.dataGridViewMetaDataChanged);
         }
     }
     if (component.BindingContext == null || component.DataSource != null)
     {
         MakeSureColumnsAreSited(component);
     }
     else
     {
         this.RefreshColumnCollection();
     }
 }
开发者ID:BachelorEric,项目名称:ModelFirst,代码行数:29,代码来源:FilterControlDesigner.cs

示例7: Edit

        protected override void Edit(CurrencyManager source, int rowNum, Rectangle bounds, bool readOnly,	string instantText, bool cellIsVisible)
        {
            if (isEditing)
                return;

            if (cellIsVisible)
            {
                mSel.Bounds = new Rectangle(bounds.X + 2, bounds.Y + 2, bounds.Width, bounds.Height);
                mSel.Visible = true;
                mSel.OnControlChanged += new EventHandler(OpenDateValueChanged);
                object value = base.GetColumnValueAtRow( source, rowNum );
                if ( value == null )
                    mSel.pSelectedItem = new PlaceCode(0, 0);
                else
                    mSel.pSelectedItem = PlaceCode.PDC2PlaceCode(value.ToString());
                value = this.GetColumnValueAtRow( source, rowNum );
                if ( value == null )
                    mSel.pText = string.Empty;
                else
                    mSel.pText = value.ToString();
            }
            else
            {
                mSel.Visible = false;
            }

            if (mSel.Visible)
            {
                isEditing = true;
                base.ColumnStartedEditing(mSel);
                DataGridTableStyle.DataGrid.Invalidate(bounds);
            }
        }
开发者ID:infobook,项目名称:Tools4,代码行数:33,代码来源:DataGridSelectFromColumn.cs

示例8: MapViewerForm

        public MapViewerForm(TileMap map)
        {
            InitializeComponent();
            Map = map;
            mv = new MapViewer(picMapViewer.Handle, picMapViewer.Width, picMapViewer.Height);
            mv.changeMap(Map);
            mv.UpdateView();

            lstLayer.DataSource = Map.myLayer;
            lstLayer.DisplayMember = "Name";

            updateLayer();
            ve = new ViewEvent();

            _layerCache = new List<LayerCache>();
            for (int i = 0; i < Map.myLayer.Count; i++ )
            {
                LayerCache lc = new LayerCache(Map.maxX, map.maxY, Map.myLayer[i]);
                _layerCache.Add(lc);
            }

            cm = (CurrencyManager)BindingContext[Map.myLayer];

            SetScrollSize();

            tmrRefresh.Interval = 180;
            tmrRefresh.Start();
        }
开发者ID:ComposerCookie,项目名称:JRPDragon,代码行数:28,代码来源:MapViewerForm.cs

示例9: Commit

        //
        // Commit Changes
        //
        protected override bool Commit(CurrencyManager DataSource,int RowNum)
        {
            HideCombo();
              if(!InEdit)
              {
            return true;
              }

              try
              {
            object Value = mCombo.SelectedValue;
            if(NullText.Equals(Value))
            {
              Value = System.Convert.DBNull;
            }
            SetColumnValueAtRow(DataSource, RowNum, Value);
              }
              catch
              {
            RollBack();
            return false;
              }

              this.EndEdit();
              return true;
        }
开发者ID:infobook,项目名称:Tools4,代码行数:29,代码来源:DataGridColumnStyle.cs

示例10: Form1_Load

 private void Form1_Load(object sender, System.EventArgs e)
 {
     sqlDataAdapter1.Fill(authorsDataSet1);
     textBox2.DataBindings.Add("Text", authorsDataSet1, "Authors.au_fname");
     MyCM = (CurrencyManager) this.BindingContext[authorsDataSet1, "authors"];
     MyCM.Position = 0;
 }
开发者ID:alvarezdaniel,项目名称:inworx-curso-dotnet,代码行数:7,代码来源:Form1.cs

示例11: Edit

        //
        // Edit Grid
        //
        protected override void Edit(
      CurrencyManager Source ,
      int Rownum,
      Rectangle Bounds, 
      bool ReadOnly,
      string InstantText, 
      bool CellIsVisible
      )
        {
            mCombo.Text = string.Empty;
              Rectangle OriginalBounds = Bounds;
              OldVal = mCombo.Text;

              if(CellIsVisible)
              {
            Bounds.Offset(xMargin, yMargin);
            Bounds.Width -= xMargin * 2;
            Bounds.Height -= yMargin;
            mCombo.Bounds = Bounds;
            mCombo.Visible = true;
              }
              else
              {
            mCombo.Bounds = OriginalBounds;
            mCombo.Visible = false;
              }
              try
              {
            mCombo.SelectedValue = GetText(GetColumnValueAtRow(Source, Rownum));
              }
              catch {}

              if(InstantText!=null)
              {
            mCombo.SelectedValue = InstantText;
              }
              mCombo.RightToLeft = this.DataGridTableStyle.DataGrid.RightToLeft;
              //			Combo.Focus();

              if(InstantText==null)
              {
            mCombo.SelectAll();

            // Pre-selects an item in the combo when user tries to add
            // a new record by moving the columns using tab.

            // Combo.SelectedIndex = 0;
              }
              else
              {
            int End = mCombo.Text.Length;
            mCombo.Select(End, 0);
              }
              if(mCombo.Visible)
              {
            DataGridTableStyle.DataGrid.Invalidate(OriginalBounds);
              }

              InEdit = true;
        }
开发者ID:infobook,项目名称:Tools4,代码行数:63,代码来源:DataGridColumnStyle.cs

示例12: Commit

        protected override bool Commit(CurrencyManager dataSource, int rowNum)
        {
            customComboBoxPicker1.Bounds = Rectangle.Empty;

            customComboBoxPicker1.TextChanged -=
                new EventHandler(ComboBoxTextChanged);

            if (!isEditing)
                return true;

            isEditing = false;

            try
            {
                string value = customComboBoxPicker1.Text;
                SetColumnValueAtRow(dataSource, rowNum, value);
            }
            catch (Exception)
            {
                Abort(rowNum);
                return false;
            }

            Invalidate();
            return true;
        }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:26,代码来源:DataGridComboBoxColumn.cs

示例13: GraphicDatabase

        public GraphicDatabase()
        {
            InitializeComponent();

            tv = new TilesetViewer(picTilesetViewer.Handle, picTilesetViewer.Width, picTilesetViewer.Height);
            vs = new ViewSprite(picSprite.Handle);
            vf = new ViewFace(picFace.Handle);
            vas = new ViewAnimateSprite(picSpriteAnimation.Handle);
            vs.SetView(picSprite.Width, picSprite.Height);

            //tv.LoadTileset(new Texture("0.png"));
            tv.yOffSet = vTilesetScroll.Value;
            tv.UpdateView();

            lstTileset.DataSource = Editor.Instance.curGame.TM.myTileset;
            lstTileset.DisplayMember = "Name";

            lstSprite.DataSource = Editor.Instance.curGame.AM.MySprite;
            lstSprite.DisplayMember = "Name";

            lstFace.DataSource = Editor.Instance.curGame.AM.MyFace;

            cmts = (CurrencyManager)BindingContext[Editor.Instance.curGame.TM.myTileset];
            cms = (CurrencyManager)BindingContext[Editor.Instance.curGame.AM.MySprite];
            cmf = (CurrencyManager)BindingContext[Editor.Instance.curGame.AM.MyFace];

            RefreshTilesetDatabase();
            RefreshSpriteDatabase();
            RefreshFaceDatabase();

            tmrRefresher.Start();
        }
开发者ID:ComposerCookie,项目名称:JRPDragon,代码行数:32,代码来源:GraphicDatabase.cs

示例14: Edit

		protected override void Edit (CurrencyManager source, int rowNum, Rectangle bounds, bool readOnly, string instantText, bool cellIsVisible)
		{
			Console.WriteLine ("TextBox bounds = {0} and is {1}, parent = {2}", TextBox.Bounds, TextBox.Visible ? "visible" : "not visible", TextBox.Parent == null ? "null" : TextBox.Parent.GetType().ToString());
			Console.WriteLine ("Edit\n{0}", Environment.StackTrace);
			base.Edit (source, rowNum, bounds, readOnly, instantText, cellIsVisible);
			Console.WriteLine ("TextBox bounds = {0} and is {1}, parent = {2}", TextBox.Bounds, TextBox.Visible ? "visible" : "not visible", TextBox.Parent == null ? "null" : TextBox.Parent.GetType().ToString());
		}
开发者ID:hitswa,项目名称:winforms,代码行数:7,代码来源:swf-datagrid-editinfo.cs

示例15: Edit

        protected override void Edit(CurrencyManager source, int rowNum, Rectangle bounds, bool readOnly,	string instantText, bool cellIsVisible)
        {
            if (isEditing)
                return;

            object value = GetColumnValueAtRow(source, rowNum);
            if (value != null && value != System.DBNull.Value)
                    mPSI.pImageCollection.pCurrentIndex = (int)value;
            else
                    mPSI.pImageCollection.pCurrentIndex = 0;

            if (cellIsVisible)
            {
                mPSI.Bounds = new Rectangle(bounds.X, bounds.Y, bounds.Width, bounds.Height);
                mPSI.Visible = true;
                isEditing = true;
                base.ColumnStartedEditing(mPSI);
                AddEventHandlerPicSwitchChanged();
            }
            else
            {
                mPSI.Visible = false;
            }

            if (mPSI.Visible)
            {
                DataGridTableStyle.DataGrid.Invalidate(bounds);
                mPSI.Invalidate();
                mPSI.Focus();
            }
        }
开发者ID:infobook,项目名称:Tools4,代码行数:31,代码来源:DataGridPicSwitchColumn.cs


注:本文中的System.Windows.Forms.CurrencyManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。