Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
LookupFieldCollector.cs
Package: WebUserForms.zip [view]
Upload User: husern
Upload Date: 2022-03-24
Package Size: 534k
Code Size: 3k
Category:
Editor
Development Platform:
C#
- // -- FILE ------------------------------------------------------------------
- // name : LookupCollector.cs
- // project : Itenso Web User Forms
- // created : Jani Giannoudis - 2008.10.30
- // language : c#
- // environment: .NET 2.0
- // copyright : (c) 2008 by Itenso GmbH, Switzerland
- // --------------------------------------------------------------------------
- using System;
- using System.Collections.Generic;
- using System.Web.UI;
- namespace Itenso.WebUserForms.Controls
- {
- // ------------------------------------------------------------------------
- public class LookupFieldCollector : UserFormVisitor
- {
- // ----------------------------------------------------------------------
- public LookupFieldCollector( Control startControl )
- : base( startControl )
- {
- } // LookupCollector
- // ----------------------------------------------------------------------
- public LookupFieldCollector( Control startControl, string lookupName )
- : this( startControl )
- {
- if ( string.IsNullOrEmpty( lookupName ) )
- {
- throw new ArgumentException( "lookupName" );
- }
- this.lookupName = lookupName;
- } // LookupCollector
- // ----------------------------------------------------------------------
- public string LookupName
- {
- get { return this.lookupName; }
- } // LookupName
- // ----------------------------------------------------------------------
- public List<ILookupField> LookupFields
- {
- get { return this.lookupFields; }
- } // LookupFields
- // ----------------------------------------------------------------------
- public void Collect()
- {
- this.lookupFields.Clear();
- Start();
- } // Collect
- // ----------------------------------------------------------------------
- public static List<ILookupField> Collect( Control startControl )
- {
- return Collect( startControl, null );
- } // Collect
- // ----------------------------------------------------------------------
- public static List<ILookupField> Collect( Control startControl, string lookupName )
- {
- LookupFieldCollector lookupFieldCollector = new LookupFieldCollector( startControl, lookupName );
- lookupFieldCollector.Collect();
- return lookupFieldCollector.LookupFields;
- } // Collect
- // ----------------------------------------------------------------------
- protected override void VisitLookupFormField( Control control,
- ILookupField lookupField, IUserFormHeader formHeader )
- {
- bool match = true;
- if ( !string.IsNullOrEmpty( this.lookupName ) )
- {
- match = this.lookupName.Equals( lookupField.LookupName );
- }
- if ( match )
- {
- this.lookupFields.Add( lookupField );
- }
- } // VisitLookupFormField
- // ----------------------------------------------------------------------
- // members
- private readonly List<ILookupField> lookupFields = new List<ILookupField>();
- private readonly string lookupName;
- } // class LookupCollector
- } // namespace Itenso.WebUserForms.Controls
- // -- EOF -------------------------------------------------------------------