18
<summary>To be added.</summary>
19
<remarks>To be added.</remarks>
18
<summary>Mutable strings that can be annotated with a set of attributes.</summary>
22
The NSMutableAttributedString holds a mutable string that can
23
has a series of overlapping attributes applied to ranges of
28
<img href="NSMutableAttributedString.png" />>
32
Unlike the <see cref="T:MonoMac.Foundation.NSAttributedString" /> both the
33
contents of the string as well as the attributes applied to it
34
can be changed after the string has been constructed.
38
These types typically are used to attach information to
39
elements of the string that dictate the font and colors to use
40
as well as rendering attributes like kerning or how to render
41
ligatures on a specific run of code.
43
<para> These classes do not dictate the meaning or behavior of
44
the attributes on a string, they merely keep track of the
45
attributes. The actual meaning of these attributes is
46
interpreted by the consumer of these objects.
48
<para> If you are performing multiple changes to an
49
NSMutableAttributedString, you can optimize the performance by
50
surrounding your changes with calls to <see cref="M:MonoMac.Foundation.BeginEditing()" /> and <see cref="M:MonoMac.Foundation.EndEditing()" />. This will
51
prevent the internal data structures to be updated on every
52
change and delay the internal changes until the <see cref="M:MonoMac.Foundation.EndEditing()" /> method is called.
22
57
<Member MemberName=".ctor">
54
92
<Parameter Name="other" Type="MonoMac.Foundation.NSAttributedString" />
57
<param name="other">To be added.</param>
58
<summary>To be added.</summary>
59
<remarks>To be added.</remarks>
95
<param name="other">The source attributed string.</param>
96
<summary>Creates a NSMutableAttributedString from a NSAttributedString.</summary>
62
101
<Member MemberName=".ctor">
88
130
<AssemblyVersion>0.0.0.0</AssemblyVersion>
134
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
91
138
<Parameter Name="t" Type="MonoMac.Foundation.NSObjectFlag" />
94
141
<param name="t">Unused sentinel value, pass NSObjectFlag.Empty.</param>
95
<summary>Constructor to call on derived classes to skip initialization and merely allocate the object.</summary>
142
<summary>Constructor to call on derived classes when the derived class has an [Export] constructor.</summary>
97
<para>This constructor should be called by derived classes when they completely construct the object in managed code and merely want the runtime to allocate and initialize the NSObject. This is required to implement the two-step initialization process that Objective-C uses, the first step is to perform the object allocation, the second step is to initialize the object. When you invoke the constructor that takes the NSObjectFlag.Empty you taking advatnage of a direct path that goes all the way up to NSObject to merely allocate the object's memory and bind the Objective-C and C# objects together. The actual initialization of the object is up to you.</para>
98
<para>This constructor is typically used by the binding generator to allocate the object, but prevent the actual initialization to take place. Once the allocation has taken place, the constructor has to initialize the object. With constructors generated by the binding generator this means that it manually invokes one of the "init" methods to initialize the object.</para>
99
<para>It is your responsability to completely initialize the object if you chain up using the NSObjectFlag.Empty path.</para>
100
<para>In general, if your constructors invokes the NSObjectFlag.Empty base implementation, then it should be calling an Objective-C init method. If this is not the case, you should instead chain to the proper constructor in your class. </para>
101
<para>The argument value is ignored and merely ensures that the only code that is executed is the construction phase is the basic NSObject allocation and runtime type registration. Typically the chaining would look like this:</para>
144
<para>This constructor should be called by derived classes when they are initialized using an [Export] attribute. The argument value is ignore, typically the chaining would look like this:</para>
105
// The NSObjectFlag merely allocates the object and registers the
106
// C# class with the Objective-C runtime if necessary, but no actual
107
// initXxx method is invoked, that is done later in the constructor
109
// This is taken from MonoMac's source code:
111
[Export ("initWithFrame:")]
112
public UIView (System.Drawing.RectangleF frame) : base (NSObjectFlag.Empty)
114
// Invoke the init method now.
115
var initWithFrame = new Selector ("initWithFrame:").Handle;
117
Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend_RectangleF (this.Handle, initWithFrame, frame);
119
Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_RectangleF (this.SuperHandle, initWithFrame, frame);
147
public class MyClass : BaseClass {
148
[Export ("initWithFoo:")]
149
public MyClass (string foo) : base (NSObjectFlag.Empty)
157
194
<Parameter Name="str" Type="System.String" />
160
<param name="str">To be added.</param>
161
<summary>To be added.</summary>
162
<remarks>To be added.</remarks>
197
<param name="str">C# String</param>
198
<summary>Creates an NSMutableAttributedString from a C# string, with no attributes attached to it.</summary>
165
203
<Member MemberName=".ctor">
174
212
<Parameter Name="attributes" Type="MonoMac.CoreText.CTStringAttributes" />
177
<param name="str">To be added.</param>
178
<param name="attributes">To be added.</param>
179
<summary>To be added.</summary>
180
<remarks>To be added.</remarks>
215
<param name="str">C# string.</param>
216
<param name="attributes">CoreText attributes to be applied to the string.</param>
217
<summary>Creates an NSMutableAttributedString from a C# string and applies the specified CoreText attributes to the entire string.</summary>
183
222
<Member MemberName=".ctor">
197
236
<Parameter Name="attributes" Type="MonoMac.Foundation.NSDictionary" />
200
<param name="str">To be added.</param>
201
<param name="attributes">To be added.</param>
202
<summary>To be added.</summary>
239
<param name="str">C# string.</param>
240
<param name="attributes">User-defined attributes as key/value pair dictionary.</param>
241
<summary>Creates an NSMutableAttributedString from a C# string and applies the attributes contained in the NSDictionary to the entire string.</summary>
203
242
<remarks>To be added.</remarks>
224
263
<Parameter Name="range" Type="MonoMac.Foundation.NSRange" />
227
<param name="attributeName">To be added.</param>
228
<param name="value">To be added.</param>
229
<param name="range">To be added.</param>
230
<summary>To be added.</summary>
231
<remarks>To be added.</remarks>
266
<param name="attributeName">Attribute name (for example, "color")</param>
267
<param name="value">Attribute value (for example "blue").</param>
268
<param name="range">Range to which the attribute will be applied.</param>
269
<summary>Adds an attribute and its value to the specified range of characters in the string.</summary>
234
274
<Member MemberName="AddAttributes">
246
286
<Parameter Name="range" Type="MonoMac.Foundation.NSRange" />
249
<param name="attrs">To be added.</param>
250
<param name="range">To be added.</param>
251
<summary>To be added.</summary>
252
<remarks>To be added.</remarks>
289
<param name="attrs">The CoreText attributes to add.</param>
290
<param name="range">Range to which the attribute will be applied.</param>
291
<summary>Adds an attribute and its value to the specified range of characters in the string.</summary>
255
296
<Member MemberName="AddAttributes">
272
313
<Parameter Name="range" Type="MonoMac.Foundation.NSRange" />
275
<param name="attrs">To be added.</param>
276
<param name="range">To be added.</param>
277
<summary>To be added.</summary>
278
<remarks>To be added.</remarks>
316
<param name="attrs">User-defined attributes as key/value pair dictionary.</param>
317
<param name="range">Range to which the attribute will be applied.</param>
318
<summary>Adds the specified attributes in the dictionary to the specified range of characters in the string.</summary>
281
323
<Member MemberName="Append">
297
339
<Parameter Name="attrString" Type="MonoMac.Foundation.NSAttributedString" />
300
<param name="attrString">To be added.</param>
342
<param name="attrString">The attributed string to append.</param>
343
<summary>Appends an attributed string to this string.</summary>
348
<Member MemberName="Append">
349
<MemberSignature Language="C#" Value="public void Append (MonoMac.Foundation.NSAttributedString first, object[] rest);" />
350
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Append(class MonoMac.Foundation.NSAttributedString first, object[] rest) cil managed" />
351
<MemberType>Method</MemberType>
353
<AssemblyVersion>0.0.0.0</AssemblyVersion>
356
<ReturnType>System.Void</ReturnType>
359
<Parameter Name="first" Type="MonoMac.Foundation.NSAttributedString" />
360
<Parameter Name="rest" Type="System.Object[]">
363
<AttributeName>System.ParamArray</AttributeName>
369
<param name="first">To be added.</param>
370
<param name="rest">To be added.</param>
301
371
<summary>To be added.</summary>
302
372
<remarks>To be added.</remarks>
322
<summary>To be added.</summary>
323
<remarks>To be added.</remarks>
392
<summary>Marks the beginning of changes.</summary>
394
You can invoke this method before you make a series of changes to a NSMutableAttributedString to inform the class that you will be making more than one change and that it does not need to compute any expensive internal data structures on each end. The internal data structures will all be updated when you call the <see cref="M:MonoMac.Foundation.EndEditing()" /></remarks>
326
397
<Member MemberName="ClassHandle">
358
429
<Parameter Name="range" Type="MonoMac.Foundation.NSRange" />
361
<param name="range">To be added.</param>
362
<summary>To be added.</summary>
363
<remarks>To be added.</remarks>
432
<param name="range">Range to delete.</param>
433
<summary>Removes the characters in the specified range.</summary>
366
438
<Member MemberName="EndEditing">
383
<summary>To be added.</summary>
384
<remarks>To be added.</remarks>
455
<summary>Marks the end of changes.</summary>
456
<remarks>You should invoke this method after you have made a series of changes to a NSMutableAttributedString to inform the class that you are done making changes and it can perform its internal book keeping. This is called after you called <see cref="M:MonoMac.Foundation.BeginEditing()" />.</remarks>
387
459
<Member MemberName="Insert">
404
476
<Parameter Name="location" Type="System.Int32" />
407
<param name="attrString">To be added.</param>
408
<param name="location">To be added.</param>
409
<summary>To be added.</summary>
410
<remarks>To be added.</remarks>
479
<param name="attrString">Attributed string to insert.</param>
480
<param name="location">Location where the string will be inserted.</param>
481
<summary>Inserts an attributed string into the current string.</summary>
482
<remarks>Any attributes that spanned the insertion point will be expanded, so they will continue to cover both the original text as well as the new text.</remarks>
413
485
<Member MemberName="RemoveAttribute">
430
502
<Parameter Name="range" Type="MonoMac.Foundation.NSRange" />
433
<param name="name">To be added.</param>
434
<param name="range">To be added.</param>
435
<summary>To be added.</summary>
436
<remarks>To be added.</remarks>
505
<param name="name">Name of the attribute to remove.</param>
506
<param name="range">Range where the attribute will be removed.</param>
507
<summary>Removes the specified attribute from the range of characters</summary>
439
512
<Member MemberName="Replace">
456
529
<Parameter Name="value" Type="MonoMac.Foundation.NSAttributedString" />
459
<param name="range">To be added.</param>
460
<param name="value">To be added.</param>
461
<summary>To be added.</summary>
462
<remarks>To be added.</remarks>
532
<param name="range">Range of characters that will be replaced.</param>
533
<param name="value">Strings that will be inserted to replace the range of characters.</param>
534
<summary>Replaces the specified range of characters with an attributed string.</summary>
465
539
<Member MemberName="Replace">
482
556
<Parameter Name="newValue" Type="System.String" />
485
<param name="range">To be added.</param>
486
<param name="newValue">To be added.</param>
487
<summary>To be added.</summary>
488
<remarks>To be added.</remarks>
559
<param name="range">Range of characters that will be replaced.</param>
560
<param name="newValue">Strings that will be inserted to replace the range of characters.</param>
561
<summary>Replaces the specified range of characters with an attributed string.</summary>
491
566
<Member MemberName="SetAttributes">
503
578
<Parameter Name="range" Type="MonoMac.Foundation.NSRange" />
506
<param name="attrs">To be added.</param>
507
<param name="range">To be added.</param>
508
<summary>To be added.</summary>
509
<remarks>To be added.</remarks>
581
<param name="attrs">CoreText attributes to be set on the string.</param>
582
<param name="range">Range to which the attribute will be applied.</param>
583
<summary>Sets the attributes for the specified ranges. Any previous attributes in that range are replaces with the new values.</summary>
512
588
<Member MemberName="SetAttributes">
529
605
<Parameter Name="range" Type="MonoMac.Foundation.NSRange" />
532
<param name="attrs">To be added.</param>
533
<param name="range">To be added.</param>
534
<summary>To be added.</summary>
535
<remarks>To be added.</remarks>
608
<param name="attrs">Dictionary of attributes to be set on the string.</param>
609
<param name="range">Range to which the attribute will be applied.</param>
610
<summary>Sets the attributes for the specified ranges. Any previous attributes in that range are replaces with the new values.</summary>
538
615
<Member MemberName="SetString">
554
631
<Parameter Name="attrString" Type="MonoMac.Foundation.NSAttributedString" />
557
<param name="attrString">To be added.</param>
558
<summary>To be added.</summary>
559
<remarks>To be added.</remarks>
634
<param name="attrString">The new attributed string to set the contents to</param>
635
<summary>Sets the contents of this NSMutableAttributedString to the value specified.</summary>