Argument

We found 10 examples in language CSharp for this search. You will see 48 fragments of code.
using DG.Tools;
using Microsoft.Crm.Sdk.Messages;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Messages;
using Microsoft.Xrm.Sdk.Metadata;
using Microsoft.Xrm.Sdk.Query;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.ServiceModel;
using System.Text.RegularExpressions;

namespace DG.Tools.XrmMockup.Metadata
{
    internal static class Arguments {

        public static ArgumentDescription Url = new ArgumentDescription() {
            Name = "url",
            Abbreviations = new string[] { }
        };

        public static ArgumentDescription Username = new ArgumentDescription() {
            Name = "username",
            Abbreviations = new string[] { "usr", "u" }
        };

        public static ArgumentDescription Password = new ArgumentDescription() {
            Name = "password",
            Abbreviations = new string[] { "pwd", "p" }
        };

        public static ArgumentDescription Domain = new ArgumentDescription() {
            Name = "domain",
            Abbreviations = new string[] { "dmn", "d" }
        };

        public static ArgumentDescription AuthProvider = new ArgumentDescription() {
            Name = "ap",
            Abbreviations = new string[] { "authenticationprovider", "provider" }
        };

        public static ArgumentDescription OutDir = new ArgumentDescription() {
            Name = "outDir",
            Abbreviations = new string[] { "out", "o" }
        };


        public static ArgumentDescription Entities = new ArgumentDescription() {
            Name = "entities",
            Abbreviations = new string[] { "es" }
        };

        public static ArgumentDescription Solutions = new ArgumentDescription() {
            Name = "solutions",
            Abbreviations = new string[] { "ss" }
        };

        public static ArgumentDescription UnitTestProjectPath = new ArgumentDescription() {
            Name = "projectPath",
            Abbreviations = new string[] { "pp" }
        };

        public static ArgumentDescription fetchFromAssemblies = new ArgumentDescription()
        {
            Name = "fetchFromAssemblies",
            Abbreviations = new string[] { "fa" }
        };

        public static ArgumentDescription Method = new ArgumentDescription()
        {
            Name = "method",
            Abbreviations = new string[] { }
        };

        public static ArgumentDescription ClientId = new ArgumentDescription()
        {
            Name = "mfaAppId",
            Abbreviations = new string[] { }
        };

        public static ArgumentDescription ReturnUrl = new ArgumentDescription()
        {
            Name = "mfaReturnUrl",
            Abbreviations = new string[] { }
        };

        public static ArgumentDescription ClientSecret = new ArgumentDescription()
        {
            Name = "mfaClientSecret",
            Abbreviations = new string[] { }
        };

        public static ArgumentDescription ConnectionString = new ArgumentDescription()
        {
            Name = "connectionString",
            Abbreviations = new string[] { }
        };

