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

📄 maskededittypeconvert.cs

📁 AJAX 应用 实现页面的无刷新
💻 CS
字号:
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.
// 
// Product      : MaskedEdit Extend Control
// Version      : 1.0.0.0
// Date         : 10/23/2006
// Development  : Fernando Cerqueira 
// Version      : 1.0.0.1
// Development  : 02/22/2007 Fernando Cerqueira 
// 
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.ComponentModel;
using System.Collections;
using System.Globalization;

namespace AjaxControlToolkit
{
    public class MaskedEditTypeConvert : StringConverter
    {
        public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
        {
            return true;
        }
        public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
        {
            return false;
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods", Justification = "context is checked against null")]
        public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            if ((context == null) || (context.Container == null))
            {
                return null;
            }
            Object[] serverControls = GetControls(context.Container);
            if (serverControls != null)
            {
                return new StandardValuesCollection(serverControls);
            }
            return null;
        }
        private static object[] GetControls(IContainer container)
        {
            ArrayList availableControls = new ArrayList();
            foreach (IComponent component in container.Components)
            {
                Control serverControl = component as Control;
                if (serverControl != null &&
                    !(serverControl is Page) &&
                    serverControl.ID != null &&
                    serverControl.ID.Length != 0 &&
                    IncludeControl(serverControl))
                {
                    availableControls.Add(serverControl.ID);
                }
            }
            availableControls.Sort(Comparer.Default);
            return availableControls.ToArray();
        }
        private static bool IncludeControl(Control serverControl)
        {
            bool ReturnedVal = false;
            string ControlType = serverControl.GetType().ToString();
            if (ControlType.IndexOf("ajaxcontroltoolkit.maskededitextender", StringComparison.OrdinalIgnoreCase) != -1)
            {
                ReturnedVal = true;
            }
            return ReturnedVal;
        }
    }
}

⌨️ 快捷键说明

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