Esempio n. 1
0
 protected override ScriptBase CloneScript()
 {
     if (m_type == null)
     {
         return(new CreateScript(m_scriptContext, m_expr.Clone()));
     }
     else
     {
         return(new CreateScript(m_scriptContext, m_expr.Clone(), m_type.Clone()));
     }
 }
Esempio n. 2
0
 protected override ScriptBase CloneScript()
 {
     if (m_initialType == null)
     {
         return(new CreateExitScript(m_scriptContext, m_name.Clone(), m_from.Clone(), m_to.Clone()));
     }
     if (m_id == null)
     {
         return(new CreateExitScript(m_scriptContext, m_name.Clone(), m_from.Clone(), m_to.Clone(), m_initialType.Clone()));
     }
     return(new CreateExitScript(m_scriptContext, m_name.Clone(), m_from.Clone(), m_to.Clone(), m_initialType.Clone(), m_id.Clone()));
 }
Esempio n. 3
0
        public static IFunction CopyToStore(this IFunction function, IFunctionStore store)
        {
            if (function.Parent == null)
            {
                var clone = (IFunction)function.Clone();

                FixFixedSize(clone);

                store.Functions.Add(clone);
                return(clone);
            }

            var variables      = function.Arguments.Concat(function.Components).ToList();
            var variableValues = new List <IMultiDimensionalArray>();

            //copy values of all variables into temp array (write them as soon as first Flush() or first SetValues() occurs).
            foreach (var variable in variables)
            {
                variableValues.Add(variable.Values);
            }

            IFunction topParent = function.Parent;

            while (topParent.Parent != null)
            {
                topParent = topParent.Parent;
            }
            var detachedFunction = (IFunction)topParent.Clone(false); //can only clone unfiltered function

            var detachedVariables = detachedFunction.Arguments.Concat(detachedFunction.Components).ToList();

            for (int i = 0; i < variableValues.Count; i++)
            {
                var values = variableValues[i];
                detachedVariables[i].FixedSize = values.Count;
            }

            store.Functions.Add(detachedFunction);

            // copy temp values back to netCdf
            for (int i = 0; i < variableValues.Count; i++)
            {
                var values = variableValues[i];
                if (values.Count > 0)
                {
                    var detachedVariable = detachedVariables[i];
                    detachedVariable.SetValues(values);
                }
            }

            return(detachedFunction);
        }
Esempio n. 4
0
 protected override ScriptBase CloneScript()
 {
     return(new RequestScript(m_scriptContext, m_request.ToString(), m_data.Clone()));
 }
Esempio n. 5
0
 protected override ScriptBase CloneScript()
 {
     return(new PlaySoundScript(m_scriptContext, m_filename.Clone(), m_synchronous.Clone(), m_loop.Clone()));
 }
Esempio n. 6
0
 protected override ScriptBase CloneScript()
 {
     return(new CreateTurnScript(m_scriptContext, m_expr.Clone()));
 }
Esempio n. 7
0
 protected override ScriptBase CloneScript()
 {
     return(new WhileScript(m_scriptContext, m_scriptFactory, m_expression.Clone(), (IScript)m_loopScript.Clone()));
 }
Esempio n. 8
0
 protected override ScriptBase CloneScript()
 {
     return(new ListAddScript(m_scriptContext, m_list.Clone(), m_value.Clone()));
 }
Esempio n. 9
0
 protected override ScriptBase CloneScript()
 {
     return(new DoActionScript(m_scriptContext, m_obj.Clone(), m_action.Clone(), m_parameters == null ? null : m_parameters.Clone()));
 }
Esempio n. 10
0
 protected override ScriptBase CloneScript()
 {
     return(new InvokeScript(m_scriptContext, m_script.Clone(), m_parameters == null ? null : m_parameters.Clone()));
 }
Esempio n. 11
0
 protected override ScriptBase CloneScript()
 {
     return(new ShowMenuScript(m_scriptContext, m_scriptFactory, m_caption.Clone(), m_options.Clone(), m_allowCancel.Clone(), (IScript)m_callbackScript.Clone()));
 }
Esempio n. 12
0
 protected override ScriptBase CloneScript()
 {
     return(new DictionaryAddScript(m_scriptContext, m_dictionary.Clone(), m_key.Clone(), m_value.Clone()));
 }
Esempio n. 13
0
 protected override ScriptBase CloneScript()
 {
     return(new InsertScript(m_scriptContext, m_filename.Clone()));
 }
Esempio n. 14
0
 protected override ScriptBase CloneScript()
 {
     return(new RunDelegateScript(m_scriptContext, m_appliesTo.Clone(), m_delegate.Clone(), m_parameters.Parameters));
 }
Esempio n. 15
0
 protected override ScriptBase CloneScript()
 {
     return(new StartTransactionScript(m_scriptContext, m_command.Clone()));
 }
Esempio n. 16
0
 protected override ScriptBase CloneScript()
 {
     return(new DestroyScript(m_scriptContext, m_expr.Clone()));
 }
Esempio n. 17
0
 protected override ScriptBase CloneScript()
 {
     return(new ForScript(m_scriptContext, m_scriptFactory, m_variable, m_from.Clone(), m_to.Clone(), m_step == null ? null : m_step.Clone(), (IScript)m_loopScript.Clone()));
 }
Esempio n. 18
0
 protected override ScriptBase CloneScript()
 {
     return(new AskScript(m_scriptContext, m_scriptFactory, m_caption.Clone(), (IScript)m_callbackScript.Clone()));
 }
Esempio n. 19
0
 protected override ScriptBase CloneScript()
 {
     return(new SetFieldScript(m_scriptContext, m_obj.Clone(), m_field.Clone(), m_value.Clone()));
 }