        public static ArgumentDescription[] ArgList = new ArgumentDescription[] {
            Url,
            Username,
            Password,
            Domain,
            AuthProvider,
            Entities,
            Solutions,
            OutDir,
            UnitTestProjectPath,
            fetchFromAssemblies,
            Method,
            ClientId,
            ReturnUrl,
            ClientSecret,
            ConnectionString
        };
    }
}


		public static void IsTrue(Condition condition, string message = "")
		{
			if (!condition())
			{
				throw new ArgumentException(message);
			}
		}
			public static void IsNotNull(object argument, string argumentName, string message = "")
			{
				if (string.IsNullOrEmpty(message))
				{
					message = string.Format("[{0}] must not be null or empty", argumentName);
				}

				if (argument == null)
				{
					throw new ArgumentNullException(argumentName, message);
				}
			}

			public static void IsStrNotNullOrEmpty(string argument, string argumentName, string message = null)
			{
				if (string.IsNullOrEmpty(argument))
				{
					if (message == null)
					{
						message = string.Format("[{0}] must not be null or empty", argumentName);
					}
					throw new ArgumentException(message, argumentName);
				}
			}

			public static void IsNotNegative(int argument, string argumentName)
			{
				if (argument < 0)
				{
					throw new ArgumentOutOfRangeException(argumentName, argumentName + " must not be negative.");
				}
			}

		[Test]
		public void Constructor0 ()
		{
			CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection ();
			Assert.IsFalse (((IList) coll).IsFixedSize, "#1");
			Assert.IsFalse (((IList) coll).IsReadOnly, "#2");
			Assert.AreEqual (0, coll.Count, "#3");
			Assert.IsFalse (((ICollection) coll).IsSynchronized, "#4");
			Assert.IsNotNull (((ICollection) coll).SyncRoot, "#5");
		}

		[Test]
		public void Constructor1 ()
		{
			CodeAttributeArgument caa1 = new CodeAttributeArgument ();
			CodeAttributeArgument caa2 = new CodeAttributeArgument ();

			CodeAttributeArgument[] arguments = new CodeAttributeArgument[] { caa1, caa2 };
			CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (
				arguments);

			Assert.AreEqual (2, coll.Count, "#1");
			Assert.AreEqual (0, coll.IndexOf (caa1), "#2");
			Assert.AreEqual (1, coll.IndexOf (caa2), "#3");
		}

		[Test]
		[ExpectedException (typeof (ArgumentNullException))]
		public void Constructor1_NullItem ()
		{
			CodeAttributeArgument[] arguments = new CodeAttributeArgument[] { 
				new CodeAttributeArgument (), null };

			CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (
				arguments);
		}

		[Test]
		[ExpectedException (typeof (ArgumentNullException))]
		public void Constructor1_Null () {
			CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (
				(CodeAttributeArgument[]) null);
		}

		[Test]
		public void Constructor2 ()
		{
			CodeAttributeArgument caa1 = new CodeAttributeArgument ();
			CodeAttributeArgument caa2 = new CodeAttributeArgument ();

			CodeAttributeArgumentCollection c = new CodeAttributeArgumentCollection ();
			c.Add (caa1);
			c.Add (caa2);

			CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (c);
			Assert.AreEqual (2, coll.Count, "#1");
			Assert.AreEqual (0, coll.IndexOf (caa1), "#2");
			Assert.AreEqual (1, coll.IndexOf (caa2), "#3");
		}

		[Test]
		[ExpectedException (typeof (ArgumentNullException))]
		public void Constructor2_Null ()
		{
			CodeAttributeArgumentCollection coll = new CodeAttributeArgumentCollection (
				(CodeAttributeArgumentCollection) null);
		}


		public static void Source (object source)
		{
			if (source == null)
				throw new ArgumentNullException ("source");
		}

		public static void Source1AndSource2 (object source1,object source2)
		{
			if (source1 == null)
				throw new ArgumentNullException ("source1");
			if (source2 == null)
				throw new ArgumentNullException ("source2");
		}

		public static void SourceAndFuncAndSelector ( object source, object func, object selector)
		{
			if (source == null)
				throw new ArgumentNullException ("source");
			if (func == null)
				throw new ArgumentNullException ("func");
			if (selector == null)
				throw new ArgumentNullException ("selector");
		}


		public static void SourceAndFunc (object source, object func)
		{
			if (source == null)
				throw new ArgumentNullException ("source");
			if (func == null)
				throw new ArgumentNullException ("func");
		}

		public static void SourceAndSelector (object source, object selector)
		{
			if (source == null)
				throw new ArgumentNullException ("source");
			if (selector == null)
				throw new ArgumentNullException ("selector");
		}

		public static void SourceAndPredicate (object source, object predicate)
		{
			if (source == null)
				throw new ArgumentNullException ("source");
			if (predicate == null)
				throw new ArgumentNullException ("predicate");
		}

        /// <summary>
        /// Throws <see cref="ArgumentOutOfRangeException"/> when <paramref name="value"/> is not greater than <paramref name="comparand"/>.
        /// </summary>
        /// <typeparam name="T">
        /// The type of the values to compare.
        /// </typeparam>
        /// <param name="value">
        /// The value to inspect.
        /// </param>
        /// <param name="comparand">
        /// The comparand.
        /// </param>
        /// <param name="paramName">
        /// The parameter name.
        /// </param>
        /// <exception cref="ArgumentOutOfRangeException">
        /// Thrown when <paramref name="value"/> is not greater than <paramref name="comparand"/>.
        /// </exception>
        public static void ArgumentGreaterThan<T>(this T value, T comparand, string paramName) where T : struct, IComparable<T>
        {
            if (value.CompareTo(comparand) > 0)
            {
                return;
            }

            throw new ArgumentOutOfRangeException(
                paramName,
                value,
                string.Format(CultureInfo.InvariantCulture, StringResources.ValueMustBeGreaterThanFmt, comparand, value));
        }

        /// <summary>
        /// Throws <see cref="ArgumentOutOfRangeException"/> when <paramref name="value"/> is not greater than or equal to
        /// <paramref name="comparand"/>.
        /// </summary>
        /// <typeparam name="T">
        /// The type of the values to compare.
        /// </typeparam>
        /// <param name="value">
        /// The value to inspect.
        /// </param>
        /// <param name="comparand">
        /// The comparand.
        /// </param>
        /// <param name="paramName">
        /// The parameter name.
        /// </param>
        /// <exception cref="ArgumentOutOfRangeException">
        /// Thrown when <paramref name="value"/> is not greater than or equal to <paramref name="comparand"/>.
        /// </exception>
        public static void ArgumentGreaterThanOrEqualTo<T>(this T value, T comparand, string paramName) where T : struct, IComparable<T>
        {
            if (value.CompareTo(comparand) >= 0)
            {
                return;
            }

            throw new ArgumentOutOfRangeException(
                paramName,
                value,
                string.Format(CultureInfo.InvariantCulture, StringResources.ValueMustBeGreaterThanOrEqualToFmt, comparand, value));
        }

        /// <summary>
        /// Throws <see cref="ArgumentOutOfRangeException"/> when <paramref name="value"/> is not less than <paramref name="comparand"/>.
        /// </summary>
        /// <typeparam name="T">
        /// The type of the values to compare.
        /// </typeparam>
        /// <param name="value">
        /// The value to inspect.
        /// </param>
        /// <param name="comparand">
        /// The comparand.
        /// </param>
        /// <param name="paramName">
        /// The parameter name.
        /// </param>
        /// <exception cref="ArgumentOutOfRangeException">
        /// Thrown when <paramref name="value"/> is not less than <paramref name="comparand"/>.
        /// </exception>
        public static void ArgumentLessThan<T>(this T value, T comparand, string paramName) where T : struct, IComparable<T>
        {
            if (value.CompareTo(comparand) < 0)
            {
                return;
            }

            throw new ArgumentOutOfRangeException(
                paramName,
                value,
                string.Format(CultureInfo.InvariantCulture, StringResources.ValueMustBeLessThanFmt, comparand, value));
        }

        /// <summary>
        /// Throws <see cref="ArgumentOutOfRangeException"/> when <paramref name="value"/> is not less than or equal to
        /// <paramref name="comparand"/>.
        /// </summary>
        /// <typeparam name="T">
        /// The type of the values to compare.
        /// </typeparam>
        /// <param name="value">
        /// The value to inspect.
        /// </param>
        /// <param name="comparand">
        /// The comparand.
        /// </param>
        /// <param name="paramName">
        /// The parameter name.
        /// </param>
        /// <exception cref="ArgumentOutOfRangeException">
        /// Thrown when <paramref name="value"/> is not less than or equal to <paramref name="comparand"/>.
        /// </exception>
        public static void ArgumentLessThanOrEqualTo<T>(this T value, T comparand, string paramName) where T : struct, IComparable<T>
        {
            if (value.CompareTo(comparand) <= 0)
            {
                return;
            }

            throw new ArgumentOutOfRangeException(
                paramName,
                value,
                string.Format(CultureInfo.InvariantCulture, StringResources.ValueMustBeLessThanOrEqualToFmt, comparand, value));
        }

        /// <summary>
        /// Throws <see cref="ArgumentEmptyException"/> when the given <paramref name="value"/> is empty, and
        /// <see cref="ArgumentEmptyException"/> when the given <paramref name="value"/> is entirely composed of white-space.
        /// </summary>
        /// <param name="value">
        /// The string to inspect.
        /// </param>
        /// <param name="paramName">
        /// The parameter name.
        /// </param>
        /// <remarks>
        /// Allows <c> null </c> values.
        /// </remarks>
        /// <exception cref="ArgumentEmptyException">
        /// Thrown when the given <paramref name="value"/> is empty
        /// </exception>
        /// <exception cref="ArgumentEmptyException">
        /// Thrown when the given <paramref name="value"/> is entirely composed of white-space.
        /// </exception>
        public static void ArgumentNotEmptyNorWhiteSpace(this string value, string paramName)
        {
            if (ReferenceEquals(value, null))
            {
                return;
            }

            if (value.Length == 0)
            {
                throw new ArgumentEmptyException(paramName ?? string.Empty, null, null);
            }

            if (value.Trim().Length == 0)
            {
                throw new ArgumentWhiteSpaceException(paramName ?? string.Empty, null, null);
            }
        }

        /// <summary>
        /// Throws <see cref="ArgumentNullException"/> when <paramref name="value"/> is a null reference.
        /// </summary>
        /// <param name="value">
        /// The value to inspect.
        /// </param>
        /// <param name="argumentName">
        /// The argumentName.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// Thrown when <paramref name="value"/> is a null reference.
        /// </exception>
        [SuppressMessage("SonarLint.CodeSmell", "S4225: Extension methods should not extend object")]
        [DebuggerStepThrough]
        public static void ArgumentNotNull([ValidatedNotNull] this object value, string argumentName)
        {
            if (ReferenceEquals(value, null))
            {
                throw new ArgumentNullException(argumentName ?? string.Empty);
            }
        }


        /// <summary>
        /// Throws proper exception if the class reference is null.
        /// </summary>
        /// <typeparam name="TValue"></typeparam>
        /// <param name="value">Class reference to check.</param>
        /// <exception cref="InvalidOperationException">If class reference is null.</exception>
        [DebuggerStepThrough]
        public static void NotNull<TValue>(Func<TValue> value)
        {
            if (value() == null)
                throw new InvalidOperationException("'{0}' cannot be null.".FormatInvariant(value));
        }

        [DebuggerStepThrough]
        public static void ArgumentNotNull(object arg, string argName)
        {
            if (arg == null)
                throw new ArgumentNullException(argName);
        }

        [DebuggerStepThrough]
        public static void ArgumentNotNull<T>(Func<T> arg)
        {
            if (arg() == null)
                throw new ArgumentNullException(GetParamName(arg));
        }

        [DebuggerStepThrough]
        public static void Arguments<T1, T2>(Func<T1> arg1, Func<T2> arg2)
        {
            if (arg1() == null)
                throw new ArgumentNullException(GetParamName(arg1));

            if (arg2() == null)
                throw new ArgumentNullException(GetParamName(arg2));
        }

        [DebuggerStepThrough]
        public static void Arguments<T1, T2, T3>(Func<T1> arg1, Func<T2> arg2, Func<T3> arg3)
        {
            if (arg1() == null)
                throw new ArgumentNullException(GetParamName(arg1));
            
            if (arg2() == null)
                throw new ArgumentNullException(GetParamName(arg2));

            if (arg3() == null)
                throw new ArgumentNullException(GetParamName(arg3));
        }

        [DebuggerStepThrough]
        public static void Arguments<T1, T2, T3, T4>(Func<T1> arg1, Func<T2> arg2, Func<T3> arg3, Func<T4> arg4)
        {
            if (arg1() == null)
                throw new ArgumentNullException(GetParamName(arg1));

            if (arg2() == null)
                throw new ArgumentNullException(GetParamName(arg2));

            if (arg3() == null)
                throw new ArgumentNullException(GetParamName(arg3));

            if (arg4() == null)
                throw new ArgumentNullException(GetParamName(arg4));
        }

        public static void AssertArgumentEquals(object object1, object object2, string message)
        {
            if (!object1.Equals(object2))
            {
                throw new InvalidOperationException(message);
            }
        }

        public static void AssertArgumentFalse(bool boolValue, string message)
        {
            if (boolValue)
            {
                throw new InvalidOperationException(message);
            }
        }

        public static void AssertArgumentLength(string stringValue, int maximum, string message)
        {
            int length = stringValue.Trim().Length;
            if (length > maximum)
            {
                throw new InvalidOperationException(message);
            }
        }

        public static void AssertArgumentLength(string stringValue, int minimum, int maximum, string message)
        {
            int length = stringValue.Trim().Length;
            if (length < minimum || length > maximum)
            {
                throw new InvalidOperationException(message);
            }
        }

        public static void AssertArgumentMatches(string pattern, string stringValue, string message)
        {
            Regex regex = new Regex(pattern);

            if (!regex.IsMatch(stringValue))
            {
                throw new InvalidOperationException(message);
            }
        }

        public static void AssertArgumentNotEmpty(string stringValue, string message)
        {
            if (stringValue == null || stringValue.Trim().Length == 0)
            {
                throw new InvalidOperationException(message);
            }
        }

