Esempio n. 1
0
File: if.cs Progetto: formist/LinkMe
 internal override bool EncloseBlock(EncloseBlockType type)
 {
     // if there's an else block, recurse down that branch
     if (FalseBlock != null)
     {
         return(FalseBlock.EncloseBlock(type));
     }
     else if (type == EncloseBlockType.IfWithoutElse)
     {
         // there is no else branch -- we might have to enclose the outer block
         return(true);
     }
     else if (TrueBlock != null)
     {
         return(TrueBlock.EncloseBlock(type));
     }
     return(false);
 }
Esempio n. 2
0
 internal override bool EncloseBlock(EncloseBlockType type)
 {
     // if there's an else block, recurse down that branch.
     // if we aren't forcing braces and the block contains nothing, then we don't
     // really have a false block.
     if (FalseBlock != null && (FalseBlock.ForceBraces || FalseBlock.Count > 0))
     {
         return(FalseBlock.EncloseBlock(type));
     }
     else if (type == EncloseBlockType.IfWithoutElse)
     {
         // there is no else branch -- we might have to enclose the outer block
         return(true);
     }
     else if (TrueBlock != null)
     {
         return(TrueBlock.EncloseBlock(type));
     }
     return(false);
 }