Example #1
0
        public static IBObject GetInstance(IDictionary <String, String> attributes)
        {
            IBObject obj;

            switch (attributes["class"])
            {
            case "NSArray":
            case "NSMutableArray":
                obj = new IBArray(attributes);
                break;

            case "NSDictionary":
            case "NSMutableDictionary":
                obj = new IBDictionary(attributes);
                break;

            case "IBClassDescriber":
                obj = new IBClassDescriber(attributes);
                break;

            case "IBPartialClassDescription":
                obj = new IBPartialClassDescription(attributes);
                break;

            case "NSSet":
            case "NSMutableSet":
                obj = new IBSet(attributes);
                break;

            default:
                obj = new IBObject(attributes);
                break;
            }
            return(obj);
        }
Example #2
0
        private void CollectOutlets(IIBReferenceResolver resolver)
        {
            IBDictionary dict = this.Find <IBDictionary>("outlets");

            if (dict == null)
            {
                return;
            }

            foreach (String key in dict.Keys)
            {
                IBString itemKey = dict[key] as IBString;
                if (itemKey == null)
                {
                    continue;
                }

                IIBItem     itemValue = dict[key];
                IBReference reference = itemValue as IBReference;
                if ((resolver != null) && (reference != null))
                {
                    itemValue = resolver.ResolveReference(reference);
                }
                this.outlets.Add(new IBOutletDescriptor(key, itemValue.ToString()));
            }
        }