using System.Xml.Serialization;

namespace WorkflowParser {

    [XmlRoot("Activity")]
    public class ActivityRoot {

        [XmlElement("Members")]
        public Members Members;

        [XmlElement("Workflow")]
        public Workflow Workflow;
    }

    [XmlType("Members")]
    public class Members {
        [XmlElement("Property")]
        public Property[] Properties;
    }

    [XmlType("Property")]
    public class Property {

        [XmlAttribute("Name")]
        public string Name;

        [XmlAttribute("Type")]
        public string Type;
                
        [XmlArray("Property.Attributes")]
        [XmlArrayItem("ArgumentRequiredAttribute", Type = typeof(ArgumentRequiredAttribute)),
        XmlArrayItem("ArgumentTargetAttribute", Type = typeof(ArgumentTargetAttribute)),
        XmlArrayItem("ArgumentDescriptionAttribute", Type = typeof(ArgumentDescriptionAttribute)),
        XmlArrayItem("ArgumentDirectionAttribute", Type = typeof(ArgumentDirectionAttribute)),
        XmlArrayItem("ArgumentEntityAttribute", Type = typeof(ArgumentEntityAttribute))]
        public PropertyAttribute[] Attributes;
    }

    [XmlInclude(typeof(ArgumentRequiredAttribute)),
    XmlInclude(typeof(ArgumentTargetAttribute)),
    XmlInclude(typeof(ArgumentDescriptionAttribute)),
    XmlInclude(typeof(ArgumentDirectionAttribute)),
    XmlInclude(typeof(ArgumentEntityAttribute))]
    public class PropertyAttribute {
        [XmlAttribute("Value")]
        public string Value;
    }

