Esempio n. 1
0
 // ------------------------------------------------------------------
 /// <summary>
 /// Constructor.
 /// </summary>
 // ------------------------------------------------------------------
 public FileShape()
     : base()
 {
     myIcon       = new IconLabelMaterial();
     myIcon.Icon  = (Bitmap)ImagePalette.Shortcut;
     myIcon.Shape = this;
     Children.Add(myIcon);
 }
Esempio 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();
 }
Esempio 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();
 }
Esempio 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();
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
    }
Esempio 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();
    }
Esempio 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);
    }
Esempio n. 10
0
 // ------------------------------------------------------------------
 /// <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();
 }