Click here to Skip to main content
15,904,416 members
Home / Discussions / C#
   

C#

 
GeneralMDI Child Form Drag Without Toolbar Pin
Cyric7419-Apr-04 16:34
Cyric7419-Apr-04 16:34 
GeneralRe: MDI Child Form Drag Without Toolbar Pin
Heath Stewart20-Apr-04 5:02
protectorHeath Stewart20-Apr-04 5:02 
QuestionCombining serialization of collection and internal data? Pin
Anonymous19-Apr-04 16:25
Anonymous19-Apr-04 16:25 
AnswerRe: Combining serialization of collection and internal data? Pin
Heath Stewart20-Apr-04 4:56
protectorHeath Stewart20-Apr-04 4:56 
GeneralWindows Messages Pin
T i T i19-Apr-04 14:22
T i T i19-Apr-04 14:22 
GeneralRe: Windows Messages Pin
Roman Rodov19-Apr-04 14:57
Roman Rodov19-Apr-04 14:57 
GeneralC# #define macro equivalent. Pin
HAHAHA_NEXT19-Apr-04 11:47
HAHAHA_NEXT19-Apr-04 11:47 
GeneralRe: C# #define macro equivalent. Pin
Mikko Puonti19-Apr-04 13:01
Mikko Puonti19-Apr-04 13:01 
Simple answer: no, there isn't equivalant (but you can define symbols for compiler)

Complex answer:
Some solutions:
1) Develope own preprocessor that handles macros (shouldn't been too hard to do - but will make your code uncompatible)
2) Use #if (compiler symbols) to "select implementation". For example:
	public abstract class DumpableObject : IDumpableObject
	{
#if DEBUG
		private DumpContext m_contextDump;
		private int m_iDumpLevel = DumpContext.DEFAULT_DUMP_LEVEL;
				
		protected int DumpLevel
		{
			get { return m_iDumpLevel; }
			set { m_iDumpLevel = value; }
		}
				
		public void DumpAll()
		{				
			DumpContext context = new DumpContext( this, m_iDumpLevel, DumpContext.DumpDetails.ALL );
		}
				
		public void Dump( DumpContext context )
		{
			m_contextDump = context;
			OnDump();
			m_contextDump = null;
		}
				
		protected virtual void OnDump()
		{
		}
				
		protected void Dump( string strName, object obj )
		{
			m_contextDump.Dump( strName, obj );
		}
#else
		protected int DumpLevel
		{
			get { return 0; }
			set { }
		}
				
		protected void DumpAll()
		{
		}
				
		public void Dump( DumpContext context )
		{
		}
				
		protected virtual void OnDump()
		{
		}
				
		protected void Dump( string strName, object obj )
		{
		}
#endif
	}

(Yes I know - it doesn't implement all macro tricks - but at least some). Basicly you really should be able to do almost anything without macros (just use sub methods).
GeneralRe: C# #define macro equivalent. Pin
HAHAHA_NEXT20-Apr-04 6:31
HAHAHA_NEXT20-Apr-04 6:31 
GeneralRe: C# #define macro equivalent. Pin
leppie20-Apr-04 7:05
leppie20-Apr-04 7:05 
GeneralRedraw scrollbars of TreeView Pin
Jean Bédard19-Apr-04 9:54
Jean Bédard19-Apr-04 9:54 
GeneralThreadPool Class Pin
Spiros19-Apr-04 8:58
Spiros19-Apr-04 8:58 
GeneralRe: ThreadPool Class Pin
Heath Stewart19-Apr-04 9:14
protectorHeath Stewart19-Apr-04 9:14 
GeneralRe: ThreadPool Class Pin
dabuskol19-Apr-04 19:02
dabuskol19-Apr-04 19:02 
GeneralAPI (GetPrivateProfileString) does not understand extention. Pin
mcgahanfl19-Apr-04 8:57
mcgahanfl19-Apr-04 8:57 
Questionhow to add function to Explorer's context menu Pin
Paolo Ponzano19-Apr-04 8:40
Paolo Ponzano19-Apr-04 8:40 
AnswerRe: how to add function to Explorer's context menu Pin
Heath Stewart19-Apr-04 8:54
protectorHeath Stewart19-Apr-04 8:54 
AnswerRe: how to add function to Explorer's context menu Pin
Mike Dimmick19-Apr-04 8:55
Mike Dimmick19-Apr-04 8:55 
AnswerRe: how to add function to Explorer's context menu Pin
Heath Stewart19-Apr-04 8:57
protectorHeath Stewart19-Apr-04 8:57 
GeneralControl Arrays Pin
SanShou19-Apr-04 7:09
SanShou19-Apr-04 7:09 
GeneralRe: Control Arrays Pin
Heath Stewart19-Apr-04 8:50
protectorHeath Stewart19-Apr-04 8:50 
GeneralOpenfiledialog Pin
Appelz19-Apr-04 4:52
Appelz19-Apr-04 4:52 
GeneralRe: Openfiledialog Pin
Jon G19-Apr-04 4:54
Jon G19-Apr-04 4:54 
GeneralRe: Openfiledialog Pin
Heath Stewart19-Apr-04 5:06
protectorHeath Stewart19-Apr-04 5:06 
GeneralRe: Openfiledialog Pin
Heath Stewart19-Apr-04 5:05
protectorHeath Stewart19-Apr-04 5:05 

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.