c# - Interface coding issue -


I send a value (attrname [5] = "WRM version";) from sendAgentInfo () to a.dll Is obtained in the form of WrmVersion in SPDL. Here I am sending those values ​​to an interface (IRSorporality) located in data.dll. But the problem is that the interface 'IRSorporis' interface is not found, if it gets in the interface, it should be displayed in a LISTVIEW in the UI (UI.dll in ResourcePolicySystemsControl.cs0) What I did is coding below < / P>


  a.dll public null SendAgentInfo () {string [] attrname = new string [6]; String [] attrval = new string [6]; Attrname [5] = "WRM version"; Attrval [5] = Registry.Get Value (@ "HKEY_LOCAL_MACHINE \ Software \ syscon \ Single Point Operations Windows Resource Monitor", "OnResource", "0"). ToString ();}  

  sp.dll string in the code wrmVersionSPURT = this_event.variableData [5] .atr_value ;. . IResourcePolicy irp = (IResourcePolicy). Irp.WrmVersion = wrmVersionSPURT; . .  

  code data.dll public interface IResourcePolicy {string WrmVersion {get; Set; }}   Code UI DLL public receive new IRSROSPC data {Return (IRSORCPC) Base data;}} Safe Override Zero On-Update () {String func = "resource policy system LVI.OnUpdate"; try {if (Data! = Null) {text = base.Data.Name; if (subtitles.count == 1) {subtitles.ed ((IRSOrSpec) data) Riser policy. Toastring ()); SubItems.Add ((IResourcePolicy) data) .ResourcePolicyCurrent.ToString ()); SubItems.Add (((IResourcePolicy) data) .WrmVersion.ToString ()); } Other {Submenus [1] Text = ((IRSSArcCPC data) .Riser PolicyIntrated. Toasting (); Subitem [2] Text = ((IRSROSPC) data.) .Reser policy style.ToString (); }} Base.OnUpdate (); }  

You must be a class that IResourcePolicy Some method UI will be assigned to property in data . Note that an interface is not an object; It only describes the interface that it is expected from a class that it implements. This standby can not be used alone, but should be implemented by a class to be used.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -