Skip to content

Commit 717df1d

Browse files
authored
Import System.Guid and System.Type.Guid documentation (#9715)
* Import System.Guid and System.Type.Guid documentation - Clarify that Type.Guid is COM-interop specific - Delete COM-interop specific sample from System.Guid. This sample is not directly relevant to Guid type and there are other similar samples on GuidAttribute. * Delete unused snippets
1 parent e106740 commit 717df1d

File tree

8 files changed

+2
-220
lines changed

8 files changed

+2
-220
lines changed

snippets/cpp/VS_Snippets_CLR/Guid/CPP/Guids.cpp

-52
This file was deleted.

snippets/csharp/System/Guid/Overview/Guids.cs

-45
This file was deleted.

snippets/csharp/System/Guid/Overview/Project.csproj

-8
This file was deleted.

snippets/fsharp/System/Guid/Overview/Guids.fs

-41
This file was deleted.

snippets/fsharp/System/Guid/Overview/fs.fsproj

-10
This file was deleted.

snippets/visualbasic/VS_Snippets_CLR/Guid/VB/Guids.vb

-50
This file was deleted.

xml/System/Guid.xml

-12
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,6 @@
114114
## Remarks
115115
A GUID is a 128-bit integer (16 bytes) that can be used across all computers and networks wherever a unique identifier is required. Such an identifier has a very low probability of being duplicated.
116116
117-
118-
119-
## Examples
120-
The following example uses the <xref:System.Runtime.InteropServices.GuidAttribute?displayProperty=nameWithType> class to assign a GUID to an interface and to a user-defined class. It retrieves the value of the GUID by calling the <xref:System.Attribute.GetCustomAttribute%2A> method, and compares it with two other GUIDs to determine whether they are equal.
121-
122-
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Guid/CPP/Guids.cpp" id="Snippet1":::
123-
:::code language="csharp" source="~/snippets/csharp/System/Guid/Overview/Guids.cs" interactive="try-dotnet" id="Snippet1":::
124-
:::code language="fsharp" source="~/snippets/fsharp/System/Guid/Overview/Guids.fs" id="Snippet1":::
125-
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/Guid/VB/Guids.vb" id="Snippet1":::
126-
127-
Note that the <xref:System.Runtime.InteropServices.GuidAttribute> attribute is typically used in an application to expose a type to COM. If you compile this example, you can run the [Assembly Registration tool (Regasm.exe)](/dotnet/framework/tools/regasm-exe-assembly-registration-tool) on the generated assembly to create registry (.reg) and type library (.tlb) files. The .reg file can be used to register the coclass in the registry, and the .tlb file can provide metadata for COM interop.
128-
129117
]]></format>
130118
</remarks>
131119
</Docs>

xml/System/Type.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11038,9 +11038,9 @@ Calling this method overload is the same as calling the <xref:System.Type.GetTyp
1103811038
<format type="text/markdown"><![CDATA[
1103911039

1104011040
## Remarks
11041-
A GUID is associated with a type using the <xref:System.Runtime.InteropServices.GuidAttribute> attribute.
11042-
11041+
This property returns a GUID that's associated with a type using the <xref:System.Runtime.InteropServices.GuidAttribute> attribute. If the attribute is omitted, a GUID is assigned automatically.
1104311042

11043+
The GUID returned by this property is typically used to expose a type to COM. It is not meant to be used as a unique identifier of the type.
1104411044

1104511045
## Examples
1104611046
The following example creates the class `MyClass1` with a public method, creates a `Type` object corresponding to `MyClass1`, and gets the <xref:System.Guid> structure using the `GUID` property of the `Type` class.

0 commit comments

Comments
 (0)