为什么会出现在我的抽象基类此编译错误? [英] Why am I getting this compilation error in my abstract base class?

查看:287
本文介绍了为什么会出现在我的抽象基类此编译错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想延长这个插件是我自己用...

I'm trying to extend this plugin for my own use...

https://github.com/jamesmontemagno/Xamarin.Plugins/blob/master/Connectivity/Connectivity/Connectivity.Plugin.Abstractions/BaseConnectivity的.cs

但是,当我到Visual Studio中的代码复制,我我收到的一些错误。

But when I copy the code over to Visual Studio, I'm am getting some error.

我是否需要输入一些特殊的框架,以使用' =>'运算符和调用方法?这是一个抽象基类。我使用VS2013

Do I need to import some special framework in order to use the '=>' operator and 'Invoke' Method? This is an abstract base class. I am using VS2013

推荐答案

?从C#6,和以及(用于表达健全成员时)=>操作符功能,仅在Visual Studio中2015年之前。

?. is a feature from C# 6, and as well as the => operator (when used for expression-bodied members), is available in Visual Studio 2015 only.

阅读有关他们在这里空条件运算符这里 =>运算符

Read about them here null-conditional operators and here => operator

C#< 6语法:

C# < 6 syntax:

protected virtual void OnConnectivityChanged(ConnectivityChangedEventArgs e)
{
    if (ConnectivityChanged != null)
        ConnectivityChanged.Invoke(this, e);
}

这篇关于为什么会出现在我的抽象基类此编译错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