-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
VBFixedStringAttribute.xml
154 lines (144 loc) · 9.49 KB
/
VBFixedStringAttribute.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<Type Name="VBFixedStringAttribute" FullName="Microsoft.VisualBasic.VBFixedStringAttribute">
<TypeSignature Language="C#" Value="public sealed class VBFixedStringAttribute : Attribute" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit VBFixedStringAttribute extends System.Attribute" FrameworkAlternate="net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-3.0;netcore-3.1" />
<TypeSignature Language="DocId" Value="T:Microsoft.VisualBasic.VBFixedStringAttribute" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class VBFixedStringAttribute
Inherits Attribute" />
<TypeSignature Language="F#" Value="type VBFixedStringAttribute = class
 inherit Attribute" />
<TypeSignature Language="C++ CLI" Value="public ref class VBFixedStringAttribute sealed : Attribute" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed VBFixedStringAttribute extends System.Attribute" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>7.0.5000.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic.Core</AssemblyName>
<AssemblyVersion>10.0.4.0</AssemblyVersion>
<AssemblyVersion>10.0.5.0</AssemblyVersion>
<AssemblyVersion>10.0.6.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
<AssemblyVersion>12.0.0.0</AssemblyVersion>
<AssemblyVersion>13.0.0.0</AssemblyVersion>
<AssemblyVersion>14.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Attribute</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.AttributeUsage(System.AttributeTargets.Field, AllowMultiple=false, Inherited=false)]</AttributeName>
<AttributeName Language="F#">[<System.AttributeUsage(System.AttributeTargets.Field, AllowMultiple=false, Inherited=false)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Indicates that a string should be treated as if it were fixed length.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Visual Basic strings are of variable length by default. This attribute is useful when using Visual Basic file input and output functions such as `FileGet` and `FilePut` that require fixed length strings.
## Examples
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbCnAttributes/VB/Class2.vb" id="Snippet23":::
> [!NOTE]
> The `VBFixedStringAttribute` is informational and cannot be used to convert a variable length string to a fixed string. The purpose of this attribute is to modify how strings in structures and non-local variables are used by methods or API calls that recognize the `VBFixedStringAttribute`. Keep in mind that this attribute does not change the actual length of the string itself.
]]></format>
</remarks>
<altmember cref="T:System.Text.StringBuilder" />
<altmember cref="T:System.Runtime.InteropServices.MarshalAsAttribute" />
<altmember cref="M:Microsoft.VisualBasic.FileSystem.FileGet(System.Int32,System.Array@,System.Int64,System.Boolean,System.Boolean)" />
<altmember cref="M:Microsoft.VisualBasic.FileSystem.FilePut(System.Int32,System.Array,System.Int64,System.Boolean,System.Boolean)" />
<altmember cref="M:Microsoft.VisualBasic.FileSystem.FileOpen(System.Int32,System.String,Microsoft.VisualBasic.OpenMode,Microsoft.VisualBasic.OpenAccess,Microsoft.VisualBasic.OpenShare,System.Int32)" />
<related type="Article" href="/dotnet/visual-basic/language-reference/attributes">Attributes (Visual Basic)</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public VBFixedStringAttribute (int Length);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(int32 Length) cil managed" FrameworkAlternate="net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-3.0;netcore-3.1" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.VBFixedStringAttribute.#ctor(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (Length As Integer)" />
<MemberSignature Language="F#" Value="new Microsoft.VisualBasic.VBFixedStringAttribute : int -> Microsoft.VisualBasic.VBFixedStringAttribute" Usage="new Microsoft.VisualBasic.VBFixedStringAttribute Length" />
<MemberSignature Language="C++ CLI" Value="public:
 VBFixedStringAttribute(int Length);" />
<MemberSignature Language="ILAsm" Value=".method public specialname rtspecialname instance void .ctor(int32 Length) cil managed" FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>7.0.5000.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic.Core</AssemblyName>
<AssemblyVersion>10.0.4.0</AssemblyVersion>
<AssemblyVersion>10.0.5.0</AssemblyVersion>
<AssemblyVersion>10.0.6.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
<AssemblyVersion>12.0.0.0</AssemblyVersion>
<AssemblyVersion>13.0.0.0</AssemblyVersion>
<AssemblyVersion>14.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="Length" Type="System.Int32" />
</Parameters>
<Docs>
<param name="Length">The length of the fixed string.</param>
<summary>Initializes the value of the <see langword="SizeConst" /> field.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The constructor runs when the `VBFixedStringAttribute` attribute is applied to a string.
]]></format>
</remarks>
<altmember cref="T:System.Text.StringBuilder" />
<altmember cref="T:System.Runtime.InteropServices.MarshalAsAttribute" />
<related type="Article" href="/dotnet/visual-basic/language-reference/attributes">Attributes (Visual Basic)</related>
<related type="Article" href="/dotnet/visual-basic/programming-guide/language-features/objects-and-classes/object-lifetime-how-objects-are-created-and-destroyed">Object Lifetime: How Objects Are Created and Destroyed</related>
</Docs>
</Member>
<Member MemberName="Length">
<MemberSignature Language="C#" Value="public int Length { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Length" />
<MemberSignature Language="DocId" Value="P:Microsoft.VisualBasic.VBFixedStringAttribute.Length" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Length As Integer" />
<MemberSignature Language="F#" Value="member this.Length : int" Usage="Microsoft.VisualBasic.VBFixedStringAttribute.Length" />
<MemberSignature Language="C++ CLI" Value="public:
 property int Length { int get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>7.0.5000.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic.Core</AssemblyName>
<AssemblyVersion>10.0.4.0</AssemblyVersion>
<AssemblyVersion>10.0.5.0</AssemblyVersion>
<AssemblyVersion>10.0.6.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
<AssemblyVersion>12.0.0.0</AssemblyVersion>
<AssemblyVersion>13.0.0.0</AssemblyVersion>
<AssemblyVersion>14.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the length of the string.</summary>
<value>The length of the string.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The constructor for this attribute sets this property when the `VBFixedStringAttribute` is applied to a string.
]]></format>
</remarks>
<related type="Article" href="/dotnet/visual-basic/language-reference/attributes">Attributes (Visual Basic)</related>
</Docs>
</Member>
</Members>
</Type>