Exemplo n.º 1
0
        public override object GetParameter(int index)
        {
            switch (index)
            {
            case 0:
                return(AppliesTo == null ? Property : AppliesTo.Save() + "." + Property);

            case 1:
                return(GetValue());

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemplo n.º 2
0
        public override string Save()
        {
            string result;

            if (AppliesTo != null)
            {
                result = AppliesTo.Save() + "." + Property;
            }
            else
            {
                result = Property;
            }

            result += GetEqualsString + GetSaveString();

            return(result);
        }
Exemplo n.º 3
0
        public override string Save(Context c)
        {
            string result = string.Empty;

            if (AppliesTo != null)
            {
                result = string.Format("set({0}, \"{1}\", {2});", AppliesTo.Save(c), Property, GetSaveString(c));
            }
            else
            {
                string varName = Utility.ReplaceReservedVariableNames(Property);
                result  = "var " + varName;
                result += " = " + GetSaveString(c) + ";";
                c.AddLocalVariable(varName);
            }

            return(result);
        }