Search Results

Search found 3 results on 1 pages for 'firesnake'.

Page 1/1 | 1 

  • compiler warning on (ambiguous) method resolution with named parameters

    - by FireSnake
    One question regarding whether the following code should yield a compiler warning or not (it doesn't). It declares two methods of the same name/return type, one has an additional named/optional parameter with default value. NOTE: technically the resolution isn't ambiguous, because the rules clearly state that the first method will get called. See here, Overload resolution, third bullet point. This behavior is also intuitive to me, no question. public void Foo(int arg) { ... } public void Foo(int arg, bool bar = true) { ...} Foo(42); // shouldn't this give a compiler warning? I think a compiler warning would be kind of intuitive here. Though the code technically is clean (whether it is a sound design is a different question:)).

    Read the article

  • Best way to check for nullable bool in a condition expression (if ...)

    - by FireSnake
    I was wondering what was the most clean and understandable syntax for doing condition checks on nullable bools. Is the following good or bad coding style? Is there a way to express the condition better/more cleanly? bool? nullableBool = true; if (nullableBool ?? false) { ... } else { ... } especially the if (nullableBool ?? false) part. I don't like the if (x.HasValue && x.Value) style ... (not sure whether the question has been asked before ... couldn't find something similar with the search)

    Read the article

  • Make SharePoint 2007 List View read-only

    - by FireSnake
    I need to deploy a new List View for the standard List View Web Part in MOSS 2007 via the object model (the list already exists, a new view should be added). I need and want to make this list view read-only. This is because saving changes to the view would corrupt modifications made to Header/Footer. How can I do that via the object model? I looked at the content db, the read-only flag (0x20) is stored with the view and could technically be updated using calls to proc_GetAllWebPartsOnPage and proc_UpdateView[Properties]. NOTE: The database interface and all mentioned stored procs are all documented by Microsoft. Is there ANY way to do that via the object model, because I would strongly prefer that?

    Read the article

1