Skip to content

Commit

Permalink
Updated to new Visual Studio 2019 Preview
Browse files Browse the repository at this point in the history
  • Loading branch information
mavaddat committed Mar 7, 2020
1 parent e882577 commit 5dd4cfc
Show file tree
Hide file tree
Showing 1,128 changed files with 296,294 additions and 2,756 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@
################################################################################

/1x
*.suo
/.vs
*.pfx
*.cache
*.ai
/PowerShell.svg
11 changes: 11 additions & 0 deletions Backup/WASP/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
//
// To add a suppression to this file, right-click the message in the
// Error List, point to "Suppress Message(s)", and click
// "In Project Suppression File".
// You do not need to add suppressions to this file manually.

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1014:MarkAssembliesWithClsCompliant")]
61 changes: 61 additions & 0 deletions Backup/WASP/Interop/AutomationElementCmdletBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright (c) 2007 Joel Bennett
// This File is license under the Ms Reciprocal License

// Copyright Grant- Subject to the terms of this license, each contributor grants you
// a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution,
// prepare derivative works of its contribution, and distribute its contribution or any
// derivative works that you create.

// Conditions and Limitations

// Reciprocal Grants- For any file you distribute that contains code from the software
// (in source code or binary format), you must provide recipients the source code to that
// file along with a copy of this license, which license will govern that file. You may
// license other files that are entirely your own work and do not contain code from the
// software under any terms you choose.

// *****************************************************************************
// NOTE: For current and complete licensing information please see:
// http://www.codeplex.com/WASP/Project/License.aspx
//

using System.Management.Automation;
using System.Runtime.InteropServices;
using System.Windows.Automation;

namespace Huddled.Wasp
{
//[Cmdlet(VerbsDiagnostic.Test, "Window")]
[Cmdlet("Nothing", "Window", DefaultParameterSetName = "Default", SupportsShouldProcess = true)]
public abstract class AutomationElementCmdletBase : Cmdlet
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
[Parameter(Position = 100, Mandatory = true,
ValueFromPipeline = true, ValueFromPipelineByPropertyName = true,
HelpMessage = "A list of AutomationElements for this cmdlet to act on.")]
[Alias("Element")]
public AutomationElement[] Window { get; set; }

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Passthru")]
[Parameter]
public SwitchParameter Passthru { get; set; }

public abstract void ProcessAutomationElement(AutomationElement element);

protected override void ProcessRecord()
{
foreach (AutomationElement w in Window)
{
if (ShouldProcess(w.ToString()))
{
ProcessAutomationElement(w);
}

if (Passthru.IsPresent && Passthru.ToBool())
{
WriteObject(w);
}
}
}
}
}
Loading

0 comments on commit 5dd4cfc

Please sign in to comment.