D
daohuy.hua
The context is that I have a C# class named MainModel which has a
private Dictionary<string, FileStream> member named dict. I also have
a property Dict to access to this member:
public Dictionary<string, FileStream> Dict
{
get { return this.dict; }
}
The problem with this implementation is that I only want to give
access to some of the methods from the Dictionary class since I don't
want another class which has a MainModel instance to have full access
to the dict member and do whatever he wants to. What should I do in
this case?
I'm not an advanced programmer and I'm not too familiar with the
design patterns, so I would like to have some code to base on and some
explainations too.
What I would like to have is somekind of:
public DictionaryExhibitor<Dictionary<string, FileStream>> Dict
{
get { return DictionaryExhibitor<this.dict>; }
}
Please correct me if I'm wrong.
Thanks
WuFei
private Dictionary<string, FileStream> member named dict. I also have
a property Dict to access to this member:
public Dictionary<string, FileStream> Dict
{
get { return this.dict; }
}
The problem with this implementation is that I only want to give
access to some of the methods from the Dictionary class since I don't
want another class which has a MainModel instance to have full access
to the dict member and do whatever he wants to. What should I do in
this case?
I'm not an advanced programmer and I'm not too familiar with the
design patterns, so I would like to have some code to base on and some
explainations too.
What I would like to have is somekind of:
public DictionaryExhibitor<Dictionary<string, FileStream>> Dict
{
get { return DictionaryExhibitor<this.dict>; }
}
Please correct me if I'm wrong.
Thanks
WuFei