Optional Parameters from CodeParameter - visual-studio-2012

I am using a T4 to create my interface, however the only issue I am having is if my methods have optional parameters, I am not adding them to the interface.
I'm using EnvDTE to get the information and I have the CodeParameter, but do not see a way to tell it parameter has optional value.
Anyway to tell if the parameter has an optional value?

Try using CodeParameter2 instead. It has a ParameterKind property, which can be set to vsCMParameterKindOptional, and a DefaultValue property.

Related

How can I get the default value of a parameter (method) in groovy at runtime?

How can I get the default value of a parameter (method) in groovy at runtime?
Is there a possibility?
How can I get the default value of a parameter (method) in groovy at
runtime? Is there a possibility?
Aside from invoking the method without supplying the parameter and then inspecting the value that was passed in, not a practical one, no. You could write code that parses the .class file and the info is there, but I don't think there is anything in Groovy related that is going to help or be relevant.

Is there something like variadic functions in Centura?

Is it possible to have optional parameters in Centura 6.1?
Like:
test( boolean , hWnd... )
And how would I declare them?
You can't.
Team Developer does not support optional parameters.
Gupta TeamDeveloper v6.3 onwards supports Overloaded Constructors , allowing you to declare any number of Constructors with different parameter types. The compiler decides which constructor to use according to the parameter list you send it. See below for a simple example of calling the Constructor using 1) a Boolean parameter and then 2) a String Parameter.

ServiceStack.OrmLite CreateTable method ignores StringLength and DecimalLength attributes

I tried it with PostgreSql provider. Digging into code I see that:
OrmLiteDialectProviderBase.ToCreateTableStatement() method strangely always passes null as scale parameter to GetColumnDefinition().
PostgreSQLDialectProvider.GetColumnDefinition() ignores all parameters except fieldType
Is this intended to be so? Is there a workaround to make CreateTable consider fields length?
P.S. Is there an active issue tracker for ServiceStack? Link at https://github.com/ServiceStack/ServiceStack/wiki/How-to-contribute is broken.

Subsonic SimpleRepository Nullable string problem

I am having a problem with subsonic simplerepository.
I have a users class and it has some optional fields.these optional fields are of type string. As soon
as I try to persist my object , if the optional fields are null , an exception is being thrown
I know string is already of type nullable so i cannot do something like nullable and string?
so what should i do in this case ?
Another option that I have at this point of time is , before persisting the object, check if the optional attributes are null
if they are null, assign them some dummy data. for example "abracadabra". now whenever i am populating the objects
back from the database i check if optional attributes have this value.
if they have this value I make the optional attributes empty in my class.
ah! one more thing, please !
can i use ActiveRecord for winforms?
Add the [SubSonicNullString] attribute.

IDispatch object that responds to all properties?

I want to create an IDispatch object that returns a value for every property. Ask it for "foo", it returns something. "bar" returns something. "faid1jhgi31jifj" as well.
Any pointers?
You need to override the GetIDsForNames methods with an appropriate implementation that returns a valid DISPID for any input parameters. Then override the Invoke method to ensure to return the correct value based on the dispatch id.
You should also look at IDispatchEx, which is designed to give more flexibility for dynamic interfaces.

Resources