Wombat.MamaMsg.tryDateTime C# (CSharp) Method

tryDateTime() public method

public tryDateTime ( Wombat.MamaFieldDescriptor descriptor, System.DateTime &result ) : bool
descriptor Wombat.MamaFieldDescriptor
result System.DateTime
return bool
        public bool tryDateTime(
			MamaFieldDescriptor descriptor,
			ref DateTime result)
        {
            return tryDateTime(null, (ushort)descriptor.getFid(), ref result);
        }

Same methods

MamaMsg::tryDateTime ( string name, ushort fid, System.DateTime &result ) : bool

Usage Example

        private void updateFundamentalFields(MamaMsg msg)
        {
            /*
            * NOTE: fields which are enums can be pubished as integers if feedhandler
            * uses mama-publish-enums-as-ints.  It may also be possible for a feed to
            * publish the numerical value as a string. All enumerated fields must be handled
            * by getting the value based on the field type.
            */

            if (msg.tryDateTime(MamdaFundamentalFields.SRC_TIME, ref mSrcTimeStr))
              mSrcTimeStrFieldState = MamdaFieldState.MODIFIED;
            
            if (msg.tryDateTime(MamdaFundamentalFields.ACTIVITY_TIME, ref mActTimeStr))
              mActTimeStrFieldState = MamdaFieldState.MODIFIED;
            
            if (msg.tryString(MamdaFundamentalFields.CORP_ACT_TYPE, ref mCorpActType))
              mCorpActTypeFieldState = MamdaFieldState.MODIFIED;
            
            if(msg.tryField (MamdaFundamentalFields.DIVIDEND_FREQ, ref mTmpfield))
            {
                mDivFreq = getFieldAsString(mTmpfield);
                mDivFreqFieldState = MamdaFieldState.MODIFIED;
            }

            if (msg.tryString(MamdaFundamentalFields.DIVIDEND_EX_DATE, ref mDivExDate))
              mDivExDateFieldState = MamdaFieldState.MODIFIED;
            
            if(msg.tryString(MamdaFundamentalFields.DIVIDEND_PAY_DATE, ref mDivPayDate))
              mDivPayDateFieldState = MamdaFieldState.MODIFIED;
            
            if (msg.tryString(MamdaFundamentalFields.DIVIDEND_REC_DATE, ref mDivRecordDate))
              mDivRecordDateFieldState = MamdaFieldState.MODIFIED;
            
            if(msg.tryString(MamdaFundamentalFields.DIVIDEND_CURRENCY, ref mDivCurrency))
              mDivCurrencyFieldState = MamdaFieldState.MODIFIED;

            if (msg.tryString(MamdaFundamentalFields.MRKT_SEGM_NATIVE, ref mMrktSegmNative))
              mMrktSegmNativeFieldState = MamdaFieldState.MODIFIED;
            
            if (msg.tryString(MamdaFundamentalFields.MRKT_SECT_NATIVE, ref mMrktSectNative))
              mMrktSectNativeFieldState = MamdaFieldState.MODIFIED;

            if(msg.tryField (MamdaFundamentalFields.MRKT_SEGMENT, ref mTmpfield))
            {
                mMarketSegment = getFieldAsString(mTmpfield);
                mMarketSegmentFieldState = MamdaFieldState.MODIFIED;
            }

            if(msg.tryField (MamdaFundamentalFields.MRKT_SECTOR, ref mTmpfield))
            {
                mMarketSector = getFieldAsString(mTmpfield);
                mMarketSectorFieldState = MamdaFieldState.MODIFIED;
            }

            if (msg.tryI64  (MamdaFundamentalFields.SHARES_OUT, ref mSharesOut))
              mSharesOutFieldState = MamdaFieldState.MODIFIED;
            
            if (msg.tryI64  (MamdaFundamentalFields.SHARES_FLOAT, ref mSharesFloat))
              mSharesFloatFieldState = MamdaFieldState.MODIFIED;
            
            if (msg.tryI64  (MamdaFundamentalFields.SHARES_AUTH, ref mSharesAuth))
              mSharesAuthFieldState = MamdaFieldState.MODIFIED;

            if (msg.tryF64(MamdaFundamentalFields.DIVIDEND_PRICE, ref mDividendPrice))
              mDividendPriceFieldState = MamdaFieldState.MODIFIED;
            
            if (msg.tryF64(MamdaFundamentalFields.EARN_PER_SHARE, ref mEarnPerShare))
              mEarnPerShareFieldState = MamdaFieldState.MODIFIED;
            
            if (msg.tryF64(MamdaFundamentalFields.VOLATILITY, ref mVolatility))
              mVolatilityFieldState = MamdaFieldState.MODIFIED;

            if (msg.tryF64(MamdaFundamentalFields.PRICE_EARN_RATIO, ref mPeRatio))
              mPeRatioFieldState = MamdaFieldState.MODIFIED;
            
            if (msg.tryF64(MamdaFundamentalFields.YIELD, ref mYield))
              mYieldFieldState = MamdaFieldState.MODIFIED;
            
            if (msg.tryF64(MamdaFundamentalFields.HIST_VOLATILITY, ref mHistVolatility))
              mHistVolatilityFieldState = MamdaFieldState.MODIFIED;
            
            if (msg.tryF64(MamdaFundamentalFields.RISK_FREE_RATE, ref mRiskFreeRate))
              mRiskFreeRateFieldState = MamdaFieldState.MODIFIED;
        }
All Usage Examples Of Wombat.MamaMsg::tryDateTime
MamaMsg