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); }
public override Object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, Object value, Type destinationType) { GridBg thickness = (GridBg)value; switch (thickness.centred) { case Centred.None: if (destinationType == typeof(String)) { return(thickness.left + "," + thickness.right + "," + thickness.top + "," + thickness.bottom + "," + thickness.centred); } else if (destinationType == typeof(InstanceDescriptor)) { { ConstructorInfo constructor = typeof(GridBg).GetConstructor(new Type[] { typeof(int), typeof(int), typeof(int), typeof(int), typeof(Centred) }); return(new InstanceDescriptor(constructor, new Object[] { thickness.left, thickness.right, thickness.top, thickness.bottom, thickness.centred })); } } break; case Centred.Vertical: if (destinationType == typeof(String)) { return(thickness.left + "," + thickness.right + "," + thickness.vertical + "," + thickness.centred); } else if (destinationType == typeof(InstanceDescriptor)) { { ConstructorInfo constructor = typeof(GridBg).GetConstructor(new Type[] { typeof(int), typeof(int), typeof(int), typeof(Centred) }); return(new InstanceDescriptor(constructor, new Object[] { thickness.left, thickness.right, thickness.vertical, thickness.centred })); } } break; case Centred.Horizontal: if (destinationType == typeof(String)) { return(thickness.horizontal + "," + thickness.top + "," + thickness.bottom + "," + thickness.centred); } else if (destinationType == typeof(InstanceDescriptor)) { { ConstructorInfo constructor = typeof(GridBg).GetConstructor(new Type[] { typeof(int), typeof(int), typeof(int), typeof(Centred) }); return(new InstanceDescriptor(constructor, new Object[] { thickness.horizontal, thickness.top, thickness.bottom, thickness.centred })); } } break; case Centred.Centred: if (destinationType == typeof(String)) { return(thickness.thick + "," + thickness.centred); } else if (destinationType == typeof(InstanceDescriptor)) { { ConstructorInfo constructor = typeof(GridBg).GetConstructor(new Type[] { typeof(int), typeof(Centred) }); return(new InstanceDescriptor(constructor, new Object[] { thickness.thick, thickness.centred })); } } break; } return(null); }