Click here to Skip to main content
16,004,887 members
Home / Discussions / C#
   

C#

 
AnswerRe: Problem in Filter Grid Pin
Vimalsoft(Pty) Ltd31-Jul-09 0:06
professionalVimalsoft(Pty) Ltd31-Jul-09 0:06 
Questiongive me a code for disable keyboard functions this project............ [modified] Pin
Member 423560130-Jul-09 22:28
Member 423560130-Jul-09 22:28 
AnswerRe: Add to disable keyboard functions this project............ Pin
OriginalGriff30-Jul-09 23:16
mveOriginalGriff30-Jul-09 23:16 
GeneralRe: Add to disable keyboard functions this project............ Pin
Luc Pattyn30-Jul-09 23:36
sitebuilderLuc Pattyn30-Jul-09 23:36 
GeneralRe: Add to disable keyboard functions this project............ Pin
Baeltazor31-Jul-09 7:17
Baeltazor31-Jul-09 7:17 
GeneralRe: Add to disable keyboard functions this project............ Pin
OriginalGriff31-Jul-09 8:12
mveOriginalGriff31-Jul-09 8:12 
GeneralRe: <blockquote class="FQ"><div class="FQA">OriginalGriff wrote:</div>Fraid so...Umpteen[^]</blockquote> Pin
Baeltazor31-Jul-09 10:01
Baeltazor31-Jul-09 10:01 
Questionusing statement Vs Dispose/Finalize pattern Pin
Cracked-Down30-Jul-09 21:28
Cracked-Down30-Jul-09 21:28 
What difference I see between using statement and Dispose/Finalize pattern is

- “Dispose/finalize” have upper hand if any object which implements this pattern and supporting different interfaces for different operations which performed on underneath unmanaged object, can take care of releasing that object even if user forgets to call dispose on that object
- However with “Using” statement, the scope of the using statement will be restricted to a single method, i.e. we will have to open the unmanaged object which will closed automatically by using’s finally block in the same method (which is, in most of the cases will not be feasible and efficient as we don’t do all the operation at a time on the unmanaged objects)

For Example:
1.Dispose/Finalize:
Suppose, we are using MS word COM to write doc files, we dedicate one class to do all the activities related to doc file and provide different interfaces to write to doc file like WriteTest() , InsertTable(), InsertImage(), …and so on . In this situation user will keep calling these interfaces according to their needs, and might forgets to close the word doc object. In this case, we can very well implement Dispose/Finalize pattern where finalize method will be act as back up plan to release unmanaged word doc object.
This approach will be efficient as long as we are using the same unmanaged object.

2.Using statement
Suppose, we are writing to a text file and we have interface to do this operation which takes text data and file name as parameter. In this case we can use “Using” statement to open the file and write data to it (again supposing that we will not any further operation on this file). What Using statement we do is it add try and finally block to this text file call. Which I guess efficient solution.

Hey guys, anybody know other differences other than what I mentioned here

Or you can correct me, If I am wrong in my above made conclusions!!!!

Smile | :)
AnswerRe: using statement Vs Dispose/Finalize pattern Pin
Christian Graus30-Jul-09 22:00
protectorChristian Graus30-Jul-09 22:00 
GeneralRe: using statement Vs Dispose/Finalize pattern Pin
N a v a n e e t h30-Jul-09 22:07
N a v a n e e t h30-Jul-09 22:07 
AnswerRe: using statement Vs Dispose/Finalize pattern Pin
N a v a n e e t h30-Jul-09 22:04
N a v a n e e t h30-Jul-09 22:04 
GeneralRe: using statement Vs Dispose/Finalize pattern Pin
Cracked-Down30-Jul-09 22:59
Cracked-Down30-Jul-09 22:59 
GeneralRe: using statement Vs Dispose/Finalize pattern Pin
Not Active30-Jul-09 23:46
mentorNot Active30-Jul-09 23:46 
GeneralRe: using statement Vs Dispose/Finalize pattern Pin
Cracked-Down30-Jul-09 23:58
Cracked-Down30-Jul-09 23:58 
GeneralRe: using statement Vs Dispose/Finalize pattern Pin
PIEBALDconsult31-Jul-09 4:58
mvePIEBALDconsult31-Jul-09 4:58 
GeneralRe: using statement Vs Dispose/Finalize pattern Pin
N a v a n e e t h31-Jul-09 7:02
N a v a n e e t h31-Jul-09 7:02 
GeneralRe: using statement Vs Dispose/Finalize pattern Pin
Cracked-Down31-Jul-09 19:46
Cracked-Down31-Jul-09 19:46 
QuestionHow to have more than one key and one value in any structure(like hash table) in C#? Pin
akashsthakkar30-Jul-09 20:46
akashsthakkar30-Jul-09 20:46 
AnswerRe: How to have more than one key and one value in any structure(like hash table) in C#? [modified] Pin
dan!sh 30-Jul-09 20:50
professional dan!sh 30-Jul-09 20:50 
AnswerRe: How to have more than one key and one value in any structure(like hash table) in C#? Pin
PIEBALDconsult30-Jul-09 20:59
mvePIEBALDconsult30-Jul-09 20:59 
AnswerRe: How to have more than one key and one value in any structure(like hash table) in C#? Pin
N a v a n e e t h30-Jul-09 22:10
N a v a n e e t h30-Jul-09 22:10 
AnswerRe: How to have more than one key and one value in any structure(like hash table) in C#? Pin
Mirko198030-Jul-09 22:14
Mirko198030-Jul-09 22:14 
QuestionGetting a program to open, search for a line of code, and edit it. Pin
craigchrist823930-Jul-09 20:32
craigchrist823930-Jul-09 20:32 
AnswerRe: Getting a program to open, search for a line of code, and edit it. Pin
dan!sh 30-Jul-09 21:00
professional dan!sh 30-Jul-09 21:00 
GeneralRe: Getting a program to open, search for a line of code, and edit it. Pin
craigchrist823930-Jul-09 21:12
craigchrist823930-Jul-09 21:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.