コード例 #1
0
        public void Cleanup()
        {
            test_meiprop = null;
            prop_obj     = null;

            test_meimensur = null;
            mensur_obj     = null;
        }
コード例 #2
0
        public void Init()
        {
            test_meiprop = new Proport();
            prop_obj     = new Proportion();

            test_meimensur = new mei.Mensur();
            mensur_obj     = new Model.Mensur();
        }
コード例 #3
0
        /// <summary>
        /// Adds properties to a Proportion object.
        /// </summary>
        /// <param name="_propobj">Empty proportion object</param>
        /// <param name="_meiprop">MEI proport element</param>
        /// <returns>Proportion object with data</returns>
        public static Model.Proportion ConvertProportion(Model.Proportion _propobj, mei.Proport _meiprop)
        {
            _propobj.Sign     = GetSign(_meiprop);
            _propobj.Affected = ConvertAffected(_meiprop);

            if (_meiprop.HasNum() && _meiprop.HasNumbase())
            {
                _propobj.Num     = ConverterHelper.ConvertNumNumbase(_meiprop.GetNumAttribute());
                _propobj.Numbase = ConverterHelper.ConvertNumNumbase(_meiprop.GetNumbaseAttribute());
            }
            else
            {
                throw new NullReferenceException($"<proport> doesn't have @num or @numbase!");
            }

            return(_propobj);
        }
コード例 #4
0
 /// <summary>
 /// Converts value of @mse:affected into Enum Duration
 /// </summary>
 /// <param name="_prop">MEI proport element</param>
 /// <returns>Model.Duration</returns>
 private static Duration ConvertAffected(mei.Proport _prop)
 {
     return(ConverterHelper.ConvertDuration(_prop.GetAffectedAttribute()));
 }