Ejemplo n.º 1
0
 public ClassExtend<int, uspFunctionGetAllByTreeResult> GetFunctionChild(int functionID)
 {
     ClassExtend<int, uspFunctionGetAllByTreeResult> objChild = new ClassExtend<int, uspFunctionGetAllByTreeResult>();
     objChild.Items = WebSoft.AdminInstance.uspFunctionGetAllByTree(functionID, VTCO.Utils.AdminUtils.AdminID).ToList();
     objChild.TotalRecord = objChild.Items.Count;
     objChild.Info = 0;
     return objChild;
 }
Ejemplo n.º 2
0
        static public void Run()
        {
            IExtend      interfaceExtend = new SomeClass();
            ClassExtend  classExtend     = new ClassExtend();
            StructExtend structExtend    = new StructExtend(10);

            //You can use extension methods to extend class, interface, structs.
            //But all extensions you declare, must be declared in a non-generic, non-nested, static class.
            interfaceExtend.ExtensionMethod();
            classExtend.ExtensionMethod();
            structExtend.ExtensionMethod();
        }
Ejemplo n.º 3
0
 public ClassExtend<int, ClassExtend<uspFunctionGetAllByTreeResult, uspFunctionGetAllByTreeResult>> GetListFunctionByAdmin()
 {
     ClassExtend<int,ClassExtend<uspFunctionGetAllByTreeResult, uspFunctionGetAllByTreeResult>> objReturn = new ClassExtend<int,ClassExtend<uspFunctionGetAllByTreeResult,uspFunctionGetAllByTreeResult>>();
     ClassExtend<uspFunctionGetAllByTreeResult, uspFunctionGetAllByTreeResult> lstFuncChild;
     var lstFunction = GetFunctionChild(-1);
     foreach(var item in lstFunction.Items)
     {
         lstFuncChild = new ClassExtend<uspFunctionGetAllByTreeResult, uspFunctionGetAllByTreeResult>();
         lstFuncChild.Info = item;
         var lstChild = GetFunctionChild(item.FunctionID).Items;
         lstFuncChild.Items = lstChild;
         lstFuncChild.TotalRecord = lstChild.Count;
         objReturn.Items.Add(lstFuncChild);
     }
     objReturn.TotalRecord = lstFunction.TotalRecord;
     return objReturn;
 }
Ejemplo n.º 4
0
 //overloaded to extend a class type
 static public void ExtensionMethod(this ClassExtend exClass)
 {
     Console.WriteLine("Method extended for class.");
 }