|
Well acording to the microsoft document, the finalize invoke leaves the object hanging around for two GC cycles. Which is inefficient use of resources and extra processing time which should really NOT be required.
I've spent ages trying to figure out if this is the case.
|
|
|
|
|
I think that the garbage collector is smart enough to recognise if it's the Object finalizer that would be called, and skip the call in that case.
I have nothing to back up my theory, though. It's only based on what I would have done myself, and that the MS guys has put quite some work in the GC and missing something that obvious would be rather silly...
---
b { font-weight: normal; }
|
|
|
|
|
As far as I know, your are correct. Garbage collection will call Finalize on ONLY those instances which contain a Finalize in their class. Otherwise, Finalize is NOT called.
Finalize does add some extra overhead to the garbage collector. When a class is constructed which contains a Finalize method, a reference is placed in a special Finalize-related queue. There is also a queue called f-reachable which pertains to finalize as well.
Microsoft's documentation recommends to not use Finalize very often as it takes a large hit to the garbage collection.
Here is an interesting article from the Microsoft site. Perhaps you have already read it. Good information!
http://msdn.microsoft.com/msdnmag/issues/1100/gci[^]
|
|
|
|
|
Hi Guys,
I have a datagrid that, to cut a long story short, has a very expensive paint event that adversly affects responsiveness. Therefore I want to disable the paint event when scrolling with the vertical scrollbar until after the user has released the scrollbar button. I have tried to add event handlers to the vscrollbar (which for some reason is hidden in the editor), but they never seem to fire. Any ideas will be warmly received...
Thanks,
Luke
|
|
|
|
|
Oh, I forgot to mention that I am working on a custom datagrid control, which inherits from the standard dot net 1.1 framework datagrid control. The inherited scroll bar in question is 'VertScrollBar'.
|
|
|
|
|
Try to catch it from WndProc:
<br />
protected override void WndProc(ref Message m)<br />
{<br />
switch (m.Msg)<br />
{<br />
case 0x0115:<br />
break;<br />
}<br />
base.WndProc (ref m);<br />
}<br />
|
|
|
|
|
Thanks Alexander. I also found another way of doing it, using the scrollEventArgs.ScrollEventType argument (never noticed this one before). Removing the scroll event handler when the bar is scrolled using the button resulted in the behaviour I was looking for.
Private Sub VertScrollBar_ScrollHandler(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs)<br />
<br />
Static scrollEventDisabled As Boolean<br />
<br />
If e.Type = ScrollEventType.ThumbTrack Then<br />
scrollEventDisabled = True<br />
RemoveHandler Me.VertScrollBar.Scroll, AddressOf Me.GridVScrolled<br />
Else<br />
If scrollEventDisabled Then<br />
AddHandler Me.VertScrollBar.Scroll, AddressOf Me.GridVScrolled<br />
scrollEventDisabled = False<br />
End If<br />
End If<br />
End Sub
|
|
|
|
|
hello,
i have decompiled a dll and i want to create a dll again is this possible because the decompiled program created several seperates files for example AssemblyInfo.il, Unknown.il, etc
greetings
Gedrain
|
|
|
|
|
Looks like you just specify multiple files on the command-line like for CSC , take a look at this which is where I made my assumption. (I don't have time to check if it works though).
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
I'm no expert, but I've never heard of the ildasm.exe creating more than one .il file. There can be multiple .resources files, and a .res file. But, as far as I know, all you need to supply when recompiling is the .il and .res file names.
ilasm /OUT:Assembly.dll AssemblyInfo.il /RESOURCE:AssemblyInfo.res /DLL
Try this after disassembly, without changing the .il code, and see if the resulting DLL is the same size as the original.
----------
There go my people. I must find out where they are going so I can lead them.
- Alexander Ledru-Rollin
|
|
|
|
|
well i did that and it says this:
Assembled method NET_Dispose_Delegate::.ctor
Assembled method NET_Dispose_Delegate::Invoke
Assembled method NET_Dispose_Delegate::BeginInvoke
Assembled method NET_Dispose_Delegate::EndInvoke
***** FAILURE *****
greetings
Gedrain
|
|
|
|
|
hello
1) how do i create a textbox with the position x:20 and y:150 from code.
2) is there a function to read a specific row and a column from a table
example: read column 4 from row 3
10x
|
|
|
|
|
As for the textBox, assign it a location as a point:
this.TextBox.Location = new System.Drawing.Point(20, 150);
As for reading a column and row, first I'd fill a dataSet with it. Once you've put it in a DataSet then:
string text = dataSet.Tables[0].Rows[3][4].ToString();
//row first, then column
RABB17
"Even in my Dreams I see the flashing of my cursor."
|
|
|
|
|
how can i set access rights to an olap cube in sql server analysis services 2005 using .net c# code? which class do i need?
|
|
|
|
|
I was looking at a tutorial on System.Drawing.Graphics manipulation utilizing GDI+, and I was wondering whether or not it was possible to add an Image.FromFile("C:/full/path/to/file.gif") to a rectangle.
Rectangle rect = new Rectangle(100, 100, 200, 200)
Can a graphics object such as a rectangle be assigned to a image file?
-- modified at 19:19 Saturday 20th May, 2006
|
|
|
|
|
new_phoenix wrote: add an Image.FromFile("C:/full/path/to/file.gif") to a rectangle.
What exactly do you mean. Do you want to resize the image to fit the rectangle or draw a rectangle on the image?
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
No, I would like to show a picture "photo" image in the Rectangle. Most of the functions provided are to draw an ellipse, arc, circle etc.
I would like to take a "picture photograph" and show it in the Rectangle. Is it possible?
|
|
|
|
|
There are several options:
1. To draw the image unscaled but cropped inside the rectangle then use the Graphics.DrawImageUnscaledAndClipped(image, x, y, width, height) method.
2. To draw the image scaled down to the rectangle then use:
Graphics.DrawImage(image, x, y, width, height). <br />
<br />
<hr>You know you're a Land Rover owner when the best route from point A to point B is through the mud.<br />
<br />
Ed
|
|
|
|
|
Thanks, Ed. I will try your suggestions this Memorial Day weekend. I appreciate the input, as I have limited experience with GDI+ functions.
Enjoy your holiday!
New_Phoenix
|
|
|
|
|
If you mean "how to draw image into rectangle" use Graphics.DrawImage function.
Best regards, Alexey.
|
|
|
|
|
No, I would like to show a picture image in the Rectangle. Most of the functions provided are to draw an ellipse, arc, circle etc. I would like to take a picture photograph and show it in the Rectangle. Is it possible?
|
|
|
|
|
Use Graphics.FillRect function with Brush wich uses your image.
Best regards, Alexey.
|
|
|
|
|
Thanks, Alexey. I will try your suggestions this Memorial Day weekend. I appreciate the input, as I have limited experience with GDI+ functions.
Enjoy your holiday!
New_Phoenix
|
|
|
|
|
Does anyone know of any .net controls like the Windows Vista Command Links? A picture can be found here[^] (about a quarter of the way down).
Thank you!
|
|
|
|
|
Can't you just use a Label and handle the mouse events? If you want snazzier graphics effects then you can override the drawing of the label.
Better thought, can't you do this with a LinkLabel control, my impression of the control is simply that the link label control is a copy of the LinkLabel control but has slightly different layout logic and/or rendering styles.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|