Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / ExpressionParser / SourceExpressionException.cs / 1305376 / SourceExpressionException.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.Activities.ExpressionParser
{
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Globalization;
using System.Runtime;
using System.Runtime.Serialization;
using System.Security;
using System.Security.Permissions;
[Serializable]
public class SourceExpressionException : Exception, ISerializable
{
CompilerError[] errors;
public SourceExpressionException()
: base(SR.CompilerError)
{
}
public SourceExpressionException(string message)
: base(message)
{
}
public SourceExpressionException(string message, Exception innerException)
: base(message, innerException)
{
}
public SourceExpressionException(string message, CompilerErrorCollection errors)
: base(message)
{
this.errors = new CompilerError[errors.Count];
errors.CopyTo(this.errors, 0);
}
protected SourceExpressionException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
if (info == null)
{
throw FxTrace.Exception.ArgumentNull("info");
}
int length = info.GetInt32("count");
this.errors = new CompilerError[length];
for (int i = 0; i < length; ++i)
{
string index = i.ToString(CultureInfo.InvariantCulture);
string fileName = info.GetString("file" + index);
int line = info.GetInt32("line" + index);
int column = info.GetInt32("column" + index);
string errorNumber = info.GetString("number" + index);
string errorText = info.GetString("text" + index);
this.errors[i] = new CompilerError(fileName, line, column, errorNumber, errorText);
}
}
public IEnumerable Errors
{
get
{
if (this.errors == null)
{
this.errors = new CompilerError[0];
}
return this.errors;
}
}
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw FxTrace.Exception.ArgumentNull("info");
}
if (this.errors == null)
{
info.AddValue("count", 0);
}
else
{
info.AddValue("count", this.errors.Length);
for (int i = 0; i < this.errors.Length; ++i)
{
CompilerError error = this.errors[i];
string index = i.ToString(CultureInfo.InvariantCulture);
info.AddValue("file" + index, error.FileName);
info.AddValue("line" + index, error.Line);
info.AddValue("column" + index, error.Column);
info.AddValue("number" + index, error.ErrorNumber);
info.AddValue("text" + index, error.ErrorText);
}
}
base.GetObjectData(info, context);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XPathException.cs
- Item.cs
- PathStreamGeometryContext.cs
- SqlBooleanMismatchVisitor.cs
- OdbcRowUpdatingEvent.cs
- WorkflowMessageEventArgs.cs
- IssuedTokenServiceCredential.cs
- ObjectDataSourceStatusEventArgs.cs
- ObjectToken.cs
- SqlProcedureAttribute.cs
- UniqueIdentifierService.cs
- UnsafeNativeMethods.cs
- DBSchemaRow.cs
- NativeMethods.cs
- ObjectDataSource.cs
- IndexingContentUnit.cs
- AssociationType.cs
- FontStretchConverter.cs
- X509KeyIdentifierClauseType.cs
- SmiRecordBuffer.cs
- XsltLoader.cs
- DiscreteKeyFrames.cs
- VisualCollection.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- RtfFormatStack.cs
- RotateTransform.cs
- BitmapSizeOptions.cs
- RegexWorker.cs
- XslCompiledTransform.cs
- UdpDiscoveryMessageFilter.cs
- designeractionbehavior.cs
- CompressedStack.cs
- CharStorage.cs
- AnchoredBlock.cs
- Trigger.cs
- XamlReader.cs
- DirectoryInfo.cs
- MapPathBasedVirtualPathProvider.cs
- UrlAuthFailedErrorFormatter.cs
- InsufficientExecutionStackException.cs
- DataRelationCollection.cs
- GraphicsState.cs
- WebExceptionStatus.cs
- SiblingIterators.cs
- MasterPageCodeDomTreeGenerator.cs
- FieldToken.cs
- WindowsScrollBar.cs
- IsolatedStorage.cs
- PersonalizationStateInfoCollection.cs
- ScriptHandlerFactory.cs
- PointAnimationBase.cs
- BamlBinaryWriter.cs
- BinHexEncoder.cs
- HttpCapabilitiesBase.cs
- RSACryptoServiceProvider.cs
- XslUrlEditor.cs
- MapPathBasedVirtualPathProvider.cs
- ExecutionEngineException.cs
- RegexInterpreter.cs
- WebPartRestoreVerb.cs
- ReadOnlyDataSourceView.cs
- SystemKeyConverter.cs
- ErrorProvider.cs
- Geometry3D.cs
- SizeChangedInfo.cs
- IisHelper.cs
- AssemblySettingAttributes.cs
- SqlFunctionAttribute.cs
- MarginCollapsingState.cs
- Operator.cs
- StatusStrip.cs
- DefaultValueAttribute.cs
- TableHeaderCell.cs
- HeaderCollection.cs
- WebPartCloseVerb.cs
- Pens.cs
- cryptoapiTransform.cs
- EdgeModeValidation.cs
- FunctionDetailsReader.cs
- SafeNativeMemoryHandle.cs
- FileLevelControlBuilderAttribute.cs
- ControlCommandSet.cs
- DataTemplateKey.cs
- DataGridViewCell.cs
- AutomationPatternInfo.cs
- UnsupportedPolicyOptionsException.cs
- EntityCommandExecutionException.cs
- ArraySegment.cs
- DesignerAdRotatorAdapter.cs
- SharedPerformanceCounter.cs
- BStrWrapper.cs
- BasicKeyConstraint.cs
- Compress.cs
- Odbc32.cs
- TraceShell.cs
- NullableConverter.cs
- UnauthorizedAccessException.cs
- ProgramNode.cs
- BrowserCapabilitiesCompiler.cs
- BaseConfigurationRecord.cs