mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 10:22:55 +00:00
Fix for C# paramArray and refactor on arguments mismatch
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace CefSharp.Example
|
||||
{
|
||||
@@ -35,5 +36,26 @@ namespace CefSharp.Example
|
||||
EventArrived(eventName, eventData);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Demonstrates the use of params as an argument in a bound object
|
||||
/// </summary>
|
||||
/// <param name="name">Dummy Argument</param>
|
||||
/// <param name="args">Params Argument</param>
|
||||
public void MethodWithParams(string name, params object[] args)
|
||||
{
|
||||
var test = args.ElementAtOrDefault(0);
|
||||
var test2 = args.ElementAtOrDefault(1);
|
||||
}
|
||||
|
||||
public void MethodWithoutParams(string name, string arg2)
|
||||
{
|
||||
var test = arg2;
|
||||
}
|
||||
|
||||
public void methodWithoutAnything()
|
||||
{
|
||||
var test = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user