Пример #1
0
        public static SymmetryBuilder CreateFromSymmetryName(string symmetryName, IEnumerable <string> unitIds)
        {
            SymmetryBuilder instance = CreateFromSymmetryName(symmetryName);

            instance.EnabledUnits = unitIds.ToArray();
            return(instance);
        }
Пример #2
0
        public virtual void DeepCopyPopulateFields(IDeepCloneObjectGraph graph, object clone)
        {
            SymmetryBuilder builder = (SymmetryBuilder)clone;

            builder._unitIdToSubunitNames             = _unitIdToSubunitNames;
            builder._unitIdToSubunitCoordinateSystems = _unitIdToSubunitCoordinateSystems;
            builder.EnabledUnits = EnabledUnits == null? null : (string[])EnabledUnits.Clone();
        }
Пример #3
0
        public static SymmetryBuilder Clone(SymmetryBuilder template)
        {
            Type symmetryType             = template.GetType();
            SymmetryDescriptor descriptor = _knownSymmetriesByType[symmetryType];
            SymmetryBuilder    builder    = CreateFromSymmetryName(descriptor.Architecture);

            builder.EnabledUnits = template.EnabledUnits == null? null : (string[])template.EnabledUnits.Clone();
            return(builder);
        }
Пример #4
0
        public static SymmetryBuilder CreateFromSymmetryName(string symmetryName)
        {
            if (!_knownSymmetriesByName.ContainsKey(symmetryName))
            {
                throw new ArgumentException(String.Format("Unknown symmetry requested: {0}", symmetryName));
            }

            SymmetryBuilder instance = (SymmetryBuilder)Activator.CreateInstance(_knownSymmetriesByName[symmetryName].Type);

            return(instance);
        }
Пример #5
0
        public static SymmetryBuilder CreateFromSymmetryName(string symmetryName, string unitId)
        {
            SymmetryBuilder instance = CreateFromSymmetryName(symmetryName, new string[] { unitId });

            return(instance);
        }