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
- ConvertersCollection.cs
- EventListener.cs
- AspProxy.cs
- GroupDescription.cs
- ToolStripGripRenderEventArgs.cs
- ContractListAdapter.cs
- ImageFormat.cs
- PathSegmentCollection.cs
- EntityDataSourceSelectingEventArgs.cs
- FacetDescription.cs
- Condition.cs
- CodeRemoveEventStatement.cs
- SiteOfOriginContainer.cs
- CodeParameterDeclarationExpression.cs
- IPCCacheManager.cs
- GridViewEditEventArgs.cs
- EnumValAlphaComparer.cs
- _SslState.cs
- TargetFrameworkAttribute.cs
- DataControlLinkButton.cs
- StoreAnnotationsMap.cs
- InlinedAggregationOperatorEnumerator.cs
- ToolStripDropDownItem.cs
- ipaddressinformationcollection.cs
- _LoggingObject.cs
- IndexedString.cs
- HelpEvent.cs
- DLinqTableProvider.cs
- OracleColumn.cs
- HttpCapabilitiesBase.cs
- RuntimeCompatibilityAttribute.cs
- XmlSchemaResource.cs
- Token.cs
- Rss20FeedFormatter.cs
- EnumMember.cs
- PeerSecurityHelpers.cs
- SafeHandles.cs
- ViewStateException.cs
- CommandHelper.cs
- AstNode.cs
- SQLDateTime.cs
- HttpCapabilitiesEvaluator.cs
- TriState.cs
- GridViewDeletedEventArgs.cs
- StringOutput.cs
- WizardDesigner.cs
- XPathException.cs
- SqlDeflator.cs
- ViewSimplifier.cs
- ToolStripDropDownMenu.cs
- RepeaterItem.cs
- StructuredTypeInfo.cs
- GridToolTip.cs
- DbReferenceCollection.cs
- DataObjectSettingDataEventArgs.cs
- SpeechUI.cs
- UInt16Converter.cs
- OletxResourceManager.cs
- WasAdminWrapper.cs
- ScriptModule.cs
- EntityProxyFactory.cs
- ItemCheckEvent.cs
- PropertyChangingEventArgs.cs
- UserMapPath.cs
- ProcessThread.cs
- MetadataArtifactLoaderResource.cs
- ProviderConnectionPointCollection.cs
- DesignerSerializationOptionsAttribute.cs
- CompressEmulationStream.cs
- JoinSymbol.cs
- ProfileGroupSettingsCollection.cs
- SharedStatics.cs
- HttpCapabilitiesEvaluator.cs
- ButtonBaseAutomationPeer.cs
- View.cs
- NavigatingCancelEventArgs.cs
- ParseNumbers.cs
- ColumnResult.cs
- RegionInfo.cs
- TableChangeProcessor.cs
- SubordinateTransaction.cs
- HttpInputStream.cs
- DataAdapter.cs
- WsdlBuildProvider.cs
- SessionIDManager.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- UriScheme.cs
- PrincipalPermission.cs
- EmbossBitmapEffect.cs
- EdmItemCollection.cs
- WebBrowserNavigatingEventHandler.cs
- OleDbErrorCollection.cs
- ScriptControlDescriptor.cs
- QueryConverter.cs
- FileDialogCustomPlacesCollection.cs
- AutoGeneratedFieldProperties.cs
- RoutingExtensionElement.cs
- _NetworkingPerfCounters.cs
- KnowledgeBase.cs
- SqlVisitor.cs