|
Can I have a abstract function to implement a interface?
For example
namespace Project1
{
public interface ITest
{
String ControlTitle { get; }
}
}
namespace Project1
{
public abstract class Test : ITest
{
public abstract String ControlTitle();
}
}
|
|
|
|
|
Not the above code, you changed the property defined in ITest to a method.
Otherwise yes.
One question though, why not just try it?
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
did you try it? what happened?
A little self help wouldn't go amiss!
|
|
|
|
|
I tried it before posting here. It was the error of having it as a method rather then a property that was holding me back.
|
|
|
|
|
how can i build a view of the object while i am editing it. Like in Ms power point. I am not sure where to start and look from any suggestion, please.
|
|
|
|
|
netJP12L wrote: I am not sure where to start
We're even, because I don't know what your asking for.
only two letters away from being an asset
|
|
|
|
|
Sorry if I didn't explain clearly. I have 2 panel on my Left side panel I couple of objects which which i move then around and on the right side I want to display the view of the left side panel. If I move any of the objects on the left side the changes should effects right away and should be shown on the right side panel.
|
|
|
|
|
The way to do this is to use a design pattern (or two). I'm thinking here specifically of the Model View Controller pattern. Read up on this as it's going to be your best friend here. As a taster though, I will tell you that the MVC pattern allows you to have one model with multiple views of the same model so you will update the model and the views will be updated to match. I'm sorry, but I can't give you the code for this because it is a fairly complex design architecture that you need to get to grips with and it's more code thank I could give you in such a short space.
|
|
|
|
|
Hello.
I have developed a simple communication system as a website where my site users can send messages to each other after logging in. I store the messages in SQL Server. I store the subject, body and other common properties of a message. What I need now is to make my web application POP3- and SMTP-enabled. So that I not only store my messages in my database, i prove my users with email addresses on my website like user1@mydomain.com, so that incoming emails to this address, will be intercepted and I can show each user his messages. Also they can send messages, not only to the internal users of my system, but everybody who owns an email. I think I should let my application talk in POP3 and SMTP language.
On the net, I found some useful articles. One described how to use socket programming to save the message on the server side in a folder. But the problem is that who is gonna send it at the end? IIS? But what if I myself want to send it? What should I do to send a queued message to the recipient's address?
Please if anybody has any experience in this field, help me out.
Thanks in advance.
|
|
|
|
|
Hi Hamid,
what you want to implement is called a 'mailserver'.
There are 2 possibilities to realize that :
1. If you want to reinvent the wheel : You can write your own server, but you should be aware, that
this is NOT trivial. There will be at least 2 protocols you have to implement (SMTP & POP3) in
addition to all the internal handling. If you plan to do something like that, I would recommend
to have a look at the RFC's first so that you have an idea what that means.
A collection of RFC's can be found here :
http://www.rfc-editor.org/rfc-index2.html
2. You can use an existing product. There are several commercial and non-commercial systems available.
Here are just a few links, to some existing solutions :
Lumisoft Mail Server
mail Enable
Hope, that helps a bit ...
Sven
|
|
|
|
|
Check out the System.Net.Mail[^] namespace. It has a bunch of good stuff that might help you with your problem.
|
|
|
|
|
I have an MS Access DB and a desktop application which I want it to check for the new items on the database and print. right now i am able to check the database and see the new items, but I dont know how to refresh it on the desktop app.
I want to check the db ( lets say) every 2 mins for new items on the list.
private void TheJob()
{
DataAccess da = new DataAccess();
string sql = "SELECT COUNT(*) FROM read WHERE [New?]=true";
string tmpValue=da.GetValue(sql);
NotifierInfo.Info = "You have " + tmpValue + " clients waiting";
NotifierInfo.ShowInfo();
How can i check the database every 2 mins for new items ? Thanks
|
|
|
|
|
You should have a look at the timer class (System.Windows.Forms.Timer).
An article about how to use it can be found > here < ...
Hope, that helps ...
|
|
|
|
|
Hi,
I'm implementing the .net Backgroundworker without any big issues.
But I don't really like to have to parse (box, unbox etc) the DoWorkEventArgs argument.
Shouldn't I be able to Inherit from this class to make my own?
When I do so, I get the No overload for method 'DoWorkEventArgs' takes '0' arguments error.
What am I doing wrong? I feel like I'm doing something shamefully wrong with inheriting in general ...
|
|
|
|
|
You could create your own args, but it'd do you no good unless you built your own BackgroundWorker that created your args.
boersnoes wrote: But I don't really like to have to parse (box, unbox etc) the DoWorkEventArgs argument.
No boxing or unboxing is going on, unless you're storing a value type in the Result or Argument of the args. Anything else is just casting, which is fine by performance standards.
|
|
|
|
|
Well, currently I have to do this:
<br />
string from = (string)((object[])e.Argument)[0];<br />
string to = (string)((object[])e.Argument)[1];<br />
string fileName = (string)((object[])e.Argument)[2];<br />
This looks like boxing to me, but correct me if I'm wrong.
Furthermore, I can't rely on all the arguments being there.
When I call the method I have to do like this:
<br />
syncWorker.RunWorkerAsync(new Object[] { fromDir, toDir, fileName });<br />
This requires the consumer of my methods to know what arguments are required and what order they ought to be in.
So either there has to be a better way of passing arguments on, or I have to create my custom DoWorkEventArgs.
|
|
|
|
|
That's not boxing, that's casting. Boxing would occur only if one of the arguments in there is a value type (a struct) such as an int, double, etc.
Here's what I recommend. Don't pass in an object array as the argument. Instead, create a custom class that contains your data, and pass that in as the args:
class MyArgs
{
string From;
string To;
string FileName;
}
....
syncWorker.RunWorkerAsync(new MyArgs(from, to, file));
...
void OnDoWork(DoWorkEventArgs e)
{
MyArgs args = (MyArgs)e.Argument;
}
|
|
|
|
|
Hi, can someone help me out ?
I have a line of code in the cellClick of a datagridview.
<br />
System.Diagnostics.Trace.WriteLine("Cell Click before");<br />
this.DoDragDrop(DgLevels.Rows[e.RowIndex].Cells[DbCnst.Lev_ID].Value.ToString(), DragDropEffects.Move)<br />
System.Diagnostics.Trace.WriteLine("Cell Click after");<br />
But when clicking one time on the cell, "Click before" appears in the output window, but it takes almost a second before "click after" appears.
it also doesn't work like it should be. seems like it switches the drag and drop.
click (drag)
click second time and nothing happens, even when event is fired.
looks like there is a timeout for the drag and drop.
do i need to cancel it ?
thx
Kurt
|
|
|
|
|
OKay, my fault.
I should have used the cellmousedown..
So this works better.
Still one problem, it doesn't show the drag icon immediatelly, only when i start moving the mouse.
greetz and merry Xmas
Kurt
|
|
|
|
|
Any webproject after build/rebuild/deployed it is taking more time to load the first page.
if we close the page and agian opening the page , it is showing very fastly
we are using Ajax, Infragistics in our project.
i think it is loading all dll in memory when loading first time.
how can we overcome this scenario that means can we load the dlls asyncronously so that user will not feel the late page loading or is there any option in .net.
|
|
|
|
|
This can be attributed to Just-In-Time (JIT) compilation occurring the first time the application is run. JIT compilation is a core feature of .NET so I suggest you read this article[^]to learn more about it.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
The delay is caused by IIS dynamically compiling the application on the first run after it is rebuilt. You'll also notice this happening if you stop IIS and start it again.
I personally don't think this is a big problem, and this approach provides a number of advantages. However, if it is a big issue for you, have a google for pre-compilation in ASP.Net 2.0.
"On one of my cards it said I had to find temperatures lower than -8. The numbers I uncovered were -6 and -7 so I thought I had won, and so did the woman in the shop. But when she scanned the card the machine said I hadn't.
"I phoned Camelot and they fobbed me off with some story that -6 is higher - not lower - than -8 but I'm not having it."
-Tina Farrell, a 23 year old thicky from Levenshulme, Manchester.
|
|
|
|
|
Is it possible to update Embedded resource file dynamically?
can we add a new Embedded resource file dynamically?
Please Provide some samples
|
|
|
|
|
No. Since the resources are compiled into the .EXE and the .EXE file is locked for the entire time your app is running, you can't modify the file.
|
|
|
|
|
Couldn't you do the following...
1. Exe1 starts running, with resourceA in it
2. Exe1 spawns Exe2
3. Exe1 is killed (either by Exe2 or it kills itself)
4. Exe2 modifies resourceA in Exe1
5. Exe2 spawns Exe1
6. Exe2 is killed (either by Exe1 or it kills itself) The step in question is step 4, as the others are pretty well defined. Is there some way to perform that step?
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|