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.º 2
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);
         }
     }
 }