Esempio n. 1
0
 internal ObjectProperty(string name, PropertyTypeEnum propertyType)
     : base(name, propertyType)
 {
     Dynamic = _DYNAMIC_DEFAULT;
     IsEnabled = _IS_ENABLED_DEFAULT;
     IncludeInAll = _INCLUDE_IN_ALL_DEFAULT;
 }
Esempio n. 2
0
 /// <summary>
 /// Establish defaults.
 /// </summary>
 public NumberProperty(string name, PropertyTypeEnum propertyType) : base(name, propertyType) 
 {
     PrecisionStep = _PRECISION_STEP_DEFAULT;
     DocValues = _DOC_VALUES_DEFAULT;
     IgnoreMalformed = _IGNORE_MALFORMED_DEFAULT;
     Coerce = _COERCE_DEFAULT;
 }
 public MetadataSelect(Title title, string propertyName, PropertyTypeEnum type)
 {
     InitializeComponent();
     _title = title;
     _propertyName = propertyName;
     _type = type;
     Type tTitle = title.GetType();
     _propertyInfo = tTitle.GetProperty(propertyName);
     lblTitleProperty.Text = String.Format("{0} : {1}", _title.Name, _propertyName);
 }
        /// <summary>
        /// Create a document property base.
        /// </summary>
        /// <param name="name">Sets the name of the property.</param>
        /// <param name="propertyType">Sets the property type.</param>
        public DocumentPropertyBase(string name, PropertyTypeEnum propertyType)
            : base(_INDEX_DEFAULT, _STORE_DEFAULT)
        {
            if (string.IsNullOrWhiteSpace(name))
                throw new ArgumentNullException("name", "All document properties require a name.");
            if (propertyType == null)
                throw new ArgumentNullException("propertyType", "All document properties require a property type.");

            Name = name;
            PropertyType = propertyType;
            IndexName = name;
            IncludeInAll = _INCLUDE_IN_ALL_DEFAULT;
        }
