c# - Replacing non type safe with type safe generic method -
I'm looking for a way to change:
public class non-encryption {Private list & lt; Object & gt; Content = new list & lt; Object & gt; (); Public listing & lt; Object & gt; Content {Get Refundable Content; }}; Public non-tipusfe (Paramaz object [] logic) {foreach (Object AGR in arguments) {contents.Add (arg); }}} Object with purpose is a purpose in which I can add many different types of objects. At present, the objects must be checked upon retrieving to determine in the right order / correct order.
Currently I have the following:
the public class type just & lt; T1 & gt; {Secure list & amp; Object & gt; ArgList = new list & lt; Object & gt; (); Private Redoni T1 arg1; Public type (T1 arg1) {ArgList.Add (arg1); This.arg1 = arg1; } Public T1 Arg1 {get {return (T1) ArgList [ArgList.IndexOf (arg1)]; }}} Public class type just & lt; T1, T2 & gt; TypeSafe & lt; T1 & gt; {Private Redoni T2 RG2; Public type (T1 arg1, T2 arg2): base (arg1) {ArgList.Add (arg2); This.arg2 = arg2; } Public T2 Arg2 {get {return (T2) ArgList [ArgList.IndexOf (arg2)]; }}} And so on, do I expect to add new classes to the largest number parameters, is there a better way to achieve this?
Are you searching again?
A tube is a data structure that has a sequence of specific numbers and elements. An example of a tuple is a data structure with three elements (known as 3-Tupal or Triple), which is used to store the identifier, such as a person's name in the first element, the other For the year and year income of the person in the third element for that year.
Comments
Post a Comment