예제 #1
0
 /// <summary>
 /// constructeur par défaut
 /// </summary>
 public HorizontalTab()
 {
     this.SetStyle(ControlStyles.DoubleBuffer, true);
     this.BackColor         = System.Drawing.Color.FromArgb(243, 241, 229);
     this.Dock              = DockStyle.Fill;
     FVerticalTextAlignment = StringAlignment.Center;
     FMargins    = TabMargins.Empty;
     FTabVisible = true;
 }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public override bool Equals(object obj)
 {
     if (obj is TabMargins)
     {
         TabMargins other = (TabMargins)obj;
         return((other.Bottom == FBottom) && (other.Top == FTop) &&
                (other.Left == FLeft) && (other.Right == FRight));
     }
     return(false);
 }
예제 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="context"></param>
 /// <param name="culture"></param>
 /// <param name="value"></param>
 /// <param name="destinationType"></param>
 /// <returns></returns>
 public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType)
 {
     if (destinationType == null)
     {
         throw new ArgumentNullException("destinationType");
     }
     if ((destinationType == typeof(string)) && (value is TabMargins))
     {
         TabMargins margins = (TabMargins)value;
         if (culture == null)
         {
             culture = CultureInfo.CurrentCulture;
         }
         string        text1      = culture.TextInfo.ListSeparator + " ";
         TypeConverter converter1 = TypeDescriptor.GetConverter(typeof(int));
         string[]      textArray1 = new string[4];
         int           num1       = 0;
         textArray1[num1++] = converter1.ConvertToString(context, culture, margins.Left);
         textArray1[num1++] = converter1.ConvertToString(context, culture, margins.Top);
         textArray1[num1++] = converter1.ConvertToString(context, culture, margins.Right);
         textArray1[num1++] = converter1.ConvertToString(context, culture, margins.Bottom);
         return(string.Join(text1, textArray1));
     }
     if ((destinationType == typeof(InstanceDescriptor)) && (value is TabMargins))
     {
         TabMargins margins    = (TabMargins)value;
         Type[]     typeArray1 = new Type[4] {
             typeof(int), typeof(int), typeof(int), typeof(int)
         };
         ConstructorInfo info1 = typeof(TabMargins).GetConstructor(typeArray1);
         if (info1 != null)
         {
             object[] objArray1 = new object[4] {
                 margins.Left, margins.Top, margins.Right, margins.Bottom
             };
             return(new InstanceDescriptor(info1, objArray1));
         }
     }
     return(base.ConvertTo(context, culture, value, destinationType));
 }