Exemplo n.º 1
0
        /// <inheritdoc/>
        public override void UpdateState()
        {
            base.UpdateState();

            Hierarchies.UpdateState();
            Types.UpdateState();
            RealIndexes.UpdateState();
            Associations.UpdateState();
        }
        public void HierarchyTests(ChannelSources src, Hierarchies val)
        {
            ParametersField parameters = new ParametersField(src);
            string          text       = "Y" + (short)val;

            parameters.EvaluateParameters(text);
            Assert.AreEqual(val, parameters.Hierarchy);
            Assert.AreEqual(val.Equals(Hierarchies.HIERARCHY_AUTO) ? string.Empty : text, parameters.ToString());
        }
Exemplo n.º 3
0
        internal Axis(Axes axes)
        {
            _axes             = axes;
            _hierarchies      = new Hierarchies();
            _hierarchies.Axis = this;

            //subscribe
            _hierarchies.BeforeChangeItem += new ObjectEventHandler(OnBeforeChangeHierarchies);
            _hierarchies.BeforeAdd        += new ObjectEventHandler(OnBeforeChangeHierarchies);
            _hierarchies.BeforeRemove     += new ObjectEventHandler(OnBeforeChangeHierarchies);
        }
Exemplo n.º 4
0
Arquivo: Item.cs Projeto: fhelje/HPE
 public Item()
 {
     Product        = new Product();
     Detail         = new Detail();
     Link           = new Link();
     Marketing      = new Marketing();
     Specifications = new Specifications();
     Supplier       = new Supplier();
     Options        = new Options();
     Hierarchies    = new Hierarchies();
 }
Exemplo n.º 5
0
        public void ReadHierarchies()
        {
            foreach (AddressClass ac in HierarchyAddresses)
            {
                uint adr = ac.Address;
                if (ROM.IsAddressSupported(adr) == false)
                {
                    continue;
                }

                uint blladr = Endian.SwapUInt32(BitConverter.ToUInt32(Nanami.RDRAM, (int)Nanami.Segments[adr >> 24].RAMAddress + (int)(adr & 0xFFFFFF)));
                if (ROM.IsAddressSupported(blladr) == false)
                {
                    return;
                }

                byte        lcount = Nanami.RDRAM[Nanami.Segments[adr >> 24].RAMAddress + (adr & 0xFFFFFF) + 4];
                LimbClass[] limbs  = new LimbClass[lcount];

                byte dlcount = lcount;
                if (ROM.IsAddressSupported((adr & 0xFFFFFF) + 8) == true)
                {
                    dlcount = Nanami.RDRAM[Nanami.Segments[adr >> 24].RAMAddress + (adr & 0xFFFFFF) + 8];
                    if (dlcount == 0)
                    {
                        dlcount = lcount;
                    }
                }
                HierarchyMatrices.Add(new byte[0x40 * dlcount]);

                for (int i = 0; i < limbs.Length; i++)
                {
                    uint cbadr = Endian.SwapUInt32(BitConverter.ToUInt32(Nanami.RDRAM, (int)(Nanami.Segments[blladr >> 24].RAMAddress + (blladr & 0xFFFFFF) + (i << 2))));
                    if (ROM.IsAddressSupported(cbadr) == false)
                    {
                        continue;
                    }

                    byte cbseg = (byte)(cbadr >> 24);
                    limbs[i]             = new LimbClass();
                    limbs[i].Translation = new Vector3d(
                        (double)Endian.SwapInt16(BitConverter.ToInt16(Nanami.RDRAM, (int)(Nanami.Segments[cbseg].RAMAddress + (cbadr & 0xFFFFFF)))),
                        (double)Endian.SwapInt16(BitConverter.ToInt16(Nanami.RDRAM, (int)(Nanami.Segments[cbseg].RAMAddress + (cbadr & 0xFFFFFF) + 2))),
                        (double)Endian.SwapInt16(BitConverter.ToInt16(Nanami.RDRAM, (int)(Nanami.Segments[cbseg].RAMAddress + (cbadr & 0xFFFFFF) + 4))));
                    limbs[i].Child       = (sbyte)Nanami.RDRAM[Nanami.Segments[cbseg].RAMAddress + (cbadr & 0xFFFFFF) + 6];
                    limbs[i].Sibling     = (sbyte)Nanami.RDRAM[Nanami.Segments[cbseg].RAMAddress + (cbadr & 0xFFFFFF) + 7];
                    limbs[i].DisplayList = Endian.SwapUInt32(BitConverter.ToUInt32(Nanami.RDRAM, (int)(Nanami.Segments[cbseg].RAMAddress + (cbadr & 0xFFFFFF) + 8)));
                }

                Hierarchies.Add(limbs);
            }
        }
Exemplo n.º 6
0
 /// <inheritdoc/>
 public override void Lock(bool recursive)
 {
     base.Lock(recursive);
     if (!recursive)
     {
         return;
     }
     Hierarchies.Lock(true);
     Types.Lock(true);
     RealIndexes.Lock(true);
     Associations.Lock(true);
     Databases.Lock(true);
     FullTextIndexes.Lock(true);
 }
        public override string ToString()
        {
            var result = string.Empty;

            if (Hierarchies.Count > 0)
            {
                result += "Hierarchies: ";

                result += string.Join(", ",
                                      Hierarchies.Where(h => h.FieldId.HasValue)
                                      .Select(h => h.FieldId.Value.ToString())
                                      .ToArray());
            }

            if (KeyFilters.Count > 0)
            {
                if (!string.IsNullOrEmpty(result))
                {
                    result += " ";
                }

                result += "KeyFilters: ";

                result += string.Join(", ",
                                      KeyFilters.Where(h => h.FieldId.HasValue)
                                      .Select(h => h.FieldId.Value.ToString())
                                      .ToArray());
            }

            if (!string.IsNullOrEmpty(result))
            {
                return(result);
            }

            return(new ToStringResult <MetadataNavigationSettingsDefinition>(this)
                   .ToString());
        }
Exemplo n.º 8
0
        public override string ToString()
        {
            var result = string.Empty;

            if (Hierarchies.Count > 0)
            {
                result += "Hierarchies: ";

                result += string.Join(", ",
                                      Hierarchies.Where(h => h.FieldId.HasValue)
                                      .Select(h => h.FieldId.Value.ToString())
                                      .ToArray());
            }

            if (KeyFilters.Count > 0)
            {
                if (!string.IsNullOrEmpty(result))
                {
                    result += " ";
                }

                result += "KeyFilters: ";

                result += string.Join(", ",
                                      KeyFilters.Where(h => h.FieldId.HasValue)
                                      .Select(h => h.FieldId.Value.ToString())
                                      .ToArray());
            }

            if (!string.IsNullOrEmpty(result))
            {
                return(result);
            }

            return(base.ToString());
        }
 /// <summary>
 /// Finds the hierarchy.
 /// </summary>
 /// <param name="item">The type to search hierarchy for.</param>
 /// <returns><see cref="HierarchyDef"/> instance or <see langword="null"/> if hierarchy is not found.</returns>
 public HierarchyDef FindHierarchy(TypeDef item)
 {
     ArgumentValidator.EnsureArgumentNotNull(item, "item");
     return(Hierarchies
            .FirstOrDefault(hierarchy => hierarchy.Root.UnderlyingType.IsAssignableFrom(item.UnderlyingType)));
 }