mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Dev/zhaopengwang/test/37733 UI test fancyzones editor (#37769)
* first launch test * add FancyZonesEditorHelper * click monitor test and add FindByAccessibilityId function * add ui initialization tests and add exit scope exe function * add cleanup test function and change file init * add TemplateLayoutsTest and add LayoutTypeEnumExtension.cs and Element class add sendkey function * add UI Initialize Test * add OpenEditLayoutDialog test case and add By type * add LayoutHotkeysTest * add EditLayoutTests and add element drag function * add DeleteLayouTest and change cleanup to base class and change FindByAccessibilityId to By.AccessibilityId * add DefaultLayoutsTest * add CustomLayoutsTest * add CreateLayoutTest * add CopyLayoutTest * add ApplyLayoutTest * add some cleanup code * fix spelling error * fix DeleteLayoutWithHotkey test code bug * change code * fix restart exe some bug * move first lunch text code to new file * test write file error * fix test code init fancyzone file error * test maxsize button * get current window size * change layout count * change test case work windows size * change fancyzone editor window size * change fancyzone editor window size and change element move rule * change window size --------- Co-authored-by: Zhaopeng Wang <zhaopengwang@microsoft.com>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace FancyZonesEditorCommon.Data
|
||||
{
|
||||
public enum CustomLayout
|
||||
{
|
||||
Canvas,
|
||||
Grid,
|
||||
}
|
||||
|
||||
public static class CustomLayoutEnumExtension
|
||||
{
|
||||
private const string CanvasJsonTag = "canvas";
|
||||
private const string GridJsonTag = "grid";
|
||||
|
||||
public static string TypeToString(this CustomLayout value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case CustomLayout.Canvas:
|
||||
return CanvasJsonTag;
|
||||
case CustomLayout.Grid:
|
||||
return GridJsonTag;
|
||||
}
|
||||
|
||||
return CanvasJsonTag;
|
||||
}
|
||||
|
||||
public static CustomLayout TypeFromString(string value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case CanvasJsonTag:
|
||||
return CustomLayout.Canvas;
|
||||
case GridJsonTag:
|
||||
return CustomLayout.Grid;
|
||||
}
|
||||
|
||||
return CustomLayout.Canvas;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user