Exemple #1
0
        /// <summary>
        /// Get a MAMA price field.
        /// </summary>
        public MamaPrice getPrice(
			string name,
			ushort fid,
			MamaPrice valueIfMissing)
        {
            if (price_ == null)
            {
                price_ = new MamaPrice ();
                price_.SelfManageLifeTime(false);
            }
            if (tryPrice (name, fid, ref price_))
                return price_;
            else
                return valueIfMissing;
        }
Exemple #2
0
        /// <summary>
        /// Get a MAMA price field.
        /// </summary>
        public MamaPrice getPrice(
			string name,
			ushort fid)
        {
            EnsurePeerCreated();
            if (price_ == null)
            {
                price_ = new MamaPrice ();
                price_.SelfManageLifeTime(false);
            }
            int code = NativeMethods.mamaMsg_getPrice(nativeHandle, name, fid, price_.NativeHandle);
            MamaStatus.mamaStatus status = (MamaStatus.mamaStatus)code;
            if (status != MamaStatus.mamaStatus.MAMA_STATUS_OK)
            {
                throw new MamaException(status);
            }

            return price_;
        }