Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:613100
More Search Options
RSS Available
Matching Posts
Re: constructor is inheritable in c#
No (the links provided by Swagat actually support this - I'm not sure why he answered 'yes')
Posted to
C#
(Forum)
by
David Anton
on 12/28/2009
Re: constructor is inheritable in c#
Yes - but even this is nothing to do with 'inheriting' a constructor - it's just making a call to the base class constructor before any derived class constructor logic occurs.
Posted to
C#
(Forum)
by
David Anton
on 12/28/2009
Re: constructor is inheritable in c#
SGWellens: If the constructor wasn't inherited, you wouldn't be able to call it. If this were true, then you'd be able to have: DerivedClass d = new DerivedClass(x); if the base class had a single parameter constructor (of the type of 'x'), even if DerivedClass declared no constructors. But of course you can't - this is related to the OP's question. 'DerivedClass' must have the same constructor signature declared explicitly - there is no seamless call to the base
Posted to
C#
(Forum)
by
David Anton
on 12/28/2009
Re: Dice rolling.
Yes, you need "New Random(1, 7)" since the second argument is exclusive, not inclusive. I overlooked this in my post.
Posted to
Visual Basic .NET
(Forum)
by
David Anton
on 12/24/2009
Re: Dice rolling.
Don't use two separate 'Random' variables: (And what the heck is "Randomize" there for? That should only be if you're using the VB-specific routines). Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim R As New Random Dim d1result As Integer = R.Next(1, 6) Dice1.Text = d1result.ToString Dim d2result As Integer = R.Next(1, 6) Dice2.Text = d2result.ToString End Sub
Posted to
Visual Basic .NET
(Forum)
by
David Anton
on 12/24/2009
Re: Problem Converting From C# to VB (HttpRuntime.Insert...)
'AddressOf' isn't a method call - it's an operator, so don't use parentheses: HttpRuntime.Cache.Insert(_cacheDependencyName, New Object(), dependency, Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration, CacheItemPriority.NotRemovable, New CacheItemRemovedCallback(AddressOf OnSiteMapChanged))
Posted to
Visual Basic .NET
(Forum)
by
David Anton
on 12/23/2009
Re: Convert C# statement to VB.NET
This functional programming technique (of which I'm certainly not a fan) involves specifying a method body inline which will be executed subsequently, but not necessarily immediately. Personally, I don't see how this adds clarity to a program. Our converters label the extracted method "Anonymous..." since the technique in C# is often referred to as an "anonymous method". If you really like this sort of stuff, then you'll probably find F# very appealing - along with
Posted to
Visual Basic .NET
(Forum)
by
David Anton
on 12/23/2009
Re: Convert C# statement to VB.NET
VB9 (VS 2008) : async.PostOperationCompleted(Function(e) AnonymousMethod1(e), completedArgs) Private Function AnonymousMethod1(ByVal e As Object) As Object OnMyTaskCompleted(CType(e, AsyncCompletedEventArgs)) Return Nothing End Function VB10 (VS 2010): async.PostOperationCompleted(Sub(e As Object) OnMyTaskCompleted(CType(e, AsyncCompletedEventArgs)), completedArgs)
Posted to
Visual Basic .NET
(Forum)
by
David Anton
on 12/23/2009
Re: VB to C# - subroutines
You should really start another thread. The method is just called as: Addition(); A 'void' method must be called this way, while a non-void method is usually called by assigning the result to something else (but you don't have to assign the result).
Posted to
C#
(Forum)
by
David Anton
on 12/21/2009
Re: Explicity Destroying Objects
Unlike VBA (or VB6), there is no need to explicitly set any local variables to 'Nothing' - when they go out of scope the GC will know that they can be collected if there are no other references to the object - setting to 'Nothing' would just tell the GC the same thing, so there's no need.
Posted to
Visual Basic .NET
(Forum)
by
David Anton
on 12/19/2009
Page 1 of 45 (442 items) 1
2
3
4
5
Next >
...
Last »
TechNet Edge:
FOPE Policies Deep Dive Interview
Silverlight:
Silverlight HVP Design Update
WindowsClient:
Windows Client Developer Roundup for 12/28/2009
WindowsClient:
Snoop with 64 bit support
ASP.NET:
jQuery Hide/Close Link
ASP.NET:
Merry Christmas
TechNet Edge:
FPE Customer Story
Silverlight:
Being a writer, and having an editor. A Short Rant.
Channel 9:
Channel 9 Live at PDC09: Dr Brian Brooks (3M)
Channel 9:
C9 Lectures: Dr. Erik Meijer - Functional Programming Fundamentals Chapter 13 of 13
Silverlight:
Information for Silverlight HVP Developers…
WindowsClient:
Custom Content Loaders in Silverlight 4.0
WindowsClient:
MVVM Links\Info
TechNet Edge:
Check out how Dolly Parton uses IE8 and Web slices!!!
Silverlight:
A Silverlight HVP Update
Channel 9:
Channel 9 Live at PDC09: This Week on Channel 9 - PDC09 Daily Show Edition Day 1
Channel 9:
Maria Klawe: Scholar, Scientist and Microsoft Board Member
Channel 10:
Play the Bing Sherlock Holmes Game
Channel 9:
Channel 9 Live at PDC09: Loic Le Meur
Channel 10:
How to Delete Jump List Items
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online