Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2334
Make my object model a participant in the calc network
posted
Would it be possible to make my object model a participant in the calc network? I am interested in using the values of properties of my object in formulas not in setting properties of my object with formulas. From quickly looking at the docs I think this would require implementing IUltraCalcParticipant. Is this correct? Would each child object of my class need to implement IUltraCalcParticipant as well? Or would they need to implement IUltraCalcReference? For example,

public class A {
public B MyB { get; set; }
public List<C> MyCs { get; set; }
public string SomeString { get; set; }
}

When my app loads I would add the NameRefs to the CalcManager and set the formulas to controls in my app all at runtime. I do not need design time support for this. Is this doable or am I out of my mind to try and attempt this?

Thanks,
Drew
  • 469350
    Offline posted

     Hi Drew,

    I don't think you need IUltraCalcParticipant, unless you want to implement design-time support for your objects. To actually have your objects participate in a the calc network as the source value for formula, what you would need to do is implement an UltraCalcReference. You would derive a class from RefBase. This is quite complicated, however, and I don't think there is any documentation or samples on this. 

    A much easier way to do it would be to simply use a NamedReference. You can add a NamedReference to the NamedReferences collection on the UltraCalcManager. Then all you have to do is change the formula on the NamedReference to reflect the current value of your object.