If object A listens to an event from object B, object B will keep object A alive.
Is there a standard implementation of weak events that would prevent this?
I know WPF has some mechanism but I am looking for something not tied to WPF.
I am guessing the solution should use weak references somewhere.
...
I'm trying to create an online search for a particular set of literature/quotes/etc from a spiritual organization,
and while the number of items (mostly PDF, HTML, or plain text) that can be searched is limited,
I wanted to provide comprehensive search filters (Kayak.com style).
That means my data will need to be organized in such a ...
Problem: I have a WinForms control ('MyControl') with a dependency on myCli.dll, a dll written in C++ CLI. This component is third party (written by another team). myCli.dll has a dependency on myLibrary.dll which is written by yet another party. The control lives in myAssembly.dll, which is a C# controls and resources library.
I had...
Hi I am trying to return a collection which may potentially have null date values.
However, if they are null - I want to keep them that way and not just use a arbitrary date instead.
If it was a string, I'd check for nulls like thus:
calEventDTO.occurrenceType = dr.IsDBNull(10) ? null : dr.GetString(10);
How would I do the same for a...
I am setting up a DataGridViewComboBoxColumn like this:
var newColumn = new DataGridViewComboBoxColumn() {
Name = "abc"
};
newColumn.DataSource = new string[] { "a", "b", "c" };
dgv.Columns.Add(newColumn);
This works: each row has a dropdown box in that column, populated with a, b, c.
However, now I would like to trim the list f...
Lets say we have a derivided class "SerializableLabel" from the base class "System.Windows.Controls.
[XmlRoot("SerializableLabel")]
public class SerializableLabel : Label
{
public string foo = "bar";
}
I'd like to serialize this class but ignore ALL of the properties in the parent class. Ideally the xml would look something like:
...
If I want to check how many files there are in a folder (where there is likely to be 10,000+ files), is there a more efficient way than...
Public Function FileCount(FolderName as String) As Integer
Dim Files() As String
Files = IO.Directory.GetFiles(FolderName)
Return Files.Length
End Function
It seems to be unweildly...
I have a search page that displays a gridview of results based on values entered into the form. What I would like to be able to do is have a button New Search. It would let me fill out the search criteria form again and on submit would add another grid view to the page with another result set. I want to be able to do it several times.
...
Hi there,
I have a treeview (using an unordered list and JQuerys treeview) in my MVC app and i am wondering the best way to keep the nodes open and close state persisted on postback?
...
I develop code using .net, and sometimes using ruby. My friend wants me to develop a small time keeping application for use on a mac. Basically a windows form application. I want to develop on my pc (it has all my tools) - I know the writing/deployment process for windows. Is it different if I want to make it work on a mac? Does th...
I apologize if the answer to this question is trivial. But I still cannot figure out this by myself.
How does the garbage collector in .NET identify what objects on the heap are garbage and what objects are not?
Lets say a .NET application is running and at a certain point of time garbage collection occurs(lets leave out the generatio...
I'm using a ListView control in a C# WinForms application. Items in the list are added to a ListViewGroup (in this case, grouping by country). The one thing that isn't working as expected is that the column sorting appears to be strange.
I've hooked into the ListViewItemSorter property of the ListView and everything sorts perfectly exce...
I have a WinForms app that has a TreeView. The user can drag files from WindowsExplorer to the TreeView, and then they can drag the files back into WindowsExplorer which in affect copies the files to wherever the files were dropped. What I'm trying to do is, if the files already exist in the directory where the files are being dropped, I...
Hello everyone,
I am making software setup package, and previously I am using Inno Setup, and it works very good.
The current issue I met with Inno setup is, it does not support all languages for the setup UI, for example Simplified Chinese.
The setup project of VSTS 2008 supports almost all languages, but it does not support invoke a...
Where does console.writeline output in a webservice go to?
...
If a web service is using an assembly for its implementation, what's the difference between giving the website/webservice full trust in web.config versus giving the assembly full trust using a tool like caspol?
...
Hi
Could you please suggest me some good free e-books related to Architecting Enterprise Applications using .NET ?
...
I have a complex RIA client that communicates with a WCF SOAP web service, the second a being the operative word. This has resulted in a dreaded god class containing 131 [OperationContract] methods so far and even more private methods.
Personally, I don't have a problem with this; I use search and the navigation features of Visual Stud...
Hi,
I have a query about drag-drop in C# using .NET.
My issue is with remote files. I have a list of remote files which the user can drag into an explorer window (desktop, etc). When such a drag occurs I want to be able to download the file and write it to the drop location.
The normal method of dragging files:
private void StartDra...
I am having a problem with with printing from .Net 2.0 on HP LaserJet 10xx printers.
Occasionally (sometimes once a month, sometimes once a day) printer gets 'blocked' in such a manner that it can not print anything from .net 2.0.
When printDocument.print method is invoked, it throws InvalidPrinterException, even if printer has just be...