|
|
And using Google, you may find your question posted by someone else with a "let me google that for you" answer only...
|
|
|
|
|
You could use a tool like ILDASM or Reflector to have a look at the code behind the class file.
|
|
|
|
|
Hi,
Each time I try to sue the Strategy pattern, the concrete strategy have difference parameters.
For example the Strategy method could be a "double getprice()"
and a concreta class could need a matrix of interest rates, another classes a series of earning, other volatility numerbers and so on.
As opposed to this, most of the example I see on the web for the strategy pattern only involve either a series of commond paramters or no parameter at all to be passed to the strategy method.
So
1) Am I using the wrong patter to sort this problem?
2) If not how can I pass the Interface (IInstrment) to the client and give a way to the client to change the parameters?
For example
inferface IInstrument
{
double GetPrice()
}
class Stock : Instrument
{
double GetBody();
array[] double earnings{get;set}
double risk;
date today()
}
class Bonds : IInstrument
{
string GetBody();
double rate;
}
Thanks
|
|
|
|
|
When a simple strategy method with a constant signature isn't sufficient, I think you should rely on an interface and a strategy object, the strategy object holding all the data it needs, and one of its methods implementing the interface you're going to call in order to apply the strategy.
|
|
|
|
|
Hi Luc,
I think what you are suggesting is in line with the example I provided in my mail. Is it?
However, if I let the object store all the parameters and implement the strategy method of the internface,
How can my client change the Parameters (without doing any typecast) ?
This this what I would like to do:
ex.
Client.GetPrice()
%Change some parameters
Client.GetPrice()
Thanks
|
|
|
|
|
pierpaolo paparo wrote: How can my client change the Parameters (without doing any typecast) ?
What I was thinking would be along these lines:
interface IStrategy {
int Execute(someParameterList);
}
class Algorithm {
public int Execute(IStrategy strategy) {
...
int result=strategy.Execute(someParameterList);
...
}
}
MyStrategy strategy=new MyStrategy();
strategy.Property1=someValue1;
strategy.Property2=someValue2;
Algorithm.Execute(strategy);
obviously the algorithm cannot provide parameters to the strategy other than those set out in someParameterList, as it must treat all strategies equally. However the caller can influence its strategy by amending the code and/or providing constructor parameters or property values.
|
|
|
|
|
Hi Felolows,
Pls how do pass values to and fro an external class library from my .exe prgram.
the class library is written in vb2008 while the exe is in c#.
thanks.
|
|
|
|
|
If you want to use a class from a dll written in vb.net in your C# program, you just instantiate that class and call the method (with the appropriate arguments). What kind of problems are you experiencing?
|
|
|
|
|
the problem is that when i instantiate the DLL class in mt program,
the base class from which the DLL inherits is loaded, that is the program that the DLL is fused to
starts up with my program.
i donot want this to happen.
thanks again.
|
|
|
|
|
You may need to explain more.
|
|
|
|
|
As PIEBALDconsult mentioned - please explain more.
|
|
|
|
|
is there any functionality in c# where in I have a windows server running on a machine and other clients in the LAN with windows OS (say 98 or XP), so I need to shutdown or standby the clients from the server.
If anybody has the answer do reply
Thanx
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:01am.
|
|
|
|
|
thanx for the help....as suggested I'm onto developing a tool for the same.........I can perform the task by making it domain controller........and also if I can do the same in java too.....coz im a novice to java
|
|
|
|
|
Hi,
There's a command line included with Windows you can use to shutdown/restart stations remotely, provided they're in a domain and the process is launched by an administrative account.
This command-line utility is called shutdown.exe, and you can have all its functionnalities printed with the /? switch.
If you want to use it in C#, here's one of the links you can use to achieve it :
http://blogs.msdn.com/b/csharpfaq/archive/2004/06/01/146375.aspx
|
|
|
|
|
Of course you can shutdown remote machine if it is in LAN. You can do it with WMI.
modified on Monday, August 23, 2010 5:23 AM
|
|
|
|
|
A server is meant to serve one or more clients, not to act as a big brother. It should not do things to a client that that particular client did not ask for.
|
|
|
|
|
In general "servers" do not have control of client machines. But there is a special class of servers that do, they are called "Domain Controlers", and as such can perform task such as shutdown a client computer.
|
|
|
|
|
Nope. If a server does something to my client machine I did not ask for, it will have been its last action. It is called server for a reason, it is not called boss.
|
|
|
|
|
Hi all. I want to write soft that will decrypt credentials file. to do this I need to use CredRead function. If anyone know even if a little information about it, please respond.
Thanks,
|
|
|
|
|
Either ask this as a Q & A or in the forums - don't just ask the same question everywhere as it just duplicates work and annoys people.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
See here[^].
It's time for a new signature.
|
|
|
|
|
|
Windows functions are documented in MSDN, so start out here[^].
As this is a native function, and assuming you really need it, you'll need P/Invoke technology. This article[^] may be useful.
However I suggest you make sure first there isn't a managed solution to whatever problem you're having.
|
|
|
|