    [XmlType("ArgumentRequiredAttribute")]
    public class ArgumentRequiredAttribute : PropertyAttribute { }

    [XmlType("ArgumentTargetAttribute")]
    public class ArgumentTargetAttribute : PropertyAttribute { }

    [XmlType("ArgumentDescriptionAttribute")]
    public class ArgumentDescriptionAttribute : PropertyAttribute { }

    [XmlType("ArgumentDirectionAttribute")]
    public class ArgumentDirectionAttribute : PropertyAttribute { }

    [XmlType("ArgumentEntityAttribute")]
    public class ArgumentEntityAttribute : PropertyAttribute { }

    public class Workflow {

        [XmlElement("ActivityReference", Type = typeof(ActivityReference))]
        [XmlElement("GetEntityProperty", Type = typeof(GetEntityProperty))]
        [XmlElement("TerminateWorkflow", Type = typeof(TerminateWorkflow))]
        [XmlElement("SetEntityProperty", Type = typeof(SetEntityProperty))]
        [XmlElement("CreateEntity", Type = typeof(CreateEntity))]
        [XmlElement("UpdateEntity", Type = typeof(UpdateEntity))]
        [XmlElement("AssignEntity", Type = typeof(AssignEntity))]
        [XmlElement("Assign", Type = typeof(Assign))]
        [XmlElement("SetAttributeValue", Type = typeof(SetAttributeValue))]
        [XmlElement("SetState", Type = typeof(SetState))]
        [XmlElement("Sequence", Type = typeof(ActivitySequence))]
        [XmlElement("Postpone", Type = typeof(Postpone))]
        [XmlElement("Null", Type = typeof(Null))]
        [XmlElement("Collection", Type = typeof(Collection))]
        [XmlElement("Persist", Type = typeof(Persist))]
        [XmlElement("SendEmail", Type = typeof(SendEmail))]
        public Activity[] Activities;
    }

