Niall, you want to implement the Do.Universe.IFileItem interface.

interface IItem {
  string Name { get; }
  string Description { get; }
  string Icon { get; }
}

interface IUriItem : IItem {
  string Uri { get; }
}

interface IFileItem : IUriItem {
  string Path { get; }
}


Your custom Item class needs to implement IFileItem. All you need to
do is provide a Path (and a Uri), along with Name, Description, and
Icon, and you will have something that acts like a file within Do. So,
what exactly is the confusion?

David


On Wed, Jan 21, 2009 at 8:40 AM, Niall Murphy <[email protected]> wrote:
>
>>> In short. i want to extend FileItem.
>>> I cant find the assembly that will let me extend from fileItem. can
>>> you tell me what it is called?
>> FileItem lives in Do.Universe.Linux.
>
> The type or namespace name `FileItem' does not exist in the namespace
> `Do.Universe.Linux'. Are you missing an assembly reference?(CS0234)
>
> I have included all references Do.* which for me are
> Do.Interface.Linux
> Do.Platform
> Do.Platform.Linux
> Do.Universe
>
> Is there something i am missing or not understanding?
>
>>> now a design question.
>>> If i can extend from Do.Platform.Linux/src/Do.Universe/FileItem.cs it
>>> would seem wrong that i am extending from platform specific class.
>>> Do you think it is possible or a good idea to have a FileItem in
>>> Do.Platfrom.Common that would be generic but on different systems use
>>> the specific implementation from another class?
>>
>> Files are different on different platforms, the Do FileItem in
>> Universe.Linux uses some linuxisms, which is why it's in Universe.Linux.
>> This is the point of IFileItem, to provide a crossplatform abstraction layer
>> that is safe to refererence.
>
> yes i understand, I am suggesting a new class that might make things
> cleaner for you and for plugin developers.
> i think i remember (i havnt touched eclipse plugins for about 3 years)
> eclipse having a system where there was an class
> File that anyone could use and simply called out to the appropriate
> platform dependant other classes.
>
> So Do.Universe.FileItem would have code along the lines of
>
> class Do.Universe.FileItem extends Item implements Iopenable
>      function Icon () :
>             if System.platform = Gnome :
>                     return Do.Platform.Linux.FileItem.Icon ()
>             if System.platform = Windows
>                     return Do.Platform.Windows.FileItem.Icon ()
>            else return "icons.generic_icon.svg"
>
> There are probably better ways to implement it (without nasty static
> methods etc) but thats what i have in mind.
> This way plugin devs can have platform independent code, not have to
> copy and paste code and still have cool features like thumbnail icons.
>
> Niall
>
>>
>>
>> --
>> --Alex Launi
>>
>> >
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GNOME Do" 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/gnome-do?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to