Ejemplo n.º 1
0
 public Component(ucss.uno.XComponentContext ctx, uno.Any[] args) {
     m_args = new Any[args.Length + 1];
     m_args[0] = new Any(typeof(ucss.uno.XComponentContext), ctx);
     for (int i = 0; i < args.Length; i ++) {
         m_args[i+1] = args[i];
     }
 }
Ejemplo n.º 2
0
        static void Main()
        {
            MiNamespace.Clase1 obj1 = new MiNamespace.Clase1();
            uno obj2 = new uno();

            obj1.Metodo();
            obj2.metodo();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            minamespace.clase1 obj1 = new minamespace.clase1();
            uno obj2 = new uno();

            obj1.Metodo();
            obj2.metodo();
            Console.ReadKey();
        }
Ejemplo n.º 4
0
 public object  createInstanceWithArgumentsAndContext(
     string ServiceSpecifier,
     uno.Any[] Arguments,
     unoidl.com.sun.star.uno.XComponentContext Context) {
     switch (kind2) {
     case test_kind.NORMAL:
         return new Component(Context, Arguments);
     case test_kind.CREATION_FAILED :
         return null;
     case test_kind.TEST_EXCEPTION:
         throw exception;
     default:
         throw new Exception("Factory not properly initialized");
     }
 }
Ejemplo n.º 5
0
 static void Main()
 {
     clase1.Program Program = new clase1.Program();
     uno            obj2    = new uno();
 }
Ejemplo n.º 6
0
 private PropertyValue CreateProperty(string name, uno.Any value)
 {
     PropertyValue prop = new PropertyValue();
     prop.Name = name;
     prop.Value = value;
     return prop;
 }
    /** Inserts a scenario containing one cell range into a sheet and
        applies the value array.
        @param xSheet           The XSpreadsheet interface of the spreadsheet.
        @param aRange           The range address for the scenario.
        @param aValueArray      The array of cell contents.
        @param aScenarioName    The name of the new scenario.
        @param aScenarioComment The user comment for the scenario. */
    private void insertScenario(
            unoidl.com.sun.star.sheet.XSpreadsheet xSheet,
            String aRange,
            uno.Any [][] aValueArray,
            String aScenarioName,
            String aScenarioComment )
    {
        // get the cell range with the given address
        unoidl.com.sun.star.table.XCellRange xCellRange =
            xSheet.getCellRangeByName( aRange );

        // create the range address sequence
        unoidl.com.sun.star.sheet.XCellRangeAddressable xAddr =
            (unoidl.com.sun.star.sheet.XCellRangeAddressable) xCellRange;
        unoidl.com.sun.star.table.CellRangeAddress[] aRangesSeq =
            new unoidl.com.sun.star.table.CellRangeAddress[1];
        aRangesSeq[0] = xAddr.getRangeAddress();

        // create the scenario
        unoidl.com.sun.star.sheet.XScenariosSupplier xScenSupp =
            (unoidl.com.sun.star.sheet.XScenariosSupplier) xSheet;
        unoidl.com.sun.star.sheet.XScenarios xScenarios =
            xScenSupp.getScenarios();
        xScenarios.addNewByName( aScenarioName, aRangesSeq, aScenarioComment );

        // insert the values into the range
        unoidl.com.sun.star.sheet.XCellRangeData xData =
            (unoidl.com.sun.star.sheet.XCellRangeData) xCellRange;
        xData.setDataArray( aValueArray );
    }