    public abstract class Activity {
        [XmlAttribute("Key")]
        public string Key;
    }

    [XmlType("ActivityReference")]
    public class ActivityReference : Activity {

        [XmlAttribute("AssemblyQualifiedName")]
        public string AssemblyQualifiedName;

        [XmlArray("ActivityReference.Arguments")]
        [XmlArrayItem("InArgument", Type = typeof(InArgument)),
        XmlArrayItem("OutArgument", Type = typeof(OutArgument))]
        public Argument[] Arguments;


        [XmlArray("ActivityReference.Properties")]
        [XmlArrayItem("ActivityReference", Type = typeof(ActivityReference)),
        XmlArrayItem("GetEntityProperty", Type = typeof(GetEntityProperty)),
        XmlArrayItem("TerminateWorkflow", Type = typeof(TerminateWorkflow)),
        XmlArrayItem("SetEntityProperty", Type = typeof(SetEntityProperty)),
        XmlArrayItem("CreateEntity", Type = typeof(CreateEntity)),
        XmlArrayItem("UpdateEntity", Type = typeof(UpdateEntity)),
        XmlArrayItem("AssignEntity", Type = typeof(AssignEntity)),
        XmlArrayItem("Assign", Type = typeof(Assign)),
        XmlArrayItem("SetAttributeValue", Type = typeof(SetAttributeValue)),
        XmlArrayItem("SetState", Type = typeof(SetState)),
        XmlArrayItem("Sequence", Type = typeof(ActivitySequence)),
        XmlArrayItem("Postpone", Type = typeof(Postpone)),
        XmlArrayItem("Null", Type = typeof(Null)),
        XmlArrayItem("Collection", Type = typeof(Collection)),
        XmlArrayItem("Persist", Type = typeof(Persist)),
        XmlArrayItem("SendEmail", Type = typeof(SendEmail))]
        public Activity[] Properties;
    }

    public class ReferenceLiteral {
        [XmlAttribute("TypeArguments")]
        public string Type;

        [XmlAttribute("Value")]
        public string Value;

        [XmlElement("OptionSetValue")]
        public OptionSetValue OptionSetValue;
    }

    public class OptionSetValue {
        [XmlAttribute("Value")]
        public int Value;
    }

    [XmlInclude(typeof(InArgument)), XmlInclude(typeof(OutArgument))]
    public class Argument {
        [XmlAttribute("TypeArguments")]
        public string Type;

        [XmlAttribute("Key")]
        public string Key;

        [XmlText]
        public string Value;

        [XmlElement("ReferenceLiteral")]
        public ReferenceLiteral ReferenceLiteral;
    }

    [XmlType("InArgument")]
    public class InArgument : Argument {


    }

    [XmlType("OutArgument")]
    public class OutArgument : Argument {

    }


    public class Persist : Activity {

    }

    public class Collection : Activity {

        [XmlAttribute("TypeArguments")]
        public string Type;

        [XmlAttribute("Key")]
        public new string Key;

        [XmlElement("Variable")]
        public Variable[] Variables;

        [XmlElement("ActivityReference", Type = typeof(ActivityReference))]
        [XmlElement("GetEntityProperty", Type = typeof(GetEntityProperty))]
        [XmlElement("TerminateWorkflow", Type = typeof(TerminateWorkflow))]
        [XmlElement("SetEntityProperty", Type = typeof(SetEntityProperty))]
        [XmlElement("CreateEntity", Type = typeof(CreateEntity))]
        [XmlElement("UpdateEntity", Type = typeof(UpdateEntity))]
        [XmlElement("AssignEntity", Type = typeof(AssignEntity))]
        [XmlElement("Assign", Type = typeof(Assign))]
        [XmlElement("SetAttributeValue", Type = typeof(SetAttributeValue))]
        [XmlElement("SetState", Type = typeof(SetState))]
        [XmlElement("Sequence", Type = typeof(ActivitySequence))]
        [XmlElement("Postpone", Type = typeof(Postpone))]
        [XmlElement("Null", Type = typeof(Null))]
        [XmlElement("Collection", Type = typeof(Collection))]
        [XmlElement("Persist", Type = typeof(Persist))]
        [XmlElement("SendEmail", Type = typeof(SendEmail))]
        public Activity[] Activities;

    }

    public class ActivitySequence : Activity {

        [XmlArray("Sequence.Variables")]
        [XmlArrayItem("Variable")]
        public Variable[] Variables;

        [XmlElement("ActivityReference", Type = typeof(ActivityReference))]
        [XmlElement("GetEntityProperty", Type = typeof(GetEntityProperty))]
        [XmlElement("TerminateWorkflow", Type = typeof(TerminateWorkflow))]
        [XmlElement("SetEntityProperty", Type = typeof(SetEntityProperty))]
        [XmlElement("CreateEntity", Type = typeof(CreateEntity))]
        [XmlElement("UpdateEntity", Type = typeof(UpdateEntity))]
        [XmlElement("AssignEntity", Type = typeof(AssignEntity))]
        [XmlElement("Assign", Type = typeof(Assign))]
        [XmlElement("SetAttributeValue", Type = typeof(SetAttributeValue))]
        [XmlElement("SetState", Type = typeof(SetState))]
        [XmlElement("Sequence", Type = typeof(ActivitySequence))]
        [XmlElement("Postpone", Type = typeof(Postpone))]
        [XmlElement("Null", Type = typeof(Null))]
        [XmlElement("Collection", Type = typeof(Collection))]
        [XmlElement("Persist", Type = typeof(Persist))]
        [XmlElement("SendEmail", Type = typeof(SendEmail))]
        public Activity[] Activities;

    }

