public BizBoxInfoControl(CoreAttributes attributes) { InitializeComponent(); CoreNameLabel.Text = attributes.CoreName; if (!string.IsNullOrEmpty(attributes.Author)) { CoreAuthorLabel.Text = "authors: " + attributes.Author; } else { CoreAuthorLabel.Visible = false; } CorePortedLabel.Text = attributes.Ported ? " (Ported)" : string.Empty; if (!attributes.Ported) { CoreUrlLink.Visible = false; } else { CoreUrlLink.Visible = true; CoreUrlLink.Text = attributes.PortedVersion; url = attributes.PortedUrl; } }
public object Clone() { Profile newProfile = MemberwiseClone() as Profile; // Since core attributes are cloned on read, we can get away with a shallow copy newProfile.CoreAttributes = CoreAttributes != null?CoreAttributes.ToDictionary(x => x.Key, x => (CoreProfileAttribute)x.Value.Clone()) : null; newProfile.ApplicationContainer = ApplicationContainer != null ? (AttributesContainer)ApplicationContainer.Clone() : null; return(newProfile); }
public CoreProfileAttribute GetCoreAttribute(string attributeName) { CoreProfileAttribute attribute; CoreAttributes.TryGetValue(attributeName, out attribute); if (attribute == null) { return(null); } return((CoreProfileAttribute)attribute.Clone()); }
private void ProcessConstructor(Type type, string system, CoreAttributes coreattr, ConstructorInfo cons) { Core core = new Core(coreattr.CoreName, type, cons); List <Core> ss; if (!systems.TryGetValue(system, out ss)) { ss = new List <Core>(); systems.Add(system, ss); } ss.Add(core); }
private T GetAttributeFromCoreContainer <T>(string attributeName, T defaultValue) { CoreProfileAttribute attribute; CoreAttributes.TryGetValue(attributeName, out attribute); if (attribute != null && attribute.Value != null && attribute.Value.GetType() == typeof(T)) { return((T)attribute.Value); } return(defaultValue); }
private void SetAttributeInCoreContainer(string attributeName, object value) { CoreProfileAttribute attribute; if (CoreAttributes.TryGetValue(attributeName, out attribute)) { attribute.Value = value; } else { CoreAttributes.Add(attributeName, new CoreProfileAttribute() { Descriptor = new AttributeDescriptor(CoreContainerName, attributeName), Value = value, }); } }
public Core( Cpu cpu, int coreId, string coreName, CoreAttributes attributes ) { Debug.Assert( cpu != null ); Debug.Assert( coreId >= 0 ); Debug.Assert( coreName != null ); Cpu = cpu; _coreId = coreId; _coreName = coreName; Cp0 = new Coprocessor0( _coreId ); Cp1 = new Coprocessor1(); bool hasCp2 = ( attributes & CoreAttributes.HasCp2 ) == CoreAttributes.HasCp2; if( hasCp2 ) Cp2 = new Coprocessor2(); Registers = new int[ 32 ]; this.Clear(); }
public Core(Cpu cpu, int coreId, string coreName, CoreAttributes attributes) { Debug.Assert(cpu != null); Debug.Assert(coreId >= 0); Debug.Assert(coreName != null); Cpu = cpu; _coreId = coreId; _coreName = coreName; Cp0 = new Coprocessor0(_coreId); Cp1 = new Coprocessor1(); bool hasCp2 = (attributes & CoreAttributes.HasCp2) == CoreAttributes.HasCp2; if (hasCp2) { Cp2 = new Coprocessor2(); } Registers = new int[32]; this.Clear(); }