Esempio n. 1
0
 /// <summary>
 /// returns an XlAddin by Index, not 0 based
 /// </summary>
 /// <param name="i"></param>
 /// <returns></returns>
 public XlAddin 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);
         }
         XlAddin newClass = new XlAddin(this, returnValue);
         ListChildReferences.Add(newClass);
         return(newClass);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Foreach Enumerator
        /// </summary>
        /// <returns></returns>
        public IEnumerator GetEnumerator()
        {
            int iCount = Count;

            XlAddin[] res_addins = new XlAddin[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]);
            }
        }
Esempio n. 3
0
        public XlWindow CreateToolWindow(XlAddin addInInst, string progId, string caption, string guidPosition, object docObj)
        {
            object[] paramArray = new object[5];
            paramArray[0] = addInInst.COMReference;
            paramArray[1] = progId;
            paramArray[2] = caption;
            paramArray[3] = guidPosition;
            paramArray[4] = docObj;
            object returnValue = InstanceType.InvokeMember("CreateToolWindow", BindingFlags.InvokeMethod, null, ComReference, paramArray, XlLateBindingApiSettings.XlThreadCulture);

            if (null == returnValue)
            {
                return(null);
            }
            XlWindow newClass = new XlWindow(this, returnValue);

            ListChildReferences.Add(newClass);
            return(newClass);
        }