Esempio n. 5
0
        public int GetDefaultDeprPct(PropertyTypeEnum propType, DateTime pisDate, DeprMethodTypeEnum deprMethod)
        {
            int percentage = 0;

            switch (deprMethod)
            {
            case DeprMethodTypeEnum.MacrsFormula:
            case DeprMethodTypeEnum.MacrsTable:
            case DeprMethodTypeEnum.MACRSIndianReservation:
                switch (propType)
                {
                case PropertyTypeEnum.RealGeneral:
                case PropertyTypeEnum.RealListed:
                case PropertyTypeEnum.RealConservation:
                case PropertyTypeEnum.RealEnergy:
                case PropertyTypeEnum.RealFarms:
                case PropertyTypeEnum.RealLowIncomeHousing:
                    percentage = 100;
                    return(percentage);

                default:
                    percentage = 200;
                    return(percentage);
                }

            case DeprMethodTypeEnum.DeclBal:
            case DeprMethodTypeEnum.DeclBalHalfYear:
            case DeprMethodTypeEnum.DeclBalModHalfYear:
            case DeprMethodTypeEnum.DeclBalSwitch:
            case DeprMethodTypeEnum.DeclBalHalfYearSwitch:
            case DeprMethodTypeEnum.DeclBalModHalfYearSwitch:
                percentage = 200;
                return(percentage);

            case DeprMethodTypeEnum.MacrsFormula30:
            case DeprMethodTypeEnum.MACRSIndianReservation30:
                percentage = 200;
                return(percentage);

            // Canadian BEGIN !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            case DeprMethodTypeEnum.CdnDeclBal:
            case DeprMethodTypeEnum.CdnDeclBalHalfYear:
            case DeprMethodTypeEnum.CdnDeclBalFullMonth:
                percentage = 30;
                return(percentage);
                // Canadian END ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            }

            return(percentage);
        }
Esempio n. 6
0
        /// <summary>
        /// Formats the dektet property.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="exportConatiner">The export conatiner.</param>
        /// <returns></returns>
        private static string FormatDektetProperty(PropertyTypeEnum type, IList <ExportPropertyGeneral> properties)
        {
            string value    = "";
            var    property = (from u in properties where u.Type == type select u).FirstOrDefault();

            if (property == null)
            {
                value = FormatOktetText(ZERRO);
                return(value);
            }
            if (type == PropertyTypeEnum.PlasticStrainStress)
            {
                foreach (var item in property.Values)
                {
                    value = value + FormatDoubleDektetText(item.X.ToString()) + FormatDoubleDektetText(item.Y.ToString()) + FormatDektetText("") + FormatDektetText("") + FormatDektetText("") + System.Environment.NewLine;
                }
                return(value);
            }
            else
            {
                if (property.Value != null)
                {
                    switch (type)
                    {
                    case PropertyTypeEnum.None:
                        break;

                    case PropertyTypeEnum.PhysicalModulusOfElasticity:
                        value = (double.Parse(property.Value) * 1000).ToString("f1", System.Globalization.CultureInfo.InvariantCulture);
                        break;

                    case PropertyTypeEnum.PhysicalPoissonCoefficient:
                        value = property.Value;
                        break;

                    case PropertyTypeEnum.PhysicalDensity:
                        value = String.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:0.###E-0}", double.Parse(property.Value) / 1000000000);
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    value = ZERRO;
                }
                return(FormatDektetText(value));
            }
        }
        internal PropertyDialog(DesignXmlDraw dxDraw, List <XmlNode> sNodes, PropertyTypeEnum type, XmlNode tcNode, XmlNode trNode)
        {
            this._Draw   = dxDraw;
            this._Nodes  = sNodes;
            this._Type   = type;
            _TableColumn = tcNode;
            _TableRow    = trNode;
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //   Add the controls for the selected ReportItems
            switch (_Type)
            {
            case PropertyTypeEnum.Report:
                BuildReportTabs();
                break;

            case PropertyTypeEnum.DataSets:
                BuildDataSetsTabs();
                break;

            case PropertyTypeEnum.Grouping:
                BuildGroupingTabs();
                break;

            case PropertyTypeEnum.ChartLegend:
                BuildChartLegendTabs();
                break;

            case PropertyTypeEnum.CategoryAxis:
            case PropertyTypeEnum.ValueAxis:
                BuildChartAxisTabs(type);
                break;

            case PropertyTypeEnum.ChartTitle:
            case PropertyTypeEnum.CategoryAxisTitle:
            case PropertyTypeEnum.ValueAxisTitle:
            case PropertyTypeEnum.ValueAxis2Title:    // 20022008 AJM GJL
                BuildTitle(type);
                break;

            case PropertyTypeEnum.ReportItems:
            default:
                BuildReportItemTabs();
                break;
            }
        }
Esempio n. 8
0
    public static float GetMinValue(PropertyTypeEnum type)
    {
//         if (type == PropertyTypeEnum.PropertyTypeHP ||
//             type == PropertyTypeEnum.PropertyTypeMana ||
//             type == PropertyTypeEnum.PropertyTypeSpeed ||
//             type == PropertyTypeEnum.PropertyTypeSpeed_Rate ||
//          type == PropertyTypeEnum.PropertyTypeAlpha ||
//          type == PropertyTypeEnum.PropertyTypeScale_Rate ||
//          type == PropertyTypeEnum.PropertyTypeSpasticityResistance ||
//             type == PropertyTypeEnum.PropertyTypeDamage ||
//             type == PropertyTypeEnum.PropertyTypeDamage_Rate
//             )
//             return 0.0f;
//         return 2000000.0f;
        return(0.0f);
    }
Esempio n. 9
0
        /// <summary>
        /// Creates the parameter detail.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="idPrefix">The identifier prefix.</param>
        /// <param name="Name">The name.</param>
        /// <param name="units">The units.</param>
        /// <param name="unitsName">Name of the units.</param>
        /// <param name="unitsDescription">The units description.</param>
        /// <returns></returns>
        private static NXSiemensParameterDetail CreateParameterDetail(PropertyTypeEnum type, string idPrefix, string Name, IList <NXSiemensUnit> units, string unitsName, string unitsDescription)
        {
            NXSiemensParameterDetail parameterDetail = new NXSiemensParameterDetail();

            parameterDetail.IdPrefix         = idPrefix;
            parameterDetail.Type             = type;
            parameterDetail.UnitsName        = unitsName;
            parameterDetail.UnitsDescription = unitsDescription;
            parameterDetail.IdString         = idPrefix;
            parameterDetail.Name             = Name;
            if (units != null && units.Count > 0)
            {
                parameterDetail.Units = units;
            }
            return(parameterDetail);
        }
Esempio n. 10
0
        /// <summary>
        /// Creates the parameter detail.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="idPrefix">The identifier prefix.</param>
        /// <param name="Id">The identifier.</param>
        /// <param name="Name">The name.</param>
        /// <param name="units">The units.</param>
        /// <returns></returns>
        private static ANSYSParameterDetail CreateParameterDetail(PropertyTypeEnum type, string idPrefix, int Id, string Name, IList <ANSYSUnit> units)
        {
            ANSYSParameterDetail parameterDetail = new ANSYSParameterDetail();

            parameterDetail.Id       = Id;
            parameterDetail.IdPrefix = idPrefix;
            parameterDetail.Type     = type;
            parameterDetail.IdString = idPrefix + Id.ToString();
            parameterDetail.Name     = Name;
            if (units != null && units.Count > 0)
            {
                parameterDetail.Units = units;
            }

            return(parameterDetail);
        }
Esempio n. 11
0
        /// <summary>
        /// Formats the octet.
        /// </summary>
        /// <param name="export">The export.</param>
        /// <param name="exportType">Type of the export.</param>
        /// <returns></returns>
        private static string FormatOctet(IList <ExportPropertyGeneral> properties, PropertyTypeEnum exportType, TypeOfOctet octetType)
        {
            double Num;
            string propertyValue           = null;
            ExportPropertyGeneral property = (from u in properties where u.Type == exportType select u).FirstOrDefault();

            if (property != null)
            {
                propertyValue = property.Value;
                return(propertyValue != null && double.TryParse(propertyValue, out Num) ? FillOctet(double.Parse(propertyValue), octetType, exportType) : EMPTYOCTET);
            }
            else
            {
                return(ZERO);
            }
        }
Esempio n. 12
0
        private void BuildChartAxisTabs(PropertyTypeEnum type)
        {
            string propName;

            if (type == PropertyTypeEnum.CategoryAxis)
            {
                //this.Text = "Chart Category (X) Axis";
                this.Text = "图表目录 (X) 轴";
                propName  = "CategoryAxis";
            }
            else
            {
                //this.Text = "Chart Value (Y) Axis";
                this.Text = "图表值 (X) 轴";
                propName  = "ValueAxis";
            }

            XmlNode cNode  = _Nodes[0];
            XmlNode aNode  = _Draw.GetCreateNamedChildNode(cNode, propName);
            XmlNode axNode = _Draw.GetCreateNamedChildNode(aNode, "Axis");

            // Now we replace the node array with a new one containing only the legend
            _Nodes = new List <XmlNode>();
            _Nodes.Add(axNode);

            EnsureStyle();              // Make sure we have Style nodes

            // Chart Axis
            ChartAxisCtl cac = new ChartAxisCtl(_Draw, this._Nodes);

            AddTab("表轴", cac);

            // Style Text
            StyleTextCtl stc = new StyleTextCtl(_Draw, this._Nodes);

            AddTab("文本", stc);

            // Border tab
            StyleBorderCtl bc = new StyleBorderCtl(_Draw, null, this._Nodes);

            AddTab("边框", bc);

            // Style tab
            StyleCtl sc = new StyleCtl(_Draw, this._Nodes);

            AddTab("样式", sc);
        }
Esempio n. 13
0
        private void BuildTitle(PropertyTypeEnum type)
        {
            XmlNode cNode = _Nodes[0];

            _Nodes = new List <XmlNode>();               // replace with a new one
            if (type == PropertyTypeEnum.ChartTitle)
            {
                this.Text = "Chart Title";

                XmlNode lNode = _Draw.GetCreateNamedChildNode(cNode, "Title");
                _Nodes.Add(lNode);                              // Working on the title
            }
            else if (type == PropertyTypeEnum.CategoryAxisTitle)
            {
                this.Text = "Category (X) Axis Title";
                XmlNode caNode = _Draw.GetCreateNamedChildNode(cNode, "CategoryAxis");
                XmlNode aNode  = _Draw.GetCreateNamedChildNode(caNode, "Axis");
                XmlNode tNode  = _Draw.GetCreateNamedChildNode(aNode, "Title");
                _Nodes.Add(tNode);                              // Working on the title
            }
            else
            {
                this.Text = "Value (Y) Axis Title";
                XmlNode caNode = _Draw.GetCreateNamedChildNode(cNode, "ValueAxis");
                XmlNode aNode  = _Draw.GetCreateNamedChildNode(caNode, "Axis");
                XmlNode tNode  = _Draw.GetCreateNamedChildNode(aNode, "Title");
                _Nodes.Add(tNode);                              // Working on the title
            }

            EnsureStyle();              // Make sure we have Style nodes

            // Style Text
            StyleTextCtl stc = new StyleTextCtl(_Draw, this._Nodes);

            AddTab("Text", stc);

            // Border tab
            StyleBorderCtl bc = new StyleBorderCtl(_Draw, this._Nodes);

            AddTab("Border", bc);

            // Style tab
            StyleCtl sc = new StyleCtl(_Draw, this._Nodes);

            AddTab("Style", sc);
        }
Esempio n. 14
0
        private void BuildChartAxisTabs(PropertyTypeEnum type)
        {
            string propName;

            if (type == PropertyTypeEnum.CategoryAxis)
            {
                Text     = Strings.PropertyDialog_BuildChartAxisTabs_ChartCategoryAxis;
                propName = "CategoryAxis";
            }
            else
            {
                Text     = Strings.PropertyDialog_BuildChartAxisTabs_ChartValueAxis;
                propName = "ValueAxis";
            }

            XmlNode cNode  = _Nodes[0];
            XmlNode aNode  = _Draw.GetCreateNamedChildNode(cNode, propName);
            XmlNode axNode = _Draw.GetCreateNamedChildNode(aNode, "Axis");

            // Now we replace the node array with a new one containing only the legend
            _Nodes = new List <XmlNode>();
            _Nodes.Add(axNode);

            EnsureStyle();      // Make sure we have Style nodes

            // Chart Axis
            var cac = new ChartAxisCtl(_Draw, _Nodes);

            AddTab(Strings.PropertyDialog_BuildChartAxisTabs_Axis, cac);

            // Style Text
            var stc = new StyleTextCtl(_Draw, _Nodes, this);

            AddTab(Strings.PropertyDialog_BuildReportItemTabs_Text, stc);

            // Border tab
            var bc = new StyleBorderCtl(_Draw, null, _Nodes);

            AddTab(Strings.PropertyDialog_BuildReportItemTabs_Border, bc);

            // Style tab
            var sc = new StyleCtl(_Draw, _Nodes);

            AddTab(Strings.PropertyDialog_BuildReportItemTabs_Style, sc);
        }
Esempio n. 15
0
        public RuleResult IsValid(PropertyTypeEnum propType, DateTime pisDate, DateTime startOfBusinessDate)
        {
            ErrorCode   errorCode;
            bool        isShortYr = false;
            IbpRuleBase rb        = new bpRuleBase();

            rb.ValidatePlaceInService((short)(propType), pisDate, startOfBusinessDate, out errorCode);

            switch ((RuleBase_ErrorCodeEnum)errorCode)
            {
            case RuleBase_ErrorCodeEnum.rulebase_Valid:
                return(RuleResult.Valid);

            case RuleBase_ErrorCodeEnum.rulebase_RuleBaseFailure:
                return(RuleResult.RuleBaseFailure);

            case RuleBase_ErrorCodeEnum.rulebase_InvalDateValue:
                return(RuleResult.InvalDateValue);

            case RuleBase_ErrorCodeEnum.rulebase_LowIncHousingInvalBefore1981:
                return(RuleResult.LowIncHousingInvalBefore1981);

            case RuleBase_ErrorCodeEnum.rulebase_ListedPropInvalBeforeJune191984:
                return(RuleResult.ListedPropInvalBeforeJune191984);

            case RuleBase_ErrorCodeEnum.rulebase_LowIncHousingInvalAfter1986:
                return(RuleResult.LowIncHousingInvalAfter1986);

            case RuleBase_ErrorCodeEnum.rulebase_AutoPropInvalBeforeJune191984:
                return(RuleResult.AutoPropInvalBeforeJune191984);

            case RuleBase_ErrorCodeEnum.rulebase_DateInvalBeforeStartBusiness:
                return(RuleResult.DateInvalBeforeStartBusiness);

            case RuleBase_ErrorCodeEnum.rulebase_DateInvalBefore1920:
                return(RuleResult.DateInvalBefore1920);

            case RuleBase_ErrorCodeEnum.rulebase_DateInvalAfter2999:
                return(RuleResult.DateInvalAfter2999);

            case RuleBase_ErrorCodeEnum.rulebase_LtTrucksAndVansPropInvalBefore2003:
                return(RuleResult.LtTrucksAndVansPropInvalBefore2003);
            }
            return(RuleResult.RuleBaseFailure);
        }
Esempio n. 16
0
    public static int ToBind(PropertyTypeEnum type)
    {
        switch (type)
        {
        case PropertyTypeEnum.PropertyTypeHP:
            return(0);

        case PropertyTypeEnum.PropertyTypeMana:
            return(1);

        case PropertyTypeEnum.PropertyTypeSpeed:
        case PropertyTypeEnum.PropertyTypeSpeed_Rate:
            return(2);

        case PropertyTypeEnum.PropertyTypeMaxHP:
        case PropertyTypeEnum.PropertyTypeMaxHP_Rate:
            return(3);

        case PropertyTypeEnum.PropertyTypeDamage:
        case PropertyTypeEnum.PropertyTypeDamage_Rate:
            return(4);

        case PropertyTypeEnum.PropertyTypeCrticalLV:
        case PropertyTypeEnum.PropertyTypeCrticalLV_Rate:
            return(5);

        case PropertyTypeEnum.PropertyTypeDefance:
        case PropertyTypeEnum.PropertyTypeDefance_Rate:
            return(6);

        case PropertyTypeEnum.PropertyTypeMaxMana:
        case PropertyTypeEnum.PropertyTypeMaxEnergy_Rate:
            return(7);

        case PropertyTypeEnum.PropertyTypeAlpha:
            return(8);

        case PropertyTypeEnum.PropertyTypeScale_Rate:
            return(9);

        case PropertyTypeEnum.PropertyTypeSpasticityResistance:
            return(10);
        }
        return(-1);
    }
Esempio n. 17
0
        public FilterViewModel GetFilterViewModel(string propertyName, PropertyTypeEnum propertyType, int propertyId, JsonDocument filterInfo, JsonDocument constraints, FilterDTO filterDto = null)
        {
            Type filterViewType = null;

            if (_mapper.ContainsId(propertyId))
            {
                filterViewType = _mapper.GetFilterForProperty(propertyId);
            }
            else if (_mapper.ContainsType(propertyType))
            {
                filterViewType = _mapper.GetFilterForType(propertyType);
            }
            else
            {
                return(null);
            }

            var filterViewModel = (FilterViewModel)_mapper.GetFilterFactory(filterViewType)();

            filterViewModel.PropertyId   = propertyId;
            filterViewModel.PropertyType = propertyType;
            filterViewModel.PropertyName = propertyName;

            dynamic filterInfoJObject  = JsonConvert.DeserializeObject(filterInfo.ToJsonString());
            dynamic constraintsJObject = JsonConvert.DeserializeObject(constraints.ToJsonString());

            if (_buildersMap.ContainsKey(filterViewType))
            {
                filterViewModel = _buildersMap[filterViewType]
                                  .BuildFilterViewModel(filterViewModel, filterInfoJObject, constraintsJObject, filterDto);
            }

            /*else
             * {
             *  var metadata = _mapper.GetFilterPropertiesMetadata(filterViewType);
             *  foreach (var property in metadata)
             *  {
             *      if(filterInfo.RootElement.TryGetProperty(property.Name, out var p))
             *          p.
             *  }
             * }*/

            return(filterViewModel);
        }
        public static dynamic GetTSObject(PropertyTypeEnum dynEnum)
        {
            var tsType = TSActivator.CreateInstance("Tekla.Structures.PropertyTypeEnum").GetType();

            switch (dynEnum)
            {
            case PropertyTypeEnum.TYPE_INT:
                return(System.Enum.Parse(tsType, "TYPE_INT"));

            case PropertyTypeEnum.TYPE_DOUBLE:
                return(System.Enum.Parse(tsType, "TYPE_DOUBLE"));

            case PropertyTypeEnum.TYPE_STRING:
                return(System.Enum.Parse(tsType, "TYPE_STRING"));

            default:
                throw new DynamicAPIException(dynEnum.ToString() + "- enum value is not implemented");
            }
        }
Esempio n. 19
0
        //
        //==============================================================================================
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="cp"></param>
        /// <param name="propertyType"></param>
        /// <remarks></remarks>
        public PropertyModelClass(CoreController core, PropertyTypeEnum propertyType)
        {
            this.core         = core;
            this.propertyType = propertyType;
            switch (propertyType)
            {
            case PropertyTypeEnum.visit:
                propertyKeyId = core.session.visit.id;
                break;

            case PropertyTypeEnum.visitor:
                propertyKeyId = core.session.visitor.id;
                break;

            default:
                propertyKeyId = core.session.user.id;
                break;
            }
        }
Esempio n. 20
0
        internal PropertyDialog(DesignXmlDraw dxDraw, List<XmlNode> sNodes, PropertyTypeEnum type, XmlNode tcNode, XmlNode trNode)
        {
            _Draw = dxDraw;
            _Nodes = sNodes;
            _Type = type;
            _TableColumn = tcNode;
            _TableRow = trNode;
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //   Add the controls for the selected ReportItems
            switch (_Type)
            {
                case PropertyTypeEnum.Report:
                    BuildReportTabs();
                    break;
                case PropertyTypeEnum.DataSets:
                    BuildDataSetsTabs();
                    break;
                case PropertyTypeEnum.Grouping:
                    BuildGroupingTabs();
                    break;
                case PropertyTypeEnum.ChartLegend:
                    BuildChartLegendTabs();
                    break;
                case PropertyTypeEnum.CategoryAxis:
                case PropertyTypeEnum.ValueAxis:
                    BuildChartAxisTabs(type);
                    break;
                case PropertyTypeEnum.ChartTitle:
                case PropertyTypeEnum.CategoryAxisTitle:
                case PropertyTypeEnum.ValueAxisTitle:
                case PropertyTypeEnum.ValueAxis2Title:// 20022008 AJM GJL
                    BuildTitle(type);
                    break;
                default:
                    BuildReportItemTabs();
                    break;
            }
        }
Esempio n. 21
0
        public RuleResult IsApplicable(PropertyTypeEnum propType, DeprMethodTypeEnum deprMethod)
        {
            IbpRuleBase rb = new bpRuleBase();
            ErrorCode   errorCode;

            rb.AllowMidQuarter((short)(propType), (short)(deprMethod), true, out errorCode);

            switch ((RuleBase_ErrorCodeEnum)errorCode)
            {
            case RuleBase_ErrorCodeEnum.rulebase_Valid:
                return(RuleResult.Valid);

            case RuleBase_ErrorCodeEnum.rulebase_Invalid:
                return(RuleResult.Invalid);

            case RuleBase_ErrorCodeEnum.rulebase_RuleBaseFailure:
                return(RuleResult.RuleBaseFailure);
            }
            return(RuleResult.RuleBaseFailure);
        }
Esempio n. 22
0
        public List <DeprPct> BuildValidList(PropertyTypeEnum propType, DateTime pisDate, DeprMethodTypeEnum deprMethod)
        {
            List <DeprPct> deprPctList = new List <DeprPct>();
            IbpRuleBase    rb          = new bpRuleBase();
            List <int>     ei          = new List <int>();

            rb.BuildDeprPercentList((short)(propType), (pisDate), (short)deprMethod, out ei);

            if (ei == null || ei.Count == 0)
            {
                return(null);
            }

            for (int posi = 0; posi < ei.Count; posi++)
            {
                deprPctList.Add(new DeprPct(ei[posi]));
            }

            return(deprPctList);
        }
Esempio n. 23
0
        public List <YrsMosDate> BuildValidList(PropertyTypeEnum propType, DateTime pisDate, DeprMethodTypeEnum method, int pct)
        {
            List <YrsMosDate> estLifeList = new List <YrsMosDate>();
            IbpRuleBase       rb          = new bpRuleBase();
            List <int>        ei          = new List <int>();

            rb.BuildEstimatedLifeList((short)propType, pisDate, (short)method, (int)pct, out ei);

            if (ei == null || ei.Count == 0)
            {
                return(null);
            }

            for (int posi = 0; posi < ei.Count; posi++)
            {
                estLifeList.Add(new YrsMosDate((uint)ei[posi] / 100, (uint)ei[posi] % 100));
            }

            return(estLifeList);
        }
Esempio n. 24
0
        public List <RuleItemDto> GetEstLifeList(string propTypeName, DateTime pisDate, string deprMethodName)
        {
            PropertyTypeEnum propType       = PropertyTypeCode.translateShortNameToType(propTypeName);
            DeprMethodCode   deprMethodCode = DeprMethodCode.translateDeprNameToCode(deprMethodName);

            EstLifeRule       estLifeRule = new EstLifeRule();
            List <YrsMosDate> estLifeList = estLifeRule.BuildValidList(propType, pisDate, deprMethodCode.Type, deprMethodCode.Percentage);

            List <RuleItemDto> itemList = new List <RuleItemDto>();

            foreach (YrsMosDate estLife in estLifeList)
            {
                string text = String.Format("{0,-2:00} yrs {1,-2:00} mos", estLife.Years, estLife.Months);
                itemList.Add(new RuleItemDto()
                {
                    Name = text, Value = text
                });
            }

            return(itemList);
        }
Esempio n. 25
0
        public RuleResult IsValid(BookTypeEnum book, PropertyTypeEnum propType, DateTime pisDate, DeprMethodTypeEnum deprMethod, int deprPct, YrsMosDate estLife)
        {
            ErrorCode   errorCode;
            IbpRuleBase rb = new bpRuleBase();

            rb.ValidateEstimatedLife((short)(propType), pisDate, (short)(deprMethod), (int)deprPct, (short)(estLife.Years * 100 + estLife.Months), out errorCode);

            switch ((RuleBase_ErrorCodeEnum)errorCode)
            {
            case RuleBase_ErrorCodeEnum.rulebase_Valid:
                return(RuleResult.Valid);

            case RuleBase_ErrorCodeEnum.rulebase_Invalid:
                return(RuleResult.Invalid);

            case RuleBase_ErrorCodeEnum.rulebase_WarnNotUsualRecoveryPd:
                return(RuleResult.WarnNotUsualRecoveryPd);

            case RuleBase_ErrorCodeEnum.rulebase_WarnNotUsualRecoveryPeriod:
                return(RuleResult.WarnNotUsualRecoveryPeriod);

            case RuleBase_ErrorCodeEnum.rulebase_WarnNotUsualUnlTransProp:
                return(RuleResult.WarnNotUsualUnlTransProp);

            case RuleBase_ErrorCodeEnum.rulebase_WarnNotOver20Years:
                return(RuleResult.WarnNotOver20Years);

            case RuleBase_ErrorCodeEnum.rulebase_WarnAANotOver20Years:
                return(RuleResult.WarnAANotOver20Years);

            case RuleBase_ErrorCodeEnum.rulebase_WarnOnlyNYLZAllowForRMF100EST0500:
                return(RuleResult.WarnOnlyNYLZAllowForRMF100EST0500);

            case RuleBase_ErrorCodeEnum.rulebase_RuleBaseFailure:
                return(RuleResult.RuleBaseFailure);
            }
            // section 179 does not apply.
            return(RuleResult.Invalid);
        }
Esempio n. 26
0
        public List <ITCCode> BuildValidList(PropertyTypeEnum propType, DateTime pisDate, DeprMethodTypeEnum depMethod, int deprPct)
        {
            List <ITCCode> itcList = new List <ITCCode>();
            IbpRuleBase    rb      = new bpRuleBase();
            List <int>     ei      = new List <int>();

            rb.BuildITCList(pisDate, Convert.ToInt16(depMethod), out ei);

            if (ei == null || ei.Count == 0)
            {
                return(null);
            }

            for (int posi = 0; posi < ei.Count; posi++)
            {
                ITCCode aCode = new ITCCode();
                aCode.Type = (ItcType)(ei[posi]);
                itcList.Add(new ITCCode(aCode));
            }

            return(itcList);
        }
Esempio n. 27
0
        //public List<DeprMethodCode> BuildValidList(string propTypeName, DateTime pisDate)
        //{
        //    PropertyTypeEnum propType = PropertyTypeCode.translateShortNameToType(propTypeName);

        //    return BuildValidList(propType, pisDate);
        //}

        public List <DeprMethodCode> BuildValidList(PropertyTypeEnum propType, DateTime pisDate)
        {
            List <DeprMethodCode> deprMethodCodeList = new List <DeprMethodCode>();
            IbpRuleBase           rb = new bpRuleBase();
            List <int>            ei = new List <int>();
            bool isShortYr           = false;

            rb.BuildDeprMethodList((short)(propType), (pisDate), isShortYr, out ei);

            if (ei == null || ei.Count == 0)
            {
                return(null);
            }

            DeprPctRule deprPctRule = new DeprPctRule();

            for (int posi = 0; posi < ei.Count; posi++)
            {
                DeprMethod aType = new DeprMethod((DeprMethodTypeEnum)ei[posi]);

                List <DeprPct> pctList = deprPctRule.BuildValidList(propType, pisDate, aType.Type);
                if (pctList != null && pctList.Count > 0)
                {
                    foreach (DeprPct deprPct in pctList)
                    {
                        deprMethodCodeList.Add(new DeprMethodCode(aType)
                        {
                            Percentage = deprPct.Percentage
                        });
                    }
                }
                else
                {
                    deprMethodCodeList.Add(new DeprMethodCode(aType));
                }
            }

            return(deprMethodCodeList);
        }
Esempio n. 28
0
        private uint      encodePisDate(DateTime pisDate, short propType)   //GSD 2011.1
        {
            DateTime         julianPisDate = pisDate.Date;
            PropertyTypeEnum pType         = (PropertyTypeEnum)(propType); //GSD 2011.1


            if (julianPisDate <= new DateTime(1980, 12, 31))
            {
                return(1);
            }
            else
            if (julianPisDate <= new DateTime(1986, 7, 31))
            {
                return(2);
            }
            else
            if (julianPisDate <= new DateTime(1986, 12, 31))
            {
                return(3);
            }

            //GSD 2015.1 - extend through 2014
            //GSD 2011.1
            // KL 2016.1
            if ((pType == PropertyTypeEnum.RealConservation ||
                 pType == PropertyTypeEnum.RealEnergy ||
                 pType == PropertyTypeEnum.RealFarms) &&
                (new DateTime(2010, 1, 1) <= julianPisDate && julianPisDate <= new DateTime(2999, 12, 31)))
            {
                return(5);
            }
            else
            {
                return(4);
            }
        }
Esempio n. 29
0
 public ForPropertyTypeAttribute(PropertyTypeEnum type)
 {
     Type = type;
 }
        private List <UserControl> _TabPanels = new List <UserControl>(); // list of IProperty controls

        internal PropertyDialog(DesignXmlDraw dxDraw, List <XmlNode> sNodes, PropertyTypeEnum type)
            : this(dxDraw, sNodes, type, null, null)
        {
        }
Esempio n. 31
0
 internal PropertyDialog(DesignXmlDraw dxDraw, List<XmlNode> sNodes, PropertyTypeEnum type)
     : this(dxDraw, sNodes, type, null, null)
 {
 }
Esempio n. 32
0
        private void BuildTitle(PropertyTypeEnum type)
        {
            XmlNode cNode = _Nodes[0];
            _Nodes = new List<XmlNode>();		// replace with a new one
            if (type == PropertyTypeEnum.ChartTitle)
            {
                this.Text = "Chart Title";

                XmlNode lNode = _Draw.GetCreateNamedChildNode(cNode, "Title");
                _Nodes.Add(lNode);		// Working on the title
            }
            else if (type == PropertyTypeEnum.CategoryAxisTitle)
            {
                this.Text = "Category (X) Axis Title";
                XmlNode caNode = _Draw.GetCreateNamedChildNode(cNode, "CategoryAxis");
                XmlNode aNode = _Draw.GetCreateNamedChildNode(caNode, "Axis");
                XmlNode tNode = _Draw.GetCreateNamedChildNode(aNode, "Title");
                _Nodes.Add(tNode);		// Working on the title
            }
            // 20022008 AJM GJL
            else if (type == PropertyTypeEnum.ValueAxis2Title)
            {
                this.Text = "Value (Y) Axis (Right) Title";
                XmlNode caNode = _Draw.GetCreateNamedChildNode(cNode, "ValueAxis");
                XmlNode aNode = _Draw.GetCreateNamedChildNode(caNode, "Axis");
                XmlNode tNode = _Draw.GetCreateNamedChildNode(aNode, "fyi:Title2");
                _Nodes.Add(tNode);		// Working on the title
            }
            else
            {
                this.Text = "Value (Y) Axis Title";
                XmlNode caNode = _Draw.GetCreateNamedChildNode(cNode, "ValueAxis");
                XmlNode aNode = _Draw.GetCreateNamedChildNode(caNode, "Axis");
                XmlNode tNode = _Draw.GetCreateNamedChildNode(aNode, "Title");
                _Nodes.Add(tNode);		// Working on the title
            }

            EnsureStyle();	// Make sure we have Style nodes

            // Style Text
            StyleTextCtl stc = new StyleTextCtl(_Draw, this._Nodes);
            AddTab("Text", stc);

            // Border tab
            StyleBorderCtl bc = new StyleBorderCtl(_Draw, null, this._Nodes);
            AddTab("Border", bc);

            // Style tab
            StyleCtl sc = new StyleCtl(_Draw, this._Nodes);
            AddTab("Style", sc);
        }
Esempio n. 33
0
        private void BuildChartAxisTabs(PropertyTypeEnum type)
        {
            string propName;
            if (type == PropertyTypeEnum.CategoryAxis)
            {
                this.Text = "Chart Category (X) Axis";
                propName = "CategoryAxis";
            }
            else
            {
                this.Text = "Chart Value (Y) Axis";
                propName = "ValueAxis";
            }

            XmlNode cNode = _Nodes[0];
            XmlNode aNode = _Draw.GetCreateNamedChildNode(cNode, propName);
            XmlNode axNode = _Draw.GetCreateNamedChildNode(aNode, "Axis");

            // Now we replace the node array with a new one containing only the legend
            _Nodes = new List<XmlNode>();
            _Nodes.Add(axNode);

            EnsureStyle();	// Make sure we have Style nodes

            // Chart Axis
            ChartAxisCtl cac = new ChartAxisCtl(_Draw, this._Nodes);
            AddTab("Axis", cac);

            // Style Text
            StyleTextCtl stc = new StyleTextCtl(_Draw, this._Nodes);
            AddTab("Text", stc);

            // Border tab
            StyleBorderCtl bc = new StyleBorderCtl(_Draw, null, this._Nodes);
            AddTab("Border", bc);

            // Style tab
            StyleCtl sc = new StyleCtl(_Draw, this._Nodes);
            AddTab("Style", sc);
        }
Esempio n. 34
0
        public FieldProperty(string name, PropertyTypeEnum propertyType)
            : base(_INDEX_DEFAULT, _STORE_DEFAULT)
        {
            if (string.IsNullOrWhiteSpace(name))
                throw new ArgumentNullException("name", "All document properties require a name.");
            if (propertyType == null)
                throw new ArgumentNullException("propertyType", "All document properties require a property type.");

            Name = name;
            PropertyType = propertyType;
            IndexName = name;
            Boost = _BOOST_DEFAULT;
            IncludeInAll = _INCLUDE_IN_ALL_DEFAULT;
            DocValuesFormat = _DOC_VALUES_FORMAT_DEFAULT;
            Similarity = _SIMILARITY_DEFAULT;
            PostingsFormat = _POSTINGS_FORMAT_DEFAULT;
        }
Esempio n. 35
0
		private void DoPropertyDialog(PropertyTypeEnum type)
		{
			this.StartUndoGroup("Dialog");
			PropertyDialog pd = new PropertyDialog(_DrawPanel, _DrawPanel.SelectedList, type);
            try
            {
                DialogResult dr = pd.ShowDialog(this);
                this.EndUndoGroup(pd.Changed || dr == DialogResult.OK);
                if (pd.Changed || dr == DialogResult.OK)
                {
                    ReportChanged(this, new EventArgs());
                    _DrawPanel.Invalidate();
                }
            }
            finally
            {
                pd.Dispose();
            }
			SetFocus();
		}
Esempio n. 36
0
 public bool ContainsType(PropertyTypeEnum type)
 => ContainsType((int)type);
Esempio n. 37
0
 public RuleResult IsValid(PropertyTypeEnum propType)
 {
     return(RuleResult.Valid);
 }
        private static string MaterialPropertyName(string property, Material mat, PropertyTypeEnum type, bool allowNone, string defaultProperty, string labelName)
        {
            Color tColor = GUI.color;
            // Create a list of available color and value properties
            List <string> props = new List <string>();

            int selectedPropIndex = 0;

            if (allowNone)
            {
                props.Add("(None)");
            }

            if (mat != null)
            {
                int    propertyCount = ShaderUtil.GetPropertyCount(mat.shader);
                string propName      = string.Empty;
                for (int i = 0; i < propertyCount; i++)
                {
                    if (ShaderUtil.GetPropertyType(mat.shader, i).ToString() == type.ToString())
                    {
                        propName = ShaderUtil.GetPropertyName(mat.shader, i);
                        if (propName == property)
                        {
                            // We've found our current property
                            selectedPropIndex = props.Count;
                        }
                        props.Add(propName);
                    }
                }

                if (string.IsNullOrEmpty(labelName))
                {
                    labelName = type.ToString();
                }
                int newPropIndex = EditorGUILayout.Popup(labelName, selectedPropIndex, props.ToArray());
                if (allowNone)
                {
                    property = (newPropIndex > 0 ? props[newPropIndex] : string.Empty);
                }
                else
                {
                    if (props.Count > 0)
                    {
                        property = props[newPropIndex];
                    }
                    else
                    {
                        property = defaultProperty;
                    }
                }
                return(property);
            }
            else
            {
                GUI.color = Color.Lerp(tColor, Color.gray, 0.5f);
                // Draw an empty property
                EditorGUILayout.Popup(labelName, selectedPropIndex, props.ToArray());
                GUI.color = tColor;
                return(string.Empty);
            }
        }
 public EnvDTE.CodeProperty EncapsulateFieldNoUI(EnvDTE.CodeVariable variable, string propertyName, EnvDTE.vsCMAccess accessibility, ReferenceSelectionEnum refSelection, PropertyTypeEnum propertyType, bool fPreview, bool fSearchComments)
 {
     throw new NotImplementedException();
 }
 public EnvDTE.CodeProperty EncapsulateFieldNoUI(EnvDTE.CodeVariable variable, string propertyName, EnvDTE.vsCMAccess accessibility, ReferenceSelectionEnum refSelection, PropertyTypeEnum propertyType, bool fPreview, bool fSearchComments)
 {
     throw new NotImplementedException();
 }
Esempio n. 41
0
 public Type GetFilterForType(PropertyTypeEnum type)
 => GetFilterForType((int)type);
Esempio n. 42
0
        private void BuildChartAxisTabs(PropertyTypeEnum type)
        {
            string propName;
            if (type == PropertyTypeEnum.CategoryAxis)
            {
                Text = Strings.PropertyDialog_BuildChartAxisTabs_ChartCategoryAxis;
                propName = "CategoryAxis";
            }
            else
            {
                Text = Strings.PropertyDialog_BuildChartAxisTabs_ChartValueAxis;
                propName = "ValueAxis";
            }

            XmlNode cNode = _Nodes[0];
            XmlNode aNode = _Draw.GetCreateNamedChildNode(cNode, propName);
            XmlNode axNode = _Draw.GetCreateNamedChildNode(aNode, "Axis");

            // Now we replace the node array with a new one containing only the legend
            _Nodes = new List<XmlNode>();
            _Nodes.Add(axNode);

            EnsureStyle();	// Make sure we have Style nodes

            // Chart Axis
            var cac = new ChartAxisCtl(_Draw, _Nodes);
            AddTab(Strings.PropertyDialog_BuildChartAxisTabs_Axis, cac);

            // Style Text
            var stc = new StyleTextCtl(_Draw, _Nodes);
            AddTab(Strings.PropertyDialog_BuildReportItemTabs_Text, stc);

            // Border tab
            var bc = new StyleBorderCtl(_Draw, null, _Nodes);
			AddTab(Strings.PropertyDialog_BuildReportItemTabs_Border, bc);

            // Style tab
            var sc = new StyleCtl(_Draw, _Nodes);
			AddTab(Strings.PropertyDialog_BuildReportItemTabs_Style, sc);
        }
Esempio n. 43
0
        private void BuildTitle(PropertyTypeEnum type)
        {
            XmlNode cNode = _Nodes[0];
            _Nodes = new List<XmlNode>();		// replace with a new one
            if (type == PropertyTypeEnum.ChartTitle)
            {
                Text = Strings.PropertyDialog_BuildTitle_ChartTitle;

                XmlNode lNode = _Draw.GetCreateNamedChildNode(cNode, "Title");
                _Nodes.Add(lNode);		// Working on the title		
            }
            else if (type == PropertyTypeEnum.CategoryAxisTitle)
            {
                Text = Strings.PropertyDialog_BuildTitle_CategoryAxisTitle;
                XmlNode caNode = _Draw.GetCreateNamedChildNode(cNode, "CategoryAxis");
                XmlNode aNode = _Draw.GetCreateNamedChildNode(caNode, "Axis");
                XmlNode tNode = _Draw.GetCreateNamedChildNode(aNode, "Title");
                _Nodes.Add(tNode);		// Working on the title		
            }
            // 20022008 AJM GJL
            else if (type == PropertyTypeEnum.ValueAxis2Title)
            {
                Text = Strings.PropertyDialog_BuildTitle_ValueAxisRightTitle;
                XmlNode caNode = _Draw.GetCreateNamedChildNode(cNode, "ValueAxis");
                XmlNode aNode = _Draw.GetCreateNamedChildNode(caNode, "Axis");
                XmlNode tNode = _Draw.GetCreateNamedChildNode(aNode, "fyi:Title2");
                _Nodes.Add(tNode);		// Working on the title		   
            }
            else
            {
                Text = Strings.PropertyDialog_BuildTitle_ValueAxisTitle;
                XmlNode caNode = _Draw.GetCreateNamedChildNode(cNode, "ValueAxis");
                XmlNode aNode = _Draw.GetCreateNamedChildNode(caNode, "Axis");
                XmlNode tNode = _Draw.GetCreateNamedChildNode(aNode, "Title");
                _Nodes.Add(tNode);		// Working on the title		
            }

            EnsureStyle();	// Make sure we have Style nodes

            // Style Text
            var stc = new StyleTextCtl(_Draw, _Nodes);
            AddTab(Strings.PropertyDialog_BuildReportItemTabs_Text, stc);

            // Border tab
            var bc = new StyleBorderCtl(_Draw, null, _Nodes);
			AddTab(Strings.PropertyDialog_BuildReportItemTabs_Border, bc);

            // Style tab
            var sc = new StyleCtl(_Draw, _Nodes);
            AddTab(Strings.PropertyDialog_BuildReportItemTabs_Style, sc);
        }