佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 18100|回复: 234

[挑战自我] 欢迎任何C#疑难杂症(编写完整软件除外)

  [复制链接]
发表于 14-9-2010 01:48 PM | 显示全部楼层 |阅读模式
我将尽所能回答所有问题。 谢谢
回复

使用道具 举报


ADVERTISEMENT

发表于 20-9-2010 12:14 PM | 显示全部楼层
1. 除了 MSDN 的网站, 请问那里能找到Offline 版的 Documentation。
2. Threading 中,假如我有 5 个Thread 在跑, 可能其中几个没用到了, 要怎么关掉?(直接关掉程式会出 Error)。
3.C# OOP 中, Protected, Partial 是做什么用的,什么用处,没用好会带来什么负面影响?
4. 我现在使用 WPF-C# 作为我的 FYP, Reporting 方面除了 Crystal Report 还有什么?
5. Crystal Report怎样 Linq as DataSource?
6. SQL Express, 如果我做好了我的 Project,我的资料库是 Service-Based-Database(.mdf)跟我的Application 一起Intall 在User电脑。 请问是不是User 的电脑要装 SQL Express?
7. 看了很多Pattern Deisgn, 但是不懂要怎么实例使用, n-tier, 现在比较有兴趣 n-tier
有没有例子?你有没有做过这样的 Architecture?

暂时这样, 如果看不明白问题就问清楚我吧。
回复

使用道具 举报

 楼主| 发表于 22-9-2010 04:18 PM | 显示全部楼层
回复 2# 宅男-兜着走

1.我本人很少用offline documentation. 只是用ebook 或 stackoverflow.
2. 直接abort 应该没有问题, 或许,你没有运用 WaitOne.

The protected keyword is a member access modifier. A protected member is accessible from within the class in which it is declared, and from within any class derived from the class that declared this member.

3. 最常见的 protected function 是 dispose().
parent class 可以直接呼叫dispose(), 而derived class只可以呼叫自己的dispose.
这是为了保护(protect) class避免以下情形,  cast derived class 成为 parent class,然后呼叫dispose.  这样做, derived class 会变成不稳定,而且会发生I/O resources 被锁着不放。

partial class. It is possible to split the definition of a class or a struct, or an interface over two or more source files.

如果你可能把你的class其中一个function sub-contract 给别家公司做,你又不想泄漏你class的秘密,你可以考虑用partial class. 现实生活中,非常罕见, 通常我们都用interface. 让别人开发。 所以用处不大。

4。一般binding 没有特别。

5。 是的,无法避免。

6。 最近已经不流行n-tier, 在流行 dependency-injection, MVP, MVC, MVVC之类。
回复

使用道具 举报

 楼主| 发表于 22-9-2010 04:20 PM | 显示全部楼层
本帖最后由 chrizyuen2 于 22-9-2010 04:28 PM 编辑

补充 :目前正玩 dependency inject - unity.
Partial class: When working on large projects, spreading a class over separate files allows multiple programmers to work on it simultaneously.


补充 : MSDN   这句话非常高误导性,现实中无人这样做,因为这样提高了debug 难度, 当我们有MVC,MVP 这些情况很少发生。
回复

使用道具 举报

发表于 23-9-2010 12:37 PM | 显示全部楼层
dependency inject - unity
就是所谓的 Prism, MVVM Architecture, 之前我有放过类似的 帖子, 没人去看。
但是你会发觉 PRISM 有些问题, 现在转换成 MVVM Light 了。

PS: 你的回复, 有些回到是我要的, 有些不是。 Anyway~ 谢谢你。
回复

使用道具 举报

 楼主| 发表于 23-9-2010 01:48 PM | 显示全部楼层
回复 5# 宅男-兜着走

补充:4) 我用dundas graphs.
回复

使用道具 举报

Follow Us
发表于 29-9-2010 09:44 AM | 显示全部楼层
补充 : MSDN   这句话非常高误导性,现实中无人这样做,因为这样提高了debug 难度, 当我们有MVC,MVP 这些情况很少发生。
chrizyuen2 发表于 22-9-2010 04:20 PM


