Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7075491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:11:02+00:00 2026-05-28T06:11:02+00:00

The BasicTypes.xsd from the GML schema includes the following: <simpleType name=SignType> <annotation> <documentation> gml:SignType

  • 0

The BasicTypes.xsd from the GML schema includes the following:

<simpleType name="SignType">
    <annotation>
        <documentation>
        gml:SignType is a convenience type with values "+" (plus) and "-" (minus).
        </documentation>
    </annotation>
    <restriction base="string">
        <enumeration value="-"/>
        <enumeration value="+"/>
    </restriction>
</simpleType>

The code generator (sparx enterprise architect) is generating the following:

namespace OGC.GML.BasicTypes {
    /// <summary>
    /// gml:SignType is a convenience type with values "+" (plus) and "-" (minus).
    /// </summary>
    public enum SignType : int {
        -,
        +
    }
}

Ofcourse, i can’t have – and + as enum keys. So my question is:

How would i define a Dicionary object to satisfy the schema as it is? Or is there a better way? Please give code example.

It looks like these people are using an array.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:11:02+00:00Added an answer on May 28, 2026 at 6:11 am

    Here’s a sample of how to use a dictionary. What a dictionary basically does is it maps one object to another, in this case, string to int, you can always use different types for the keys and values if you like.

            Dictionary<string, int> SignType = new Dictionary<string, int>();
            SignType.Add("-", 0);
            SignType.Add("+", 1);
    
            int plusValue = SignType["+"];
    

    EDIT: I’ve updated it again

    Now you can use a static class like so

    namespace OGC.GML.BasicTypes
    {
        public static class SignType
        {
            public static Dictionary<string, int> Values = new Dictionary<string, int>();
            static SignType()
            {
                Values.Add("-", 0);
                Values.Add("+", 1);
            }
        }
    }
    

    and you’ll have to type OGC.GML.BasicTypes.SignType.Values["+"]

    Or, you can use an instance class

        public class SignType
        {
            private static Dictionary<string, int> Values = new Dictionary<string, int>();
            public SignType()
            {
                Values.Add("-", 0);
                Values.Add("+", 1);
            }
            public int this[string s]
            {
                get { return Values[s]; }
            }
        }
    }
    

    which will allow `new OGC.GML.BasicTypes.SignType()[“+”]’

    and even if BasicTypes is a class instead of a namespace, it’s still possible to put more Enums and Sub-Classes inside of it, but that might not be the ideal solution, depending on the purpose of the namespace.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an AIDL interface that uses an object type from an android
I have a bunch of XSD's from https://github.com/XeroAPI/XeroAPI-Schemas/tree/master/v2.00 I need to do two things:
Ideally I would like to send an object of type ArrayList<ArrayList<ASimpleClass>> from a remote
Extends Say you're looking at the 6 basic types of UML diagram (from this
how can I eliminate duplicate elements from an array of ruby objects using an
I have an app that's about presenting fictional simplified cities. Please consider the following
I am working with a Hashtable struct that maps keys to values, where the
I can't make sense of the following behavior: one header with some basic types,
Consider the following simplified version of my code. I have a template class A
I have working app1.ear , containing: JPA entity, MyObjectImpl , implementing interface MyObject from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.