小编Bon*_*han的帖子

C# Learning for a Beginner : To do a project without having read big concepts

After 3 years working as an IT Support Technician, I decided to change of field and get to Programming.

I am learning C# through the Wrox Beginning Visual C# 2008 book, that I use as guideline.

I have read the whole POO part (inheritance, Polymorphism,....delegates,...). I have started the second part which is Windows Programming (Winforms)

我知道很多人建议做一些有用的应用程序来练习,但是如果我还没有开始像SQL Server,LINQ或网络编程,WPF,WCF这样的概念,我怎么能做一些个人项目....在本书的最后给出了主题.

我只是想找到最好的方法:我应该先完成这本书,然后开始编码,或者我应该在没有阅读热门话题的情况下做一个项目,或直接跳到这些主题.

我不知道你是否明白我的意思,因为英语不是我的第一语言.但如果你不这样做,我可以改进我的解释.

c#

15
推荐指数
3
解决办法
2万
查看次数

有关IEnumerable.GetEnumerator()的错误消息

我收到此错误消息,我无法弄清楚原因!

Error   1   'Exo5Chap12.ShortCollection<T>' does not implement interface member 
'System.Collections.IEnumerable.GetEnumerator()'. 
'Exo5Chap12.ShortCollection<T>.GetEnumerator()' cannot implement 
'System.Collections.IEnumerable.GetEnumerator()' because it does not have the matching 
return type of 'System.Collections.IEnumerator'.    
E:\MyFolders\Dev\c#\Chapter12\Exo5Chap12\Exo5Chap12\exo5.cs 9   18  Exo5Chap12
Run Code Online (Sandbox Code Playgroud)

以下是具有GetEnumerator()实现的代码.怎么了?

 public class ShortCollection<T> : IList<T>
{
    protected Collection<T> innerCollection;
    protected int maxSize = 10;
    public IEnumerator<T> GetEnumerator()
    {
        return (innerCollection as IEnumerator<T>).GetEnumerator();
    }
}
Run Code Online (Sandbox Code Playgroud)

c# ienumerable

8
推荐指数
2
解决办法
9369
查看次数

我们可以在不使用IEnumerable接口的情况下使用GetEnumerator()吗?

我有一个名为Primes的类,这个类实现GetEnumerator()而不实现IEnumerable接口.

public class Primes
{
    private long min;
    private long max;

    public Primes()
        : this(2, 100)
    {
    }

    public IEnumerator GetEnumerator()
    {...}
Run Code Online (Sandbox Code Playgroud)

我不明白.我错过了什么吗?

c# ienumerator

2
推荐指数
1
解决办法
1012
查看次数

Object Class的受保护方法MemberWiseClone()

这可能是一个愚蠢的问题,但我不明白:

我有一个名为Card的课程.我想使用MemberWiseClone()进行浅层克隆.理论卡继承自Object.所以它应该能够使用MemberWiseClone(),即使MWC()受到保护?

我遗失/遗忘了什么吗?

c# clone protected

0
推荐指数
1
解决办法
1489
查看次数

标签 统计

c# ×4

clone ×1

ienumerable ×1

ienumerator ×1

protected ×1