Hello,
I have an application with one main thread and N worker threads. At some point I need that the main thread waits until all the N threads have completed one section of their work.
I normally would use Monitor.Wait() and Monitor.Pulse() but this will prevent the N threads from working at the same time.
Any idea on how to do that?...
It is my understanding building a COM object aggregating an existing COM object implies implementing redirection logic in the IUnknown.QueryInterface method of the outer object.
The question I have is how to do that if the object you are building is managed. On managed objects IUnknown is not explicitly implemented COM Interop does it f...
I am getting the following exception when I deploy my WPF app to another user's machine:
An unhandled exception of type
'System.Windows.Markup.XamlParseException'
occurred in PresentationFramework.dll
However, the WPF app runs fine when I open it. The app crashes at StartUp with this message. I've double-checked to make sure ...
I have a class that I need to do some custom XML output from, thus I implement the IXmlSerializable interface. However, some of the fields I want to output with the default serialization except I want to change the xml tag names. When I call serializer.Serialize, I get default tag names in the XML. Can I change these somehow?
Here is my...
I need to determine if any of the Lists contained in the Dictionary contain the specified value. I'm new to LINQ, so is the following the correct way to achieve this?
Dictionary lotsOfStuff = new Dictionary<string, List<string>>();
string searchString;
// populate lotsOfStuff and searchString...
// detemine if any of the values of lot...
I have a wpf toolkit datagrid with a few columns, then inside the row details I have another datagrid. Basically I am emulating a treelistview control (example: http://www.codeproject.com/KB/list/treelistview.aspx) but using datagrids.
I would like to sync the column widths of the datagrid in the row details with the column widths of th...
I have been working on an app with a datagrid from the wpf toolkit and the width was not specified in the xaml (default to auto), and it was working fine. It would extend the window width as I resized the window. However, all the sudden the "auto" width is massive and I don't know why. When I pull the xaml file up in blend it shows auto ...
Hi, I wanted to try to deploy our project for .net 3.5 client framework (so that we could distribute it with smaller runtime), but when I go to VS 2008 Project properties and check the “Client-only Framework subset” checkbox (and click Save all), it has no effect - the .csproj file does not change (the diff for whole project is empty), a...
if i have objectA that implements ISomeInterface
why can't i do this:
List<objectA> list = (some list of objectAs . . .)
List<ISomeInterface> interfaceList = new List<ISomeInterface>(list);
why can't i stick in list into the interfaceList constructor ? Is there any workaround?
...
I have a wpf button like this:
<Button Click="button1_Click" Height="23" Margin="0,0,5,0" Name="button1" Width="75">Initiate</Button>
And I want to pass {Binding Code} passed as parameter to the button1_click handler.
How do I go about this?
Disclaimer: really new to WPF
...
Why can the Linq to SQL designer not understand the following stored procedure and import it correctly?
CREATE PROCEDURE dbo.MartinTest
@parameter1 INTEGER
AS
SET NOCOUNT ON
SELECT C1, C2, C3
INTO #myTempTable
FROM MyTable
SELECT C1, C2, C3
FROM MyOtherTable INNER JOIN #myTempTable ON ....
RETURN
W...
I wrote ASP.NET pages which will manage forms. They're based on the following base class.
public abstract class FormPageBase<TInterface, TModel> : Page, IKeywordProvider
where TModel:ActiveRecordBase<MasterForm>, TInterface, new()
where TInterface:IMasterForm
{
public TInterface FormData { get; set; } ...
For the sake of this question, here is my generic class.
[ComVisible(true)]
public class HtmlTable<T> where T : class
{
List<T> listToConvert;
public HtmlTable(List<T> listToConvert)
{
this.listToConvert = listToConvert;
}
}
Essentially, this class is responsibly for converting a List of class T to an HTML tab...
I'm writing a test winforms / C# / .NET 3.5 application for the system we're developing and we fell in the need to switch between .config files at runtime, but this is turning out to be a nightmare.
Here's the scene: the Winforms application is aimed at testing a WebApp, divided into 5 subsystems. The test proccess works with messages b...
If I write a generic class like class MyGeneric<T> is it possible to write an implicit cast to type T, so I can do stuff like:
public class MyGeneric<T>
{
...
}
public class GenericProperties
{
public MyGeneric<string> MyGenericString {get;set;}
public void UseMyGeneric()
{
string sTest = MyGenericString;
MyGene...
Hi.
We have several legacy components that interact with COM ports, USB etc.
I would like to create a .NET program that would emulate a COM port and log the traffic, relaying it to a WCF service endpoint somewhere or directly into a database. Maybe also wrapping a real COM port kind of like the decorator pattern.
I have looked around...
As part of a program I have to be able to pull a few random frames from a user specified video file. I do not have any experience with video processing programming, so this is new to me.
I've determined that I need to use DirectShow.net to do this on Windows XP using .Net, but I cannot figure out how to get it done. I'm trying to use th...
I am learning LINQ and this seems like a fairly simple problem. I have a semi-working solution but I am sure it could be cleaned up.
The propertyAuto node represents a car with id = 606.
This node needs to have at least two child propertyValue nodes, one that references a vehicleValuation element with attribute of "Book" and one of "Au...
Hi,
I have a table named "data_buckets" and a column in that table named "data_bucket".
When I buid the activerecord.cs, subsonic created a class name "data_bucket" (extending IActiveRecord) for the table and obviously a conflict will arise when you try to access the field "data_bucket". Is it a known issue? Is there any workaround with...
List<string> a = new List<string>() { "a", "b", "c" };
List<string> b = new List<string>() { "a", "b", "c", "d", "e", "f" };
b.RemoveAll(a.Contains);
If you loop through b it will now only contain d e and f. Can anyone expand out whats actually happening, because currently it doesnt make any sense at all.
Edit: I was more talking abo...