In my program I need a way to click on an Image control, the program takes in the X,Y position of where the click took place, and then produce a rectangle around that position. My problem is that I'm using MVVM, so all my code is in a separate file (ViewModel file rather than the code-behind file). The Image control doesn't have a Comm...
If I want to produce a Base64-encoded output, how would I do that in .NET?
I know that since .NET 2.0, there is the ICryptoTransform interface, and the
ToBase64Transform() and FromBase64Transform() implementations of that interface.
But those classes are embedded into the System.Security namespace, and require the use of a TransformB...
I know WPF is more complex an flexible so could be thought to do more calculations. But since the rendering is done on the GPU, wouldn't it be faster than Winforms for the same application (functionally and visually)?
I mean when you are not running any games or heavy 3d rendering, the GPU isn't doing heavy work, right? Whereas the CPU ...
I have a local collection of record Id's (integers).
I need to retrieve records that have every one of their child records' ids in that local collection.
Here is my query:
public List<int> OwnerIds { get; private set; }
...
filteredPatches = from p in filteredPatches
where OwnerIds.All(o => p.PatchesOwners.Select(x =...
With a windows MSI file, is there a way to grab all the possible installation parameters in .NET code? I need to make a generic user interface to configure multiple MSI files not known until run-time – then install them together in one go.
...
I'm maintaining the build process for our application which consist of an ASP.Net application, two different Win32 services and other sysadmin related applications.
I want to end up with the following configuration to be used both when debugging & deploying.
libraires/ -- Contains shared assemblies used by all other apps.
web/ ...
If I'm using a ListView in virtual mode then, as I understand it, the list view only keeps track of a small number of items in the list. As the user scrolls it dynamically retrieves items it needs to show from the virtual list.
But what if an item is added or removed from the master list? If an item is added/removed outside of the range...
I am writing a usenet newsreader, and calling the XOVER id- message to get all articles in a group.
If i am using this code, i am only getting the first 5kB of the response:
while((read = _networkStream.Read(buffer, 0, 5000)) > 0)
{
ret += Encoding.ASCII.GetString(buffer, 0, read);
if(read < 5000...
I work in a shop that is a mix of mostly Java and .NET technologists. When discussing new solutions and architectures we often encounter impedance in trying to compare the various technologies, frameworks, APIs etc. in use between the two camps. It seems that each camp knows little about the other and we end up comparing apples to orange...
Ignoring unsafe code, .NET cannot have memory leaks. I've read this endlessly from many experts and I believe it. However, I do not understand why this is so.
It is my understanding that the framework itself is written in C++ and C++ is susceptible to memory leaks.
Is the underlying framework so well-written, that it absolutely does n...
I have a Windows Forms app that itself launches different threads to do different kinds of work. Occasionally, ALL threads (including the UI thread) become frozen, and my app becomes unresponsive. I've decided it may be a Garbage Collector-related issue, as the GC will freeze all managed threads temporarily. To verify that just managed t...
I've built a C# .NET app that uses the Adobe ActiveX control to display a PDF.
It relies on a couple DLLs that get shipped with the application.
These DLLs interact with the locally installed Adobe Acrobat or Adobe Acrobat Reader installed on the machine.
This app is being used by some customer already and works great for nearly all us...
Let's get this out of the way first: I know that SessionFactory is immutable - I'm trying to change the Configuration at runtime and regenerate ISessionFactory.
Specifically, I have a Customer mapped that will have some fields added to its dynamic-component node at runtime. I would like to do something like this
var newSessionFactory ...
I'm trying to use a single HTTPHandler to authenticate a user's open id and receive a claimresponse. The initial authentication works, but the claimresponse does not. The error I receive is "This webpage has a redirect loop." What am I doing wrong?
public class OpenIdLogin : IHttpHandler
{
private HttpContext _context = null;
p...
Normally when I have a private field inside a class or a struct, I use camelCasing, so it would be obvious that it's indeed private when you see the name of it, but in some of my colleagues' C# code, I see that they use m_ mostly or sometimes _, like there is some sort of convention.
Aren't .NET naming conventions prevent you from using...
I am missing something basic when it comes to using MEF. I got it working using samples and a simple console app where everything is in the same assembly. Then I put some imports and exports in a separate project which contains various entities. I want to use these entities in an MS Test, but the composition is never actually done. When ...
I have a class that wraps List<>
I have GetValue by index method:
public RenderedImageInfo GetValue(int index)
{
list[index].LastRetrieved = DateTime.Now;
return list[index];
}
If the user requests an index that is out of range, this will throw an ArgumentOutOfRangeException .
Should I just let this happe...
I’m working on a large and a high volume transactional enterprise application which has been designed using n-tire application architecture .And it was developed in the .NET platform utilizing C#,VB.NEt, Framework 3.5, ObjectDataSources, DataSet, WCF, asp.net update panel, JavaScript ,JSON, 3rd Party tools. The application is supposed ...
Okay so I'm trying to make a little gag program that will "run away" from the mouse.
So, to get the mouse coordinates for the whole screen and not just the form control I had to create a little helper:
static class MouseHelper
{
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool Ge...
I see some people write:
//wordList is List<string>
wordList.ForEach(delegate(string word){ Console.WriteLine(word);});
instead of:
foreach(string word in wordList)
{
Console.WriteLine(word);
}
What is the advantage in doing so. Also I couldn't fathom the Action delegate syntax given above though I have used delegates in C#...