Click here to Skip to main content
15,896,557 members
Home / Discussions / C#
   

C#

 
QuestionFloating point compare Pin
_eulogy_19-Jan-06 3:59
_eulogy_19-Jan-06 3:59 
QuestionFetch variable information over multiple lines with regex Pin
SirErugor19-Jan-06 3:42
SirErugor19-Jan-06 3:42 
QuestionRemove white space from the beginning of a rich text Pin
Agyeman19-Jan-06 3:30
Agyeman19-Jan-06 3:30 
AnswerRe: Remove white space from the beginning of a rich text Pin
CWIZO19-Jan-06 3:39
CWIZO19-Jan-06 3:39 
GeneralRe: Remove white space from the beginning of a rich text Pin
Agyeman19-Jan-06 3:44
Agyeman19-Jan-06 3:44 
AnswerRe: Remove white space from the beginning of a rich text Pin
CWIZO19-Jan-06 3:47
CWIZO19-Jan-06 3:47 
GeneralRe: Remove white space from the beginning of a rich text Pin
Agyeman19-Jan-06 6:01
Agyeman19-Jan-06 6:01 
QuestionLibraries of functions Pin
Roger Jane19-Jan-06 3:27
Roger Jane19-Jan-06 3:27 
Hi All,

This might stem back to 'C' days and I probably ought to change my 'mindset' and other such phrases but old habits die hard. Call me Cliché Man...

When I write an applicaton, I tend to have a source file or two put aside to put all 'those little useful functions' in. You know, generic things like formatting a postal code, validating things etc. that don't fit in with a specific class anywhere. Well, using C#, I've implementing this as follows:

In library.cs:

<br />
namespace mylib {<br />
    public class rog {<br />
        static public int DoSomething(int arg) {<br />
            return arg+1;<br />
        }<br />
    }<br />
}<br />


To call this function, I'm putting this in app1.cs:

<br />
using mylib;<br />
...<br />
    b = rog.DoSomething(3);<br />


This seems like using a class where there is really no need. I'd like to just call 'DoSomething(3)' without the 'rog.' part.

I'm new to C# so be gentle, I'm old to C and C++ so feel free to be harsh.

Am I being stupid?

Thanks for any confirmation or denial...

Rog
AnswerRe: Libraries of functions Pin
CWIZO19-Jan-06 3:42
CWIZO19-Jan-06 3:42 
AnswerRe: Libraries of functions Pin
Werdna19-Jan-06 4:43
Werdna19-Jan-06 4:43 
GeneralRe: Libraries of functions Pin
Roger Jane20-Jan-06 7:14
Roger Jane20-Jan-06 7:14 
QuestionBinding Datagrid to a bidimensional array Pin
hellamasta19-Jan-06 3:21
hellamasta19-Jan-06 3:21 
Questionfor RealCondor Pin
Sasuko19-Jan-06 3:13
Sasuko19-Jan-06 3:13 
AnswerRe: for RealCondor Pin
Colin Angus Mackay19-Jan-06 4:16
Colin Angus Mackay19-Jan-06 4:16 
QuestionNetwork problem Pin
snouto19-Jan-06 3:10
snouto19-Jan-06 3:10 
AnswerRe: Network problem Pin
c#guy381119-Jan-06 6:27
c#guy381119-Jan-06 6:27 
AnswerRe: Network problem Pin
mcljava19-Jan-06 10:35
mcljava19-Jan-06 10:35 
GeneralRe: Network problem Pin
snouto19-Jan-06 10:48
snouto19-Jan-06 10:48 
QuestionMarshal an array of WinAPI structs Pin
Sajit Jacob19-Jan-06 1:41
Sajit Jacob19-Jan-06 1:41 
QuestionDataGrid Header sorting Arrow Pin
eliasvipin19-Jan-06 1:16
eliasvipin19-Jan-06 1:16 
QuestionApplication hanging while using AxWebBrowser Pin
JayaDurai19-Jan-06 0:46
JayaDurai19-Jan-06 0:46 
QuestionRichTextBox Pin
krieg3819-Jan-06 0:21
krieg3819-Jan-06 0:21 
QuestionOutlook object model Guard Pin
Werner Reyneke19-Jan-06 0:12
Werner Reyneke19-Jan-06 0:12 
AnswerRe: Outlook object model Guard Pin
c#guy381119-Jan-06 6:31
c#guy381119-Jan-06 6:31 
QuestionSUM(Excel.range) Pin
Frank23119-Jan-06 0:07
Frank23119-Jan-06 0:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.