I don't know if this is the correct way , but may be it is helpful
class File { }
class TextFile : File
{
public void Process () { }
}
class IniFile : File
{
public void Process () { }
}
------
File myFile = new TextFile ( "filename.txt");
myFile.Process ();
--------------
:umm:
On Sat, Apr 2, 2011 at 2:31 PM, tom.schultz <[email protected]> wrote:
> I have a question
>
> If I wanted to implements an class that can take files of different
> types as input i guess interfaces
> Like:
> myTextFile = MyFileHost.RequestDocument( ITextFile("test.txt"));
> myIniFile = MyFileHost.RequestDocument( IIniFile("test.ini"));
>
> myTextFile.ReadLine(...);
>
> myInifile.ReadValue(sSection, sVar);
>
> Is this even the correct way of doing things in c#, and how would you
> implement this?
>
> regards Tom
>
> --
> You received this message because you are subscribed to the Google
> Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
> Web Services,.NET Remoting" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
> or visit the group website at http://megasolutions.net
>
--
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net