예제 #1
0
        private string GetElementTypeName(PartElement element)
        {
            switch (element)
            {
            case PartSurface _:
                return(ModelLocalizations.Label_Surface);

            case PartBone _:
                return(ModelLocalizations.Label_Bone);

            case MaleStudModel _:
                return(ModelLocalizations.ModelComponentType_MaleStud);

            case FemaleStudModel _:
                return(ModelLocalizations.ModelComponentType_FemaleStud);

            case BrickTubeModel _:
                return(ModelLocalizations.ModelComponentType_BrickTube);

            case PartModel _:
                return(ModelLocalizations.ModelComponentType_Part);

            case ModelMeshReference _:
                return(ModelLocalizations.Label_Mesh);

            case PartConnection _:
                return(ModelLocalizations.Label_Connection);

            case PartCollision _:
                return(ModelLocalizations.Label_Collision);
            }

            return(element.GetType().Name);
        }
예제 #2
0
        private string GetElementTypeName2(PartElement element)
        {
            if (element is PartSurface)
            {
                return(ModelLocalizations.Label_Surface);
            }

            switch (element)
            {
            case PartSurface _:
                return(ModelLocalizations.Label_Surface);

            case PartBone _:
                return(ModelLocalizations.Label_Bone);

            case MaleStudModel _:
                return(ModelLocalizations.ModelComponentType_MaleStud);

            case FemaleStudModel _:
                return(ModelLocalizations.ModelComponentType_FemaleStud);

            case BrickTubeModel _:
                return(ModelLocalizations.ModelComponentType_BrickTube);

            case PartModel _:
                return(ModelLocalizations.ModelComponentType_Part);

            case ModelMeshReference _:
                return(ModelLocalizations.Label_Mesh);

            case PartConnection conn:
                return($"{ModelLocalizations.Label_Connection} <{conn.ConnectorType.ToString()}>");

            //return ModelLocalizations.ResourceManager.GetString($"ConnectorType_{conn.ConnectorType}");
            case PartCollision coll:
                string collType = ModelLocalizations.ResourceManager.GetString($"CollisionType_{coll.CollisionType}");
                return($"{ModelLocalizations.Label_Collision} ({collType})");
            }

            return(element.GetType().Name);
        }