コード例 #1
0
        private void DefaultValueIncludeActivity(CustomVariable instance)
        {

            bool handled = false;

            if (instance.GetIsCsv())
            {
                if (instance.GetIsListCsv())
                {
                    handled = true;
                    var member = IncludeMember("Set CreatesDictionary to true to assign value", typeof(string),
                        (object sender, MemberChangeArgs args) => { },
                        () => { return null; },


                        null,
                        // Let's put this in the variables list
                        new Attribute[] { new CategoryAttribute("\t") });
                    member.IsReadOnly = true;
                }
            }


            if (!handled)
            {
                Type typeToPass = instance.GetRuntimeType();
                if (typeToPass == null)
                {
                    typeToPass = typeof(string);
                }

                var typeConverter =
                    instance.GetTypeConverter(CurrentElement);

                IncludeMember(
                    "DefaultValue",
                    typeToPass,
                    OnMemberChanged,
                    instance.GetValue,
                    typeConverter,
                    new Attribute[] { new CategoryAttribute("\t") });
            }
            else
            {
                ExcludeMember("DefaultValue");
            }
        }
コード例 #2
0
 public static bool ShouldAssignToCsv(CustomVariable customVariable, string variableToAssign)
 {
     return IsTypeFromCsv(customVariable) && !string.IsNullOrEmpty(variableToAssign) && variableToAssign != "<NULL>" && variableToAssign != "\"\"" && 
         !customVariable.GetIsListCsv();
 }