Fix CA1801 build warnings except auto-generated code by SWIG.
Co-authored-by: Youngbok Shin <youngb.shin@samsung.com>
Co-authored-by: woohyun <woo_hyun0705@naver.com>
#if !(NUI_DEBUG_ON)
internal class tlog
{
- internal static void Fatal(string tag, string msg) { }
- internal static void Error(string tag, string msg) { }
+ internal static void Fatal(string tag, string msg) { _ = tag; _ = msg; }
+ internal static void Error(string tag, string msg) { _ = tag; _ = msg; }
}
#endif
internal static Exception GetException(Interop.FrameBroker.ErrorCode err, string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0)
{
- Log.Error(LogTag, memberName + "(" + lineNumber + ") " + message);
+ Log.Error(LogTag, memberName + "@" + filePath + "(" + lineNumber + ") " + message);
switch (err)
{
case Interop.FrameBroker.ErrorCode.InvalidParameter:
internal static Exception GetException(Interop.FrameProvider.ErrorCode err, string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0)
{
- Log.Error(LogTag, memberName + "(" + lineNumber + ") " + message);
+ Log.Error(LogTag, memberName + "@" + filePath + "(" + lineNumber + ") " + message);
switch (err)
{
case Interop.FrameProvider.ErrorCode.InvalidParameter:
return;
//If value is BindingBase, SetBinding
- if (xpe == null && TrySetBinding(xamlelement, property, localName, value, lineInfo, out xpe))
+ if (xpe == null && TrySetBinding(xamlelement, property, value, lineInfo, out xpe))
return;
//Call TrySetProperty first and then TrySetValue to keep the code logic consistent whether it is through xaml or code.
//If we can assign that value to a normal property, let's do it
- if (xpe == null && TrySetProperty(xamlelement, localName, value, lineInfo, serviceProvider, context, out xpe))
+ if (xpe == null && TrySetProperty(xamlelement, localName, value, serviceProvider, context, out xpe))
return;
//If it's a BindableProberty, SetValue
var property = GetBindableProperty(bpOwnerType, localName, lineInfo, false);
//If it's a BindableProberty, GetValue
- if (xpe == null && TryGetValue(xamlElement, property, attached, out value, lineInfo, out xpe, out targetProperty))
+ if (xpe == null && TryGetValue(xamlElement, property, out value, out xpe, out targetProperty))
return value;
//If it's a normal property, get it
- if (xpe == null && TryGetProperty(xamlElement, localName, out value, lineInfo, context, out xpe, out targetProperty))
+ if (xpe == null && TryGetProperty(xamlElement, localName, out value, context, out xpe, out targetProperty))
return value;
xpe = xpe ?? new XamlParseException($"Property {localName} is not found or does not have an accessible getter", lineInfo);
return true;
}
- static bool TrySetBinding(object element, BindableProperty property, string localName, object value, IXmlLineInfo lineInfo, out Exception exception)
+ static bool TrySetBinding(object element, BindableProperty property, object value, IXmlLineInfo lineInfo, out Exception exception)
{
exception = null;
return false;
}
- static bool TryGetValue(object element, BindableProperty property, bool attached, out object value, IXmlLineInfo lineInfo, out Exception exception, out object targetProperty)
+ static bool TryGetValue(object element, BindableProperty property, out object value, out Exception exception, out object targetProperty)
{
exception = null;
value = null;
return true;
}
- static bool TrySetProperty(object element, string localName, object value, IXmlLineInfo lineInfo, XamlServiceProvider serviceProvider, HydrationContext context, out Exception exception)
+ static bool TrySetProperty(object element, string localName, object value, XamlServiceProvider serviceProvider, HydrationContext context, out Exception exception)
{
exception = null;
}
}
- static bool TryGetProperty(object element, string localName, out object value, IXmlLineInfo lineInfo, HydrationContext context, out Exception exception, out object targetProperty)
+ static bool TryGetProperty(object element, string localName, out object value, HydrationContext context, out Exception exception, out object targetProperty)
{
exception = null;
value = null;
var markupString = markupnode.MarkupString;
var node =
- ParseExpression(ref markupString, markupnode.NamespaceResolver, markupnode, markupnode, parentNode) as IElementNode;
+ ParseExpression(ref markupString, markupnode.NamespaceResolver, markupnode) as IElementNode;
if (node != null)
{
((IElementNode)parentNode).Properties[propertyName] = node;
{
}
- INode ParseExpression(ref string expression, IXmlNamespaceResolver nsResolver, IXmlLineInfo xmlLineInfo, INode node,
- INode parentNode)
+ INode ParseExpression(ref string expression, IXmlNamespaceResolver nsResolver, INode node)
{
if (expression.StartsWith("{}", StringComparison.Ordinal))
return new ValueNode(expression.Substring(2), null);
public void Visit(ElementNode node, INode parentNode)
{
- var ns = parentNode == null || IsDataTemplate(node, parentNode) || IsStyle(node, parentNode) || IsVisualStateGroupList(node)
+ var ns = parentNode == null || IsDataTemplate(node, parentNode) || IsStyle(parentNode) || IsVisualStateGroupList(node)
? new NameScope()
: scopes[parentNode];
node.Namescope = ns;
return false;
}
- static bool IsStyle(INode node, INode parentNode)
+ static bool IsStyle(INode parentNode)
{
var pnode = parentNode as ElementNode;
return pnode != null && pnode.XmlType.Name == "Style";
else
value = property.DefaultValue;
- if (!TryConvert(part, ref value, property.ReturnType, true))
+ if (!TryConvert(ref value, property.ReturnType, true))
{
Console.WriteLine("Binding", "{0} can not be converted to type '{1}'", value, property.ReturnType);
return;
{
object value = Binding.GetTargetValue(target.GetValue(property), part.SetterType);
- if (!TryConvert(part, ref value, part.SetterType, false))
+ if (!TryConvert(ref value, part.SetterType, false))
{
Console.WriteLine("Binding", "{0} can not be converted to type '{1}'", value, part.SetterType);
return;
}
static Type[] DecimalTypes = new[] { typeof(float), typeof(decimal), typeof(double) };
- bool TryConvert(BindingExpressionPart part, ref object value, Type convertTo, bool toTarget)
+ bool TryConvert(ref object value, Type convertTo, bool toTarget)
{
if (value == null)
return true;
return iOS;
}
- public static void OpenUri(Uri uri)
- {
- // PlatformServices?.OpenUriAction(uri);
- }
+ // public static void OpenUri(Uri uri)
+ // {
+ // PlatformServices?.OpenUriAction(uri);
+ // }
[EditorBrowsable(EditorBrowsableState.Never)]
public static Assembly[] GetAssemblies()
?? property.DeclaringType.GetRuntimeMethod("Get" + property.PropertyName, new[] { typeof(BindableObject) }) as MemberInfo;
var serviceProvider = new StyleSheetServiceProvider(target, property);
// return value.ConvertTo(property.ReturnType, minforetriever, serviceProvider);
+ // Unused parameter
+ _ = value;
return null;
}
return tcs.Task;
}
- public static void OnContentChanged(BindableObject bindable, object oldValue, object newValue)
- {
- }
-
public static void OnControlTemplateChanged(BindableObject bindable, object oldValue, object newValue)
{
+ // Unused parameter
+ _ = newValue;
+
var self = (IControlTemplated)bindable;
// First make sure any old ContentPresenters are no longer bound up. This MUST be
private void SendViewAddedEventToWindow(IntPtr data)
{
+ // Unused parameter
+ _ = data;
+
NUIApplication.GetDefaultWindow()?.SendViewAdded(this);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public void FeedTouchEvent(object sender, View.TouchEventArgs e, object userData)
{
+ // Unused parameter
+ _ = sender;
+
mUserData = userData;
mTapGestureDetector.Detected -= InternalOnTap;
mLongGestureDetector.Detected -= InternalOnLongPress;
}
internal static void OnChildPropertyChanged(Binding.BindableObject bindable, object oldValue, object newValue)
{
+ // Unused parameters
+ _ = oldValue;
+ _ = newValue;
+
View view = bindable as View;
view?.Layout?.RequestLayout();
}
internal Rectangle(RectangleChangedCallback cb) : this()
{
+ callback = cb;
}
internal Rectangle(RectangleChangedCallback cb, Rectangle other) : this(cb, other.x, other.y, other.width, other.height)
{
object resource = null;
if (Application.Current == null || !((IResourcesProvider)Application.Current).IsResourcesCreated || !Application.Current.XamlResources.TryGetValue(Key, out resource))
- throw new XamlParseException($"StaticResource not found for key {Key}", xmlLineInfo);
+ throw new XamlParseException($"StaticResource not found for key {key}", xmlLineInfo);
return resource;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public XamlFilePathAttribute([CallerFilePath] string filePath = "")
{
+ // Unused parameter
+ _ = filePath;
}
}
}
\ No newline at end of file
internal event EventHandler ParentSet;
- internal static void SetFlowDirectionFromParent(Element child)
- {
- }
-
internal virtual void SetChildInheritedBindingContext(Element child, object context)
{
SetInheritedBindingContext(child, context);