Пример #1
0
        private void NewBaseAltNameValue()
        {
            if (this.baseAltName == null)
            {
                this.symbol = null;
                return;
            }
            objTaxonomy      t  = objTaxonomy.GetInstance();
            taxonomyQuantity tq = t.quantities.Find(x => x.quantityName == this._quantity);
            taxonomyNames    tn = tq.baseAltNames.Find(x => x.baseAltName == this._baseAltName);

            this.symbols = tn.taxonomyNamesSymbols;
        }
Пример #2
0
        private void GetUniqueQuantityNames()
        {
            UoM myUom = UoM.GetInstance();

            foreach (basenames bn in myUom._lBasenames)
            {
                foreach (string qty in bn.quantities)
                {
                    List <string> currentQtyNames = new List <string>();
                    foreach (taxonomyQuantity tq in this._quantities)
                    {
                        currentQtyNames.Add(tq.quantityName);
                    }

                    bool containsQty = currentQtyNames.Contains(qty);
                    if (!containsQty)
                    {
                        taxonomyQuantity newTQ = new taxonomyQuantity();
                        newTQ.quantityName = qty;
                        taxonomyNames newTN = new taxonomyNames();
                        newTN.baseAltName = bn.name;
                        newTN.taxonomyNamesSymbols.Add(bn.symbol);
                        foreach (string s in bn.aliases)
                        {
                            newTN.taxonomyNamesSymbols.Add(s);
                        }
                        newTQ.baseAltNames.Add(newTN);
                        foreach (alternatives alt in bn.alts)
                        {
                            taxonomyNames newAltTN = new taxonomyNames();
                            newAltTN.baseAltName = alt.altName;
                            newAltTN.taxonomyNamesSymbols.Add(alt.altSymbol);
                            foreach (string s in alt.altAliases)
                            {
                                newAltTN.taxonomyNamesSymbols.Add(s);
                            }
                            newTQ.baseAltNames.Add(newAltTN);
                        }
                        this._quantities.Add(newTQ);
                    }
                }
            }
        }