NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

CodePersister Methods

The methods of the CodePersister class are listed below. For a complete list of CodePersister class members, see the CodePersister Members topic.

Public:

Dispose Disposes this object. After this call the object is no longer useful.
Equals (inherited from Object) Determines whether the specified Object is the same instance as the current Object. Subclasses are expected to override this method to support value equality (not reference equality).
GetComponentCode Parse code fragments into statements. This should be fragments that normally would live inside a method body.
GetComponentsFromCode Parse code fragments into components. This should be fragments that normally would live inside a method body.
GetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetNameFromReference Returns the name of the given reference. This will look up in either the referenceService or the component's site.
GetReferenceFromName Retrieves the component with the specified reference name. If the component has not been declared yet, this will call CreateComponentInstance to create it.
GetType (inherited from Object) Gets the Type of the Object.
Init Initializes this persister with the specified host and sourceFile.
Load Called by the code stream when it needs to load the document. This should parse the source code in the document and create the instances of the individual components.
ToString (inherited from Object) Returns a String that represents the current Object.

Protected:

AlwaysPersist If any value provider indicates that a value is "UserSelected" then we must force the persistence of the value.
BeginDepersisting Notifies value providers that depersisting has begun.
BeginPersisting Notifies value providers that persisting has begun.
CreateComponentInstance Create the component specified and initialize its Modifiers property.
CreateExpressionFromPropertyValue Creates an expression value object from a PropertyValue. This will perform a deep scan on the PropertyValue and convert any nested object creates, array creates, name references, or constants.

For more information on values and expressions see the ICodeSourceFile documentation.

CreateExpressionFromValue Creates an expression from a component/propertyName combination. This should only be used for property sets.
CreateValueFromExpression Creates a value from an expression object returned form the CodeSense APIs. This will take the various expressions and execute them, so to say. For example, if you pass in a ICodeObjectCreateExpression for value and it refers to the Point class, then a Point object will be returned.

For more information on values and expression see the ICodeSourceFile documentation.

DeclareComponent This is used during code parsing to declare a given data member. We declare the member, and then we create an instance of this data member. This will throw an exception if the data member has already been declared.
EndDepersisting Notifies value providers that depersisting has completed.
EndPersisting Notifies value providers that persisting has completed.
Finalize (inherited from Object) Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by the Garbage Collector (GC). This method may be ignored by the runtime; therefore, necessary cleanup operations should be done elsewhere.
GetServiceObject Searches for the requested service.
GetValueProviderDeclarations Returns the array of value provider local variable declarations.
IsValueProviderDeclaration Determines if the specified statement is a the local declaration for a value provider.
MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.
PersistNamedResource Creates an expression from a name/value pair.

See Also

CodePersister Class | System.ComponentModel.Design Namespace