    [XmlType("TerminateWorkflow")]
    public class TerminateWorkflow : Activity {
        [XmlAttribute("Exception")]
        public string Exception;

        [XmlAttribute("Reason")]
        public string Reason;
    }

    [XmlType("SetEntityProperty")]
    public class SetEntityProperty : Activity {
        [XmlAttribute("Attribute")]
        public string Attribute;

        [XmlAttribute("Entity")]
        public string Entity;

        [XmlAttribute("EntityName")]
        public string EntityName;

        [XmlAttribute("Value")]
        public string Value;
    }

    [XmlType("CreateEntity")]
    public class CreateEntity : Activity {
        [XmlAttribute("EntityId")]
        public string EntityId;

        [XmlAttribute("Entity")]
        public string Entity;

        [XmlAttribute("EntityName")]
        public string EntityName;
    }

    [XmlType("UpdateEntity")]
    public class UpdateEntity : Activity {

        [XmlAttribute("Entity")]
        public string Entity;

        [XmlAttribute("EntityName")]
        public string EntityName;
    }

    [XmlType("AssignEntity")]
    public class AssignEntity : Activity {

        [XmlAttribute("Entity")]
        public string Entity;

        [XmlAttribute("EntityId")]
        public string EntityId;

        [XmlAttribute("EntityName")]
        public string EntityName;

        [XmlAttribute("Owner")]
        public string Owner;
    }

    [XmlType("SetState")]
    public class SetState : Activity {

        [XmlAttribute("Entity")]
        public string Entity;

        [XmlAttribute("EntityId")]
        public string EntityId;

        [XmlAttribute("EntityName")]
        public string EntityName;

        [XmlArray("SetState.State")]
        [XmlArrayItem("InArgument")]
        public InArgument[] StateArguments;

        [XmlArray("SetState.Status")]
        [XmlArrayItem("InArgument")]
        public InArgument[] StatusArguments;


    }

    [XmlType("SetAttributeValue")]
    public class SetAttributeValue : Activity {

        [XmlAttribute("Entity")]
        public string Entity;

        [XmlAttribute("EntityName")]
        public string EntityName;
    }

    public class Variable {

        [XmlAttribute("TypeArguments")]
        public string Type;

        [XmlAttribute("Name")]
        public string Name;

        [XmlAttribute("Default")]
        public string Default;

        [XmlArray("Variable.Default")]
        [XmlArrayItem("Literal")]
        public Literal[] DefaultList;

    }

    public class Literal {
        [XmlAttribute("TypeArguments")]
        public string Type;

        [XmlAttribute("Value")]
        public string Value;

        [XmlElement("XrmTimeSpan")]
        public XrmTimeSpan XrmTimeSpan;
    }

    public class XrmTimeSpan {
        [XmlAttribute("Days")]
        public string Days;
        [XmlAttribute("Hours")]
        public string Hours;
        [XmlAttribute("Minutes")]
        public string Minutes;
        [XmlAttribute("Months")]
        public string Months;
        [XmlAttribute("Years")]
        public string Years;

    }

    [XmlType("GetEntityProperty")]
    public class GetEntityProperty : Activity {

        [XmlAttribute("Attribute")]
        public string Attribute;

        [XmlAttribute("Entity")]
        public string Entity;

        [XmlAttribute("EntityName")]
        public string EntityName;

        [XmlAttribute("Value")]
        public string Value;


        [XmlArray("GetEntityProperty.TargetType")]
        [XmlArrayItem("InArgument")]
        public Argument[] InArguments;

    }

    [XmlType("Postpone")]
    public class Postpone : Activity {
        
        [XmlAttribute("BlockExecution")]
        public string BlockExecution;

        [XmlAttribute("PostponeUntil")]
        public string PostponeUntil;
    }

    [XmlType("Null")]
    public class Null : Activity {

    }

    [XmlType("Assign")]
    public class Assign : Activity {

        [XmlAttribute("TypeArguments")]
        public string TypeArguments;

        [XmlAttribute("To")]
        public string To;

        [XmlAttribute("Value")]
        public string Value;
    }

    [XmlType("SendEmail")]
    public class SendEmail : Activity {

        [XmlAttribute("EntityId")]
        public string EntityId;

        [XmlAttribute("DisplayName")]
        public string DisplayName;

