Пример #1
0
        private void AddScriptAssembly(ScriptAssembly scriptAssembly)
        {
            ScriptAssemblyViewModel vm = null;

            if (scriptAssembly.Assembly == null)
            {
                if (orphanScriptsAssembly == null)
                {
                    orphanScriptsAssembly = new ScriptAssemblyViewModel(scriptAssembly, this);
                    scriptAssemblies.Add(orphanScriptsAssembly);
                }
                vm = orphanScriptsAssembly;
            }
            else
            {
                vm = new ScriptAssemblyViewModel(scriptAssembly, this);
                scriptAssemblies.Add(vm);
            }

            vm.UpdateScripts();
        }
Пример #2
0
        public ScriptTypeViewModel(string typeName, IEnumerable <ScriptEntry2> scriptEntries, ScriptAssemblyViewModel parent)
        {
            if (typeName == null)
            {
                throw new ArgumentNullException("typeName");
            }

            if (scriptEntries == null)
            {
                throw new ArgumentNullException("scriptEntries");
            }

            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }

            Parent        = parent;
            this.typeName = typeName;

            Methods = scriptEntries.Select(item => new ScriptMethodViewModel(item, this));
        }
Пример #3
0
        private void RemoveScriptAssembly(ScriptAssembly scriptAssembly)
        {
            ScriptAssemblyViewModel foundViewModel = scriptAssemblies.Single(item => string.Compare(item.Url, scriptAssembly.Url, true) == 0);

            scriptAssemblies.Remove(foundViewModel);
        }