コード例 #1
0
 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);
     }
 }
コード例 #2
0
 /// <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);
     }
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        /// <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]);
            }
        }