Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface ISendLogic<T> where T : NarcoticsResult
- {
- ChangeType Change_New();
- ChangeType Change_Cancel();
- PurchaseType Purchase_New();
- PurchaseType Purchase_Cancel();
- }
- public class SendLogic<T> : ISendLogic<T> where T : NarcoticsResult
- {
- private eReportType _type;
- private bool Send_Change()
- {
- // Send to server by xml file
- }
- private bool Send_Purchase()
- {
- // Send to server by xml file
- }
- public ChangeType Change_New()
- {
- _type = change_new;
- Send_Change();
- }
- public ChangeType Change_Cancel()
- {
- _type = change_cancel;
- Send_Change();
- }
- public PurchaseType Purchase_New()
- {
- _type = purchase_new;
- Send_Purchase();
- }
- public PurchaseType Purchase_Cancel()
- {
- _type = purchase_cancel;
- Send_Purchase();
- }
- }
- // this class can only be used when someone wants to use change function
- var logic = SendLogic<ChangeType >();
- logic.Change_New();
- logic.Change_Cancel();
- var logic = SendLogic<ChangeType>();
- logic.Change_New(); // OK
- logic.Purchase_New(); // You should make this class like SendLogic<PurchaseType>()
Add Comment
Please, Sign In to add comment