Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b4e6ada
add GraphicalHost
SteveL-MSFT Apr 21, 2019
a7283b4
update copyright notice, move files to folder with namespace name not…
SteveL-MSFT Apr 21, 2019
bbdf1eb
fix path names to resources
SteveL-MSFT Apr 22, 2019
2f10f5e
enable generation of public resources needed by show-command
SteveL-MSFT Apr 24, 2019
710918a
remove timeout for ogv window
SteveL-MSFT Apr 24, 2019
ed9ff12
fix some style issues
SteveL-MSFT Apr 24, 2019
a457c4f
remove reference to workflow
SteveL-MSFT Aug 4, 2019
e559a8c
add attribute indicating where the resource dictionary is located
SteveL-MSFT Oct 25, 2019
b61795c
fix show-command by removing workflow type and added back -showwindow…
SteveL-MSFT Oct 25, 2019
87c48e9
fix CodeFactor style issues
SteveL-MSFT Oct 25, 2019
d2ce8a7
fix default commands test
SteveL-MSFT Oct 25, 2019
30a4c97
codefactor: space after `if` and remove multiple newlines
SteveL-MSFT Oct 25, 2019
a3f413a
more codefactor fixes and ConfirmImpact test fix
SteveL-MSFT Oct 26, 2019
8d1d13e
more codefactor fixes
SteveL-MSFT Oct 26, 2019
c9a149b
files.wxs update, more codefactor fixes
SteveL-MSFT Oct 26, 2019
425d3f9
fix win-arm build
SteveL-MSFT Oct 26, 2019
43de95c
codefactor fixes
SteveL-MSFT Oct 26, 2019
3f2add5
sort using directives
SteveL-MSFT Oct 26, 2019
4b9510c
add copyright header
SteveL-MSFT Oct 26, 2019
df23970
update fwlink
SteveL-MSFT Oct 29, 2019
5f34e80
update help test
SteveL-MSFT Oct 29, 2019
60dd857
update show-command fwlink
SteveL-MSFT Oct 29, 2019
b619630
Merge branch 'master' of github.com:PowerShell/PowerShell into graphi…
SteveL-MSFT Oct 31, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions assets/files.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -3065,6 +3065,15 @@
<Component Id="cmpEC42F4F98D70437BB0E290A0E0FE1775" Guid="{5483092a-12c2-4e6c-b730-be491b8909c0}">
Comment thread
SteveL-MSFT marked this conversation as resolved.
Comment thread
SteveL-MSFT marked this conversation as resolved.
Comment thread
SteveL-MSFT marked this conversation as resolved.
<File Id="filBE60A48C75214B7B810D695039AC47B5" KeyPath="yes" Source="$(env.ProductSourcePath)\mscordaccore_$(var.FileArchitecture)_$(var.FileArchitecture)_4.700.19.50403.dll" />
</Component>
<Component Id="cmp73A4CC8E2C9E4594A3D8258C9E00D7E6" Guid="{0aba3675-b1b5-4464-b8ed-937d3b9ea9ed}">
<File Id="fil8DBDCAE679714880A535D26FFE95A8F9" KeyPath="yes" Source="$(env.ProductSourcePath)\Microsoft.PowerShell.GraphicalHost.dll.config" />
</Component>
<Component Id="cmpAC984FA3A67247BC996F60290C87D0A1" Guid="{4ecc767e-b16c-45b8-8011-cc7374fccd5d}">
<File Id="fil1B9348FB24ED43DBAF5D977C7342C2B6" KeyPath="yes" Source="$(env.ProductSourcePath)\Microsoft.PowerShell.GraphicalHost.dll" />
</Component>
<Component Id="cmp2E32A6E773F543F0A150B972F8D3E23A" Guid="{a43d0117-1193-4316-a0f6-fef892870f38}">
<File Id="fil66411B8941CA492E93BF262EA72C6BE6" KeyPath="yes" Source="$(env.ProductSourcePath)\Microsoft.PowerShell.GraphicalHost.xml" />
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
Expand Down Expand Up @@ -3907,6 +3916,9 @@
<ComponentRef Id="cmp859A3876902946E7B5B4965F90664C5D" />
<ComponentRef Id="cmpEC42F4F98D70437BB0E290A0E0FE1775" />
<ComponentRef Id="cmpF1B0E6DCC3BD4797B206C879EF270062" />
<ComponentRef Id="cmp73A4CC8E2C9E4594A3D8258C9E00D7E6" />
<ComponentRef Id="cmpAC984FA3A67247BC996F60290C87D0A1" />
<ComponentRef Id="cmp2E32A6E773F543F0A150B972F8D3E23A" />
</ComponentGroup>
</Fragment>
</Wix>
3 changes: 2 additions & 1 deletion build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2210,7 +2210,7 @@ function Start-CrossGen {
$crossGenRequiredAssemblies = @("mscorlib.dll", "System.Private.CoreLib.dll")
Comment thread
SteveL-MSFT marked this conversation as resolved.
Comment thread
SteveL-MSFT marked this conversation as resolved.
Comment thread
SteveL-MSFT marked this conversation as resolved.

$crossGenRequiredAssemblies += if ($Environment.IsWindows) {
"clrjit.dll"
"clrjit.dll"
} elseif ($Environment.IsLinux) {
"libclrjit.so"
} elseif ($Environment.IsMacOS) {
Expand Down Expand Up @@ -2269,6 +2269,7 @@ function Start-CrossGen {
"Microsoft.WSMan.Management.dll",
"Microsoft.WSMan.Runtime.dll",
"Microsoft.PowerShell.Commands.Diagnostics.dll",
"Microsoft.PowerShell.GraphicalHost.dll",
"Microsoft.Management.Infrastructure.CimCmdlets.dll"
)
}
Expand Down
71 changes: 71 additions & 0 deletions src/Microsoft.Management.UI.Internal/CommonHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Windows;

// Specifies the location in which theme dictionaries are stored for types in an assembly.
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]

