Gets or sets a Boolean value that specifies whether the site collection is read-only, locked, and unavailable for write access. Property that indicates whether users will be able to share links to documents that can be accessed without logging in. Gets or sets a value that specifies whether the URL structure of this site collection is viewable. Gets or sets a value that specifies whether the Visual Upgrade UI of this site collection is displayed.
Specifies a date, after which site collection administrators will be reminded to upgrade the site collection. Gets the full URL to the root Web site of the site collection, including host name, port number, and path. Gets a value that specifies usage information about the site, including bandwidth, storage, and the number of visits to the site collection.
Each Site object, or site collection, is represented within a SiteCollection object that consists of the collection of all site collections in the Web application. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. ToString method to provide a more suitable string representation of a particular type.
Types also frequently overload the Object. ToString method to provide support for format strings or culture-sensitive formatting. The default Object.
ToString method Overriding the Object. ToString method Notes for the Windows Runtime. The default implementation of the ToString method returns the fully qualified name of the type of the Object , as the following example shows. Because Object is the base class of all reference types in the. NET Framework, this behavior is inherited by reference types that do not override the ToString method.
The following example illustrates this. It defines a class named Object1 that accepts the default implementation of all Object members. Its ToString method returns the object's fully qualified type name. Types commonly override the Object. ToString method to return a string that represents the object instance. For example, the base types such as Char , Int32 , and String provide ToString implementations that return the string form of the value that the object represents. The following example defines a class, Object2 , that overrides the ToString method to return the type name along with its value.
The following table lists the type categories in. NET and indicates whether or not they override the Object. See the Notes to Inheritors section for additional information on overriding ToString. In addition to overriding the parameterless Object. ToString method, many types overload the ToString method to provide versions of the method that accept parameters. Most commonly, this is done to provide support for variable formatting and culture-sensitive formatting. The following example overloads the ToString method to return a result string that includes the value of various fields of an Automobile class.
It defines four format strings: G, which returns the model name and year; D, which returns the model name, year, and number of doors; C, which returns the model name, year, and number of cylinders; and A, which returns a string with all four field values.
The following example calls the overloaded Decimal. For more information on format strings and culture-sensitive formatting, see Formatting Types.
Because a type inherits the default Object. ToString method, you may find its behavior undesirable and want to change it. This is particularly true of arrays and collection classes. While you may expect the ToString method of an array or collection class to display the values of its members, it instead displays the type fully qualified type name, as the following example shows.
Next construct in Visual Basic. If the class is not sealed in C or NotInheritable in Visual Basic , you can develop a wrapper class that inherits from the base class whose Object. ToString method you want to customize. At a minimum, this requires that you do the following:. Implement any necessary constructors. Derived classes do not inherit their base class constructors. Quick access. Search related threads. Remove From My Forums. Answered by:. Archived Forums. Visual C. Sign in to vote. Tuesday, May 13, AM.
Hi ArtVandelez, It sounds like your "object" might actually be a control. Is that true? Tuesday, May 13, PM.
Thanks for the info though.
0コメント