示例#1
0
        public XlShape AddOLEObject(string classType, string filename, Single left, Single top, Single width, Single height)
        {
            object[] parameters = new object[11];
            parameters[0]  = classType;
            parameters[1]  = filename;
            parameters[2]  = Missing.Value;
            parameters[3]  = Missing.Value;
            parameters[4]  = Missing.Value;
            parameters[5]  = Missing.Value;
            parameters[6]  = Missing.Value;
            parameters[7]  = left;
            parameters[8]  = top;
            parameters[9]  = width;
            parameters[10] = height;
            object returnValue = InstanceType.InvokeMember("AddOLEObject", BindingFlags.InvokeMethod | BindingFlags.OptionalParamBinding, null, ComReference, parameters, XlLateBindingApiSettings.XlThreadCulture);

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

            ListChildReferences.Add(newClass);
            return(newClass);
        }
示例#2
0
 public void EndConnect(XlShape connectedShape, int connectionSite)
 {
     object[] paramArray = new object[2];
     paramArray[0] = connectedShape.COMReference;
     paramArray[1] = connectionSite;
     InstanceType.InvokeMember("EndConnect", BindingFlags.InvokeMethod, null, ComReference, paramArray, XlLateBindingApiSettings.XlThreadCulture);
 }
示例#3
0
        public XlShape Group()
        {
            object returnValue = InstanceType.InvokeMember("Group", BindingFlags.InvokeMethod, null, ComReference, null, XlLateBindingApiSettings.XlThreadCulture);

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

            ListChildReferences.Add(newClass);
            return(newClass);
        }
示例#4
0
        public XlShape Item(int index)
        {
            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);
            }
            XlShape newClass = new XlShape(this, returnValue);

            ListChildReferences.Add(newClass);
            return(newClass);
        }
示例#5
0
        public XlShape AddCurve(Array safeArrayOfPoints)
        {
            object[] parameters = new object[1];
            parameters[0] = safeArrayOfPoints;
            object returnValue = InstanceType.InvokeMember("AddCurve", BindingFlags.InvokeMethod | BindingFlags.OptionalParamBinding, null, ComReference, parameters, XlLateBindingApiSettings.XlThreadCulture);

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

            ListChildReferences.Add(newClass);
            return(newClass);
        }
示例#6
0
        /// <summary>
        /// Foreach Enumerator
        /// </summary>
        /// <returns></returns>
        public IEnumerator GetEnumerator()
        {
            int iCount = Count;

            XlShape[] res_addins = new XlShape[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]);
            }
        }
示例#7
0
        public XlShape AddLine(Single beginX, Single beginY, Single endX, Single endY)
        {
            object[] parameters = new object[4];
            parameters[0] = beginX;
            parameters[1] = beginY;
            parameters[2] = endX;
            parameters[3] = endY;
            object returnValue = InstanceType.InvokeMember("AddLine", BindingFlags.InvokeMethod | BindingFlags.OptionalParamBinding, null, ComReference, parameters, XlLateBindingApiSettings.XlThreadCulture);

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

            ListChildReferences.Add(newClass);
            return(newClass);
        }
示例#8
0
        public XlShape AddDiagram(MsoDiagramType type, Single left, Single top, Single width, Single height)
        {
            object[] parameters = new object[5];
            parameters[0] = type;
            parameters[1] = left;
            parameters[2] = top;
            parameters[3] = width;
            parameters[4] = height;
            object returnValue = InstanceType.InvokeMember("AddDiagram", BindingFlags.InvokeMethod | BindingFlags.OptionalParamBinding, null, ComReference, parameters, XlLateBindingApiSettings.XlThreadCulture);

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

            ListChildReferences.Add(newClass);
            return(newClass);
        }
示例#9
0
        public XlShape AddPicture(string filename, MsoTriState linkToFile, MsoTriState saveWithDocument, Single left, Single top, Single width, Single height)
        {
            object[] parameters = new object[7];
            parameters[0] = filename;
            parameters[1] = linkToFile;
            parameters[2] = saveWithDocument;
            parameters[3] = left;
            parameters[4] = top;
            parameters[5] = width;
            parameters[6] = height;
            object returnValue = InstanceType.InvokeMember("AddPicture", BindingFlags.InvokeMethod | BindingFlags.OptionalParamBinding, null, ComReference, parameters, XlLateBindingApiSettings.XlThreadCulture);

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

            ListChildReferences.Add(newClass);
            return(newClass);
        }
示例#10
0
        /// <summary>
        /// Foreach Enumerator
        /// </summary>
        /// <returns></returns>
        public IEnumerator GetEnumerator()
        {
            /*
             *
             * yield cant have a try catch block
             *
             */

            int iCount = Count;

            XlShape[] res_shapes = new XlShape[iCount];

            for (int i = 1; i <= iCount; i++)
            {
                res_shapes[i - 1] = this[i];
            }

            for (int i = 0; i < res_shapes.Length; i++)
            {
                yield return(res_shapes[i]);
            }
        }
示例#11
0
        public XlShape AddTextEffect(MsoPresetTextEffect presetTextEffect, string text, string fontName, Single fontSize, MsoTriState fontBold, MsoTriState fontItalic, Single left, Single top)
        {
            object[] parameters = new object[8];
            parameters[0] = presetTextEffect;
            parameters[1] = text;
            parameters[2] = fontName;
            parameters[3] = fontSize;
            parameters[4] = fontBold;
            parameters[5] = fontItalic;
            parameters[6] = left;
            parameters[7] = top;

            object returnValue = InstanceType.InvokeMember("AddTextEffect", BindingFlags.InvokeMethod | BindingFlags.OptionalParamBinding, null, ComReference, parameters, XlLateBindingApiSettings.XlThreadCulture);

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

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