Exemplo n.º 1
0
 public static void setCBItems(vdUsr.vdComboBox cbo, ICollection col1, ICollection col2, Type converter, object selected, object objDefault)
 {
     ArrayList al = new ArrayList(col1.Count + col2.Count);
     al.AddRange(col1);
     al.AddRange(col2);
     setCBItems(cbo, al, converter, selected, objDefault);
 }
Exemplo n.º 2
0
 public static void selectText(vdUsr.vdComboBox cbo, string strText)
 {
     foreach (object obj in cbo.Items)
         if (obj.ToString().Equals(strText))
         {
             cbo.SelectedItem = obj;
             return;
         }
 }
Exemplo n.º 3
0
 public static void selectTag(vdUsr.vdComboBox cbo, object tag)
 {
     foreach (ListBoxItem lbi in cbo.Items)
         if (lbi.Tag.Equals(tag))
         {
             cbo.SelectedItem = lbi;
             return;
         }
 }
Exemplo n.º 4
0
 public static void loadCBSimple(vdUsr.vdComboBox cbo, IEnumerable list, object selected)
 {
     ArrayList al = new ArrayList();
     foreach (object obj in list)
         al.Add(obj);
     al.Sort();
     cbo.Items.Clear();
     foreach (object obj in al)
         cbo.Items.Add(obj);
     if (selected != null)
         cbo.SelectedItem = selected;
 }
Exemplo n.º 5
0
        public static void setCBItems(vdUsr.vdComboBox cbo, ICollection col, Type converter, object selected, object objDefault)
        {
            System.Reflection.ConstructorInfo constructorInfoObj = converter.GetConstructor(new Type[] { typeof(object) });
            object obj2Select = null;

            cbo.Items.Clear();
            if (objDefault != null)
                cbo.Items.Add(objDefault);
            foreach (object obj in col)
            {
                object obj2stuff = constructorInfoObj.Invoke(new object[] { obj });
                cbo.Items.Add(obj2stuff);
                if (obj == selected)
                    obj2Select = obj2stuff;
            }
            if (obj2Select != null)
                cbo.SelectedItem = obj2Select;
            else if (objDefault != null)
                cbo.SelectedItem = objDefault;
        }
Exemplo n.º 6
0
 public static object selectedTag(vdUsr.vdComboBox cbo)
 {
     ListBoxItem lbi = cbo.SelectedItem as ListBoxItem;
     return cbo != null ? lbi.Tag : null;
 }
Exemplo n.º 7
0
 public static void select(vdUsr.vdComboBox cbo, object Tag)
 {
     cbo.SelectedItem = find(cbo.Items, Tag);
 }
Exemplo n.º 8
0
 private void calendar_PaintCalendarDay( object sender, vdUsr.PaintCalendarDayEventArgs e )
 {
     if ( e.fIsWeek )
     {
         e.Graphics.DrawString( e.number.ToString(), e.font, SystemBrushes.ControlDark, e.rect, e.format );
         return;
     }
     Rectangle r = e.rect;
     r.Offset( 2, 0 );
     if ( e.date.Date == _dateSelected )
         e.Graphics.FillEllipse( SystemBrushes.Highlight, r );
     if ( e.date.Date == DateTime.Now.Date )
         e.Graphics.DrawEllipse( Pens.Red, r );
     if ( _notes.hasRegardingDate( e.date ) )
         using ( Font font = new Font( e.font, FontStyle.Bold ) )
             e.Graphics.DrawString( e.number.ToString(), font, e.brush, e.rect, e.format );
     else
         e.Graphics.DrawString( e.number.ToString(), e.font, e.brush, e.rect, e.format );
 }