Skip to content

Commit 8720859

Browse files
authored
Added DRT Window (dotnet#2)
* Added DRT Window : Testing Window Styling, Icon, parenting and Close related events
1 parent 6522765 commit 8720859

File tree

9 files changed

+538
-1
lines changed

9 files changed

+538
-1
lines changed

Microsoft.DotNet.Wpf.Test.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.28516.95
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DrtHwndSource", "src\Test\ElementServices\DRT\HwndSource\DrtHwndSource.csproj", "{3804427A-DA5F-44B7-B1A2-54C620EAF686}"
77
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DrtWindow", "src\Test\AppModel\DRT\Window\Window\DrtWindow.csproj", "{44307102-D75F-43F4-9A44-37CDC45E5E36}"
9+
EndProject
810
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommonData", "src\Test\BranchCommon\data\CommonData.csproj", "{D5F8FF19-BE50-49D3-9343-EEF2182611B7}"
911
EndProject
1012
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestServices", "src\Test\Common\DRT\TestServices\TestServices.csproj", "{12B6B1C0-A834-4223-B5F4-5813F2D73FAA}"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<Project>
2+
<Import Condition="Exists('../Directory.Build.props')" Project="../Directory.Build.props" />
3+
<Import Condition="Exists('$(WpfTestBasePath)/DRT.Build.props')" Project="$(WpfTestBasePath)/DRT.Build.props" />
4+
</Project>
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
6+
using System.IO;
7+
8+
using System.Windows;
9+
10+
11+
namespace DRT
12+
{
13+
public class Logger
14+
{
15+
protected string DrtName
16+
{
17+
get{ return _drtName;}
18+
}
19+
20+
protected string Contact
21+
{
22+
get { return _contact; }
23+
}
24+
25+
protected string Title
26+
{
27+
get { return _title; }
28+
}
29+
30+
public Logger(string drtName, string contact, string title)
31+
{
32+
_drtName = drtName;
33+
_contact = contact;
34+
_title = title;
35+
36+
_logFile = System.IO.File.CreateText(DrtName + ".log");
37+
38+
Console.WriteLine("DrtName: {0} -- Owner: [AppModel/{1}]", _drtName, _contact);
39+
_logFile.WriteLine("DrtName: {0} -- Owner: [AppModel/{1}]", _drtName, _contact);
40+
41+
Console.WriteLine("Title: {0}", _title);
42+
_logFile.WriteLine("Title: {0}", _title);
43+
}
44+
45+
public void Log(string message)
46+
{
47+
Console.WriteLine(message);
48+
_logFile.WriteLine(message);
49+
_logFile.Flush();
50+
}
51+
52+
public void Log(string message, params object[] args)
53+
{
54+
Console.WriteLine(message, args);
55+
_logFile.WriteLine(message, args);
56+
_logFile.Flush();
57+
}
58+
59+
public void Log(object obj)
60+
{
61+
Log(obj.ToString());
62+
}
63+
64+
65+
private Logger()
66+
{
67+
}
68+
69+
private string _drtName;
70+
private string _contact;
71+
private string _title;
72+
private StreamWriter _logFile;
73+
}
74+
}
22.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)