        [XmlAttribute("Entity")]
        public string Entity;
    }
}


            [TestMethod]
            [TestCategory(TestTiming.CheckIn)]
            public void It_should_not_throw_when_the_value_is_greater_than_the_comparand()
            {
                Action act = () => 5.ArgumentGreaterThan(0, "myParameterName");
                act.Should().NotThrow();
            }

            [TestMethod]
            [TestCategory(TestTiming.CheckIn)]
            public void It_should_throw_with_the_provided_argument_name_when_the_value_equals_the_comparand()
            {
                const string givenParameterName = "myParameterName";
                const int value = 1;
                const int comparand = 1;
                // var expectedMessage = string.Format(CultureInfo.InvariantCulture, ExceptionMessageFmt, comparand, value, givenParameterName);

                Action throwingAction = () => value.ArgumentGreaterThan(comparand, givenParameterName);

                var e = throwingAction.Should().Throw<ArgumentOutOfRangeException>();
                // e.WithMessage(expectedMessage);
                e.And.ActualValue.Should().BeEquivalentTo(value);
                e.And.ParamName.Should().Be(givenParameterName);
            }

            [TestMethod]
            [TestCategory(TestTiming.CheckIn)]
            public void It_should_throw_with_the_provided_argument_name_when_the_value_is_less_than_the_comparand()
            {
                const string givenParameterName = "myParameterName";
                const int value = 1;
                const int comparand = 5;
                // var expectedMessage = string.Format(CultureInfo.InvariantCulture, ExceptionMessageFmt, comparand, value, givenParameterName);

                Action throwingAction = () => value.ArgumentGreaterThan(comparand, givenParameterName);

                var e = throwingAction.Should().Throw<ArgumentOutOfRangeException>();
                // e.WithMessage(expectedMessage);
                e.And.ActualValue.Should().BeEquivalentTo(value);
                e.And.ParamName.Should().Be(givenParameterName);
            }

            [TestMethod]
            [TestCategory(TestTiming.CheckIn)]
            public void
                It_should_throw_with_the_provided_argument_name_when_the_value_is_less_than_the_comparand_and_handle_null_argument_names()
            {
                // When the parameter name is null, the BCL changes the message body.
                const string givenParameterName = null;
                const int value = 1;
                const int comparand = 5;
                var expectedMessage = string.Format(
                    CultureInfo.InvariantCulture,
                    NullParamNameExceptionMessageFmt,
                    comparand,
                    value);

                Action throwingAction = () => value.ArgumentGreaterThan(comparand, givenParameterName);

                var e = throwingAction.Should().Throw<ArgumentOutOfRangeException>();
                e.WithMessage(expectedMessage);
                e.And.ActualValue.Should().BeEquivalentTo(value);
                e.And.ParamName.Should().BeNull();
            }

            [TestMethod]
            [TestCategory(TestTiming.CheckIn)]
            public void It_should_not_throw_when_the_value_is_equal_to_the_comparand()
            {
                Action act = () => 5.ArgumentGreaterThanOrEqualTo(5, "myParameterName");
                act.Should().NotThrow();
            }

            [TestMethod]
            [TestCategory(TestTiming.CheckIn)]
            public void It_should_not_throw_when_the_value_is_greater_than_the_comparand()
            {
                Action act = () => 5.ArgumentGreaterThanOrEqualTo(0, "myParameterName");
                act.Should().NotThrow();
            }

		[TearDown]
		public void TearDown () {}

		[SetUp]
		public void SetUp () {}

		[Test]
		public void TestActiveBorder ()
		{
			SolidBrush brush;
			brush = (SolidBrush) SystemBrushes.ActiveBorder;
			Assert.IsTrue (brush.Color.IsSystemColor, "P1#1");
			Assert.AreEqual (SystemColors.ActiveBorder, brush.Color, "P1#2");

			try {
				brush.Color = Color.Red;
				Assert.Fail ("P1#3: must throw ArgumentException");
			} catch (ArgumentException) {
				Assert.IsTrue (true, "P1#3");
			}

			try {
				brush.Color = SystemColors.ActiveBorder;
				Assert.Fail ("P1#4: must throw ArgumentException");
			} catch (ArgumentException) {
				Assert.IsTrue (true, "P1#4");
			}

			try {
				brush.Dispose();
				Assert.Fail ("P1#5: must throw ArgumentException");
			} catch (ArgumentException) {
				Assert.IsTrue (true, "P1#5");
			}
		}

		[Test]
		public void TestActiveCaption ()
		{
			SolidBrush brush;
			brush = (SolidBrush) SystemBrushes.ActiveCaption;
			Assert.IsTrue (brush.Color.IsSystemColor, "P2#1");
			Assert.AreEqual (SystemColors.ActiveCaption, brush.Color, "P2#2");

			try {
				brush.Color = Color.Red;
				Assert.Fail ("P2#3: must throw ArgumentException");
			} catch (Exception e) {
				Assert.IsTrue (e is ArgumentException, "P2#3");
			}

			try {
				brush.Color = SystemColors.ActiveCaption;
				Assert.Fail ("P2#4: must throw ArgumentException");
			} catch (Exception e) {
				Assert.IsTrue (e is ArgumentException, "P2#4");
			}

			try {
				brush.Dispose();
				Assert.Fail ("P2#5: must throw ArgumentException");
			} catch (Exception e) {
				Assert.IsTrue (e is ArgumentException, "P2#5");
			}

		}

		[Test]
		public void TestActiveCaptionText ()
		{
			SolidBrush brush;
			brush = (SolidBrush) SystemBrushes.ActiveCaptionText;
			Assert.IsTrue (brush.Color.IsSystemColor, "P3#1");
			Assert.AreEqual (SystemColors.ActiveCaptionText, brush.Color, "P3#2");

			try {
				brush.Color = Color.Red;
				Assert.Fail ("P3#3: must throw ArgumentException");
			} catch (Exception e) {
				Assert.IsTrue (e is ArgumentException, "P3#3");
			}

			try {
				brush.Color = SystemColors.ActiveCaptionText;
				Assert.Fail ("P3#4: must throw ArgumentException");
			} catch (Exception e) {
				Assert.IsTrue (e is ArgumentException, "P3#4");
			}

			try {
				brush.Dispose();
				Assert.Fail ("P3#5: must throw ArgumentException");
			} catch (Exception e) {
				Assert.IsTrue (e is ArgumentException, "P3#5");
			}
		}

		[Test]
		public void TestAppWorkspace ()
		{
			SolidBrush brush;
			brush = (SolidBrush) SystemBrushes.AppWorkspace;
			Assert.IsTrue (brush.Color.IsSystemColor, "P4#1");
			Assert.AreEqual (SystemColors.AppWorkspace, brush.Color, "P4#2");

			try {
				brush.Color = Color.Red;
				Assert.Fail ("P4#3: must throw ArgumentException");
			} catch (Exception e) {
				Assert.IsTrue (e is ArgumentException, "P4#3");
			}

			try {
				brush.Color = SystemColors.AppWorkspace;
				Assert.Fail ("P4#4: must throw ArgumentException");
			} catch (Exception e) {
				Assert.IsTrue (e is ArgumentException, "P4#4");
			}

			try {
				brush.Dispose();
				Assert.Fail ("P4#5: must throw ArgumentException");
			} catch (Exception e) {
				Assert.IsTrue (e is ArgumentException, "P4#5");
			}
		}

