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())); } }
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())); }
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); }
protected override ScriptBase CloneScript() { return(new RequestScript(m_scriptContext, m_request.ToString(), m_data.Clone())); }
protected override ScriptBase CloneScript() { return(new PlaySoundScript(m_scriptContext, m_filename.Clone(), m_synchronous.Clone(), m_loop.Clone())); }
protected override ScriptBase CloneScript() { return(new CreateTurnScript(m_scriptContext, m_expr.Clone())); }
protected override ScriptBase CloneScript() { return(new WhileScript(m_scriptContext, m_scriptFactory, m_expression.Clone(), (IScript)m_loopScript.Clone())); }
protected override ScriptBase CloneScript() { return(new ListAddScript(m_scriptContext, m_list.Clone(), m_value.Clone())); }
protected override ScriptBase CloneScript() { return(new DoActionScript(m_scriptContext, m_obj.Clone(), m_action.Clone(), m_parameters == null ? null : m_parameters.Clone())); }
protected override ScriptBase CloneScript() { return(new InvokeScript(m_scriptContext, m_script.Clone(), m_parameters == null ? null : m_parameters.Clone())); }
protected override ScriptBase CloneScript() { return(new ShowMenuScript(m_scriptContext, m_scriptFactory, m_caption.Clone(), m_options.Clone(), m_allowCancel.Clone(), (IScript)m_callbackScript.Clone())); }
protected override ScriptBase CloneScript() { return(new DictionaryAddScript(m_scriptContext, m_dictionary.Clone(), m_key.Clone(), m_value.Clone())); }
protected override ScriptBase CloneScript() { return(new InsertScript(m_scriptContext, m_filename.Clone())); }
protected override ScriptBase CloneScript() { return(new RunDelegateScript(m_scriptContext, m_appliesTo.Clone(), m_delegate.Clone(), m_parameters.Parameters)); }
protected override ScriptBase CloneScript() { return(new StartTransactionScript(m_scriptContext, m_command.Clone())); }
protected override ScriptBase CloneScript() { return(new DestroyScript(m_scriptContext, m_expr.Clone())); }
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())); }
protected override ScriptBase CloneScript() { return(new AskScript(m_scriptContext, m_scriptFactory, m_caption.Clone(), (IScript)m_callbackScript.Clone())); }
protected override ScriptBase CloneScript() { return(new SetFieldScript(m_scriptContext, m_obj.Clone(), m_field.Clone(), m_value.Clone())); }