|
Don't program in .Net.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
1. Just don't care.
2. Create a pool of recyclable bitmaps and manage them on your own.
3. Re-think your design
Remark: GC does the job it was designed for - it recognizes that your collection is not referenced by the program so it is collected. One point I don't understand is this: The collection you are talking about must be a temporary, otherwise it would not be gcollected. In that case, what other behaviour would you expect?
|
|
|
|
|
If i call 'dispose' at the end of use of each bitmap - I releasing the memory and i slow down the GC call - right ?
|
|
|
|
|
No, on the contrary, at least if we are talking about System.Drawing.Bitmap. This one implements IDisposable and allows you to explicitely release the resources and to notify the GC that there is no need to finalize this object.
It depends a lot on the scenario in which you are using it:
If you create a Bitmap and use it in a local scope, use the using syntax:
using (Bitmap tB = new Bitmap(...)) {
}
If you need to keep references to Bitmap object (as you apparently do), then take care that after calling Bitmap.Dispose no reference to that object exists in your program. Assuming your Bitmap container is a Queue<Bitmap> :
using (Bitmap tB = BitmapQueue.Dequeue());
|
|
|
|
|
How can I check file is broken?
I want to get alarm when text file or .sdf (database file) file is broken in specified directory.
How can I check it in C#?
Thanks...
|
|
|
|
|
What do you mean by broken?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
|
You'd need to have something to compare it to; the original, undamaged file then carry out a byte-by-byte comparison. You could create a checksum of the original file and store that then compare that to the checksum of the damaged file. You could also compare file lengths; if they are different then so are the files (obviously). If you don't have the original file to compare to then you might be a bit stuck unless the damage you are looking for is quite specific and testable.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
digital man wrote: If you don't have the original file to compare to then you might be a bit stuck unless the damage you are looking for is quite specific and testable.
That's testing whether the .sdf has changed, compared to the original. It's probably a SqlCE database, and it's checksum would change on every update/delete.
I are Troll
|
|
|
|
|
dataminers wrote: How can I check file is broken?
Define "broken"; a textfile may contain any character, printable or not. Does the textfile have a specific format that you can compare against?
The SqlCe database is somewhat easier to verify, and that's documented over here[^]
I are Troll
|
|
|
|
|
I have print statement in Sql Sp. How can I bind print statement to DropdownList
|
|
|
|
|
hi friends & all seniors,
i have created a user control. i want to add it dynamically to list view. for certain criteria i am saying
for(certain condition)
listview.control.add(object_of_createdUserControl);
If i am using this for flow layout panel it works fine. but this fails for list view.
i dont get any error and all the objects of user control are added to the listview but only the first is displayed.
hope i have stated my problem correctly
Looking forward for your kind response!!
Regards
Samir
|
|
|
|
|
Did you check the Location property of your newly added user controls? Perhaps they are all at the same place, and hence only one of them appears on the screen.
|
|
|
|
|
In general if you want to add multiple controls to a Listview then you need to produce a custom list view control derived from ListView.
Check out this link C# Listview 1.3
|
|
|
|
|
How can I binding of DomainUpDown control to some variable that i hold.
modified on Thursday, August 19, 2010 12:42 AM
|
|
|
|
|
hi
please... i try..... but i dont know java-script......
if someone can help me... i'll be grateful
this:
http://static.peace-love-freedom.net/js-itm/trunk/jsdoc/symbols/src/js-itm.js.html
thank's in advance
|
|
|
|
|
Then start learning.
This code is simply creating a class with some methods, i.e. functions
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
See, Javascript is a client end language that runs in the browser, while C# is the code that runs in the server. Just put all the data you need in JSON format and send it using AJAX to a handler. You can also use hiddenfield or XML or by any means. Now from Server use the handler to parse JSON object and get the data.
Read about AJAX and also start learning the basics of C#.
Abhishek Sur
Don't forget to click "Good Answer" if you like this Solution. Visit My Website-->www.abhisheksur.com
|
|
|
|
|
Google and do some hands-on JavaScript
// ♫ 99 little bugs in the code,
// 99 bugs in the code
// We fix a bug, compile it again
// 101 little bugs in the code ♫
|
|
|
|
|
|
Is it possible to dynamically adding custom attributes to class methods or properties? If so any examples will be appreciated.
|
|
|
|
|
No
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Man, way to crush his dreams
|
|
|
|
|
Try This [^]
I know nothing , I know nothing ...
|
|
|
|
|
This is using codedom to write code dynamically not dynamically adding an attribute to existing code. They are not equal.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Would compiling code at runtime suffice (e.g., creating a new class with methods/properties that have the custom attributes)? That can be done.
|
|
|
|