/// <summary> /// Loads and analyzes an assembly without the help of any package manager or server. /// </summary> public void LoadAssemblyManual(Assembly assembly) { Type entityImplementationType = typeof(EntityImplementationAttribute); foreach (Type t in assembly.GetTypes()) { object instance = null; object[] eias = t.GetCustomAttributes(entityImplementationType, false); if (eias.Length > 0) { if (instance == null) { instance = Activator.CreateInstance(t); } IArchitectureFactory builder = instance as IArchitectureFactory; if (builder != null) { foreach (EntityImplementationAttribute attr in eias) { Entity e; if (entityTable.TryGetValue(attr.EntityId, out e)) { archTable.AddArchitectureBuilder(e, builder); } } } } } }
public void AppendArchitectures(ArchitectureTable table) { #region Arithmetics table.AddArchitectureBuilder(new Arithmetics.AdditionArchitectures()); table.AddArchitectureBuilder(new Arithmetics.SubtractionArchitectures()); table.AddArchitectureBuilder(new Arithmetics.MultiplicationArchitectures()); table.AddArchitectureBuilder(new Arithmetics.DivisionArchitectures()); table.AddArchitectureBuilder(new Arithmetics.NegateArchitectures()); table.AddArchitectureBuilder(new Arithmetics.InvertArchitectures()); table.AddArchitectureBuilder(new Arithmetics.AbsoluteArchitectures()); table.AddArchitectureBuilder(new Arithmetics.ExponentialArchitectures()); table.AddArchitectureBuilder(new Arithmetics.NaturalLogarithmArchitectures()); table.AddArchitectureBuilder(new Arithmetics.SquareArchitectures()); table.AddArchitectureBuilder(new Arithmetics.PowerArchitectures()); #endregion #region Trigonometry table.AddArchitectureBuilder(new Trigonometry.SineArchitectures()); table.AddArchitectureBuilder(new Trigonometry.CosineArchitectures()); table.AddArchitectureBuilder(new Trigonometry.TangentArchitectures()); table.AddArchitectureBuilder(new Trigonometry.CotangentArchitectures()); table.AddArchitectureBuilder(new Trigonometry.SecantArchitectures()); table.AddArchitectureBuilder(new Trigonometry.CosecantArchitectures()); table.AddArchitectureBuilder(new Trigonometry.HyperbolicSineArchitectures()); table.AddArchitectureBuilder(new Trigonometry.HyperbolicCosineArchitectures()); table.AddArchitectureBuilder(new Trigonometry.HyperbolicTangentArchitectures()); table.AddArchitectureBuilder(new Trigonometry.HyperbolicCotangentArchitectures()); table.AddArchitectureBuilder(new Trigonometry.HyperbolicSecantArchitectures()); table.AddArchitectureBuilder(new Trigonometry.HyperbolicCosecantArchitectures()); #endregion #region Logic table.AddArchitectureBuilder(new Logic.AndArchitectures()); table.AddArchitectureBuilder(new Logic.NandArchitectures()); table.AddArchitectureBuilder(new Logic.OrArchitectures()); table.AddArchitectureBuilder(new Logic.NorArchitectures()); table.AddArchitectureBuilder(new Logic.XorArchitectures()); table.AddArchitectureBuilder(new Logic.XnorArchitectures()); table.AddArchitectureBuilder(new Logic.NotArchitectures()); #endregion #region Algebra & Analysis table.AddArchitectureBuilder(new Analysis.AlgebraicDerivativeArchitecture()); table.AddArchitectureBuilder(new Algebra.AutoSimplifyArchitecture()); #endregion #region Flow table.AddArchitectureBuilder(new Flow.TransportArchitecture()); table.AddArchitectureBuilder(new Flow.SyncArchitecture()); table.AddArchitectureBuilder(new Flow.ClockArchitecture()); #endregion }