0 Members and 1 Guest are viewing this topic.
if ( some_condition ){ do_this();}else{ do_that(); }
if ( some_condition ) do_this();else do_that();
if ( XrLock == null ) XrDb.Dispose();else XrLock.Dispose();
foreach ( KeyValuePair<string, AnnotationScale> kvp in ScDict ) ScCntxCol.RemoveContext( kvp.Key );
I use both.But lately started to leave the braces, since end up adding more lines in between, something that can be done very easy later, but also to keep all on the same.But that's me.
if (some_condition) { do_this(); do_this_too(); } else { do_that(); }
if (some_condition) { do_this(); do_this_too(); } else do_that();
For the most part I don't use the extra braces, however, I keep them symmetrical I.e.
if (some_condition){ do_this(); do_this_too(); }else { do_that(); }
BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead); if( !bt.Has(blockName) ) { ed.WriteMessage("\nBlock '{0}' is not available in the current drawing.", blockName); return; } PromptPointResult ppr = ed.GetPoint("\nSpecify insertion point: "); if( ppr.Status != PromptStatus.OK ) return;
get { return doc; } set { doc = value; if( doc == null ) { db = null; ed = null; } else { db = doc.Database; ed = doc.Editor; } }
if (x >= 0) if (x > 0) PositiveX();else // Oops! Matches most recent if! NegativeX();