Exemplo n.º 1
0
 public void Insert(XlInsertShiftDirection shift, XlRange copyOrigin)
 {
     object[] paramArray = new object[2];
     paramArray[0] = shift;
     paramArray[1] = copyOrigin.COMReference;
     InstanceType.InvokeMember("Insert", BindingFlags.InvokeMethod, null, ComReference, paramArray, XlLateBindingApiSettings.XlThreadCulture);
 }
Exemplo n.º 2
0
 public void FillAcrossSheets(XlRange range, XlFillWith type)
 {
     object[] paramArray = new object[2];
     paramArray[0] = range.COMReference;
     paramArray[1] = type;
     InstanceType.InvokeMember("FillAcrossSheets", BindingFlags.InvokeMethod, null, ComReference, paramArray, XlLateBindingApiSettings.XlThreadCulture);
 }
Exemplo n.º 3
0
 public void Import(XlRange changingCells, object values)
 {
     object[] paramArray = new object[2];
     paramArray[0] = changingCells;
     paramArray[1] = values;
     InstanceType.InvokeMember("Import", BindingFlags.InvokeMethod, null, ComReference, paramArray, XlLateBindingApiSettings.XlThreadCulture);
 }
Exemplo n.º 4
0
 public XlRange this[string adress]
 {
     get
     {
         object[] paramArray = new object[1];
         paramArray[0] = adress;
         object  returnValue = InstanceType.InvokeMember("Range", BindingFlags.GetProperty, null, ComReference, paramArray, XlLateBindingApiSettings.XlThreadCulture);
         XlRange newClass    = new XlRange(this, returnValue);
         ListChildReferences.Add(newClass);
         return(newClass);
     }
 }
Exemplo n.º 5
0
        public XlRange Resize()
        {
            object returnValue = InstanceType.InvokeMember("Resize", BindingFlags.GetProperty, null, ComReference, null, XlLateBindingApiSettings.XlThreadCulture);

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

            ListChildReferences.Add(newClass);
            return(newClass);
        }
        internal void RaiseSelectionChangeEvent(object Target)
        {
            if (null == SelectionChange)
            {
                Marshal.ReleaseComObject(Target);
                return;
            }

            XlRange ra = new XlRange(this, Target);

            ListChildReferences.Add(ra);

            SelectionChange(ra);
        }
        internal void RaiseBeforeRightClickEvent(object Target, ref bool Cancel)
        {
            if (null == BeforeRightClick)
            {
                Marshal.ReleaseComObject(Target);
                return;
            }

            XlRange ra = new XlRange(this, Target);

            ListChildReferences.Add(ra);

            BeforeRightClick(ra, ref Cancel);
        }
Exemplo n.º 8
0
        public XlRange Range(XlRange cell1)
        {
            object[] paramArray = new object[1];
            paramArray[0] = cell1.COMReference;
            object returnValue = InstanceType.InvokeMember("Range", BindingFlags.GetProperty, null, ComReference, paramArray, XlLateBindingApiSettings.XlThreadCulture);

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

            ListChildReferences.Add(newClass);
            return(newClass);
        }
Exemplo n.º 9
0
        public XlAllowEditRange Add(string title, XlRange range)
        {
            object[] paramArray = new object[1];
            paramArray[0] = title;
            paramArray[1] = range;
            object returnValue = InstanceType.InvokeMember("Add", BindingFlags.InvokeMethod, null, ComReference, paramArray, XlLateBindingApiSettings.XlThreadCulture);

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

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

            XlRange[] res_addins = new XlRange[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]);
            }
        }
Exemplo n.º 12
0
        public XlRange Resize(double rowSize, double columnSize)
        {
            object[] paramArray = new object[2];
            paramArray[0] = rowSize;
            paramArray[1] = columnSize;
            object returnValue = InstanceType.InvokeMember("Resize", BindingFlags.GetProperty, null, ComReference, paramArray, XlLateBindingApiSettings.XlThreadCulture);

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

            ListChildReferences.Add(newClass);
            return(newClass);
        }
Exemplo n.º 13
0
        public XlRange Offset(int rowOffset, int columnOffset)
        {
            object[] paramArray = new object[2];
            paramArray[0] = rowOffset;
            paramArray[1] = columnOffset;
            object returnValue = InstanceType.InvokeMember("Offset", BindingFlags.GetProperty, null, ComReference, paramArray, XlLateBindingApiSettings.XlThreadCulture);

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

            ListChildReferences.Add(newClass);
            return(newClass);
        }
Exemplo n.º 14
0
        internal static XlNonCreatable CreateDynamicType(IXlObject parent, object comProxy)
        {
            string className = TypeDescriptor.GetClassName(comProxy);

            switch (className)
            {
            case "Workbooks":

                XlWorkbooks newBooks = new XlWorkbooks(parent, comProxy);
                return(newBooks);

            case "Workbook":

                XlWorkbook newBook = new XlWorkbook(parent, comProxy);
                return(newBook);

            case "Worksheets":

                XlWorksheets newSheets = new XlWorksheets(parent, comProxy);
                return(newSheets);

            case "Worksheet":

                XlWorksheet newSheet = new XlWorksheet(parent, comProxy);
                return(newSheet);

            case "Range":

                XlRange newRange = new XlRange(parent, comProxy);
                return(newRange);

            default:

                throw (new ProxyTypeException("Unhandled ComProxyType: " + className));
            }
        }
Exemplo n.º 15
0
 public void Paste(XlRange range)
 {
     object[] paramArray = new object[1];
     paramArray[0] = range.COMReference;
     InstanceType.InvokeMember("Paste", BindingFlags.InvokeMethod | BindingFlags.OptionalParamBinding, null, ComReference, paramArray, XlLateBindingApiSettings.XlThreadCulture);
 }