자바 코드를 C#으로 포팅하고이 코드를 발견했습니다. 클래스 배열을 선언하는 것처럼이 방법을 이식 할 수있는 방법을 모르겠습니다. C#의 내 지식은 C#에서이 동작이 어떻게 달성되는지 파악하기에는 너무 제한적입니다. C#에서이 스텁 선언에 해당하는 것이 있습니까? 어떻게 생겼습니까? 10 개의 객체를 선언했기 때문에 최소로 줄였습니다. 여기에 코드를 보이는 방법은 다음과 같습니다C와 같은 Java 코드는 어떻게 나타 납니까?
public interface IcodecWeightFunctionStub
{
void hcodec_weight_func(int[] block, int block_offset, int stride, int log2_denom, int weight, int offset);
}
public interface IHcodecBiWeightFunctionStub
{
void hcodec_biweight_func(int[] dst, int dst_offset, int[] src, int src_offset, int stride, int log2_denom, int weightd, int weights, int offset);
}
public IHcodecWeightFunctionStub[] weight_hcodec_pixels_tab = new IHcodecWeightFunctionStub[] {
new IHcodecWeightFunctionStub() {
public void hcodec_weight_func(int []block, int block_offset, int stride, int log2_denom, int weight, int offset) {
weight_hcodec_pixels_c(16, 16, block, block_offset, stride, log2_denom, weight, offset);
}
},
new IHcodecWeightFunctionStub() {
public void hcodec_weight_func(int []block, int block_offset, int stride, int log2_denom, int weight, int offset) {
weight_hcodec_pixels_c(16, 8, block, block_offset, stride, log2_denom, weight, offset);
}
}
};
문제는 C#에서 인터페이스의 인스턴스에 대한 것이 아니라 C#으로 새로운 클래스를 반환에 대한 자세한.
복사, 비주얼 스튜디오에 붙여 넣습니다 당신을주는 무슨 오류 및 위글 라인을 참조하십시오
다음 C# 코드는 동일합니다. –
그것이 내가있는 곳입니다. 오류는'Expected class, delegate, enum, interface, or struct'입니다. 나는 그것을'행동'으로 바꾸려고 노력할 것이다. 아마도. –