Consider the following serializable classes:
class Item {...}
class Items : List<Item> {...}
class MyClass
{
public string Name {get;set;}
public Items MyItems {get;set;}
}
I want the serialized output to look like:
<MyClass>
<Name>string</Name>
<ItemValues>
<ItemValue></ItemValue>
<ItemValue></ItemValue...
I am trying to determine if my application is closed through clicking the "X" on the windows form, or if they clicked an "Exit" button I have on it. Right now I am using StackTrace.GetFrame(someIndex) to determine how, but i am looking for a more definitive way since it looks like these frame orders arent guaranteed. Is there a better ...
I realize a very similar question was asked on SO in the past, but that was a while ago, and some of the replies no longer work.
The first road I went down was the .NET port of Aspell. Problems I ran into were:
1. The website is worthless. Cannot browse source, no binaries available, broken links...
2. Trying to build Aspell on Wind...
a) As far as I know, GridView’s RowStyle-HorizontalAlign property should overwrite CSS’s text-align property, and thus text inside GridView's cells should be located on the left side of the cells, but is instead moved to the right side. Why is that?
b) Similarly, RowStyle-Font-Bold should overwrite CSS’s font-weight property and thus fo...
I have an XML document, several actually, that will be editable via a front-end UI. I've discovered a problem with this approach (other than the fact that it is using xml files instead of a database... but I cannot change that right now).
If one user makes a change while another user is in the process of making a change, then the second...
There is an insightful question about reading a C/C++ data structure in C# from a byte array, but I cannot get the code to work for my collection of big-endian (network byte order) bytes. (EDIT: Note that my real struct has more than just one field.) Is there a way to marshal the bytes into a big-endian version of the structure and then ...
I've no idea. I'm trying to get XML from a REST service on an app I'm building for Windows Phone. I always get an exception at the following line:
HttpWebResponse response = request.EndGetResponse(ar) as HttpWebResponse;
I have the following setup (ignore the bad url, it's just an example .. )
HttpWebRequest request = WebRequest.Crea...
Using import aliasing in one file/class, we can reference class library namespaces by assigning our own custom alias like this:
' VB
Imports Db = Company.Lib.Data.Objects
// C#
using Db = Company.Lib.Data.Objects;
And then we are able to reference the classes inside of Company.Lib.Data.Objects by using the Db alias that we assigned....
Currently i'm using the PrintPreviewDialog to open a window to preview the printed pages before they are sent to a printer. The problem is though that it first appears very small, at the top left of the screen and the buttons are too small.
Is there anyway i can set a starting size for this dialog or start position or even make the li...
I have an arrow drawn between two objects on a Winform.
What would be the simplest way to determine that my mouse is currently hovering over, or near, this line.
I have considered testing whether the mouse point intersects a square defined and extrapolated by the two points, however this would only be feasible if the two points had ve...
Hey,
I have just been looking into Linq with ASP.Net. It is very neat indeed. I was just wondering - how do all the classes get populated? I mean in ASP.Net, suppose you have a Linq file called Catalogue, and you then use a For loop to loop through Catalogue.Products and print each Product name. How do the details get stored? Does it ju...
It would be interesting/nice to have something portable like TK to be used in Windows and in Linux with Mono like TK. Does anyone know of any bindings? or What would be a good place to start in creating bindings.
...
Hello.
I found a topic on MSDN that talks that yes, this is possible.
I did a test that seems to break this statement:
using System;
namespace Test
{
class Program
{
static void Main(string[] args)
{
Foo f = new Foo("1");
Console.WriteLine(f.Bar); // prints 1
f.Test("2");
...
I am wanting to send some data to a server from a client application to the server via port 5555. I don't have a window's server. My question is if I purchase a .Net Framework hosting service. Would I be able to connect the client application to this server. and could I do it by sending a Post. I am new to this, so excuse me if it doesn'...
Hi all,
I've used the default .NET serialization for a class with a System.Drawing.Color member. The code is now in use by people, and I need to add an extra member to the class, but still deserialize older versions.
So I tried the standard way of doing this: The ISerializable interface, using SerializationInfo methods to get the int ...
I've heard/read about people not wanting to reference the assembly because of the Windows component (e.g. "I don't want to reference Windows for my Web App).
I'd like to hear what a large community feels about this.
For which project types (business, data access, etc.) is it considered acceptable to reference WindowsBase.dll.
...
Hello
I have Class Library Where a class of multithreading Of Producer and consumer based.
private void WorkDeQueue()
{
while (true)
{
string Url = null;
lock (locker)
{
if (queueList.Count > 0)
{
Url = queueList.Dequeue();
...
A few months back I've discovered PostSharp, and for a time, it was good.
But then legal came back with an answer saying that they don't like the licence of the old versions. Then the department told me that 2.0's price was unacceptably high (for the number of seats we need)... I was extremely disapponted, but not disheartened. Can't be...
So I am very new to WPF and trying to bind or assign a list of Drink values to a wpf treeview, but don't know how to do that, and find it really hard to find anything online that just shows stuff without using xaml.
struct Drink
{
public string Name { get; private set; }
public int Popularity { get; private set; }
public Dr...
I have an application written in C# that needs to retrieve information like IP address, subnet mask from a disconnected network adapter.
I've tried using various methods such as WMI and the .NET NetworkAdapter class but they don't return any useful data when the network adapter is disconnected. I'm pretty sure Windows keeps this informa...