public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
            {
                if (destType == typeof(string) && value is CellHelper)
                {
                    // Cast the value to an Employee type
                    CellHelper pp = (CellHelper)value;

                    return(pp.Value + ", " + pp.Rowhandle + ", " + pp.Columnindex);
                }
                return(base.ConvertTo(context, culture, value, destType));
            }
 public bool Contains(CellHelper value)
 {
     // If value is not of type Int16, this will return false.
     return (List.Contains(value));
 }
 public int Add(CellHelper value)
 {
     return (List.Add(value));
 }
 public void Remove(CellHelper value)
 {
     List.Remove(value);
 }
 public void Insert(int index, CellHelper value)
 {
     List.Insert(index, value);
 }
 public int IndexOf(CellHelper value)
 {
     return (List.IndexOf(value));
 }
 public bool Contains(CellHelper value)
 {
     // If value is not of type Int16, this will return false.
     return(List.Contains(value));
 }
 public void Remove(CellHelper value)
 {
     List.Remove(value);
 }
 public void Insert(int index, CellHelper value)
 {
     List.Insert(index, value);
 }
Beispiel #10
0
 public int IndexOf(CellHelper value)
 {
     return(List.IndexOf(value));
 }
Beispiel #11
0
 public int Add(CellHelper value)
 {
     return(List.Add(value));
 }
Beispiel #12
0
        private void CopySelectionToClipboard()
        {
            try
            {
                DevExpress.XtraGrid.Views.Base.GridCell[] cellcollection = gridView1.GetSelectedCells();
                CellHelperCollection chc = new CellHelperCollection();
                foreach (DevExpress.XtraGrid.Views.Base.GridCell gc in cellcollection)
                {
                    CellHelper ch = new CellHelper();
                    ch.Rowhandle = gc.RowHandle;
                    ch.Columnindex = gc.Column.AbsoluteIndex;
                    object o = gridView1.GetRowCellValue(gc.RowHandle, gc.Column);
                    if (m_viewtype == ViewType.Hexadecimal)
                    {
                        ch.Value = Convert.ToInt32(o.ToString(), 16);
                    }
                    else
                    {
                        ch.Value = Convert.ToInt32(o);
                    }
                    chc.Add(ch);
                }
                string serialized = ((int)m_viewtype).ToString();//string.Empty;
                foreach (CellHelper ch in chc)
                {
                    serialized += ch.Columnindex.ToString() + ":" + ch.Rowhandle.ToString() + ":" + ch.Value.ToString() + ":~";
                }

                Clipboard.SetText(serialized);
            }
            catch (Exception E)
            {
                Console.WriteLine(E.Message);
            }
        }