|
sro116 wrote: I want to use the class BackgroundWorker in a project I'm working on but I want to eliminate the need for the client to cast the arguments in some of the methods and events.
Why do you want to do this? When you say "client" I assume you mean the developer who is using your class. If so, where is the benefit in deriving your own class?
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Hi
I am creating a subtree of XmlElement and XmlText which later are to be inserted into another document. However, it seems that XmlElement only can be created from an existing XmlDocument so I am in trouble. Is there any "workaround" for this so that the XmlElement and XmlText can be created "standalone" without any XmlDocument?
|
|
|
|
|
No, but the XmlDocument doesn't have to be anything special, I've used something like:
class x
{
private static readonly doc = new XmlDocument() ;
...
void somemethod()
{
XmlElement e = doc.CreateElement ( ... ) ;
...
}
}
|
|
|
|
|
Hi all,
I have some problem with hosting an WCF-Service.
I have build my interface and my service.
And then I want to instantiate my ServiceHost with the type of my interface.
But I get an error:
"ServiceHost supports only Class-Service-Types".
When instantiate my ServiceHost with the type of my class, it have no problem.
MSDN-Documentation says:
ServiceHost (Type, Uri[]):
Initializes a new instance of the ServiceHost class with the type of service and its base addresses specified.
Is it not possible to use the type of an interface?
Or have I make an other error?
Thanks in advance for your helpings!
Martin
=== MY SAMPLE FOR BETTER UNDERSTANDING ============
// MY INTERFACE
[ServiceContract()]
public interface IAddressService {
[OperationContract]
Address GetAddress (Int32 index);
}
// MY IMPLEMENTATION OF THE INTERFACE
[ServiceBehavior()]
public class AddressService : IAddressService {
...
}
// MY SERVICE-HOST
static void Main(string[] args) {
// THIS PRODUCES AN ERROR
ServiceHost host = new ServiceHost(typeof (IAddressService));
// this makes no problem
// ServiceHost host = new ServiceHost(typeof(AddressService));
host.Open();
...
host.Close();
}
|
|
|
|
|
Hi,
I want get the actual quota's assigned to a user account.
The code is as follows.
public class QuotaInformation
{
public String DiskSpaceUsed;
public String Limit;
public String QuotaVolume;
public String User;
}
.
.
.
void GetQuotaInformation()
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher(ManagementPath.DefaultPath.Path,
"SELECT DiskSpaceUsed, Limit, QuotaVolume, User FROM Win32_DiskQuota");
foreach (ManagementObject queryObj in searcher.Get())
{
Console.WriteLine("Disk Space Used: " + queryObj["DiskSpaceUsed"].ToString());
Console.WriteLine("Limit: " + queryObj["Limit"].ToString());
Console.WriteLine("QuotaVolume:" + queryObj["QuotaVolume"].ToString());
Console.WriteLine("User: " + queryObj["User"].ToString());
QuotaInformation quotaInfo = new QuotaInformation();
quotaInfo.DiskSpaceUsed = queryObj["DiskSpaceUsed"].ToString();
quotaInfo.Limit = queryObj["Limit"].ToString();
quotaInfo.QuotaVolume = queryObj["QuotaVolume"].ToString();
quotaInfo.User = queryObj["User"].ToString();
}
}
when i used the code in the windows application. it works. it gets the actual quota
inforamation for each user account on my computer.
However, i used the code in the windows service. it gets quota information only for
Asministrater. not for the other users (for example, dad, mam, and grampa).
How I can get the quota information for all the users on my computer.
Thanks for reading.
-- modified at 4:23 Thursday 21st June, 2007
|
|
|
|
|
As default a service runs under the 'Local System' account. This account is restricted for security reasons.
Using the Services snapin for the MMC you can change the account the services runs under which should allow you more control.
|
|
|
|
|
Hi, originSH.
Thank for reply.
I have changed the account the services runs to my account (Administrator). but no luck.
goblins
|
|
|
|
|
First, the quota service has to be turned on. Then, by deault, there are no quotas. They have to be setup first.
|
|
|
|
|
Hi, Dave.
I set up the quota service in the first place. there are entries, Bob, Alice, Administrators, LOCAL SERVICE, etc.
Thanks.
|
|
|
|
|
Hi,
I have a MDI app. On one of the forms I have a control, that uses Ctrl + Shift + F4 and Ctrl + Shift + F6 as a shortcut. The problem is, that the control never gets the keys, because they are used for closing the form and switching MDI forms. Is there a way to disable this function, so they get to the control?
Thanks for reading ...
|
|
|
|
|
Have a look at Control.IsInputKey
|
|
|
|
|
Thanks for directions, but doesn't work
|
|
|
|
|
Don't override functions that are standard within the OS and that people are used to. It's really annoying. People won't want to use an app that doesn't behave in ways that they are expecting.
|
|
|
|
|
I'd really love to, cause I don't like it too. But this seems to me like a bug. If it was just Ctrl + F6, I won't say a thing and would choose another shortcut. But why Ctrl + Shift + F6 is handled like Ctrl + F6?
|
|
|
|
|
I have finally come to a solution. As you know, I think about this issue as a bug. The solution lefts the possibility to use Ctrl + F6 and Ctrl + F4 shortcuts as they are used throughout Windows environment (switching tabs and closing tabs in MDI apps):
    protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
    {
        if (keyData == (Keys.F4 | Keys.Shift | Keys.Control))
          return false;
        if (keyData == (Keys.F6 | Keys.Shift | Keys.Control))
          return false;
        return base.ProcessCmdKey(ref msg, keyData);
    }
Ondra
|
|
|
|
|
MrAndrew wrote: Disabling Ctrl + F4
I hate such applications which go against native Windows experiences. My first preference towards them would be navigating to Control Panel -> Add Remove and Uninstall.
|
|
|
|
|
As I stated, I think it's a bug in handling this keypress by .NET framework. It considers Ctrl + Shift + F4 as Ctrl + F4, which is wrong. My solution preserves the standard function of those keys ...
|
|
|
|
|
Hi all,
currently i am working on visual sutdio 2003 with .net framework 1.1,2
now i am thinking to move to .net framework 3 and visual studio 2005
does this affect my application should i do any special changes except of the installation ?
does upgrading my solution on VS 2003 to VS 2005 affect any thing other than the solution itself ?
kindly tell me about any effects that could happen due to this movement .
thanks
|
|
|
|
|
You shouldn't have any problems, except perhaps if you upgrade an existing ASP.NET app. Nothing should be insurmountable though.
Kevin
|
|
|
|
|
hi,
i want to upgrade an exsiting ASP.NET application . from VS2003 to VS2005
and the .net framework to version 3
so what do u mean by
You shouldn't have any problems, except perhaps if you upgrade an existing ASP.NET app
thanks
|
|
|
|
|
ASP.NET 2.0 is laid out very differently to 1.1
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Is there an easy way to assign a name to an already existing DataSet? I have code which I should not change that returns unnamed datasets, and these I add to a DataSet. The data binding scenario I'm using requires me to give names of DataTables in the DataSet. The Name property is read only on a DataTable.
|
|
|
|
|
Brady Kelly wrote: The Name property is read only on a DataTable.
DataTables don't have a Name property, and TableName isn't read only. What am I missing?
|
|
|
|
|
It's what I was missing, thanks.
|
|
|
|