Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Xml / System / Xml / XPath / Internal / Function.cs / 1 / Function.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
namespace MS.Internal.Xml.XPath {
using System;
using System.Xml;
using System.Xml.XPath;
using System.Diagnostics;
using System.Collections;
internal class Function : AstNode {
public enum FunctionType {
FuncLast,
FuncPosition,
FuncCount,
FuncID,
FuncLocalName,
FuncNameSpaceUri,
FuncName,
FuncString,
FuncBoolean,
FuncNumber,
FuncTrue,
FuncFalse,
FuncNot,
FuncConcat,
FuncStartsWith,
FuncContains,
FuncSubstringBefore,
FuncSubstringAfter,
FuncSubstring,
FuncStringLength,
FuncNormalize,
FuncTranslate,
FuncLang,
FuncSum,
FuncFloor,
FuncCeiling,
FuncRound,
FuncUserDefined,
};
private FunctionType functionType;
private ArrayList argumentList;
private string name = null;
private string prefix = null;
public Function(FunctionType ftype, ArrayList argumentList) {
this.functionType = ftype;
this.argumentList = new ArrayList(argumentList);
}
public Function(string prefix, string name, ArrayList argumentList) {
this.functionType = FunctionType.FuncUserDefined;
this.prefix = prefix;
this.name = name;
this.argumentList = new ArrayList(argumentList);
}
public Function(FunctionType ftype) {
this.functionType = ftype;
}
public Function(FunctionType ftype, AstNode arg) {
functionType = ftype;
argumentList = new ArrayList();
argumentList.Add(arg);
}
public override AstType Type { get {return AstType.Function;} }
public override XPathResultType ReturnType {
get {
return ReturnTypes[(int) functionType];
}
}
public FunctionType TypeOfFunction { get { return functionType; } }
public ArrayList ArgumentList { get { return argumentList; } }
public string Prefix { get { return prefix; } }
public string Name { get { return name; } }
internal static XPathResultType[] ReturnTypes = {
/* FunctionType.FuncLast */ XPathResultType.Number ,
/* FunctionType.FuncPosition */ XPathResultType.Number ,
/* FunctionType.FuncCount */ XPathResultType.Number ,
/* FunctionType.FuncID */ XPathResultType.NodeSet,
/* FunctionType.FuncLocalName */ XPathResultType.String ,
/* FunctionType.FuncNameSpaceUri */ XPathResultType.String ,
/* FunctionType.FuncName */ XPathResultType.String ,
/* FunctionType.FuncString */ XPathResultType.String ,
/* FunctionType.FuncBoolean */ XPathResultType.Boolean,
/* FunctionType.FuncNumber */ XPathResultType.Number ,
/* FunctionType.FuncTrue */ XPathResultType.Boolean,
/* FunctionType.FuncFalse */ XPathResultType.Boolean,
/* FunctionType.FuncNot */ XPathResultType.Boolean,
/* FunctionType.FuncConcat */ XPathResultType.String ,
/* FunctionType.FuncStartsWith */ XPathResultType.Boolean,
/* FunctionType.FuncContains */ XPathResultType.Boolean,
/* FunctionType.FuncSubstringBefore */ XPathResultType.String ,
/* FunctionType.FuncSubstringAfter */ XPathResultType.String ,
/* FunctionType.FuncSubstring */ XPathResultType.String ,
/* FunctionType.FuncStringLength */ XPathResultType.Number ,
/* FunctionType.FuncNormalize */ XPathResultType.String ,
/* FunctionType.FuncTranslate */ XPathResultType.String ,
/* FunctionType.FuncLang */ XPathResultType.Boolean,
/* FunctionType.FuncSum */ XPathResultType.Number ,
/* FunctionType.FuncFloor */ XPathResultType.Number ,
/* FunctionType.FuncCeiling */ XPathResultType.Number ,
/* FunctionType.FuncRound */ XPathResultType.Number ,
/* FunctionType.FuncUserDefined */ XPathResultType.Any
};
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NamespaceCollection.cs
- MemberDomainMap.cs
- CheckBoxPopupAdapter.cs
- ByteStream.cs
- dsa.cs
- DesignTimeValidationFeature.cs
- SyntaxCheck.cs
- Timer.cs
- XmlSchemaObject.cs
- CompressionTransform.cs
- KeyInfo.cs
- SBCSCodePageEncoding.cs
- StickyNote.cs
- XomlCompilerError.cs
- XPathScanner.cs
- IdentifierCreationService.cs
- BindToObject.cs
- NavigationPropertyEmitter.cs
- BulletedList.cs
- TripleDES.cs
- LoadItemsEventArgs.cs
- RegexTree.cs
- RuntimeArgumentHandle.cs
- KnownTypesProvider.cs
- NativeMethods.cs
- DataStreams.cs
- CodeTypeConstructor.cs
- SqlException.cs
- DataControlPagerLinkButton.cs
- OLEDB_Util.cs
- x509utils.cs
- TrackingQueryElement.cs
- SmtpDateTime.cs
- ConnectionString.cs
- DocumentGridContextMenu.cs
- Color.cs
- AnnotationAdorner.cs
- CellParaClient.cs
- X509SecurityTokenProvider.cs
- SqlNodeAnnotation.cs
- EventLogEntry.cs
- ISAPIRuntime.cs
- PersonalizablePropertyEntry.cs
- MetabaseSettingsIis7.cs
- ToolStripContainerActionList.cs
- XmlProcessingInstruction.cs
- SplitContainer.cs
- WindowsTreeView.cs
- PositiveTimeSpanValidator.cs
- BatchWriter.cs
- SafeViewOfFileHandle.cs
- Rect3D.cs
- LocalFileSettingsProvider.cs
- CqlLexer.cs
- Ipv6Element.cs
- SafeLocalAllocation.cs
- KeyPullup.cs
- PrimitiveXmlSerializers.cs
- SerializationEventsCache.cs
- MonthCalendar.cs
- SqlConnectionPoolGroupProviderInfo.cs
- StringPropertyBuilder.cs
- FieldNameLookup.cs
- TextTabProperties.cs
- EdmError.cs
- XmlSchema.cs
- FreezableCollection.cs
- IntegerValidator.cs
- Executor.cs
- Label.cs
- AbstractSvcMapFileLoader.cs
- TemplateControl.cs
- MethodAccessException.cs
- baseaxisquery.cs
- ExpressionList.cs
- Metadata.cs
- metadatamappinghashervisitor.cs
- XmlAttributeProperties.cs
- StoreItemCollection.cs
- FormatStringEditor.cs
- DataSetViewSchema.cs
- TextMessageEncoder.cs
- GetKeyedHashRequest.cs
- DetailsViewInsertEventArgs.cs
- ModelItemImpl.cs
- PropertyPushdownHelper.cs
- Point4DConverter.cs
- AddressingProperty.cs
- SubordinateTransaction.cs
- ControlPropertyNameConverter.cs
- ReadContentAsBinaryHelper.cs
- NativeObjectSecurity.cs
- DisposableCollectionWrapper.cs
- XmlSerializerNamespaces.cs
- EnumValAlphaComparer.cs
- BamlRecordReader.cs
- WindowsStartMenu.cs
- OletxCommittableTransaction.cs
- CodeTypeDeclaration.cs
- ObjectHandle.cs