namespace Microsoft.Management.UI
{
/// <summary>
/// Utilities in common in this assembly
/// </summary>
internal static class CommonHelper
{
/// <summary>
/// Restore the values from the settings to the actual window position, size and state.
/// </summary>
/// <param name="target">the window we are setting position and size of</param>
/// <param name="userSettingTop">the value for top from the user settings</param>
/// <param name="userSettingLeft">the value for left from the user settings</param>
/// <param name="userSettingWidth">the value for width from the user settings</param>
/// <param name="userSettingHeight">the value for height from the user settings</param>
/// <param name="defaultWidth">the with used if <paramref name="userSettingWidth"/> is not valid</param>
/// <param name="defaultHeight">the height used if <paramref name="userSettingHeight"/> is not valid</param>
/// <param name="userSettingMaximized">true if the window is maximized in the user setting</param>
internal static void SetStartingPositionAndSize(Window target, double userSettingTop, double userSettingLeft, double userSettingWidth, double userSettingHeight, double defaultWidth, double defaultHeight, bool userSettingMaximized)
{
bool leftInvalid = userSettingLeft < System.Windows.SystemParameters.VirtualScreenLeft ||
userSettingWidth > System.Windows.SystemParameters.VirtualScreenLeft +
System.Windows.SystemParameters.VirtualScreenWidth;

bool topInvalid = userSettingTop < System.Windows.SystemParameters.VirtualScreenTop ||
userSettingTop > System.Windows.SystemParameters.VirtualScreenTop +
System.Windows.SystemParameters.VirtualScreenHeight;

bool widthInvalid = userSettingWidth < 0 ||
userSettingWidth > System.Windows.SystemParameters.VirtualScreenWidth;

bool heightInvalid = userSettingHeight < 0 ||
userSettingHeight > System.Windows.SystemParameters.VirtualScreenHeight;

if (leftInvalid || topInvalid)
{
target.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
}
else
{
target.Left = userSettingLeft;
target.Top = userSettingTop;
}

// If any saved coordinate is invalid, we set the window to the default position
if (widthInvalid || heightInvalid)
{
target.Width = defaultWidth;
target.Height = defaultHeight;
}
else
{
target.Width = userSettingWidth;
target.Height = userSettingHeight;
}

if (userSettingMaximized)
{
target.WindowState = WindowState.Maximized;
}
}
}
}
Loading