|
OriginalGriff wrote: days
Only nights
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
We can't possibly help you because we don't know what the code looks like that called the code you've already posted.
And turn off your CapsLock key.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Just don't add the second row. check the data being added for unique values against the existing table. If the data exists, don't add it.
- Kalvin
|
|
|
|
|
I have a border set in all my form controls to Fixed3D but when I run the app, it displays FixedSingle for all of them. And this is across many forms in this project. I have other projects where the border settings display correctly.
What could be causing this?
Thank you
|
|
|
|
|
You could try cleaning your solution, sometimes old settings 'stick'. It's on the Build menu. Then build it again.
Other than that it is very difficult to diagnose. I have occasionally had things like that and the only solution I have found is to start again in a new solution.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Trying to use FTPWebRequest to upload a file through a proxy server and get the error 'The requested FTP command is not supported when using HTTP proxy'. I've looked for help on the net but the only solution people come up with is set the proxy to null
request.proxy = null;
This doesn't help me at all because our firewall has a direct internet block rule. So basically I have to go through the proxy. I can access FTP by using Filezilla with the proxy settings configured correctly (HTTp/1.1 CONNECT method), so I know it is possible.
Anybody have any ideas?
|
|
|
|
|
I don't know myself, however one of my articles got this[^] reaction, which might help you.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hi All,
I am developing a C# library. In that library there is an abstract method in an abstract class which let the users to implement it. Now I want to call that method in some other parts of my library. My problem is that the library aware only about the abstract class not about the class which user implemented. This is something I want to implement.
abstract class MyBase
{
abstract void DoSomething();
}
class AnotherPartOfLibrary
{
public void AnotherFunction()
{
}
}
class UserImplementation : MyBase
{
public void DoSomething(){}
}
All I need to let the user to extent my library and I want to call these extended functionalities in some parts of library. One method I found that to force the user for an entry of user class name in configuration file. So that I can create an instance of user class using reflection. But is there any other methods to do this?
Thanks & Regards,
Thomas
|
|
|
|
|
Does AnotherPartOfLibrary inherit from MyBase? If not, what is the relationship between the two classes?
You can't call MyBase.DoSomething() because it is abstract. If everything in the base is abstract are you sure you want a base class and not an Interface?
|
|
|
|
|
No AnotherPartOfLibrary is not inherited from MyBase. They don't have any relationship. This a library which can be extent. Its a component for the programmers. My problem is related to design of the component. Ok I will tell you the scenario. In this library, I am not aware of the user implemented classes. The users will implement the classes by extending the classes in my library. So those classes are defined only at the time of user implementation, not at the time of designing the library. Here comes my problem. I want to call the user extended functionalities in my library. Hope I am clear now.
|
|
|
|
|
I agree with the other answer...are you sure you don't want an interface and not an abstract class?
Also, how are you not getting errors with what's written anyway? First, you need to specify that abstract void DoSomething() is public. Secondly, in order to implement it, you have to override it in the class that inherits from it. In other words, it should be
public override void DoSomething()
And why would you ever want to call a method within an abstract class? You want to call a method within a class that inherits that abstract class. Unless, you just want an interface.
If you just want an interface, you would want something like this:
|
|
|
|
|
William Winner wrote: how are you not getting errors with what's written anyway?
yes I know I can't call a method in an abstract class, it will make a runtime error. I just demonstrated how I want to implement it. It was to make clear my idea.
William Winner wrote: Secondly, in order to implement it, you have to override it in the class that inherits from it. In other words, it should be
public override void DoSomething()
Sorry that was a typo.
William Winner wrote: And why would you ever want to call a method within an abstract class? You want to call a method within a class that inherits that abstract class. Unless, you just want an interface.
May be I couldn't explained my problem properly. This is a design issue. myBase and AnotherPartOfLibrary are in my library. The
UserImplementation is not part of my library. It declared only at the time of user implementation. That is my problem. This a set of components for the use of programmers. They can use the classes in library. Also they can inherit some class for extending its functionality. So my problem is, while designing this set of classes I am not aware of the classes the users going to implement. How can I initialize those classes in my classes?
|
|
|
|
|
Your users can pass any instance of thier class that derives from your abstract base class to any method that has a parameter of your base class's type as per my earlier example. You will only have access to properties/methods declared (not necessarily implemented) in the base class of course - but that's all you need.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
To do this you need to either have a parameter of MyBase or ineriting class in the method
public abstract class MyBase
{
public abstract void DoSomething();
}
public class AnotherPartOfLibrary
{
public void AnotherFunction(MyBase myBase)
{
myBase.DoSomething();
}
}
public class UserImplementation : MyBase
{
public override void DoSomething()
{
throw new NotImplementedException();
}
} or a field of MyBase or inheriting class that you can use in AnotherPartOfLibrary .
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Hi,
I'm trying to obtain the row number yet I haven't been able to figure out how. I have tried this:
x = reunionBindingSource.Position;
However, since I have already done this:
this.reunionBindingSource.Sort = "LastName";
the position does not equal the row number. I know I can save the position number, unsort it, grab the row number from position, resort it, and set the position. I could also build a dictionary before sorting it using the database key as the dictionary key, but there has to be a better way.
Thank you,
Glenn
modified on Thursday, May 13, 2010 1:01 PM
|
|
|
|
|
Sorry - but not sure what a non-grid view is...
|
|
|
|
|
What I mean from a non-grid view is a detail view, where the controls are individual controls on a form instead of a grid view.
Thank you,
Glenn
|
|
|
|
|
Hi
Does anyone have any decent links or documentation for non blocking TCP programming. I have a server that accepts incoming connections and processes requests from users but I cant get it working very well. Any help would be appreciated.
Thanx
|
|
|
|
|
|
When you accept you get a socket.
You process that socket in another thread. Either create one or use the thread pool.
|
|
|
|
|
Hello,
I've some list<string>, i would like to retrieve a sub list of a given list from 'startPos' till 'endPos'
how can i do that ?
thanks
|
|
|
|
|
If you are using List<T>[^] class then see GetRange[^] method.
If you are talking about a different kind of list then you need to elaborate a bit.
|
|
|
|
|
and after GetRange, i should Clone it ? (avoid shallow Copy)
|
|
|
|
|
igalep132 wrote: and after GetRange, i should Clone it ?
It depends on your requirements.
If you really need to avoid shallow copy, then you can make a deep copy on result returned from GetRange .
For this purpose you can use a generic method like this one:
public static T DeepCopy<T>(T obj)
{
object result = null;
using (var ms = new MemoryStream())
{
var formatter = new BinaryFormatter();
formatter.Serialize(ms, obj);
ms.Position = 0;
result = formatter.Deserialize(ms);
ms.Close();
}
return (T)result;
}
The code above should work for all serializable types.
modified on Thursday, May 13, 2010 10:49 AM
|
|
|
|
|
thanks
|
|
|
|