Exemplo n.º 1
0
        private void Add(EditableScriptBase script, int? index, bool fromUpdate)
        {
            script.Updated += script_Updated;
            if (index.HasValue)
            {
                m_scripts.Insert(index.Value, script);
            }
            else
            {
                m_scripts.Add(script);
            }

            if (m_underlyingScript == null)
            {
                InitialiseMultiScript(new MultiScript());
            }

            if (!fromUpdate)
            {
                // Add underlying script to multiscript.
                // We don't always want to do this - we might be responding
                // to a multiscript update in the first place so no point adding the same
                // script again!

                m_adding = true;
                m_underlyingScript.Add(script.Script);
                m_adding = false;
            }

            System.Diagnostics.Debug.Assert(m_underlyingScript.Scripts.Count() == m_scripts.Count);
        }
Exemplo n.º 2
0
 private void Add(EditableScriptBase script, bool fromUpdate)
 {
     Add(script, null, fromUpdate);
 }