Ejemplo n.º 1
0
        public virtual void Write(Type uiItemType, string actionName, string identification, object[] parameters)
        {
            StringBuilder builder = new StringBuilder(CodeForGettingUIItem(uiItemType, identification));

            builder.Append(".").Append(actionName);
            Class uiItemClass = new Class(uiItemType);
            if (uiItemClass.IsProperty(actionName))
            {
                builder.Append(" = ");
                if (parameters[0] is bool) builder.Append((bool) parameters[0] ? "true" : "false");
                else builder.Append("\"" + parameters[0] + "\"");
            }
            else
            {
                builder.Append("(");
                for (int i = 0; i < parameters.Length; i++)
                {
                    builder.Append("\"").Append(parameters[i]).Append("\"");
                    if (i != parameters.Length - 1) builder.Append(", ");
                }
                builder.Append(")");
            }

            builder.Append(";");
            code = builder.ToString();
        }
Ejemplo n.º 2
0
 public void IsProperty()
 {
     var @class = new Class(typeof(ClassForClassTest));
     Assert.AreEqual(true, @class.IsProperty("StringProperty"));
     Assert.AreEqual(false, @class.IsProperty("ToString"));
 }