IsValid() public method

public IsValid ( ) : bool
return bool
Ejemplo n.º 1
0
        public QDBusReply(QDBusMessage reply)
        {
            m_error = new QDBusError(reply);

            QVariant variant;

            if (typeof(T) == typeof(QVariant))
            {
                variant = QVariant.FromValue <QDBusVariant>(null);
            }
            else
            {
                variant = QVariant.FromValue <T>(default(T));
            }

            qyoto_qdbus_reply_fill((IntPtr)GCHandle.Alloc(reply), (IntPtr)GCHandle.Alloc(m_error),
                                   (IntPtr)GCHandle.Alloc(variant));

            if (!m_error.IsValid())
            {
                // qyoto_qdbus_reply_fill extracts the QVariant from the QDBusVariant for us
                if (typeof(T) == typeof(QVariant))
                {
                    m_data = (T)(object)variant;
                }
                else
                {
                    m_data = variant.Value <T>();
                }
            }
        }
Ejemplo n.º 2
0
        public QDBusReply(QDBusMessage reply)
        {
            m_error = new QDBusError(reply);
            QVariant variant = QVariant.FromValue <T>(default(T));

            qyoto_qdbus_reply_fill((IntPtr)GCHandle.Alloc(reply), (IntPtr)GCHandle.Alloc(m_error),
                                   (IntPtr)GCHandle.Alloc(variant));
            if (!m_error.IsValid())
            {
                m_data = variant.Value <T>();
            }
        }