コード例 #1
0
        private void OnInterpretersChanged(object sender, EventArgs e)
        {
            if (!Dispatcher.CheckAccess())
            {
                Dispatcher.BeginInvoke((Action)(() => OnInterpretersChanged(sender, e)));
                return;
            }
            var existing = Interpreters.Where(iv => iv.Interpreter != null).ToDictionary(iv => iv.Interpreter);
            var def      = _interpreterService.DefaultInterpreter;

            int i = 0;

            foreach (var interp in _interpreterService.Interpreters)
            {
                if (!existing.Remove(interp))
                {
                    Interpreters.Insert(i, new InterpreterView(interp, interp.Description, interp == def));
                }
                i += 1;
            }
            foreach (var kv in existing)
            {
                Interpreters.Remove(kv.Value);
            }
        }
コード例 #2
0
        private void OnInterpretersChanged(object sender, EventArgs e)
        {
            if (!Dispatcher.CheckAccess())
            {
                Dispatcher.BeginInvoke((Action)(() => OnInterpretersChanged(sender, e)));
                return;
            }

            var existing = Interpreters.Where(iv => iv.Interpreter != null).ToDictionary(iv => iv.Interpreter);
            var def      = _project.GetInterpreterFactory();

            int i = 0;

            foreach (var interp in InterpreterView.GetInterpreters(_project.Site, _project).Select(x => x.Interpreter))
            {
                if (!existing.Remove(interp))
                {
                    Interpreters.Insert(i, new InterpreterView(interp, interp.Configuration.FullDescription, interp == def));
                }
                i += 1;
            }
            foreach (var kv in existing)
            {
                Interpreters.Remove(kv.Value);
            }
        }
コード例 #3
0
        public void RemoveInterpreter(int nameId)
        {
            AttributeInterpreterBase removedInterpreter;

            if (!Interpreters.TryGetValue(nameId, out removedInterpreter))
            {
                return;
            }
            Interpreters.Remove(nameId);
            removedInterpreter.OnRemove();
            OnModified(this, removedInterpreter);
            return;
        }
コード例 #4
0
ファイル: TestQuery.cs プロジェクト: thienhaflash/unium
 public void TearDown()
 {
     Interpreters.Remove(typeof(TestObject));
 }