예제 #1
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));
        }
예제 #2
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();
        }
예제 #3
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));
        }
예제 #4
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();
        }
예제 #5
0
        private void RemoveScriptAssembly(ScriptAssembly scriptAssembly)
        {
            ScriptAssemblyViewModel foundViewModel = scriptAssemblies.Single(item => string.Compare(item.Url, scriptAssembly.Url, true) == 0);

            scriptAssemblies.Remove(foundViewModel);
        }