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
- PropertyItemInternal.cs
- InternalBufferOverflowException.cs
- PartialToken.cs
- GradientSpreadMethodValidation.cs
- SessionEndedEventArgs.cs
- Assert.cs
- DbUpdateCommandTree.cs
- uribuilder.cs
- DbExpressionVisitor.cs
- PropertyStore.cs
- DictionarySectionHandler.cs
- PersonalizationProvider.cs
- IgnoreFileBuildProvider.cs
- SecurityContext.cs
- ByteStreamGeometryContext.cs
- WebPartUtil.cs
- ForeignConstraint.cs
- CodeSpit.cs
- Int32AnimationUsingKeyFrames.cs
- DocumentXPathNavigator.cs
- EventProxy.cs
- Light.cs
- EntityConnection.cs
- ConsumerConnectionPoint.cs
- OutputCacheModule.cs
- AttributedMetaModel.cs
- NaturalLanguageHyphenator.cs
- DataGridCaption.cs
- ActivationProxy.cs
- CacheHelper.cs
- VariableModifiersHelper.cs
- InvalidPrinterException.cs
- GridEntry.cs
- DbConvert.cs
- DefaultTextStoreTextComposition.cs
- StackBuilderSink.cs
- Int64Storage.cs
- TargetPerspective.cs
- RangeValueProviderWrapper.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- SendActivityEventArgs.cs
- SchemaTypeEmitter.cs
- PersistenceMetadataNamespace.cs
- TagPrefixAttribute.cs
- _Rfc2616CacheValidators.cs
- CancelEventArgs.cs
- Geometry3D.cs
- StylusPointPropertyId.cs
- PointConverter.cs
- ObjectMemberMapping.cs
- SplitterPanel.cs
- HttpServerUtilityWrapper.cs
- IDQuery.cs
- Grant.cs
- SqlDataReader.cs
- DataExpression.cs
- Util.cs
- GACIdentityPermission.cs
- CollectionViewProxy.cs
- XDeferredAxisSource.cs
- IBuiltInEvidence.cs
- JoinGraph.cs
- WindowsFormsLinkLabel.cs
- SQLCharsStorage.cs
- __ConsoleStream.cs
- SignatureDescription.cs
- ValueTable.cs
- DayRenderEvent.cs
- DesignTimeHTMLTextWriter.cs
- ProcessManager.cs
- WhitespaceRule.cs
- ToolZone.cs
- GrabHandleGlyph.cs
- FastEncoderWindow.cs
- _LocalDataStoreMgr.cs
- CookieHandler.cs
- Converter.cs
- SafeCryptContextHandle.cs
- WindowsSolidBrush.cs
- PropertyBuilder.cs
- TextShapeableCharacters.cs
- SoapObjectInfo.cs
- KeyInterop.cs
- CompositeDataBoundControl.cs
- MappingException.cs
- UniqueIdentifierService.cs
- QilFactory.cs
- XPathScanner.cs
- CodeCompileUnit.cs
- SqlAliaser.cs
- CriticalFinalizerObject.cs
- OperationGenerator.cs
- ResXResourceWriter.cs
- VirtualPathUtility.cs
- InputMethodStateTypeInfo.cs
- TemplateXamlTreeBuilder.cs
- MemoryResponseElement.cs
- OneOfTypeConst.cs
- PagesSection.cs
- BoundConstants.cs