WINFORM的Form.Designer.cs和Form.cs就是用Partial Class 啊!
如果用IDE当然少人用Partial Class. 如果用notepad,就会用到。
回复

使用道具 举报

发表于 29-9-2010 09:46 AM | 显示全部楼层
回复  宅男-兜着走

最近已经不流行n-tier, 在流行 dependency-injection, MVP, MVC, MVVC之类。
chrizyuen2 发表于 22-9-2010 04:18 PM


Winform Desktop App有MVC吗?你是说Web App 吧!
回复

使用道具 举报


ADVERTISEMENT

 楼主| 发表于 29-9-2010 09:53 AM | 显示全部楼层
回复 8# Reader



Partial class winform  也是以下道理。 谢谢补充
如果你可能把你的class其中一个function sub-contract 给别家公司做,你又不想泄漏你class的秘密,你可以考虑用partial class. 现实生活中,非常罕见, 通常我们都用interface. 让别人开发。 所以用处不大。



MVC 只是architecture. 当然,desktop application没有类似 asp.net MVC的官方标准。
在desktop application MVC 存在意义非凡, 尤其现在TDD大行其道。
回复

使用道具 举报

发表于 29-9-2010 10:05 AM | 显示全部楼层
本帖最后由 Reader 于 29-9-2010 10:29 AM 编辑

只用过ASP.net的MVC,不过Winform我还在等官方版的MVC。
MVC看起来不错。

Do you have any example for Winform MVC? mind to Share?
回复

使用道具 举报

 楼主| 发表于 29-9-2010 10:28 AM | 显示全部楼层
官方MVC 在 best practices 以学术性质公布, 而不是以API framework 的方式公布。
Model-View-Controller
http://msdn.microsoft.com/en-us/library/ff649643.aspx
回复

使用道具 举报

发表于 29-9-2010 10:30 AM | 显示全部楼层
回复 11# chrizyuen2


    Thanks for Sharing
回复

使用道具 举报

 楼主| 发表于 29-9-2010 10:39 AM | 显示全部楼层
别客气,互相学习。
因为你, 我才发现原来partial class通常运用在UI上。 高达80% 以上例子都是UI(View)。
回复

使用道具 举报

 楼主| 发表于 4-10-2010 10:20 PM | 显示全部楼层
回复 5# 宅男-兜着走

Creating a Private Installation for SQL Compact
http://www.codeproject.com/KB/database/SQLCEPrivateInstallation.aspx

你要的东西,新鲜热辣刚刚出炉
回复

使用道具 举报

发表于 5-10-2010 12:27 AM | 显示全部楼层
回复  宅男-兜着走

Creating a Private Installation for SQL Compact
http://www.codeproject.com/KB ...
chrizyuen2 发表于 4-10-2010 10:20 PM



    我几时说过我要 SQL CE?
回复

使用道具 举报

发表于 5-10-2010 11:57 AM | 显示全部楼层
回复 14# chrizyuen2

有没有 SQL CE 4.0 的?
回复

使用道具 举报


ADVERTISEMENT

 楼主| 发表于 5-10-2010 12:15 PM | 显示全部楼层
回复  chrizyuen2
有没有 SQL CE 4.0 的?
hooi1983 发表于 5-10-2010 11:57 AM


没有留意到,这不是我专长, 应该帮不上, 对不起。
回复

使用道具 举报

 楼主| 发表于 5-10-2010 05:45 PM | 显示全部楼层
Embedding SQL Server Express into Custom Applications
http://technet.microsoft.com/en-us/library/bb264562(SQL.90).aspx

正巧, 今天我需要用。。。
回复

使用道具 举报

发表于 5-10-2010 06:30 PM | 显示全部楼层
Embedding SQL Server Express into Custom Applications
(SQL.90).aspx

正巧, 今天我需要用。。。 :l ...
chrizyuen2 发表于 5-10-2010 05:45 PM


教教下, 我还不会 Install SQL Instance。
来个教程。
回复

使用道具 举报

 楼主| 发表于 5-10-2010 07:53 PM | 显示全部楼层
三天。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 11-10-2025 04:09 PM , Processed in 0.719150 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表