Home > Net >  C # the nuptial writing
C # the nuptial writing

Time:09-26

In vs. Windows form how to share the same code

CodePudding user response:

1
the static method2 create a class, write the method

CodePudding user response:

The same logic code extraction, abstraction, separate written public methods class libraries, other classes to invoke the public methods class library,
Complex scenarios may need to design class, the inheritance of the interface,

CodePudding user response:

Put the same code in a class, the rest of the class the class inheritance

CodePudding user response:

In a way out

CodePudding user response:

Can put the same code into a method, which can implement code reuse, reduce code redundancy

CodePudding user response:

Write your methods in a class
And then where do you want this method
  •  Tags:  
  • C#
  • Related