Ejemplo n.º 8
0
 public Object createInstanceWithArgumentsAndContext(
     uno.Any [] args, XComponentContext xContext )
 {
     return m_ctor.Invoke( new Object [] { xContext } );
 }
        private void handleChild(object sender, uno.Any newValue, uno.Any oldValue)
        {

            System.Diagnostics.Debug.WriteLine("[INFO] OoDrawPagesObserver: handle accessible child ID");

            if (newValue.hasValue())
            {
                if (oldValue.hasValue()) // change
                {
                    //System.Diagnostics.Debug.WriteLine("child changed");
                }
                else // added
                {
                    addNewShape(newValue.Value as XAccessible);
                }

            }
            //else if (oldValue.hasValue() && oldValue.Value is XAccessible)
            //{

            //    // FIXME: this does not work properly because sometimes the page itself do this and there is no way to check if this is the page.
            //    //          So we have to leave the corresponding shape and its observer as a dead body in the lists ...
            //    //          Maybe the OoShapeObeservers can detect their disposing by their own and handle a clean up of the lists

            //    //// child deleted;
            //    ////System.Diagnostics.Debug.WriteLine("child deleted");

            //    //XAccessible oldValAcc = oldValue.Value as XAccessible;

            //    //if (oldValAcc != null)
            //    //{
            //    //    if (accshapes.ContainsKey((oldValAcc.getAccessibleContext())))
            //    //    {
            //    //        //TODO: remove ....
            //    //        System.Diagnostics.Debug.WriteLine("have to remove observer");
            //    //    }
            //    //    else
            //    //    {
            //    //        string Name = OoAccessibility.GetAccessibleName(oldValAcc);
            //    //        if (shapes.ContainsKey(Name))
            //    //        {
            //    //            removeChild(shapes[Name]);
            //    //        }
            //    //    }
            //    //}

            //}
        }
Ejemplo n.º 10
0
 static void Main()
 {
     MiNameSpace.Clase1 obj1 = new MiNameSpace.Clase1();
     uno obj2 = new uno();
 }
Ejemplo n.º 11
0
    //returns the values which have been set in a previous call
    //to this function or inParameters.
    public void inoutParameters(ref bool aBool, ref byte aByte,
                      ref short aShort, ref ushort aUShort,
                      ref int aInt, ref uint aUInt,
                      ref long aLong, ref ulong aULong,
                      ref float aFloat, ref double aDouble,
                      ref char aChar,  ref string aString,
                      ref Type aType, ref uno.Any aAny,
                      ref Enum2 aEnum, ref Struct1 aStruct,
                      ref object aXInterface,
                      ref unoidl.com.sun.star.lang.XComponent aXComponent,
                      ref bool[] seqBool)
    {
        bool _bool = aBool;
        aBool = m_Bool;
        m_Bool = _bool;

        byte _byte = aByte;
        aByte = m_Byte;
        m_Byte = _byte;
        
        short _short = aShort;
        aShort = m_Short;
        m_Short = _short;

        ushort _ushort = aUShort;
        aUShort = m_UShort;
        m_UShort = _ushort;

        int _int = aInt;
        aInt = m_Int;
        m_Int = _int;

        uint _uint = aUInt;
        aUInt = m_UInt;
        m_UInt = _uint;
        
        long _long = aLong;
        aLong = m_Long;
        m_Long = _long;

        ulong _ulong = aULong;
        aULong = m_ULong;
        m_ULong = _ulong;
        
        float _f = aFloat;
        aFloat = m_Float;
        m_Float = _f;

        double _d = aDouble;
        aDouble = m_Double;
        m_Double = _d;
        
        char _char = aChar;
        aChar = m_Char;
        m_Char = _char;

        string _string = aString;
        aString = m_String;
        m_String = _string;

        Type _type = aType;
        aType = m_Type;
        m_Type = _type;

        Any _any = aAny;
        aAny = m_Any;
        m_Any = _any;

        Enum2 _enum2 = aEnum;
        aEnum = m_Enum2;
        m_Enum2 = _enum2;

        Struct1 _struct1 = aStruct;
        aStruct = m_Struct1;
        m_Struct1 = _struct1;
        
        object _obj = aXInterface;
        aXInterface = m_XInterface;
        m_XInterface = _obj;

        ucss.lang.XComponent _xcomp = aXComponent;
        aXComponent = m_XComponent;
        m_XComponent = _xcomp;

        bool[] _seq = seqBool;
        seqBool = m_seqBool;
        m_seqBool = _seq;
    }
