i am making applications in c#.In that application i have one class as DataCapture.cs. In same application i have another class as Listner.cs . Here in Listner.cs class i want to use object of DataCapture.cs without creating new object of DataCapture.cs. As if i am creating new object of DataCapture.cs,i cant access the the data DataCapture.cs as it creates the new instance of class and all data gets lost as i am using collection in DataCapture.cs.Please help me.Thanks in advance.
i am making applications in c#.In that application i have one class as DataCapture.cs
Share
You vould use the the
singleton patternto ensure that onlyone objectof theclassexists. You could then get theobjectas,DataCapture.Instance.…… where .Inastance ispublic static.