예제 #1
0
 public override object GetVariable(string name)
 {
     if (GetContext.ContainsKey(name))
     {
         return(SPCoderForm.ScriptStateCSharp.GetVariable(name));
     }
     return(null);
 }
예제 #2
0
        public override void AddOrUpdateItem(ContextItem item)
        {
            bool alreadyExistsInContext = GetContext.ContainsKey(item.Name);

            base.AddOrUpdateItem(item);
            DataHolder = item.Data;
            string script = "";

            if (alreadyExistsInContext)
            {
                //
                script = item.Name + " = (" + item.Data.GetType().FullName + ")DataHolder;";
            }
            else
            {
                script = item.Data.GetType().FullName + " " + item.Name + " = (" + item.Data.GetType().FullName + ") DataHolder;";
            }

            SPCoderForm.ScriptStateCSharp = SPCoderForm.ScriptStateCSharp.ContinueWithAsync(script).Result;
        }