Skip to content

Commit

Permalink
SingleAction: change type of Arguments to array
Browse files Browse the repository at this point in the history
  • Loading branch information
d2phap committed Aug 12, 2023
1 parent 6047f43 commit a0698cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions v9/Components/ImageGlass.Base/Actions/SingleAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class SingleAction
/// <summary>
/// Arguments to pass to the <see cref="Executable"/>.
/// </summary>
public object Arguments { get; set; } = string.Empty;
public object?[] Arguments { get; set; } = Array.Empty<object?>();


/// <summary>
Expand All @@ -66,10 +66,10 @@ public SingleAction() { }
/// <summary>
/// Initialize the <see cref="SingleAction"/> instance.
/// </summary>
public SingleAction(string executable = "", string arguments = "", SingleAction? nextAction = null)
public SingleAction(string executable = "", object?[]? arguments = null, SingleAction? nextAction = null)
{
Executable = executable.Trim();
Arguments = arguments.Trim();
Arguments = arguments ?? Array.Empty<object>();
NextAction = nextAction;
}

Expand Down
4 changes: 2 additions & 2 deletions v9/ImageGlass/FrmMain/FrmMain.Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ private void UpdateToolbarItemsState(bool performLayout = true)
{
Toolbar.SuspendLayout();

// Toolbar itoms
// Toolbar buttons
foreach (var item in Toolbar.Items)
{
if (item.GetType() == typeof(ToolStripButton))
Expand Down Expand Up @@ -657,7 +657,7 @@ private void UpdateToolbarItemsState(bool performLayout = true)
// Example: OnClick = new("IG_SetZoomMode", ZoomMode.AutoZoom.ToString())
else if (configProp.PropertyType.IsEnum)
{
tItem.Checked = tagModel.OnClick.Arguments.Equals(propValue.ToString());
tItem.Checked = tagModel.OnClick.Arguments.FirstOrDefault().Equals(propValue.ToString());
}
// Executable is IGMethod
// Example: OnClick = new("IG_ToggleToolbar", false)
Expand Down
4 changes: 1 addition & 3 deletions v9/ImageGlass/FrmMain/FrmMain.IGMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,6 @@ public bool IG_ToggleCheckerboard(bool? visible = null)
/// <summary>
/// Toggles form top most
/// </summary>
/// <param name="enableTopMost"></param>
/// <returns></returns>
public bool IG_ToggleTopMost(bool? enableTopMost = null, bool showInAppMessage = true)
{
enableTopMost ??= !Config.EnableWindowTopMost;
Expand Down Expand Up @@ -2448,7 +2446,7 @@ public bool IG_ToggleFullScreen(bool? enable = null, bool showInAppMessage = tru
// update toolbar items state
UpdateToolbarItemsState();
}


if (showInAppMessage)
{
Expand Down

0 comments on commit a0698cd

Please sign in to comment.