.net

Idiomatic default sort using WCF RIA, Entity Framework 4, Silverlight 4?

I've got two Silverlight 4.0 ComboBoxes; the second displays the children of the entity selected in the first: <ComboBox Name="cmbThings" ItemsSource="{Binding Path=Things,Mode=TwoWay}" DisplayMemberPath="Name" SelectionChanged="CmbThingsSelectionChanged" /> <ComboBox Name="cmbChildThings" ItemsSource="{Binding...

How to disable maximize button in a WPF appication page not in a window

I want to disable the maximize button in WPF application page, not in a WPF application window When I searched in Google, it is available methods for disabling the maximize button in WPF window The code snippet is as follows Window.WindowStyle= WindowStyle.None But is not working in WPF page It is showing errors. In WPF page there ...

Windows Forms: Enable/Disable WS_CLIPCHILDREN

How do I turn on/off the WS_CLIPCHILDREN window style in a Windows Forms parent control? I would like to display some text on top of the child control after it has painted. In my parent control, this is what I have: class Parent : public Control { void Parent::OnPaint(PaintEventArgs ^e){ Control::OnPaint(e); // par...

Several appdomains calling the same unmanged dll

Our .NET 3.5 C# application creates multiple appdomains. Each appdomain loads the same unmanaged 3rd party dll. This dll reads a configuration file upon initialization. If the configuration changes during runtime, the dll must be unloaded and loaded again. This dll is not in our scope to rewrite correctly. Does each appdomain have acce...

A good file path builder library for C#?

System.IO.Path in .NET is notoriously clumsy to work with. In my various projects I keep encountering the same usage scenarios which require repetitive, verbose and thus error-prone code snippets that use Path.Combine, Path.GetFileName, Path.GetDirectoryName, String.Format, etc. Scenarios like: changing the extension for a given file n...

Powerpoint Add-In: Add a Button to PPT to SyntaxHighlight a Textbox

I am trying to write an Add-In to PowerPoint that does basically one thing: Give users a button somewhere to click, once they click on it the currently selected TextField should get syntax highlighted. The Syntax highlighting part is easy, I'm just having a real hard time finding some good information on how to successfully interact wit...

Configuring IoC container from modules/plug-ins ?

Hi guys, i am in big dilema.. I am working on highly modular web app in ASP.NET MVC 2 (in fact, core will be super lightweight, all work on modules/plugins). I found MEF pretty useful for modules discovery, but i dont want to us it as IoC container. There is pretty good chance that I will need advanced features of "true" IoC container, s...

OutOfMemoryException - out of ideas II

Hello, This question is related to my previous question. The storyline: I have an .NET application which consumes a lot of memory if you look at task manager VMSize. I am trying to find out what consumes this amount of memory. You see in the picture below that VM size is 2,46 GB Ok now I am looking at .net performance counters C...

How to disable Hover-Messages in .NET List/TreeViews?

I have a Windows Forms application that uses some Application.Idle handlers to change the status of controls on the form. After I added a ListView to the form I realized the Idle-Handlers get called way too often when the mouse cursor is over the ListView. By using Spy++ I saw that when the mouse cursor is over the control (not moving) ...

Using a Cross Thread Boolean to Abort Thread

Possible Duplicate: Can a C# thread really cache a value and ignore changes to that value on other threads? Lets say we have this code: bool KeepGoing = true; DataInThread = new Thread(new ThreadStart(DataInThreadMethod)); DataInThread.Start(); //bla bla time goes on KeepGoing = false; private void DataInThreadMethod() { ...

Recommend .NET data access layer/middle tier

Hi, I'm currently creating an MVC application that will likely to expand to include a silverlight, wpf and possible windows phone all using the same data. So I've created a class library to keep all my objects in and I've created the MVC app. My question is what would be the best way to access the data? Taking into account possible ex...

Does Marshal.ReleaseComObject call the garbage collector ?

Hi, I was asked this question today by a colleague, and couldn't find any clue on the Internet... Can someone tell me if calling Marshall.ReleaseComObject()directly calls the garbage collector ? As I understand it, it only removes COM references, and then the G.C. cleans memory on its next pass, but I can be mistaken... Thanks in advan...

Most appropriate exception for a collection not being initialised?

What is the most appropriate .Net exception type for when you have a class which must have its collection property initialised with at least one item? I'm thinking that it would be an ArgumentOutOfRangeException but is there something more appropriate based on a collection? ...

Guesses of my session value conflicts

I have a asp.net web form which will submit information to come as emails. Whenever user fill the form and click on submit button,the information user entered will be sent as email. This web form has 4 page. but the web form will not use all 4 page on all requests. if the user select a particular value in first page, the form will bypa...

WCF 4.0 new enhancements over WCF 3.5

What are the new enhancements in WCF 4.0 and how easy would it be to upgrade existing WCF services to 4.0? ...

Reading tags of *.tiff and *.eps files

i have to read tags of cmyk *.tiff and *.eps files. i use .net 3.5. How can i do it? ...

What is the difference between Server. Transfer and Response. Redirect??

will any one please elaborate this ...

Ole atomation in c#

I write vbs that create ole atomation object On Error Resume Next dim objShell dim objFolder if not objFolder is nothing then objFolder.CopyHere "ftp://anonymous:[email protected]/bussys" WScript.Sleep 100 end if set objShell = nothing set objFolder = nothing How to do that on C# (or do that without ole automation just use ...

Destructor - does it get called if the app crashes

Does a destructor get called if the app crashes? If it's an unhandled exception I'm guessing it does, but what about more serious errors, or something like a user killing the application process? And a few more potentially dumb questions: what happens to all the objects in an app when the app exits and all finalizers have been execut...

How does ListView.ItemCollection.Contains() work?

Hi everyone, I'm copying ListViewItems from one ListView to another, sth. like: foreach (ListViewItem item in usersListView.SelectedItems) { selectedUsersListView.Items.Add((ListViewItem)item.Clone()); } If I want to use ListView.ItemCollection.Contains() to determine if an item was already copied I always get false: foreach (Li...