// ------------------------------------------------------------------ /// <summary> /// Constructor. /// </summary> // ------------------------------------------------------------------ public FileShape() : base() { myIcon = new IconLabelMaterial(); myIcon.Icon = (Bitmap)ImagePalette.Shortcut; myIcon.Shape = this; Children.Add(myIcon); }
/// <summary> /// Initializes a new instance of the <see cref="T:FolderMaterial"/> class. /// </summary> /// <param name="title">The title.</param> /// <param name="entries">The entries.</param> /// <param name="defaultIconLocation">The default icon location.</param> public FolderMaterial(string title, string[] entries, string defaultIconLocation) : this(title) { IconLabelMaterial label; for (int k = 0; k < entries.Length; k++) { label = new IconLabelMaterial(entries[k], defaultIconLocation); mEntries.Add(label); } Collapse(); }
/// <summary> /// Initializes a new instance of the <see cref="T:FolderMaterial"/> class. /// </summary> /// <param name="title">The title.</param> /// <param name="entries">The entries.</param> public FolderMaterial(string title, string[] entries) : this(title) { IconLabelMaterial label; for (int k = 0; k < entries.Length; k++) { label = new IconLabelMaterial("Resources.Text.png", entries[k]); mEntries.Add(label); } Collapse(); }
/// <summary> /// Initializes a new instance of the <see cref="T:FolderMaterial"/> class. /// </summary> /// <param name="title">The title.</param> /// <param name="entries">The entries.</param> public FolderMaterial(string title, string[] entries) : this(title) { myTextStyle = new TextStyle( Color.Black, new Font("Arial", 10), StringAlignment.Near, StringAlignment.Near); IconLabelMaterial label; for (int k = 0; k < entries.Length; k++) { label = new IconLabelMaterial("Resources.Text.png", entries[k]); // We attach our ITextStyle to items when they're added to the // collection. mEntries.Add(label); } Collapse(); }
// ------------------------------------------------------------------ /// <summary> /// Loads the icon from Windows for the filename specified and /// creates our 'icon'. /// </summary> /// <param name="filename">string</param> // ------------------------------------------------------------------ void CreateIcon(string filename) { if (this.myIcon == null) { this.myIcon = new IconLabelMaterial(); Children.Add(myIcon); this.myIcon.Shape = this; } try { this.myIcon.Icon = GetIconForFile(filename, false).ToBitmap(); } catch { this.myIcon.Icon = (Bitmap)ImagePalette.Shortcut; } this.myIcon.Transform(new Rectangle(Location, new Size(1, 1))); Transform(myIcon.Rectangle); }
/// <summary> /// Initializes a new instance of the <see cref="T:FolderMaterial"/> class. /// </summary> /// <param name="title">The title.</param> /// <param name="entries">The entries.</param> /// <param name="defaultIconLocation">The default icon location.</param> public FolderMaterial( string title, string[] entries, string defaultIconLocation) : this(title) { IconLabelMaterial label; myTextStyle = new TextStyle( Color.Black, new Font("Arial", 10), StringAlignment.Near, StringAlignment.Near); for (int k = 0; k < entries.Length; k++) { label = new IconLabelMaterial(entries[k], defaultIconLocation); mEntries.Add(label); } Collapse(); myTextStyle.TextStyleChanged += new TextStyleChangedEventHandler(HandleTextStyleChanged); }
/// <summary> /// Initializes a new instance of the <see cref="T:FolderMaterial"/> class. /// </summary> /// <param name="title">The title.</param> /// <param name="entries">The entries.</param> public FolderMaterial(string title, string[] entries) : this(title) { IconLabelMaterial label; for (int k = 0; k < entries.Length; k++) { label = new IconLabelMaterial("Resources.Text.png" ,entries[k]); mEntries.Add(label); } Collapse(); }