Example #1
0
        public static T LoadOptions <T>(OptionsType optionsType) where T : struct
        {
            string json = string.Empty;

            switch (optionsType)
            {
            case OptionsType.Controll:
            {
                json = File.ReadAllText(Application.streamingAssetsPath + "/ControllOptions.json");
            }
            break;

            case OptionsType.Graphic:
            {
                json = File.ReadAllText(Application.streamingAssetsPath + "/GraphicOptions.json");
            }
            break;

            case OptionsType.Sounds:
            {
                json = File.ReadAllText(Application.streamingAssetsPath + "/SoundsOptions.json");
            }
            break;
            }

            var result = JsonUtility.FromJson <T>(json);


            return((T)result);
        }
Example #2
0
        public static void InitialiseOptions(OptionsType type)
        {
            switch (type)
            {
            case OptionsType.TextFile:
                Settings = new SettingsTextFile(optionsFilePath);
                break;

            default:
                break;
            }
        }
Example #3
0
        public ProtobufOption(OptionsType type)
        {
            Type = type;
            var props = GetType().GetProperties();

            foreach (var p in props)
            {
                var field = p.GetCustomAttribute <FieldAttribute>();
                if (field != null)
                {
                    properties.Add(field.Name, p);
                }
            }
        }
 public TemplateOptions(
     Guid id,
     string key,
     string fullKey,
     bool optional      = true,
     OptionsType type   = OptionsType.Empty,
     string description = "")
     : base(id)
 {
     Key         = key;
     FullKey     = fullKey;
     Optional    = optional;
     Type        = type;
     Description = description;
 }
 protected BaseSheet(BaseModel model, OptionsType options = OptionsType.Full)
 {
     InitializeComponent();
     ConnectionInfo.Initialize(model);
     Options.Initialize(model);
     if (options == OptionsType.Printer) PrintScreenOnly.Initialize(model);
     Options.Hide();
     PrintScreenOnly.Hide();
     _controlOption = options;
     Height = 600;
     Width = 800;
     ToggleControls();
     model.MainMenuRequest = _mainMenuBtn.GetClick().Select(__ => model);
     logo.GetClick().Subscribe(_ => new AboutDialog().ShowDialog());
 }
        public SecurityOptions(OptionsType type) : base(type)
        {

        }
 // Use this for initialization
 void Start()
 {
     gameObject.SetActive (false);
     optype = GameObject.Find ("Optiontypes");
     options = optype.GetComponent<OptionsType> ();
 }
Example #8
0
XmlNode GetPropertiesNode (OptionsType Type)
	{
	if (m_OptionsRootPath == null)
		return null;
	String OptionsPath = String.Empty;

	switch (Type)
		{
		case DataHandling.OptionsType.Activ:
			OptionsPath = OPTION_ACTIV;
			break;
		case DataHandling.OptionsType.BackgroundBeitrag:
			OptionsPath = OPTION_BACKGROUND_BEITRAG;
			break;
		case DataHandling.OptionsType.ForegroundBeitrag:
			OptionsPath = OPTION_FOREGROUND_BEITRAG;
			break;
		case DataHandling.OptionsType.ShowInInternet:
			OptionsPath = OPTION_SHOW_IN_INTERNET;
			break;
		case DataHandling.OptionsType.ShortAsPreText:
			OptionsPath = OPTION_SHORT_AS_PRE_TEXT;
			break;
		case DataHandling.OptionsType.ShortAsPostText:
			OptionsPath = OPTION_SHORT_AS_POST_TEXT;
			break;
		case DataHandling.OptionsType.LongAsPreText:
			OptionsPath = OPTION_LONG_AS_PRE_TEXT;
			break;
		case DataHandling.OptionsType.LongAsPostText:
			OptionsPath = OPTION_LONG_AS_POST_TEXT;
			break;
		case DataHandling.OptionsType.InBlockAnouncement:
			OptionsPath = OPTION_IN_BLOCK_ANOUNCEMENT;
			break;
		case DataHandling.OptionsType.InSendungAnouncement:
			OptionsPath = OPTION_IN_SENDUNG_ANOUNCEMENT;
			break;
		case DataHandling.OptionsType.AnouncementLayout:
			OptionsPath = OPTION_ANOUNCEMENT_LAYOUT;
			break;
		case DataHandling.OptionsType.AudioBackground:
			OptionsPath = OPTION_AUDIO_BACKGROUND;
			break;
		case DataHandling.OptionsType.VideoScreenSize:
			OptionsPath = OPTION_VIDEO_SCREEN_LAYOUT_SIZE;
			break;
		case DataHandling.OptionsType.VideoScreenHorizontal:
			OptionsPath = OPTION_VIDEO_SCREEN_LAYOUT_HORIZONTAL_POSITION;
			break;
		case DataHandling.OptionsType.VideoScreenVertical:
			OptionsPath = OPTION_VIDEO_SCREEN_LAYOUT_VERTICAL_POSITION;
			break;
		}

	XmlNode OptionNode = m_OptionsRootPath.SelectSingleNode ("child::" + PGM_BEITRAG_OPTIONS + "/" + OptionsPath);
	return OptionNode;
	}
