Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Compiler / Validation / ValidationError.cs / 1305376 / ValidationError.cs
namespace System.Workflow.ComponentModel.Compiler { using System; using System.Collections; using System.Globalization; #region Class ValidationError [Serializable()] public sealed class ValidationError { private string errorText = string.Empty; private int errorNumber = 0; private Hashtable userData = null; private bool isWarning = false; string propertyName = null; public ValidationError(string errorText, int errorNumber) : this(errorText, errorNumber, false, null) { } public ValidationError(string errorText, int errorNumber, bool isWarning) : this(errorText, errorNumber, isWarning, null) { } public ValidationError(string errorText, int errorNumber, bool isWarning, string propertyName) { this.errorText = errorText; this.errorNumber = errorNumber; this.isWarning = isWarning; this.propertyName = propertyName; } public string PropertyName { get { return this.propertyName; } set { this.propertyName = value; } } public string ErrorText { get { return this.errorText; } } public bool IsWarning { get { return this.isWarning; } } public int ErrorNumber { get { return this.errorNumber; } } public IDictionary UserData { get { if (this.userData == null) this.userData = new Hashtable(); return this.userData; } } public static ValidationError GetNotSetValidationError(string propertyName) { ValidationError error = new ValidationError(SR.GetString(SR.Error_PropertyNotSet, propertyName), ErrorNumbers.Error_PropertyNotSet); error.PropertyName = propertyName; return error; } public override string ToString() { return String.Format(CultureInfo.InvariantCulture, "{0} {1}: {2}", this.isWarning ? "warning" : "error", this.errorNumber, this.errorText); } } #endregion } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. namespace System.Workflow.ComponentModel.Compiler { using System; using System.Collections; using System.Globalization; #region Class ValidationError [Serializable()] public sealed class ValidationError { private string errorText = string.Empty; private int errorNumber = 0; private Hashtable userData = null; private bool isWarning = false; string propertyName = null; public ValidationError(string errorText, int errorNumber) : this(errorText, errorNumber, false, null) { } public ValidationError(string errorText, int errorNumber, bool isWarning) : this(errorText, errorNumber, isWarning, null) { } public ValidationError(string errorText, int errorNumber, bool isWarning, string propertyName) { this.errorText = errorText; this.errorNumber = errorNumber; this.isWarning = isWarning; this.propertyName = propertyName; } public string PropertyName { get { return this.propertyName; } set { this.propertyName = value; } } public string ErrorText { get { return this.errorText; } } public bool IsWarning { get { return this.isWarning; } } public int ErrorNumber { get { return this.errorNumber; } } public IDictionary UserData { get { if (this.userData == null) this.userData = new Hashtable(); return this.userData; } } public static ValidationError GetNotSetValidationError(string propertyName) { ValidationError error = new ValidationError(SR.GetString(SR.Error_PropertyNotSet, propertyName), ErrorNumbers.Error_PropertyNotSet); error.PropertyName = propertyName; return error; } public override string ToString() { return String.Format(CultureInfo.InvariantCulture, "{0} {1}: {2}", this.isWarning ? "warning" : "error", this.errorNumber, this.errorText); } } #endregion } // 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
- Helper.cs
- HttpCookie.cs
- DataSourceCacheDurationConverter.cs
- FileEnumerator.cs
- DesignerPerfEventProvider.cs
- ResourceDescriptionAttribute.cs
- ObjRef.cs
- LayoutSettings.cs
- KeyManager.cs
- NameSpaceEvent.cs
- XmlSchemaImporter.cs
- MSAANativeProvider.cs
- ScaleTransform.cs
- RangeValuePatternIdentifiers.cs
- HtmlShim.cs
- StatusBarDrawItemEvent.cs
- SqlClientFactory.cs
- BamlBinaryWriter.cs
- FilterQuery.cs
- ParallelTimeline.cs
- DataGridViewSelectedRowCollection.cs
- ToolStripDropTargetManager.cs
- Point.cs
- CommonXSendMessage.cs
- HttpHandlersSection.cs
- IpcClientManager.cs
- ColumnResizeUndoUnit.cs
- ValueQuery.cs
- XmlILOptimizerVisitor.cs
- Wizard.cs
- CopyCodeAction.cs
- WebBrowsableAttribute.cs
- MetadataItem.cs
- VisualStyleInformation.cs
- SqlNotificationRequest.cs
- GcHandle.cs
- Transform.cs
- XPathBinder.cs
- EndPoint.cs
- XmlBindingWorker.cs
- LocalizationParserHooks.cs
- BrowserTree.cs
- InstanceBehavior.cs
- Graphics.cs
- RootAction.cs
- FormClosedEvent.cs
- IdentifierCollection.cs
- XamlPathDataSerializer.cs
- OleDbFactory.cs
- LineVisual.cs
- InfoCardMetadataExchangeClient.cs
- ReadOnlyMetadataCollection.cs
- RequestTimeoutManager.cs
- ZipIOFileItemStream.cs
- StringConcat.cs
- WebPartExportVerb.cs
- DataReceivedEventArgs.cs
- SharedPerformanceCounter.cs
- DiscoveryClientDuplexChannel.cs
- Cursor.cs
- ClientTargetSection.cs
- SimpleHandlerFactory.cs
- EmptyStringExpandableObjectConverter.cs
- safelink.cs
- Misc.cs
- WebEventTraceProvider.cs
- ToolStripPanelRenderEventArgs.cs
- OptionalColumn.cs
- SpeechRecognizer.cs
- TransactionWaitAsyncResult.cs
- FixedSOMPageConstructor.cs
- SQLDateTime.cs
- SqlCharStream.cs
- BinaryObjectInfo.cs
- RtfFormatStack.cs
- ProcessHost.cs
- DiagnosticsConfiguration.cs
- AvTraceFormat.cs
- FormatControl.cs
- DelayedRegex.cs
- XmlArrayItemAttributes.cs
- CompareValidator.cs
- TwoPhaseCommit.cs
- EventProviderWriter.cs
- DataSourceCacheDurationConverter.cs
- ValidationHelpers.cs
- SqlUserDefinedTypeAttribute.cs
- ServicesExceptionNotHandledEventArgs.cs
- ComponentConverter.cs
- PhonemeEventArgs.cs
- ThrowOnMultipleAssignment.cs
- RawStylusSystemGestureInputReport.cs
- WebZoneDesigner.cs
- ChildTable.cs
- CodeIterationStatement.cs
- ManifestResourceInfo.cs
- IsolationInterop.cs
- TextInfo.cs
- DeferredBinaryDeserializerExtension.cs
- ChannelServices.cs