|
Hi All,
What's the equivalent of CScrollView in .NET? I'm looking for something to let me draw large vector diagrams in a scrollable, zoomable view, then print them either on multiple pages or scale-to-fit, and nothing seems to fit the bill.
Any suggestions gratefully received!
|
|
|
|
|
Should I implement an IEnermable interface explicitly?
#region IEnumerable<Range> Members
IEnumerator<Range> IEnumerable<Range>.GetEnumerator()
{
foreach (Range r in ranges)
yield return r;
}
#endregion
#region IEnumerable Members
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
throw new NotImplementedException("Non-generic enumerator");
}
They both cannot be implicit because C# does not allow overloading methods that only differ by return type. In what senerio should GetEnermerator be explicit rather than implicit? How do you usually implement yours? Also should I implement anything in the non-generic GetEnumerator method?
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
I'm not sure I understand the question, but I would probably change that first method to
<br />
IEnumerator IEnumerable.GetEnumerator() <br />
{<br />
return ( ranges.GetEnumerator() ) ;<br />
}<br />
|
|
|
|
|
PIEBALDconsult wrote: I'm not sure I understand the question
I am curious to whether I should implement the interface explicitly rather than implicitly. If I implement it explicitly I will not be able to call the GetEnumerator method unless I cast the instance of my class to IEnumerable(I think). Do you usually implement your IEnumerable interfaces explicitly, and do you implement any functionality in the non-generic GetEnumerator method?
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
Why does your generic GetEnumerator method return a non-generic enumerator?
---
Year happy = new Year(2007);
|
|
|
|
|
Guffa wrote: Why does your generic GetEnumerator method return a non-generic enumerator?
CP seen those as HTML tags and removed them, I should have checked "ignore html tags" when I posted it. It is generic in my project.
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
Captain See Sharp wrote: CP seen those as HTML tags and removed them, I should have checked "ignore html tags" when I posted it. It is generic in my project.
I see.
If you let Visual Studio create the stubs for implementing the interface, this is what you get:
public class test : IEnumerable<string> {
#region IEnumerable<string> Members
public IEnumerator<string> GetEnumerator() {
throw new Exception("The method or operation is not implemented.");
}
#endregion
#region IEnumerable Members
IEnumerator IEnumerable.GetEnumerator() {
throw new Exception("The method or operation is not implemented.");
}
#endregion
}
This makes the non-generic method explicitly implemented. I think that will work the best, as you should prefer the generic method unless you are using a reference to IEnumerable.
I would implement both of them, even if one is rarely used. There might be a situation where you would need the non-generic one.
---
single minded; short sighted; long gone;
|
|
|
|
|
Guffa wrote: I would implement both of them, even if one is rarely used. There might be a situation where you would need the non-generic one.
Is it possible for me to use the yield statement in the non-generic GetEnumerator method? If so should I then make the generic version call and return the return value of the non-generic GetEnumerator method which would contain the iterator logic with the yield keyword? What is the best practice for implementing the IEnermerable interface?
I figured out a better way, I will just return the enumerator for the internal array.
-- modified at 17:24 Thursday 1st February, 2007
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
I wrote some C# code to send an e-mail using System.Net.Mail.SmtpClient. This allows me to specify the sender, receiver, message, etc., and it works on one SMTP server perfectly. However, when I tried using AOL's SMTP server instead, I was getting authentication failures from their server. Using my regular e-mail program (Eudora), I CAN send to AOL's SMTP server.
The only apparent difference between the two programs is that Eudora does this:
EHLO name..
AUTH LOGIN..
<credentials>..
The program I wrote using SmtpClient does this:
EHLO name...
AUTH LOGIN <credentials>..
AOL's SMPT server rejects the latter, saying "501 INVALID SASL FORMAT OR LENGTH".
I don't know if what AOL's server is doing is breaking any rules or not, but that's kind of beside the point. Is there any way to adjust the SmtpClient object to be more "friendly" to AOL? If not, is there another class I can use?
|
|
|
|
|
I have my collection displayed as property in PropertyGrid.
How can I prevent the collection from being editable by .NET Framework's Collection Editor Dialog Box?
Thanks.
|
|
|
|
|
if i understand correctly
[Browsable(false)]<br />
public CollectionType Collection<br />
{<br />
get{;}<br />
set{;}<br />
}
|
|
|
|
|
No, this is not what I mean...
"[Browsable(false)]" on my collection tells the property grid not to display the collection in the grid.
Whereas I _need_ the collection to be displayed; at the same time the collection is expected to be in "read-only" mode.
Thanks.
|
|
|
|
|
Oh sorry man.
You define only the get function.
Now if you want the property to be read/write but only readonly in the designer i realy haven't used it but i think there might be a readonly attribute like browsable.
Let me know. Thank you.
|
|
|
|
|
I have a managed dll that captures webcam video with Directshow. I could easily display the video in .NET 2.0 by drawing on the background of the panel. There is just an abstract Panel in .NET 3.0, other Panels (Dockable,..) have no Graphic object I could draw with nor any background I could set my images to.
I tried the following:
BitmapSource bitmap = BitmapSource.Create(320, 240,
96, 96, PixelFormats.Rgb24, null,
Streaming.samplePointer, 357480, 320 * 3);
dockPanel1.Background = new ImageBrush(bitmap);
dockPanel1.InvalidateVisual();
It didn't work. It just fills my memory periodically if I observe Task Manager, but it displays nothing. And streaming works perfectly well under 2.0 by drawing on a Panel. What should I do? How is this situation supposed to be handled in 3.0?
|
|
|
|
|
Hi All,
How can I change the build version of the generated DLL file in Visual Studio 2005 webproject??
I want it to be changed automatically each time I build the project.
Thanks all
|
|
|
|
|
In your AssemblyInfo file, there is a section that looks like this:
<br />
[assembly: AssemblyVersion("1.2.1.*")]
This controls the assembly version. The asterisk at the end shows that the revision will be autoincremented. If you want to autoincrement the build number, place a * there as well.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi all,
what are differences between Local, Global and Satellite assemblies. And which should be used in which scenarios. Can anybody please tell me in detail. Thank you.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
indian143 wrote: Can anybody please tell me in detail. Thank you.
Yes. Lots of people. And lots of them can be found through Google.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Yes, I tried with google. But I couldnt find it in nice way(may be my query was in incorrect matching, because google works on it only), if you have any link please provide it to me, no. Please. Thank you.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
Have a look at this resource then. Clickety[^]
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi all,
In which component of .Net framework, the basic data types are defined. Means from which component we are able to get all the basic datatypes. And how. Please tell me in detail. Thank you.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
First of all, have you googled for this information.
Second, stop asking people to tell you in detail. I sometimes think you are asking to get flamed.
Third, learn a bit about how .NET works. Buy some books, or read the MSDN or something. Try to show that you have done a bit of research beforehand.
Finally, if you want to know where something exists learn to use the Object Browser. Open it up and have a look around the different namespaces. The big hint here, is that it isn't where you would expect it to be (i.e. the System DLL). If you know anything about the compile cycle in C#, then you will know that there is a certain DLL that gets linked in regardless of anything else and that does not appear in the references. A bit of thinking would deduce that this is the logical place for the basic types (i.e. System.String). Open it up in the browser and there you go.
I'm not going to tell you which DLL this is. There is enough information there for you to find it yourself.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Yes sir, I got it. But why are you so angry. I am sorry. I know that its very basic, but I didnt observe. Thank you.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
indian143 wrote: Yes sir, I got it. But why are you so angry. I am sorry. I know that its very basic, but I didnt observe. Thank you
I'm not angry. I'm trying to help you here. You are in serious danger of people ignoring your posts because they think you are trying to get them to do your work for them. You have made lots of postings where pretty much the first reply is look it up in google. This is known as RTFW. It's pretty much becoming the standard response to you.
Plus, you have to stop asking people to give you detailed replies. This is a volunteer forum where people give their time freely - they don't have time for handholding. Most of the time, you will get pointers, hints and suggested areas to take you further if you are asking for something that takes a little bit longer to understand. The forums are not the place for detailed replies or article length conversations.
Before you post a question here, take a look at Google. Find out what other people have to say and read up on it. Then, if you don't understand something post here with a question that shows that you have read up on a subject and that there is a specific area that you are having a problem with. This gets you respect, and people will be far more willing to help you.
Take the following two hypothetical questions, and ask yourself which is likely to get you an answer.
"How do I load an assembly?"
"I understand that I can load an assembly using a method like Assembly.LoadFrom, but I can't really get my head around how to load it into a separate Application Domain. I've looked it up but opinion seems to be divided about what the best method is, and what the performance hits are going to be. Has anybody done this before and, if so, what were the tradeoffs that you had to cope with."
Think about it. That's all we're asking.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Ok. Thank you my dear Pete, I will try to change it my attitude. But still I say sorry. Thanks for your advise.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|