Code:
/ FX-1434 / FX-1434 / 1.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
- SocketException.cs
- IListConverters.cs
- ButtonBaseAdapter.cs
- KnownTypeAttribute.cs
- StringKeyFrameCollection.cs
- InvalidPropValue.cs
- _PooledStream.cs
- TreeNodeClickEventArgs.cs
- WpfKnownType.cs
- BlurEffect.cs
- CompilerErrorCollection.cs
- LinearKeyFrames.cs
- ThreadExceptionDialog.cs
- DataContractFormatAttribute.cs
- TranslateTransform3D.cs
- CompilationUtil.cs
- AppDomainProtocolHandler.cs
- OleDbErrorCollection.cs
- ChannelBuilder.cs
- SemanticAnalyzer.cs
- XamlInt32CollectionSerializer.cs
- SHA1Managed.cs
- DocumentScope.cs
- TableRowCollection.cs
- SectionRecord.cs
- ExtensibleClassFactory.cs
- ListView.cs
- ImageClickEventArgs.cs
- HScrollProperties.cs
- DynamicValueConverter.cs
- SoapMessage.cs
- MultilineStringConverter.cs
- CalendarDay.cs
- ParameterModifier.cs
- SocketElement.cs
- KeyNotFoundException.cs
- MenuItem.cs
- ListControlConvertEventArgs.cs
- FixedSOMContainer.cs
- CommonObjectSecurity.cs
- Internal.cs
- basecomparevalidator.cs
- BoundingRectTracker.cs
- VisualTreeFlattener.cs
- BulletedListEventArgs.cs
- StringResourceManager.cs
- XsltConvert.cs
- InternalSafeNativeMethods.cs
- Localizer.cs
- DoWhileDesigner.xaml.cs
- XmlSubtreeReader.cs
- WebPartConnectionsCancelEventArgs.cs
- PathFigureCollectionConverter.cs
- SourceExpressionException.cs
- SelectionItemProviderWrapper.cs
- XhtmlConformanceSection.cs
- WmlValidatorAdapter.cs
- HtmlWindow.cs
- processwaithandle.cs
- CodeGenHelper.cs
- IUnknownConstantAttribute.cs
- XmlSchemaSequence.cs
- WebBrowserContainer.cs
- ButtonColumn.cs
- SemaphoreSecurity.cs
- Part.cs
- Documentation.cs
- ObjectConverter.cs
- Compensation.cs
- ObjectDataSourceDisposingEventArgs.cs
- TokenBasedSetEnumerator.cs
- xsdvalidator.cs
- VisualTreeUtils.cs
- ParseChildrenAsPropertiesAttribute.cs
- SamlAttribute.cs
- BamlRecords.cs
- EventPropertyMap.cs
- MailMessage.cs
- InvalidWMPVersionException.cs
- ChoiceConverter.cs
- ViewEvent.cs
- SessionIDManager.cs
- ProcessHostFactoryHelper.cs
- TextTabProperties.cs
- URLAttribute.cs
- ServiceHttpModule.cs
- ExpressionBindingCollection.cs
- AstNode.cs
- WebExceptionStatus.cs
- ActivityExecutionFilter.cs
- Thickness.cs
- TableRow.cs
- ObsoleteAttribute.cs
- CodeIndexerExpression.cs
- LocalizableAttribute.cs
- ContentPathSegment.cs
- RelationshipSet.cs
- DrawingAttributesDefaultValueFactory.cs
- SingleAnimationBase.cs
- MenuItemStyle.cs