Exemple #1
0
        public MozPane()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // TODO: remove the following lines after you know the resource names

            // This call is required by the Windows.Forms Form Designer.
            components = new Container();

            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            SetStyle(ControlStyles.ContainerControl, true);

            m_mozItemCollection = new MozItemCollection(this);

            // Enable Autoscroll
            AutoScroll = true;

            m_padding = new PaddingCollection(this);
            m_colorCollection = new ColorCollection(this);
            m_borderStyleCollection = new BorderStyleCollection(this);
            m_themeManager = new ThemeManager();
            m_selectButton = MozSelectButton.Left;
            m_style = MozPaneStyle.Vertical;
            m_toggle = false;
            m_maxSelectedItems = 1;
            m_selectedItems = 0;

            m_useTheme = false;
            m_theme = IntPtr.Zero;

            // Listen for changes to the parent
            ParentChanged += OnParentChanged;


            beginUpdateCount = 0;

            deserializing = false;
            initialising = false;

            m_borderColor = Color.FromArgb(127, 157, 185);
            BackColor = Color.White;
            m_borderStyle = ButtonBorderStyle.Solid;
        }
Exemple #2
0
 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
 {
     if (value.GetType() == typeof (string))
     {
         // Parse property string
         string[] ss = value.ToString().Split(new[] {';'}, 2);
         if (ss.Length == 2)
         {
             // Create new PaddingCollection
             var item = new PaddingCollection((MozPane) context.Instance);
             // Set properties
             item.Horizontal = int.Parse(ss[0]);
             item.Vertical = int.Parse(ss[1]);
             return item;
         }
     }
     return base.ConvertFrom(context, culture, value);
 }