Say I have the following set of classes, is it possible for the attributes of DerivedClass to be merged? Currently if I use the GetType().GetCustomAttributes()method passing in true for inheritance it takes the highest attributes in the inheritance structure.
i.e. [Another("Bob")] and [My(16)]
Is it possible for the attributes to be me...
I write a desktop application that can open / edit / save documents.
Those documents are described by several objects of different types that store references to each other. Of course there is a Document class that that serves as the root of this data structure.
The question is how to save this document model into a file.
What I need:...
Every time that I want to make a thread in the ThreadPool I make a stupid little function like Worker_O below.
Sub Worker(ByVal i As Integer)
'do important stuff
End Sub
Sub Worker_O(ByVal o as Object)
Worker(CType(o, Integer))
End Sub
Sub MakeThread()
Dim worker1 as new Threading.WaitCallback(AddressOf Worker_O))
Thre...
We have a .net 3.5 web app that consumes third party web services. The proxy was created by adding a web reference to their wsdl. This proxy is not compiled.
Our error logging is picking up frequent but intermittent exceptions:
An exception of type 'System.Web.Services.Protocols.SoapHeaderException' occurred and was caught
If I follow...
Hi
I am currently tryibng to convert a given time(Entered via a text box) , The time entered would look a little like 01 52 22 mins secs mili secs.
however Timespan.parse(tbName.text) gives me an incorrect format error.
I have got it to work if i input something like 46 in to the textbox but then it sets the days to 46 not the second...
Is it possible to tell that a mock/stub has seen no interaction at all in RhinoMocks.
Something along the lines of:
logger.AssertNoInteraction();
Which would assert no method has been called on the stubbed logger.
This would be a much less tedious than calling the following each time:
logger.AssertWasNotCalled(l => l.Debug(Arg<strin...
What is the best way to use java library from .NET?
...
I have a CustomConfigurationSection that I have implemented. I would like to be able to support having many different named instances of this configuration section defined. However I would also like some way to identify a default instance of the ConfigurationSection if an application developer doesn't specify a specific named instance ...
hi
a) Shouldn’t the following assignment cause an error, since number 100 is a literal of type int and since compiler doesn’t allow implicit narrowing conversions?
byte b = 100;
b) If compiler doesn’t complain about implicit narrowing conversion from int literal to type byte, then why doesn’t it also allow an implicit narrowing co...
I'm working on a new project now, and have given some thought to the IoC setup. I'm aware that you shouldn't be depending on the service location pattern (much, anyway), but that there are just a few places in a well-structured application where it may be necessary. In that case, do you use the CommonServiceLocator project, or not bother...
Hi,
I have a .NET windows service which acts as a host for some wcf. In the OnStart method the service hosts are created and started. The service is configured to startup automatically. This works well on Windows 7 (32bit and 64bit) and it can be startet with "net start" on Windows XP Pro SP3. The service startup with "net start" comman...
How can I do some code when the user changes what line the caret is on?
so something like:
sub textbox1_lineindexchanged (byval ....) Handles Textbox1.Lineindexchanged
'do code based on the current line
end sub
sorry, I am using a richtextbox, just I always used it so I just call it a textbox in my thoguhts.
...
I have vb app that calls another vb app using Process.Start(PROGRAM).
My question is how can I pass a parameter to the PROGRAM and how can I intercept it in the PROGRAM?
...
Suppose you're calling a Win32 function that will fill in your byte array. You create an array of size 32, empty. Then pass it in to the Win32 function to be filled int, and use it later in your managed code. Does there exist the chance that the byte array might be moved or overwritten in between the time it was allocated and it is fille...
I changed a dataset based approach to my sqlite database to one using the Entity Framework. I created the entities using Visual studio 2008's wizard and had the connection string stored in the app.config. A client program then communicates through WCF with the database. This works well on the development computer when I host the WCF serv...
I have a working screensaver and would like to figure out how I can control the name Windows displays in the screensaver drop down list. Currently it all seems to be based on the filename but I know that can't be the case. Here's what I've tried and the results:
Filename: CC.Votd.scr ScreenSaver Name: Cc
Filename: CC Votd.scr ScreenSav...
I've added to my project a dataset item called : myDataSet.xsd
After this, I drop tables on myDataSet.xsd file. That's all okey.
What I want to do is, to build Sql Transaction's as function on
that dataset, how can I do this?
...
This test fails:
using Microsoft.VisualStudio.TestTools.UnitTesting;
[TestMethod()]
public void dictEqualTest() {
IDictionary<string, int> dict = new Dictionary<string, int>();
IDictionary<string, int> dictClone = new Dictionary<string, int>();
for (int x = 0; x < 3; x++) {
d...
I need certain criteria to be met, a particular folder needs to be present on the c drive, before this app should load. How, during the load process, can I stop/quit the application.
I already have ascertained if the folder exists. In old VB projects you would just use 'Unload Me' but that isn't in C#. I tried Application.Exit() but t...
Ok so Google is not my friend tonight...
I have a screen saver, CC.Votd (Full source on Codeplex), and I've just started to implement the preview mode (/p argument) which is working ok. When it's in preview mode I make my form a child to the little computer monitor window and it draws in there.
This works fine and my application exits ...