Ejemplo n.º 1
0
 // ------------------------------------------------------------------
 /// <summary>
 /// Constructor.
 /// </summary>
 // ------------------------------------------------------------------
 public FileShape()
     : base()
 {
     myIcon       = new IconLabelMaterial();
     myIcon.Icon  = (Bitmap)ImagePalette.Shortcut;
     myIcon.Shape = this;
     Children.Add(myIcon);
 }
Ejemplo n.º 2
0
 /// <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();
 }
Ejemplo n.º 3
0
 /// <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();
 }
Ejemplo n.º 4
0
        /// <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();
        }
Ejemplo n.º 5
0
        // ------------------------------------------------------------------
        /// <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);
        }
Ejemplo n.º 6
0
        /// <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);
        }
Ejemplo n.º 7
0
    /// <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);
    }
Ejemplo n.º 8
0
    /// <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();
    }
Ejemplo n.º 9
0
    // ------------------------------------------------------------------
    /// <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);
    }
Ejemplo n.º 10
0
 // ------------------------------------------------------------------
 /// <summary>
 /// Constructor.
 /// </summary>
 // ------------------------------------------------------------------
 public FileShape()
   : base() {
   myIcon = new IconLabelMaterial();
   myIcon.Icon = (Bitmap)ImagePalette.Shortcut;
   myIcon.Shape = this;
   Children.Add(myIcon);
 }
Ejemplo n.º 11
0
 /// <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();
 }
Ejemplo n.º 12
0
 /// <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();
 }