forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIsArgumentSet.cs
More file actions
41 lines (39 loc) · 1.26 KB
/
Copy pathIsArgumentSet.cs
File metadata and controls
41 lines (39 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// Copyright (C) Microsoft. All rights reserved.
//
using System;
using System.Activities;
using System.Collections.Generic;
using System.Globalization;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Management.Automation;
using System.Management.Automation.Language;
using System.ComponentModel;
using System.Text;
using System.Reflection;
namespace Microsoft.PowerShell.Activities.Internal
{
/// <summary>
/// Determines whether an argument to a PSActivity activity
/// has been set.
/// </summary>
[SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes", Justification = "Needed Internal use only")]
public class IsArgumentSet : CodeActivity<bool>
{
/// <summary>
/// The argument to investigate.
/// </summary>
[DefaultValue(null)]
public Argument Argument { get; set; }
/// <summary>
/// Invokes the activity
/// </summary>
/// <param name="context">The activity context.</param>
/// <returns>True if the given argument is set.</returns>
protected override bool Execute(CodeActivityContext context)
{
return Argument != null && Argument.Expression != null;
}
}
}