I have an abstract base class T, from which classes A and B inherit. I now have an operation (on T) which requires a slightly different implementation in A and B, but most of the code is the same. Let me give you an example: There are two possibilities to implement something like a .Clone method:
Public MustInherit Class T
Protected...
Hi.
I need to build a service in form of a COM+ component using Enterprise Services.
The service is working right now. It gets a string does some spell-checking and returns a string.
My question is:
This component was compiled in .NET 1.1 but my environment is going to change to .NET 3.5 soon.
So if I compile the code in .NET 3.5 (w...
can any expert help me out to solve a problem of burning a dvd using c#.net as a front end??
i need to select files from the listview in winform and then on button click i need to burn those multiple files in the dvd..
the concept is to select the multiple files from listview then on button click it should make a folder in some desired d...
ClickOnce security causes deployment of an application to fail if the new installation location is different from the previous one. Typically, this is the message one gets:
You cannot start the application
from this location because
it is already installed from a
different location.
Click here to send this error to the
...
I use TextWriterTraceListener (System.Diagnostics) in my application to trace several things like exceptions,...
The application is running on a terminal server and if there are many users using it simultaneously the listener starts to create many tracefiles with random GUIDs in the filename.
Are there possibilities or workarounds to ...
I'm developing an application in VB.Net (VS2008) which allows the creation of classroom layouts. The layout is a panel and has child panels (seat objects) the seats are then populated using drag and drop and show a preview of the person sitting there.
I would like to export this panel to a printable format such as jpeg, pdf etc.
I have...
In the class:
private Func<T, object> pony;
In my function:
object newValue;
try {
newValue = pony.Invoke(model as T); // This is the line where I get an exception!
} catch (Exception exception) {
// This code is never run, even though I get an exception two lines up!
if(exception is DivideByZeroException) throw new DivideByZer...
Let's say I have some variable x (of type myClass), which is initially null and some assignment
x = myObject
occuring exactly once in some background thread.
Is it guaranteed that x always contains either null or myObject when accessed from the main thread? Or is it possible that x contains some invalid data shortly?
...
Hi what is the best way to format a decimal amount to string for ui display in the correct culture info?
Many Thanks
...
I am using T4MVC, and I can't use a pre-build event to run TextTransform.exe as it relies on EnvDTE, and must be run with Visual Studio as host.
If I have run custom tool once, it works nicely because it marks itself dirty when its executed (AlwaysKeepTemplateDirty = true), but when you open the solution, it doesn't run on build, so I w...
Application.SetCompatibleTextRenderingDefault(false);
Error :
Before the establishment of the first object IWin32Window in the annex to call SetCompatibleTextRenderingDefault.
why error ? how to avoid ? and ... what SetCompatibleTextRenderingDefault actually makes :)
...
I have a windows form (C#.NET) with a statusLabel that I can not seem to get to update in the middle of a process in event handler methods. My code looks like this...
void Process_Completed(object sender, EventArgs e)
{
string t = "Process is finished!";
this.Invoke(new StatusLabelUpdator(updateStatusLabel), new...
Regex hrefs = new Regex("<a href.*?>");
Regex http = new Regex("http:.*?>");
StringBuilder sb = new StringBuilder();
WebClient client = new WebClient();
string source = client.DownloadString("http://google.com");
foreach (Match m in hrefs.Matches(source)){
sb.Append(http.Match(m.ToString()));
Console.WriteLine(http.Match(m.ToString()))...
Hi!
I've got an ASP-UserControl QuestionWithAnswer (.ascx) : BaseQuestion : UserControl
and a ControlDesigner QuestionDesigner : UserControlDesigner.
Now i use the DesignerAttribute to associate control and designer:
[Designer(typeof(QuestionDesigner))]
public class BaseQuestion : UserControl
all types are in the same assembly (WEB A...
I have a table with hit statistics for some items in another table.
This table is defined like this
ID (Primary key)
ItemId (Foreign key)
Date
Hits
Giving me have a record pr. item pr day.
The database is used in a multithreaded environment, so two users might make the first hit at the same time causing two records to be created, w...
Looks like XSD.exe is not delivered as a part of Visual Studio 2010.
what is the alternative being offered in VS2010?
...
This is a bit of weird scenario. I had a class that was quickly becoming a God class. It was doing WAY too much. Suddenly I had violated SRP. The class was responsible for X and Y and Z, oh and A, and B, don't forget C. So I decided to refactor it. The reason it got this big is because the class does a lot of work with a collection which...
While trying to reproduce a reported problem with a managed nt-service, I've noticed that the performance counter "# of Methods Jitted" is constantly increasing (together with "# of IL Bytes Jitted"). The reported behavior consists of taking alot of memory (not necessarily everything available on the machine) and consuming 100% cpu. Requ...
I'm using a ContentControl to display various ViewModels, which all use DataTemplates for view generation.
Now the problem is, after i change the content (by clicking on a hyperlink for example), things such as hyperlinks appear inactive (i.e. grayed out), until i click on the UI again. Is there any way to avoid this behaviour without ha...
How to measure the total memory consumption of the current process programatically in .NET?
...