Exemplo n.º 1
0
        internal void EmbedTerminalInObject(VtNetTerminal vtNetTerminal)
        {
            ManualResetEvent reset = new ManualResetEvent(false);

            var t = Task.Factory.StartNew(() =>
                                          TerminalContainer.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                //UI code here
                var newTerminal  = new VirtualTerminalControl();
                var newPivotItem = new PivotItem {
                    Content = newTerminal
                };
                var headingBinding = new Binding {
                    Source = newTerminal, Path = new Windows.UI.Xaml.PropertyPath("WindowTitle")
                };
                newPivotItem.SetBinding(PivotItem.HeaderProperty, headingBinding);

                TerminalContainer.Items.Add(newPivotItem);

                var result = new VtNetTerminal(newTerminal);

                vtNetTerminal.Terminal = newTerminal;
                lock (Terminals)
                {
                    Terminals.Add(vtNetTerminal);
                }

                reset.Set();
            })
                                          );

            t.Wait();
            reset.WaitOne();
            return;
        }
Exemplo n.º 2
0
 internal static void RegisterTerminal(VtNetTerminal vtNetTerminal)
 {
     Instance.EmbedTerminalInObject(vtNetTerminal);
 }