mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-12 08:40:37 -06:00
When I added these macros in #11619, the real purpose was to make sure we don't forget to add new settings to these test mocks as well. However, I totally forgot to convert those. I guess that happens with a 1300 line diff ¯\\\_(ツ)_/¯ * [x] Is a codehealth thing * [x] I work here * [x] tests still pass
62 lines
2.2 KiB
C++
62 lines
2.2 KiB
C++
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
#include "pch.h"
|
|
#include "MyPage.h"
|
|
#include <LibraryResources.h>
|
|
#include "MyPage.g.cpp"
|
|
#include "MySettings.h"
|
|
|
|
using namespace std::chrono_literals;
|
|
using namespace winrt::Microsoft::Terminal;
|
|
|
|
namespace winrt
|
|
{
|
|
namespace MUX = Microsoft::UI::Xaml;
|
|
namespace WUX = Windows::UI::Xaml;
|
|
using IInspectable = Windows::Foundation::IInspectable;
|
|
}
|
|
|
|
namespace winrt::SampleApp::implementation
|
|
{
|
|
MyPage::MyPage()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
void MyPage::Create()
|
|
{
|
|
auto settings = winrt::make_self<implementation::MySettings>();
|
|
|
|
auto connectionSettings{ TerminalConnection::ConptyConnection::CreateSettings(L"cmd.exe /k echo This TermControl is hosted in-proc...",
|
|
winrt::hstring{},
|
|
L"",
|
|
nullptr,
|
|
32,
|
|
80,
|
|
winrt::guid()) };
|
|
|
|
// "Microsoft.Terminal.TerminalConnection.ConptyConnection"
|
|
winrt::hstring myClass{ winrt::name_of<TerminalConnection::ConptyConnection>() };
|
|
TerminalConnection::ConnectionInformation connectInfo{ myClass, connectionSettings };
|
|
|
|
TerminalConnection::ITerminalConnection conn{ TerminalConnection::ConnectionInformation::CreateConnection(connectInfo) };
|
|
Control::TermControl control{ *settings, *settings, conn };
|
|
|
|
InProcContent().Children().Append(control);
|
|
}
|
|
|
|
// Method Description:
|
|
// - Gets the title of the currently focused terminal control. If there
|
|
// isn't a control selected for any reason, returns "Windows Terminal"
|
|
// Arguments:
|
|
// - <none>
|
|
// Return Value:
|
|
// - the title of the focused control if there is one, else "Windows Terminal"
|
|
hstring MyPage::Title()
|
|
{
|
|
return { L"Sample Application" };
|
|
}
|
|
|
|
}
|