Ejemplo n.º 1
0
        private int WriteDictionary(Udbus.Serialization.UdbusMessageBuilder builder, Udbus.Containers.dbus_union variantDict)
        {
            int result;
            if (variantDict.IsDbusDictionary == false) // If not a dictionary
            {
                result = -1;
                throw new System.InvalidCastException("object is a dbus_union, but not a dbus dictionary");

            } // Ends if not a dictionary
            else // Else a dictionary
            {
                result = builder.MarshalDict(variantDict.DbusDictionary, this.ObjectDelegateKey, this.ObjectDelegateValue);

            } // Ends else a dictionary

            return result;
        }
Ejemplo n.º 2
0
 private int ReadDictionary(Udbus.Serialization.UdbusMessageReader reader, out Dictionary<object, object> dict)
 {
     IDictionary<object, object> idict;
     int result = reader.MarshalDict(this.ObjectDelegateKey, this.ObjectDelegateValue, out idict);
     dict = new Dictionary<object, object>(idict);
     return result;
 }