NAnt SDK Documentation - v0.92

IfNotTask Class

NOTE: This class is now obsolete.

Use the <if> task instead.


The opposite of the if task.

For a list of all members of this type, see IfNotTask Members.

System.Object
   NAnt.Core.Element
      NAnt.Core.Task
         NAnt.Core.TaskContainer
            NAnt.Core.Tasks.IfTask
               NAnt.Core.Tasks.IfNotTask

[Visual Basic]
<TaskName(Name:="ifnot"), _  Obsolete(Message:="Use the <if> task instead.", IsError:=False)>
Public Class IfNotTask
    Inherits IfTask
[C#]
[TaskName(Name="ifnot")]
[Obsolete(Message="Use the <if> task instead.", IsError=False)]
public class IfNotTask : IfTask

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Example

Check that a property does not exist.

    
<ifnot propertyexists="myProp">
    <echo message="myProp does not exist."/>
</if>
    
  

Check that a property value is not true.

    
<ifnot propertytrue="myProp">
    <echo message="myProp is not true."/>
</if>
    
  

Check that a target does not exist.

    
<ifnot targetexists="myTarget">
    <echo message="myTarget does not exist."/>
</if>
    
  

Requirements

Namespace: NAnt.Core.Tasks

Assembly: NAnt.Core (in NAnt.Core.dll)

See Also

IfNotTask Members | NAnt.Core.Tasks Namespace