Example #9
0
String [] GetPossibleOptionsContent (OptionsType Type)
	{
	if (m_AllPossibleProperties == null)
		{
		return null;
		}
	String OptionsName = PropertiesDefinitionen [(int) Type*4];

	return m_AllPossibleProperties [OptionsName].m_AllowedValues;
	}
Example #10
0
public void SetOptionsContent (OptionsType Type, String NewValue)
	{
	if (m_AllPossibleProperties != null)
		{
		String OptionsName = PropertiesDefinitionen [(int)Type * 4];
		m_AllPossibleProperties [OptionsName].m_SelectedValue = NewValue;
		}
	XmlNode OptionNode = GetPropertiesNode (Type);
	if (OptionNode == null)
		return;
	OptionNode.InnerText = NewValue;
	}
Example #11
0
public String GetOptionsContent (OptionsType OType)
	{
	if (m_AllPossibleProperties != null)
		{
		String OptionsName = PropertiesDefinitionen [(int) OType*4];
		if (m_AllPossibleProperties.ContainsKey (OptionsName) == false)
			return String.Empty;
		return m_AllPossibleProperties [OptionsName].m_SelectedValue;
		}

	XmlNode OptionNode = GetPropertiesNode (OType);
	if (OptionNode == null)
		return "";
	return OptionNode.InnerText;
	}
Example #12
0
public bool IsOptionSet (OptionsType Type)
	{
	String OptionContent = GetOptionsContent (Type);
	if (OptionContent == "Yes")
		return true;
	return false;
	}
Example #13
0
        public static OptionsField NewOptionsField(OptionsType type, string name = null)
        {
            OptionsField optionsField;

            switch (type)
            {
                case OptionsType.Combobox:
                    optionsField = new OptionsField
                        {
                            Id = Guid.NewGuid(),
                            Name = "Barrel Size",
                            Tooltip = "The type of barrel",
                            AllowMultipleSelection = false,
                            OptionsType = OptionsType.Combobox,
                            Value = "1,2",
                            CreatedDate = DateTime.UtcNow,
                            LastModified = DateTime.UtcNow
                        };
                    optionsField.Options.Add(new Option { Name = "Small", IsChecked = false });
                    optionsField.Options.Add(new Option { Name = "Medium", IsChecked = false });
                    optionsField.Options.Add(new Option { Name = "Large", IsChecked = true });
                    break;
                case OptionsType.Checklist:
                    optionsField = new OptionsField
                        {
                            Id = Guid.NewGuid(),
                            Name = "Barrel TODO",
                            Tooltip = "Things to do with the barrels",
                            AllowMultipleSelection = true,
                            OptionsType = OptionsType.Checklist,
                            Value = "0,2",
                            CreatedDate = DateTime.UtcNow,
                            LastModified = DateTime.UtcNow
                        };
                    optionsField.Options.Add(new Option { Name = "Empty Barrels", IsChecked = true });
                    optionsField.Options.Add(new Option { Name = "Assess Oil Quantity", IsChecked = true });
                    optionsField.Options.Add(new Option { Name = "Lock The Barrel", IsChecked = false });
                    break;
                default:
                    optionsField = new OptionsField
                        {
                            Id = Guid.NewGuid(),
                            Name = "Paid",
                            Tooltip = "Has the client paid?",
                            AllowMultipleSelection = false,
                            OptionsType = OptionsType.Checkbox,
                            CreatedDate = DateTime.UtcNow,
                            LastModified = DateTime.UtcNow
                        };
                    optionsField.Options.Add(new Option { Name = "Collected paperwork", IsChecked = true });
                    break;
            }

            if (name != null)
                optionsField.Name = name;

            return optionsField;
        }