Ejemplo n.º 12
0
 public void outParameters(out bool aBool, out byte aByte,
                   out short aShort, out ushort aUShort,
                   out int aInt, out uint aUInt,
                   out long aLong, out ulong aULong,
                   out float aFloat, out double aDouble,
                   out char aChar, out string aString,
                   out Type aType, out uno.Any aAny,
                   out Enum2 aEnum, out Struct1 aStruct,
                   out object aXInterface,
                   out unoidl.com.sun.star.lang.XComponent aXComponent,
                   out bool[] seqBool)
 {
     aBool = m_Bool;
     aByte = m_Byte;
     aShort = m_Short;
     aUShort = m_UShort;
     aInt = m_Int;
     aUInt = m_UInt;
     aLong = m_Long;
     aULong = m_ULong;
     aFloat = m_Float;
     aDouble = m_Double;
     aChar = m_Char;
     aString = m_String;
     aType = m_Type;
     aAny = m_Any;
     aEnum = m_Enum2;
     aStruct = m_Struct1;
     aXInterface = m_XInterface;
     aXComponent = m_XComponent;
     seqBool = m_seqBool;
         
 }
Ejemplo n.º 13
0
    public void inParameters(bool aBool, byte aByte,
                      short aShort, ushort aUShort,
                      int aInt, uint aUInt,
                      long aLong, ulong aULong,
                      float aFloat, double aDouble,
                      char aChar, string aString,
                      Type aType, uno.Any aAny,
                      Enum2 aEnum, Struct1 aStruct,
                      object aXInterface,
                      unoidl.com.sun.star.lang.XComponent aXComponent,
                      bool[] seqBool)
    {
        m_Bool = aBool;
        m_Byte = aByte;
        m_Short = aShort;
        m_UShort = aUShort;
        m_Int = aInt;
        m_UInt = aUInt;
        m_Long = aLong;
        m_ULong = aULong;
        m_Float = aFloat;
        m_Double = aDouble;
        m_Char = aChar;
        m_String = aString;
        m_Type = aType;
        m_Any = aAny;
        m_Enum2 = aEnum;
        m_Struct1 = aStruct;
        m_XInterface = aXInterface;
        m_XComponent = aXComponent;
        m_seqBool = seqBool;

    }
Ejemplo n.º 14
0
 public static unsafe extern void Dispatch(IntPtr unoInterface,
                                       /* uno.Typelib.TypeDescription */ void *memberTD,
                                       void *result,
                                       void **args,
                                       uno.Binary.Any **exception);
Ejemplo n.º 15
0
 IMessage ConstructReturnMessage(uno.Any result, object[] args,
                                 InterfaceMethodTypeDescription *methodTD,
                                 IMethodCallMessage callmsg, uno.Any exception)
 {
     if (exception.hasValue())
     {
         throw (System.Exception)exception.Value;
     }
     else
     {
         if (args != null)
         {
             object[] outArgs = new object[methodTD->nParams];
             int numOutArgs = 0;
             for (int i = 0; i < methodTD->nParams; ++i)
             {
                 if (methodTD->pParams[i].bOut == 1)
                 {
                     outArgs[i] = args[i];
                     ++numOutArgs;
                 }
             }
             return new ReturnMessage(result.Value, outArgs, numOutArgs,
                                      callmsg.LogicalCallContext,
                                      callmsg);
         }
         else
         {
             return new ReturnMessage(result.Value, null, 0,
                                      callmsg.LogicalCallContext,
                                      callmsg);
         }
     }
 }
Ejemplo n.º 16
0
 // FIXME redundant
 static object to_cli_constant(uno.Any value)
 {
     return value.Value;
 }