org.mariuszgromada.math.mxparser.Argument : PrimitiveElement

Fields :

public static Boolean NO_SYNTAX_ERRORS
public static Boolean SYNTAX_ERROR_OR_STATUS_UNKNOWN
public static Double ARGUMENT_INITIAL_VALUE
public static Int32 NOT_FOUND
public static Int32 FREE_ARGUMENT
public static Int32 DEPENDENT_ARGUMENT
public static Int32 RECURSIVE_ARGUMENT
public static Int32 TYPE_ID
public static String TYPE_DESC
public static Int32 BODY_RUNTIME
public static Int32 BODY_EXTENDED

Constructors :

public Argument(String argumentDefinitionString = , PrimitiveElement[] elements = )
public Argument(String argumentDefinitionString = , Boolean forceDependent = , PrimitiveElement[] elements = )
public Argument(String argumentName = , Double argumentValue = )
public Argument(String argumentName = , ArgumentExtension argumentExtension = )
public Argument(String argumentName = , String argumentExpressionString = , PrimitiveElement[] elements = )

Methods :

public Void setDescription(String description = )
public String getDescription()
public Void setVerboseMode()
public Void setSilentMode()
public Boolean getVerboseMode()
public Boolean getRecursiveMode()
public Double getComputingTime()
public Void setArgumentName(String argumentName = )
public Void setArgumentExpressionString(String argumentExpressionString = )
public String getArgumentName()
public String getArgumentExpressionString()
public Int32 getArgumentType()
public Void setArgumentValue(Double argumentValue = )
public Int32 getArgumentBodyType()
public Boolean checkSyntax()
public String getErrorMessage()
public Double getArgumentValue()
public Void addDefinitions(PrimitiveElement[] elements = )
public Void removeDefinitions(PrimitiveElement[] elements = )
public Void addArguments(Argument[] arguments = )
public Void defineArguments(String[] argumentsNames = )
public Void defineArgument(String argumentName = , Double argumentValue = )
public Int32 getArgumentIndex(String argumentName = )
public Argument getArgument(String argumentName = )
public Argument getArgument(Int32 argumentIndex = )
public Int32 getArgumentsNumber()
public Void removeArguments(String[] argumentsNames = )
public Void removeArguments(Argument[] arguments = )
public Void removeAllArguments()
public Void addConstants(Constant[] constants = )
public Void defineConstant(String constantName = , Double constantValue = )
public Int32 getConstantIndex(String constantName = )
public Constant getConstant(String constantName = )
public Constant getConstant(Int32 constantIndex = )
public Int32 getConstantsNumber()
public Void removeConstants(String[] constantsNames = )
public Void removeConstants(Constant[] constants = )
public Void removeAllConstants()
public Void addFunctions(Function[] functions = )
public Void defineFunction(String functionName = , String functionExpressionString = , String[] argumentsNames = )
public Int32 getFunctionIndex(String functionName = )
public Function getFunction(String functionName = )
public Function getFunction(Int32 functionIndex = )
public Int32 getFunctionsNumber()
public Void removeFunctions(String[] functionsNames = )
public Void removeFunctions(Function[] functions = )
public Void removeAllFunctions()
public Argument clone()
public Int32 getMyTypeId()
public Type GetType()
public String ToString()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()