Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 这种不兼容的类型分配怎么可能呢?_C#_Visual Studio 2013 - Fatal编程技术网

C# 这种不兼容的类型分配怎么可能呢?

C# 这种不兼容的类型分配怎么可能呢?,c#,visual-studio-2013,C#,Visual Studio 2013,我正在为VS2013开发一些自定义编辑器。我遇到了以下函数调用: 如何将SnapshotPoint结构参数传递给int参数 跨度的第二个过载为: 快照点可以是整数 隐式地将快照点转换为等于快照点在快照中的位置的整数 很可能是因为SnapshotPoint有一个 像这样: public static implicit operator int(SnapshotPoint s) { return s.SomeProperty; } 因为SnapshotPoint同时实现了so span。S

我正在为VS2013开发一些自定义编辑器。我遇到了以下函数调用:

如何将SnapshotPoint结构参数传递给int参数

跨度的第二个过载为:

快照点可以是整数

隐式地将快照点转换为等于快照点在快照中的位置的整数

很可能是因为SnapshotPoint有一个

像这样:

public static implicit operator int(SnapshotPoint s)
{
    return s.SomeProperty;
}

因为SnapshotPoint同时实现了so span。Start+offset返回另一个SnapshotPoint和。

span的重载构造函数在其第一个参数中接受什么类型?也可能是一个隐式转换运算符。@WordsLikeJared Span.Span如果您能显示一些上下文,例如您在这里谈论的类型以及相关文档的链接,这将非常有用。
public static implicit operator int (
  SnapshotPoint snapshotPoint
)
public static implicit operator int(SnapshotPoint s)
{
    return s.SomeProperty;
}