|
Cet article a fait l'objet d'une traduction automatique. Déplacez votre pointeur sur les phrases de l'article pour voir la version originale de ce texte. Informations supplémentaires.
|
Traduction
Source
|
XmlDataFileEditor, classe
System.Drawing.Design.UITypeEditor
System.Web.UI.Design.UrlEditor
System.Web.UI.Design.XmlDataFileEditor
Espace de noms : System.Web.UI.Design
Assembly : System.Design (dans System.Design.dll)
Le type XmlDataFileEditor expose les membres suivants.
| Nom | Description | |
|---|---|---|
![]() | XmlDataFileEditor |
| Nom | Description | |
|---|---|---|
![]() | Caption | |
![]() | Filter | |
![]() | IsDropDownResizable | |
![]() | Options |
| Nom | Description | |
|---|---|---|
![]() | EditValue(IServiceProvider, Object) | |
![]() | EditValue(ITypeDescriptorContext, IServiceProvider, Object) | |
![]() | Equals(Object) | |
![]() | Finalize | |
![]() | GetEditStyle() | |
![]() | GetEditStyle(ITypeDescriptorContext) | |
![]() | GetHashCode | |
![]() | GetPaintValueSupported() | |
![]() | GetPaintValueSupported(ITypeDescriptorContext) | |
![]() | GetType | |
![]() | MemberwiseClone | |
![]() | PaintValue(PaintValueEventArgs) | |
![]() | PaintValue(Object, Graphics, Rectangle) | |
![]() | ToString |
using System; using System.ComponentModel; using System.ComponentModel.Design; using System.Web.UI; using System.Web.UI.Design; using System.Web.UI.Design.WebControls; using System.Web.UI.WebControls; using System.IO; namespace ControlDesignerSamples.CS { // Define a simple text control, derived from the // System.Web.UI.WebControls.Label class. [ Designer(typeof(TextControlDesigner)) ] public class SimpleTextControl : Label { // Define a private member to store the file name value in the control. private string _filename = ""; private string _internalText = ""; // Define the public XML data file name property. Indicate that the // property can be edited at design-time with the XmlDataFileEditor class. [EditorAttribute(typeof(System.Web.UI.Design.XmlDataFileEditor), typeof(System.Drawing.Design.UITypeEditor))] public string XmlFileName { get { return _filename; } set { _filename = value; } } // Define a property that returns the timestamp // for the selected file. public string LastChanged { get { if ((_filename != null) && (_filename.Length > 0)) { if (File.Exists(_filename)) { DateTime lastChangedStamp = File.GetLastWriteTime(_filename); return lastChangedStamp.ToLongDateString(); } } return ""; } } // Override the control Text property, setting the default // text to the LastChanged string value for the selected // file name. If the file name has not been set in the // design view, then default to an empty string. public override string Text { get { if ((_internalText == "") && (LastChanged.Length > 0)) { // If the internally stored value hasn't been set, // and the file name property has been set, // return the last changed timestamp for the file. _internalText = LastChanged; } return _internalText; } set { if ((value != null) && (value.Length > 0)) { _internalText = value; } else { _internalText = ""; } } } } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (rôle principal du serveur non pris en charge), Windows Server 2008 R2 (rôle principal du serveur pris en charge avec SP1 ou version ultérieure ; Itanium non pris en charge)
Le .NET Framework ne prend pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.
