Click here to Skip to main content
15,908,843 members

Comments by david salaman (Top 7 by date)

david salaman 16-Feb-18 3:41am View    
thnx)) your answer is good enough)))but i have no other choice bcz there`s a fingerprint device and i have to deal with methods which it provides. manual of function are in the link file:///C:/Users/jack/Desktop/baha/Biometric%20Device%20SDK-%20Programmers%20Guide.1517824896.pdf
david salaman 13-Feb-18 22:47pm View    
Found answer)))))))))))))))))))))

Problem
You have a subclass that uses only a portion of the methods of its superclass (or it's not possible to inherit superclass data).

Solution
Create a field and put a superclass object in it, delegate methods to the superclass object, and get rid of inheritance.
david salaman 13-Feb-18 6:00am View    
kk. thnx i really need go back)))
david salaman 13-Feb-18 5:48am View    
what i learned about encapsulation. -it is not good to have fields public. MAKE them private and use properties or methods to work with that. that`s all i understood. ssry if taking you time.
david salaman 13-Feb-18 5:42am View    
public interface IZKEM
{
[DispId(3)]
bool ClearAdministrators(int dwMachineNumber);
[DispId(4)]
bool DeleteEnrollData(int dwMachineNumber, int dwEnrollNumber, int dwEMachineNumber, int dwBackupNumber);
[DispId(134)]
bool BatchUpdate(int dwMachineNumber);

........

using System.Runtime.InteropServices;

namespace zkemkeeper
{
[CoClass(typeof(CZKEMClass))]
[Guid("102F4206-E43D-4FC9-BAB0-331CFFE4D25B")]
public interface CZKEM : IZKEM, _IZKEMEvents_Event
{
}
}
Now what is purpose of doing this???

public class ZkemClient : IZKEM
{


CZKEM objCZKEM = new CZKEM();

public bool BatchUpdate(int dwMachineNumber)
{
return objCZKEM.BatchUpdate(dwMachineNumber);
}
}
can`t we use the methods in other ways???