.net

WPF: Animate Height of ListView when final height is unknown

I have a ListView, that is defined very simply in my XAML like so <ListView Name="myListVew" MaxHeight="200" Visibility="Collapsed"> <ListView.View> <GridView> <GridViewColumn Header="Line" Width="Auto" DisplayMemberBinding="{Binding Line}" /> <GridViewColumn Header="Error" Width="Auto" DisplayMemberB...

Can I fire an event directly from BackgroundWorker's DoWork handler?

I'm using BackgroundWorker for the first time, and use is not entirely clear. Can I send events directly from the DoWork handler, or do I have to instead call ReportEvents and send the event from the ProgressChanged handler? ...

why does this code lock my files?

Ive narrowed down to this method but i don't understand why its locking the file. I believe you could use something like using( something) { //do stuff here } But im not sure that would A) solve the issue or B) be the correct way if it did. any ideas? [DllImport("user32.dll", CharSet = CharSet.Auto)]private static extern Int32 Syst...

Defining multiple TraceSources not running

I'm new with TraceSource so I'm doing some investigation into how it can/ can't be used (basically pros and cons). Something I do like is that I can get dumps from within the .NET framework itself, so I've made a little app to test that and using my own custom source together (as that's how I'd expect it to be used), like so: class Pro...

Versioning assemblies of distributed application with hot fixes

We are developing an application with components on multiple physical tiers, sharing many assemblies as well as having some exclusive to each tier. I am wanting to know what the typical versioning strategy is for release hot-fixes, or only a few components of the application. Our issue tracking software contains a version number for ...

How to define generic type limit to primitive types?

I have the following method with generic type: T GetValue<T>(); I would like to limit T to primitive types such as int, string, float but not class type. I know I can define generic for class type like this: C GetObject<C>() where C: class; I am not sure if it is possible for primitive types and how if so. ...

Can I set an infinite AutoPopDelay for a tooltip in a .net winform?

I have a requirement to not have the standard .net winform tooltip automatcially hide - that is, I need them to remain visible until the mouse moves off the control that has the tooltip. I'd like to avoid having to specific MouseEnter and MouseLeave events for all controls with a tooltip. I'm happy to hear about 3rd party solutions if ...

Why this odd default output from Configuration.Save()?

I noticed this interesting behavior today while messing around with the configuration system. When I run this minimal program with no preexisting .config file (use ctrl-F5 to avoid the vshost)... using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Configuration; namespace PlayinWithConfi...

Populate WinFrom TreeView from DataTable

I have a WinForm TreeView Control that displays the Parent Child relationship of CaseNotes(I know that means nothing to most of you but it helps me visualize the answers). I have a DataTable of the CaseNotes that I need to display. The Parent/Child is defined as: If the row has a ParentNoteID then it is a childNode of that note other...

Syntax Highlighting in a ListBox

Hi all, I've searched the web and I can't seem to find anything that will work for me. I've seen plenty of discussion, and even some fairly extensible open-source tools, for code editors that provide line numbers and syntax highlighting. Here's my dilemma... I'm working on a "digital code review" project in C#.NET that allows users t...

Free obfuscation tools for .NET

Please point me to FREE/Open source obfuscation tools for .NET assemblies. Edit: I also want to obfuscate strings in my application. I think Dotfuscator Community Edition doesn't obfuscate an application fully. ...

Simple iteration through an Integer-type enum?

Hi, I have the following Enum: Public Enum myEnum As Integer first = &H1 second = &H2 third = &H4 fourth = &H8 fifth = &H10 sixth = &H20 End Enum It is neccessary, unfortunately, that the enum elements have those values, or at least have values that can be binary compared. I have a class which can be set d...

Convenient way to call GC::KeepAlive in C++/CLI scenarios?

Hi I'm writing some managed wrappers using C++/CLI. The problem is that the GC sometimes disposes the object while I'm using unmanaged members from it. (I think this behaviour is insane but this is another topic). For more details see: http://stackoverflow.com/questions/134653/finalizer-launched-while-its-object-was-still-being-used ht...

.NET Licensing Components

I'm looking for not too intrusive to the end user and decently priced .NET Licencing components. Especially something allows serial key and time based expiration. Any recommendations? ...

shim add-in not loaded

I am kind of new on the whole shim add-in thing so go easy on me. Here is what I did: 1) create shared add-in (new_addin) and put messagebox on the on connect proc 2) add shim add-in project and chose for word and excel 3) then add setup project add primary output for the three project set the register property for the shim vsdrpCOM ...

Dynamic table row not being updated via jquery ajax call

Hi there, Having a bit of a hairy issue when submitting data over a jquery ajax call. Basically, form values of form fields which have been dynamically added to the screen into a tubular grid using jquery are not updating on a batch save command. Basically I have a grid listing which displays all current rows saved to the database with...

custom field not show

hi, I have make a custom textfield and put a default value in. That's working good but the value i wanne have in the textfield is using a webservice. When i try to initiate the webservice the custom field doesn't show anymore. I initiate my webservice like this public CusterNameService.ServiceSoapClient demo = new CusterNameService.Ser...

How to unsubscribe from an event which uses a lambda expression?

I have the following code to let the GUI respond to a change in the collection. myObservableCollection.CollectionChanged += ((sender, e) => UpdateMyUI()); First of all is this a good way to do this? Second: what's the code to unsubscribe from this event? Is it the same but with -= (and then the complete anonymous method again)? ...

Are resx files suitable for Internationalization?

I have been given the task of internationalizing a large client-server application. The remit is that I make the app 'World Ready' and then the compiled application and resources gets passed over to colleagues in another country for translation and release to their customers. There will be several countries and therefore several seperate...

System.Data.Linq.ChangeConflictException: Row not found or changed.

I am trying to delete a selected gridview row using LINQ (No LINQDataSource). when the selection is changed, the detailsview binding is changed also. I can add a new entry to the database, but when i added this code to a delete button inside the updatePanel, i got an exception: try { var query = from i in db.QuestionModules where i.Que...