⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iiswebsitelistviewitem.cs

📁 用ADSI操作IIS文件
💻 CS
字号:
// IIsAdmin.NET
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// 
// This softwareis provided "AS IS" with no warranties of any kind.
// The entire risk arising out of the use or performance of the software
// and source code is with you.
//
// THIS NOTICE MAY NOT BE REMOVED FROM THIS FILE.

using System;
using System.Drawing;
using System.Windows.Forms;

namespace IIsAdmin
{
	/// <summary>
	/// Defines a
	/// </summary>
    public class IIsWebSiteListViewItem : ListViewItem 
    {
        private IIsWebSite _site;

        /// <summary>
        /// Initializes a new instance of the IIsWebSiteListViewItem class
        /// </summary>
        /// <param name="site"></param>
        public IIsWebSiteListViewItem(IIsWebSite site) : base(site.Name)
        {
            base.Checked = (site.State == IIsWebSiteStates.Started); 
            if (base.Checked)
            {
                this.MakeBold(true);
            }

            base.SubItems.Add(site.Index.ToString());
            _site = site;
        }
        
        /// <summary>
        /// Makes the item bold
        /// </summary>
        /// <param name="bold">A flag to indicate if the item is displayed in bold or normal font</param>
        public void MakeBold(bool bold)
        {
            if (bold)
            {
                base.Font = new Font(this.Font.FontFamily.Name, this.Font.Size, FontStyle.Bold | FontStyle.Underline);               
            }
            else
            {
                base.Font = new Font(this.Font.FontFamily.Name, this.Font.Size, FontStyle.Regular);
            }
        }

        /// <summary>
        /// Returns the site represented by this item
        /// </summary>
        public IIsWebSite WebSite
        {
            get
            {
                return _site;
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -