public void SetupEventBinding(XlChart chart) { if (true == XlLateBindingApiSettings.EventsEnabled) { _chart = chart; IConnectionPointContainer connectionPointContainer = (IConnectionPointContainer)chart.COMReference; Guid guid = new Guid("{0002440F-0000-0000-C000-000000000046}"); connectionPointContainer.FindConnectionPoint(ref guid, out _connectionPoint); _connectionPoint.Advise(this, out _connectionCookie); } }
/// <summary> /// returns an COMAddin by Index, not 0 based /// </summary> /// <param name="i"></param> /// <returns></returns> public XlChart this[int index] { get { object[] paramArray = new object[1]; paramArray[0] = index; object returnValue = InstanceType.InvokeMember("Item", BindingFlags.InvokeMethod, null, ComReference, paramArray, XlLateBindingApiSettings.XlThreadCulture); if (null == returnValue) { return(null); } XlChart newClass = new XlChart(this, returnValue); return(newClass); } }
public XlChart Location(XlChartLocation where) { object[] paramArray = new object[2]; paramArray[0] = where; paramArray[1] = Missing.Value; object returnValue = InstanceType.InvokeMember("Location", BindingFlags.InvokeMethod | BindingFlags.OptionalParamBinding, null, ComReference, paramArray, XlLateBindingApiSettings.XlThreadCulture); if (null == returnValue) { return(null); } XlChart newClass = new XlChart(this, returnValue); ListChildReferences.Add(newClass); return(newClass); }
/// <summary> /// Foreach Enumerator /// </summary> /// <returns></returns> public IEnumerator GetEnumerator() { int iCount = Count; XlChart[] res_addins = new XlChart[iCount]; for (int i = 1; i <= iCount; i++) { res_addins[i - 1] = this[i]; } for (int i = 0; i < res_addins.Length; i++) { yield return(res_addins[i]); } }