Exemplo n.º 1
0
            public override Object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, Object value, Type destinationType)
            {
                LukaSiatki thickness = (LukaSiatki)value;

                if (destinationType == typeof(String))
                {
                    return(thickness.gapX + "," + thickness.gapY + "," + thickness.posX + "," + thickness.posY + "," + thickness.centred);
                }
                else if (destinationType == typeof(InstanceDescriptor))
                {
                    {
                        ConstructorInfo constructor = typeof(LukaSiatki).GetConstructor(new Type[] { typeof(int), typeof(int), typeof(int), typeof(int), typeof(Centred) });
                        return(new InstanceDescriptor(constructor, new Object[] { thickness.gapX, thickness.gapY, thickness.posX, thickness.posY, thickness.centred }));
                    }
                }
                else
                {
                    return(null);
                }
            }
Exemplo n.º 2
0
        public Calendar()
        {
            imgB_prawy      = Image.FromFile("C:\\Users\\User\\Source\\Repos\\calendar\\WindowsFormsApplication1\\WindowsFormsApplication1\\sprite\\prawy.png");
            imgB_lewy       = Image.FromFile("C:\\Users\\User\\Source\\Repos\\calendar\\WindowsFormsApplication1\\WindowsFormsApplication1\\sprite\\lewy.png");
            d_frame_normal  = Image.FromFile("C:\\\\Users\\User\\Source\\Repos\\calendar\\WindowsFormsApplication1\\WindowsFormsApplication1\\sprite\\d_frame_normal.png");
            d_frame_active  = Image.FromFile("C:\\Users\\User\\Source\\Repos\\calendar\\WindowsFormsApplication1\\WindowsFormsApplication1\\sprite\\d_frame_active.png");
            d_frame_today   = Image.FromFile("C:\\Users\\User\\Source\\Repos\\calendar\\WindowsFormsApplication1\\WindowsFormsApplication1\\sprite\\d_frame_today.png");
            d_bg_normal     = Image.FromFile("C:\\Users\\User\\Source\\Repos\\calendar\\WindowsFormsApplication1\\WindowsFormsApplication1\\sprite\\d_bg_normal.png");
            d_accent_normal = Image.FromFile("C:\\Users\\User\\Source\\Repos\\calendar\\WindowsFormsApplication1\\WindowsFormsApplication1\\sprite\\d_accent_normal.png");
            d_accent_sunday = Image.FromFile("C:\\Users\\User\\Source\\Repos\\calendar\\WindowsFormsApplication1\\WindowsFormsApplication1\\sprite\\d_accent_sunday.png");
            siatka_bg       = Image.FromFile("C:\\Users\\User\\Source\\Repos\\calendar\\WindowsFormsApplication1\\WindowsFormsApplication1\\sprite\\bg.png");


            gap    = new LukaSiatki();
            grid   = new GridBg();
            today  = DateTime.Now;
            active = today;
            InitializeComponent();
            panel     = new Rectangle(ClientRectangle.Left, ClientRectangle.Top, ClientRectangle.Width, panelHigh);
            monthName = new Font("Verdana", panel.Height * 0.5f + 1, FontStyle.Bold, GraphicsUnit.Pixel);
        }