Hi All,
Currently I have the following code:
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
var myObject = new MyObject() {Text = "€ 232.22"};
StringBuilder sb = new StringBuilder();
var xmlWriterSettings = new XmlWriterSettings();
...
Is there a method to check if object has been disposed different then
try
{
myObj.CallRandomMethod();
} catch (ObjectDisposedException e)
{
// now I know object has been disposed
}
In my case I'm using TcpClient class that has Close() method which disposes object and this can happen in piece of code I don't have control of. In...
Hi, I have a similar problem to this question regarding painting of wpf controls
The application I work on is a rather large Windows forms threaded application with several wpf user controls throughout the application. The problem occurs in a plugin of the application where a third party c++ library is called on a separate thread, WndP...
If some one knows any more ways of doing this in .NET and also what is your opinions about that approaches? Which approach you choose and why?
Here is the tests of different ways of object copy in .NET.
Tests Related to this original thread: http://stackoverflow.com/questions/531505/how-to-copy-value-from-class-x-to-class-y-with-the-s...
I need to convert a System.Windows.Media.SolidcolorBrush to a System.Drawing.Color in C# any clues would be great.
...
I'm trying to retrieve an XML document from a server and store it locally as a string. In desktop .Net I didn't need to, I just did:
string xmlFilePath = "https://myip/";
XDocument xDoc = XDocument.Load(xmlFilePath);
However on WP7 this returns:
Cannot open 'serveraddress'. The Uri parameter must be a relative path po...
I'm using .NET 3.5 to create an application that requires a Stack<T> with unique values. I realize I could call Contains() before every Push(), but it makes sense semantically that I roll my own "unique stack" (UniqueStack<T> or maybe HashStack<T>?). I'm having a hard time to determine a strong name for this data structure.
I hate the ...
I am trying to understand how objects are created in a .Net world as oppose to that in an unmanaged code environment (VB6 etc)
From what I understand, when an object is created in lets say C# by using the new keyowrd, the reference variable is placed in the managed heap until the garbage collector takes a proactive measure to check if t...
I would like to export the site settings and app pool settings for a specific site in IIS7 using Powershell so i can restore them on another server. Anyone knows how to do this?
...
I run the below code in my C# .Net application, but I keep getting error ORA-01722: invalid number. When running the same SQL directly in PL/SQL Developer it does exactly what I ask it to without complaining.
What could be causing this?
OracleCommand command = connection.CreateCommand();
command.CommandType = CommandType.Text;
command....
Hi all
I am writing a some unit test classes and i only want to run them in debug mode .
Is there some way not to deploy the classes itself to the final assemblies when i run in different mode .
I am not talking about their content (#if DEBUG flag) , the files them self .
I use VS2005.
Thanks.
...
Are finalizers guaranteed to be executed in .NET at some point (spare power outages and the like)? I know how GC works and that it is nondeterministic when exactly they'll run.
(The search did not display good answers, so I'm adding this question in high expectation of a merge with the not-so-easy-to-discover actual answers. Apart from ...
Hi All,
How can I get a List from all nodes in a tree using LINQ?
My classes are:
class Node
{
public class Node()
{
Children = new List<Node>();
}
public List<Node> Children { get; set;}
}
class Tree
{
public Tree()
{
Roots = new List<Node>();
}
List<Node> Roots { get; set;}
}
...
I have 2 application, one is iOS app and one is .NET app. I want my iOS app send an message (call a method of .NET app, send some string to .NET app to save to database). So, how can my iOS app can comunicate with .NET app? Anybody can help me.
Thanks :)
...
JRebel is a tool for Java that can automatically swap in new versions of classes to a running JVM. Not only can method implementations be changed, it's also possible to change their signatures, to add new or remove existing methods, and also add/remove fields. About the only thing that cannot do is allow the class hierarchy to be alter...
Hi all,
I have an HTTP Handler that I want every request from a specific page to go through. The page in question contains async javascript calls etc. The handler is called fine for the initial page load and also a call to an ashx file, however, it doesn't get invoked for any of the requests were the target url is a .js (which are made ...
I'm looking for a way in C# .NET to get the Unicode character corresponding to a given fraction. In my code I have the numerator and denominator and I need to work out how to get the corresponding Unicode character from these, which is then displayed in a WinForms combobox.
Any ideas?
...
When we define a COM interface in MIDL (Microsoft Interface Decription Language), we should utilize the oleautomation compatible data types. These types could be recognized by the COM aware languages.
Suddenly, the .NET CTS (Common Type Specification) flashed into my mind. The CTS is the minimum subset of types that any .NET compatible ...
Why is it necessary to use the new keyword when a method shall be hidden?
I have two classes:
public class Parent
{
public void Print()
{
Console.WriteLine("Parent");
}
}
public class Child : Parent
{
public void Print()
{
Console.WriteLine("Child");
}
}
Following code produces the given outpu...
I would like to install the Web Deployment Handler service on my development machine (Windows 7 with IIS7) for test purposes, but according to the documentation on MSDN (http://technet.microsoft.com/en-us/library/dd722796(WS.10).aspx) it seems like it can only be installed on Windows Server 2008 with IIS7.
Anyone knows of a way around ...