예제 #1
0
 private static void addInstance(ValueListManager instance)
 {
     if (instances.ContainsKey(instance.key))
     {
         instances.Remove(instance.key);
     }
     instances.Add(instance.key, instance);
 }
예제 #2
0
    private List <ValueList> valueLists;                                // Valid value lists, already filtered and ordered

    // TODO: add tester interface. You can enter an ID, and it shows the selected value, and where it's coming from. Also add a simulator?
    // TODO: add a "comparer", so two language xmls can be compared and the missing ids can be listed.
    // TODO: create a better inspector? http://answers.unity3d.com/questions/26207/how-can-i-recreate-the-array-inspector-element-for.html

    // ================================================================================================================
    // MAIN EVENT INTERFACE -------------------------------------------------------------------------------------------

    void Awake()
    {
        // Load all value lists, creating a pre-filtered list
        valueLists = new List <ValueList>();

        for (var i = 0; i < valueListsWithQualifiers.Length; i++)
        {
            // Filter
            if (doQualifiersApply(valueListsWithQualifiers[i]))
            {
                // Is valid, load
                var valueList = new ValueList("values_" + key + "_" + i);
                valueList.SetFromJSON(File.ReadAllText(valueListsWithQualifiers[i].fileName));
                valueLists.Add(valueList);
            }
        }

        // Add to the list of instances that can be retrieved later
        ValueListManager.addInstance(this);

        Debug.Log("Value lists read; current language is " + ValueListManager.GetInstance().GetString("generic.language"));
    }
예제 #3
0
        public static HtmlString CtrlCheckBoxList(this HtmlHelper html, string idList, string labelName, string columnDataName = "", string viewname = "")
        {
            ValueListManager Select = new ValueListManager();

            var buscarSelect = new ValueListSelect
            {
                IdList = idList
            };

            var options = Select.GetValuesList(buscarSelect);

            var checkList = new CtrlCheckBoxList
            {
                Id             = idList,
                Label          = labelName,
                List           = options,
                ViewName       = viewname,
                ColumnDataName = columnDataName
            };

            return(new HtmlString(checkList.GetHtml()));
        }