Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Utility.cs / 1305376 / Utility.cs
namespace System.Workflow { using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; static class Utility { [SuppressMessage("Reliability", "Reliability113", Justification = "These are the core methods that should be used for all other Guid(string) calls.")] internal static Guid CreateGuid(string guidString) { bool success = false; Guid result = Guid.Empty; try { result = new Guid(guidString); success = true; } finally { if (!success) { Debug.Assert(false, "Creation of the Guid failed."); } } return result; } [SuppressMessage("Reliability", "Reliability113", Justification = "These are the core methods that should be used for all other Guid(string) calls.")] internal static bool TryCreateGuid(string guidString, out Guid result) { bool success = false; result = Guid.Empty; try { result = new Guid(guidString); success = true; } catch (ArgumentException) { // ---- this } catch (FormatException) { // ---- this } catch (OverflowException) { // ---- this } return success; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. namespace System.Workflow { using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; static class Utility { [SuppressMessage("Reliability", "Reliability113", Justification = "These are the core methods that should be used for all other Guid(string) calls.")] internal static Guid CreateGuid(string guidString) { bool success = false; Guid result = Guid.Empty; try { result = new Guid(guidString); success = true; } finally { if (!success) { Debug.Assert(false, "Creation of the Guid failed."); } } return result; } [SuppressMessage("Reliability", "Reliability113", Justification = "These are the core methods that should be used for all other Guid(string) calls.")] internal static bool TryCreateGuid(string guidString, out Guid result) { bool success = false; result = Guid.Empty; try { result = new Guid(guidString); success = true; } catch (ArgumentException) { // ---- this } catch (FormatException) { // ---- this } catch (OverflowException) { // ---- this } return success; } } } // 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
- ClientProtocol.cs
- KeyEvent.cs
- SafeArrayRankMismatchException.cs
- PrintEvent.cs
- EdgeModeValidation.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- ManifestResourceInfo.cs
- BamlRecordWriter.cs
- DotExpr.cs
- SQLGuidStorage.cs
- PathSegmentCollection.cs
- Constants.cs
- Content.cs
- SplitContainer.cs
- RawTextInputReport.cs
- BuildProvidersCompiler.cs
- ObjectSpanRewriter.cs
- Mappings.cs
- XmlDataDocument.cs
- XmlDocumentFragment.cs
- DialogWindow.cs
- DragCompletedEventArgs.cs
- LinkDescriptor.cs
- BindingSourceDesigner.cs
- AttributeAction.cs
- Types.cs
- SafeFileMappingHandle.cs
- CompiledQuery.cs
- Renderer.cs
- controlskin.cs
- ContextActivityUtils.cs
- NamespaceMapping.cs
- PointCollectionValueSerializer.cs
- TextEndOfLine.cs
- ProfessionalColorTable.cs
- RolePrincipal.cs
- ConfigurationElement.cs
- BuildResultCache.cs
- WebPartCloseVerb.cs
- VariantWrapper.cs
- XmlCustomFormatter.cs
- InstanceDataCollection.cs
- categoryentry.cs
- XmlTextWriter.cs
- OutOfMemoryException.cs
- SqlDataReader.cs
- AuthenticationService.cs
- ProxyWebPartConnectionCollection.cs
- Italic.cs
- HandleCollector.cs
- MenuEventArgs.cs
- TablePattern.cs
- RepeatBehavior.cs
- RepeatInfo.cs
- XdrBuilder.cs
- PageBuildProvider.cs
- DynamicQueryableWrapper.cs
- PropertyValueChangedEvent.cs
- MailMessageEventArgs.cs
- TypeSource.cs
- DispatcherExceptionFilterEventArgs.cs
- Win32PrintDialog.cs
- SqlReorderer.cs
- XmlBinaryReaderSession.cs
- EventRouteFactory.cs
- OrderedDictionary.cs
- DateTimeUtil.cs
- SchemaLookupTable.cs
- MultiSelectRootGridEntry.cs
- QuaternionAnimation.cs
- SqlDataSourceQueryConverter.cs
- PrinterSettings.cs
- EntityReference.cs
- AffineTransform3D.cs
- RowToParametersTransformer.cs
- ToolStripKeyboardHandlingService.cs
- Literal.cs
- BitmapImage.cs
- SecurityTokenContainer.cs
- XPathMessageFilterTable.cs
- ConfigXmlElement.cs
- DataGridViewRowEventArgs.cs
- AjaxFrameworkAssemblyAttribute.cs
- SafeSecurityHandles.cs
- SoapExtensionImporter.cs
- Application.cs
- DefaultParameterValueAttribute.cs
- InputDevice.cs
- UniformGrid.cs
- EventHandlerService.cs
- AlphabeticalEnumConverter.cs
- XmlSchemaImport.cs
- RadioButton.cs
- SendMailErrorEventArgs.cs
- _NetRes.cs
- FontSourceCollection.cs
- EntityCollection.cs
- PersistenceParticipant.cs
- WebPartEditVerb.cs
- PlaceHolder.cs