I have created an application that uses settings.settings to store some user specific settings (scope=User). Settings are loaded correctly on startup, changed during use and saved correctly for next launch. This cycle appears to have no problems.
The problem arises when I update the assembly and file versions for a new build. The set...
How can I recognize (.NET 2) a generic class?
Class A(Of T)
End Class
' not work '
If TypeOf myObject Is A Then
?
...
i have two lists:
List<comparerobj> list_c = new List<comparerobj>();
List<comparerobj> list_b = new List<comparerobj>();
i'm filling lists somehow
then i'm trying to find elements in list_b which list_c doesnt contain:
foreach (comparerobj b in list_b)
{
bool lc = !list_c.Contains(b);
if (lc != true)
{
data.Add(...
I've a WSDL defining a web service named CalendarService:
<soap:address location="http://example.com/calendar"/>
The WSDL defines following methods:
String setDate(String date)
int setTime(int time)
CalendarService is not deployed anywhere.
CalendarServiceProxy is a proxy generated from CalendarService WSDL.
I've a web servic...
Hello,
I'm wondering why the 'partial class' concept even exists in C#/VB.NET. I'm working on an application and we are reading a (actually very good) book relavant to the development platform we are implementing at work. In the book he provides a large code base /wrapper around the platform API and explains how he developed it as he te...
We have Win Forms application uses the 3rd party windows native controls. Can these controls used with WPF application?
...
I have a SQLite DB that is set up so when I delete a Person the delete is cascaded. This works fine when I manually delete a Person (all records that reference the PersonID are deleted). But when I use Entity Framework to delete the Person I get an error:
System.InvalidOperationException: The operation failed: The relationship could no...
I have a project folder called XSL which contains xsl files used for transforming xml. I use the following code to fetch an xsl file:
string html = @"c:\temp\export.html";
XslCompiledTransform transform = new XslCompiledTransform();
Uri uri = new Uri(@"XSL\ToHtml.xsl", UriKind.Relative);
transform.Transform(CurrentXmlFile, html);
System...
I don't get the abstractions and the terminology :-(
For example, DirectoryInfo.FullName is defined as the full path of the directory or file, but it's a string! So is DirectoryInfo.Name, FileInfo.FullName, Path.GetDirectoyName and so on.
This means that in .Net there is no "depth" (or "meat" - my English isn't so good) for the file s...
Everything about Type is reflective in nature. Is it because Type is used more often than the rest of the classes in System.Reflection? Or because it functions more like a system class than a reflection class?
In short, I've always wondered what the motivation behind the location of System.Type was.
...
I am taking over a system that a previous developer wrote. The system has an administrator approve a user account and when they do that the system uses the following method to hash a password and save it to the database. It sends the unhashed password to the user. When the user logs in the system uses the exact same method to hash wha...
One if the first things I learned when I started with C# was the most important one. You can decompile any .NET assembly with Reflector or other tools. Many developers are not aware of this fact and most of them are shocked when I show them their source code.
Protection against decompilation is still a difficult task. I am still looking...
Dear all,
is it possible for a WPF Label to split itself automatically into several lines? In my following example, the text is cropped at the right.
<Window x:Class="..." xmlns="..." xmlns:x="..." Height="300" Width="300">
<Grid>
<Label>
`_Twas brillig, and the slithy toves did gyre and gimble in the wabe:
...
In my early .Net programming days, I used string.Format() only for complex string concatenations, for example to compile strings as
Problem with customer order 234 of date 2/2/2002 and payment id 55543.
But now I use string.Format for almost every string concatenation I have to do, also simple ones such as prefixing a string with somet...
Hi,
i would like to set the date format of all the dates in my web application in a central location.
i mean if the website is opened in USA it will have a format such as
3/19/2010 (March/19/2010)
while in Italy will be
19/3/2010 (19/March/2010)
i am no really concerned with how to locate the users but indeed on how to set the dif...
I would like to implement multi-touch in my applications for Windows Mobile. The applications will mostly use it for zoom related actions e.g. two points (touched) moving towards each other while relatively moving towards a certain point will zoom IN to that point, where two touched points moving away from each other will do the exact op...
I'm using the code below to take a string and split it up into an array. It will take: Disney Land and make it two separate elements. If the string contains "Disney Land" then it is one element in the array. Works great, however it adds some empty elements to the array each time. So I just iterate over the elements and remove them i...
Hi all! I create a new instance and trying to resize new instance of browser like this:
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool GetWindowInfo(IntPtr hwnd, ref tagWINDOWINFO pwi);
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
pu...
A classes Type metadata can be obtained in several ways. Two of them are:
var typeInfo = Type.GetType("MyClass")
and
var typeInfo = typeof(MyClass)
The advantage of the second way is that typos will be caught by the compiler, and the IDE can understand what I'm talking about (allowing features like refactoring to work without silentl...
I have set up references to 2 web services in a separate assembly TestProj.Core.
I reference this Project in a Web Application Project called TestProj.Web.
When I setup the references in TestProj.Core the wizard gave me an app.config and through an application settings section into it.
How do I get these settings to my web app? Copy an...