public DateObjectModelVal(string aVal, string aCFormat = null, bool aDualDated = false, string aNewYear = null, DateQuality aQuality = DateQuality.unknown, DateValType aValType = DateValType.unknown)
        {
            {
                Contract.Requires(!string.IsNullOrEmpty(aVal));

                // Setup basics
                ModelItemGlyph.Symbol       = Constants.IconDate;
                ModelItemGlyph.SymbolColour = CommonRoutines.ResourceColourGet("CardBackGroundUtility");
                //DerivedType = DateObjectModelDerivedTypeEnum.DateObjectModelVal;

                HLinkKey = Common.CustomClasses.HLinkKey.NewAsGUID();

                try
                {
                    GCformat = aCFormat;

                    GDualdated = aDualDated;

                    GNewYear = aNewYear;

                    GQuality = aQuality;

                    GVal = aVal;

                    GValType = aValType;

                    NotionalDate = ConvertRFC1123StringToDateTime(aVal);
                }
                catch (Exception e)
                {
                    App.Current.Services.GetService <IErrorNotifications>().NotifyException("Error in SetDate", e);
                    throw;
                }
            }
        }
        public DateObjectModelRange(string aStart, string aStop, string aCFormat = null, bool aDualDated = false, string aNewYear = null, DateQuality aQuality = DateQuality.unknown)
        {
            Contract.Requires(!string.IsNullOrEmpty(aStart));
            Contract.Requires(!string.IsNullOrEmpty(aStop));

            // Setup basics
            ModelItemGlyph.Symbol       = Constants.IconDate;
            ModelItemGlyph.SymbolColour = CommonRoutines.ResourceColourGet("CardBackGroundUtility");
            //DerivedType = DateObjectModelDerivedTypeEnum.DateObjectModelRange;

            HLinkKey = Common.CustomClasses.HLinkKey.NewAsGUID();

            GCformat = aCFormat;

            // dualdated value #REQUIRED
            GDualdated = aDualDated;

            // newyear CDATA #IMPLIED
            GNewYear = aNewYear;

            // type CDATA #REQUIRED
            GQuality = aQuality;

            // start CDATA #REQUIRED
            GStart = new DateObjectModelVal(aStart);

            // stop CDATA #REQUIRED
            GStop = new DateObjectModelVal(aStop);

            // Set NotionalDate
            NotionalDate = ConvertRFC1123StringToDateTime(aStart);
        }
Example #3
0
        public DateObjectModelSpan(string aStart, string aStop, string aCFormat = null, bool aDualDated = false, string aNewYear = null, DateQuality aQuality = DateQuality.unknown)
        {
            Contract.Requires(!string.IsNullOrEmpty(aStart));
            Contract.Requires(!string.IsNullOrEmpty(aStop));

            // Setup basics
            ModelItemGlyph.Symbol       = Constants.IconDate;
            ModelItemGlyph.SymbolColour = CommonRoutines.ResourceColourGet("CardBackGroundUtility");
            //DerivedType = DateObjectModelDerivedTypeEnum.DateObjectModelSpan;

            HLinkKey = Common.CustomClasses.HLinkKey.NewAsGUID();

            // check for date range
            try
            {
                GCformat = aCFormat;

                // dualdated value #REQUIRED
                GDualdated = aDualDated;

                // newyear CDATA #IMPLIED
                GNewYear = aNewYear;

                // type CDATA #REQUIRED
                GQuality = aQuality;

                // start CDATA #REQUIRED
                GStart = new DateObjectModelVal(aStart);

                // stop CDATA #REQUIRED
                GStop = new DateObjectModelVal(aStop);;

                // Set NotionalDate
                NotionalDate = NotionalDate = ConvertRFC1123StringToDateTime(aStart);
            }
            catch (Exception e)
            {
                // TODO
                App.Current.Services.GetService <IErrorNotifications>().NotifyException("Error in SetDate", e);
                throw;
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="EffectiveDateHasQuality" /> class.
 /// </summary>
 /// <param name="quality">quality.</param>
 public EffectiveDateHasQuality(DateQuality quality = default(DateQuality))
 {
     this.Quality = quality;
 }