-2

我对 C# 和 Java 非常熟悉,因为我编写了一些没有 gui 的研究项目。我现在需要构建一个带有图形用户界面和所有标准东西的项目,这意味着本地化、版本控制、配置等。我已经开始单独学习每个方面,但我找到了一个很好的示例开源项目,它拥有所有需要的东西功能(以 xml 格式保存、报告等)。我正在深入研究代码,但我对所有自动生成的代码感到沮丧,我无法过滤掉有用的信息。我从哪里开始?似乎从一开始就更容易开始清理,但是有没有办法了解示例项目是如何构建的?我可以添加断点并提取一些关键功能,但我不确定何时通过其他方式自动生成代码。我想了解该示例项目是如何组合在一起的。有没有办法从成品中理解它,我从哪里开始?这个示例项目对我如何构建具有类似功能的自己的 gui 有任何用处吗?我使用视觉工作室 IDE。

4

2 回答 2

1

谢谢您的回答。由于很难提取有关如何设置示例项目的 GUI 的信息,因此我总结了以下过程:

  1. 通过从示例项目中获取想法来完成我的要求。
  2. 搜索有关如何设置每个方面的信息(本地化、配置等)。
  3. 我可能会找到不止一种方法来实现每个方面,所以我会选择最适合我的方法。
  4. 识别我的 GUI 设置方法是否类似于示例项目,以了解更多信息。

通过逐行调试来了解示例项目的特殊功能是如何实现的。我希望我可以从中学习 GUI 方面的知识,例如本地化。但似乎我首先需要学习如何使用 VS 实现本地化,然后将其与示例项目进行比较。我很抱歉标题,它可能具有误导性。

于 2013-10-20T08:36:56.350 回答
0

I can give you some tips from my own experience dealing with a big project, which has millions of lines of code.

  • First, see and try to understand the project architecture, which layers it has, UI, Entity Framework, etc... If you have DB then see the diagram of the tables and try to understand which entities you have, the relations between them, the properties. You can write for yourself a short diagram with the main entities.
  • Then you can run the project so you can see what it does, if you have a specification document than first, read it (skimming).
  • Then you can see your code, read notes (if exists), read the names of the functions, members, etc... Try to understand a little bit what each function does and who calls it - you can use F12 keyboard or Shift + F12 to see the code usages.
  • Next step, going dipper, run your project and debug it, this is the best to learn a code, so debug it a lot. Try to understand why each method is called, note also the layer the methods are, for example you debug a code in the UI Layer which calls to a method in the BL (Buisness Logic) layer, so you can understand that it accesses from the client side to the server side.
  • If there are some methods that you don't understand, then you can remove some lines or change them and to see the effect when you run the code.
  • Don't forget - sometimes the codes are wrong, so always be suspicious.

This may take some time, but if you do those steps then finally you will get it.

Goodluck :)

于 2013-10-19T13:47:19.020 回答