.net

Is it possible to create a Mono bundle that includes WPF libraries?

I know WPF libraries aren´t implemented by mono class library, however(as far as I know) the mono 2.6 runtime is fully compatible with the .NET 2.0/3.5 runtime, so if the WPF libraries only make PInvoke calls to windows api it is theoretically possible to run a wpf application on windows using the mono runtime. The reason for wanting ...

Why Isn't My .Net Object Serializable?

I've got a 'MyDataTable' class that inherits from System.Data.DataTable I've implemented ISerializable in my class and have a 'Public Overrides Sub GetObjectData...' But when I try to serialize the an object of 'MyDataTable' I get an error saying that 'MyDataTable' is not marked as serializable. If I used a DataTable instead - my code...

What is the accepted pattern for naming methods that return Tasks?

APM uses BeginXXX/EndXX pairs and the Event-based Asynchronous Pattern (EAP) uses XXXAsync and XXXCompleted pairs, but I haven't seen anything standard on how to name methods that return a task. I have been using XXXTask: Data GetData() Task<Data> GetDataTask() but was wondering if a more standard approach has developed ...

What inspired WPF?

I was told by someone that, just as .NET started inspired from Java, WPF was inspired by a similar technology, as "Microsoft never innovates". However, I can't find anything remotely close to WPF. What particular technology did or could have inspired Microsoft to write WPF? ...

How to remove dangerous characters(ie script tags)?

I am wondering is there any sort of C# class or 3rd party library that removes dangerous characters such as script tags? I know you can use regex but I also know people can write their script tags so many ways that you can fool the regex into thinking it is OK. I also heard that HTML Agility Pack is good so I am wondering is there any ...

DataAdapter SelectCommand that excludes current DataTable rows

Is there a clean method of creating a DataAdapter SelectCommand to select rows from the database that are not already present in the DataTable? I am calling DataAdapter.Fill(DataTable) and only want to have new rows inserted into the DataTable. ...

Serializing an extended form object

I've been reading up on this whole subject, but I never came across this specific problem. I already understand that the whole idea of serializing an entire form is a horrible idea and just doesn't work. But, I am encountering a bit of a different problem. I have a class that inherits the "button" form object, that I call DataButton. No...

Choosing an installer product that is free and will download/install the .NET Framework

I'm currently using the Visual Studio Installer (Setup Project) in Visual Studio 2010 as the installer for MyProgram. It has some quirky bugs and is not very customizable so I would like to switch to another installer product. Here are my requirements: Must be free (and licensed for commercial use) Must install the Windows Installer 3....

how can we avoid allocation done by Marshal::StringToHGlobalAnsi?

my wrapper from managed to unmanaged is handling a lot of data and this function Marshal::StringToHGlobalAnsi would call new for each of them, which is a big hit for me. So my question is : can I allocate a chunk of unmanaged memory and use it to convert the managed data types to unmanaged by hand. ...

How Does the VS 2010 web.config work?

Hi I am just wondering in VS2010 the web.config is broken up into web.config web.debug.config web.release.config So from what I gathered is the web.config is just like the master template. So I am guessing in my debug I could put things like my local database where in my release one I would put my server database. Now how does it kn...

How to get a list of groups in an Active Directory group

I'm trying to get a list of the groups that are in an AD group using .NET. As an example, I have a group called TestGroup and inside that group I have the group DomainAdministrators. Using the code below I can get all of the users including those from the DomainAdministrators group but not the group itself. PrincipalContext ctx = ...

Real World strtod(); for use with WINAPI textbox.

ResultBox1->Text = (sin(TextBox1->Text)) * TextBox2->Text That is what i would like to work, but im dealing with Strings I cant seem to convert the strings, do the trig, and convert back to string for displaying properly... anyone with an example? ...

Regex.IsMatch vs string.Contains

Is there any difference in speed/memory usage for these two equivalent expressions: Regex.IsMatch(Message, "1000") Vs Message.Contains("1000") Any situations where one is better than other ? The context of this question is as follows: I was making some changes to legacy code which contained the Regex expression to find whether a s...

Network communication for a turn based board game

Hi all, my first question here, so please don't be to harsh if something went wrong :) I'm currently a CS student (from Germany, if this info is of any use ;) ) and we got a, free selectable, programming assignment, which we have to write in a C++/CLI Windows Forms Application. My team, two others and me, decided to go for a network-co...

How to allow users to select their own grouping for a .NET TreeView control

I am using a treeview to display projects, tasks, time entries, and the people who are working on a project. I would like to allow the user to define a custom grouping (ie. Project->Task->Time Entries or Project->Date (of time entry)->Task->TimeEntry). The relevant groups would be Project, Task, Time Entry, and Person, with some meta...

Is there a framework for .NET that supports Erlang's concept of "mobile code"?

In other words, "A serialization framework for closures and their set of (IL-code) dependencies". ...

Learn C# now or finish up with Java and then learn C#?

Ok here is my situation. I've studied Java in my college for 2 semesters. But you know they teach you jack in there, just the basics. We skipped half of our textbook and even then our professors don't teach from section to section of each chapter. I don't blame them. It's hard as it is for new students to understand even the basic concep...

coherence/memcache/AppFabric for pub/sub

Looking for advice/pro's/con's on using the memory cache servers for pub/sub esp wrt a high-throughput system ( 1000's of updates/sec ) Coherence seems to have pub/sub as a use-case, not sure about the others Would love to get some real-world input ! ...

In WinForms Application control + C is not doing a copy on my rich text box.

I added a menu with short cut keys for copy and past (Control+C & Control+V) on a windows forms application. The application has a single richtextbox control. The events for the menu items call RichTextBox.Copy and RichTextBox.Paste but I can't get the short cut keys to work. Control+c & +v do nothing. Is there a step I am missing? ...

Cleanup vs Dispose(bool) in MVVM-light

In the lastest version of MVVM-light (V3 SP1) both "Dispose()" and "Dipose(bool)" methods in ViewModel class are marked Do not use this method anymore, it will be removed in a future version. Use ICleanup.Cleanup() instead Does this mean that IDisposable interface must not be implemented in all ViewModel classes that are derived f...