dotnetomaniak.pl - Artykuły z tagiem implementacja-niejawnadotnetomaniak.pl - Artykuły z tagiem implementacja-niejawna2024-03-28T23:59:08Zhttps://dotnetomaniak.pl/Tags/implementacja-niejawnaCopyright (c) dotnetomaniak.pldotnetomaniak.pl Atom Generatordotnetomaniak.pl webmasteradmin@dotnetomaniak.plhttps://dotnetomaniak.pl/Assets/Images/fav.icohttps://dotnetomaniak.pl/Assets/Images/dotnetomaniak_logo-negatyw_small.png1025https://dotnetomaniak.pl/Piotr-Zielinski-Interfejsy-implementacja-jawna-vs-niejawnaPiotr Zieliński » Interfejsy: implementacja jawna vs. niejawna2012-10-29T20:41:27Z<div><div><div style="float:right"><img alt ="" src="http://dotnetomaniak.pl/Data/Thumbnails/small_9gf6UO1zz0OnGMjqQOoUcQ.png"/></div><div>W C# można implementować interfejsy na dwa sposoby: jawny oraz niejawny. Rozważmy poniższy interfejs:interface ISerializable
{
void Serialize(string path);
}
Implementacja jawna:class ExplicitImplementation:ISerializable
{
#region ISerializable Membersvoid ISerializable.Serialize(string path)
{
thrownew NotImplementedException();
}
#endregion
}
Implementacja niejawna:class ImplicitImplementation:ISerializable
{
#region ISerializable Membersvoid ISerializable.Serial...</div></div><div style="padding-top:4px"><a rev="vote-for" href="https://dotnetomaniak.pl/Piotr-Zielinski-Interfejsy-implementacja-jawna-vs-niejawna"><img alt="Podbij ↑" src="https://dotnetomaniak.pl/image.axd?url=http%3a%2f%2fwww.pzielinski.com%2f%3fp%3d1387" style="border:0px"/></a></div></div>pzielinskihttps://dotnetomaniak.pl/Users/uL1CEj4isEuRvajW8gS3pQ2012-11-08T15:41:50Zhttps://dotnetomaniak.pl/Piotr-Zielinski-Interfejsy-implementacja-jawna-vs-niejawna21320W C# można implementować interfejsy na dwa sposoby: jawny oraz niejawny. Rozważmy poniższy interfejs:interface ISerializable
{
void Serialize(string path);
}
Implementacja jawna:class ExplicitImplementation:ISerializable
{
#region ISerializable Membersvoid ISerializable.Serialize(string path)
{
thrownew NotImplementedException();
}
#endregion
}
Implementacja niejawna:class ImplicitImplementation:ISerializable
{
#region ISerializable Membersvoid ISerializable.Serial...http://www.pzielinski.com/?p=1387http://dotnetomaniak.pl/Data/Thumbnails/small_9gf6UO1zz0OnGMjqQOoUcQ.png