Example #1
0
        public IClassProcessor ProcessorForClass(string aclass)
        {
            if (!ignoredClasses.Contains(aclass))
            {
                IClassProcessor processor = (Classes.Where(m => m.Handles == aclass)).FirstOrDefault();
                if (processor == null)
                {
                    processor = (Classes.Where(m => m.Name == aclass)).FirstOrDefault();
                    if (processor == null)
                    {
                        processor      = new DumbClassProcessor();
                        processor.Name = aclass;
                    }
                }

                return(processor);
            }
            return(new InvalidClassProcessor());
        }
Example #2
0
        private void ParseChildren(XElement element, string currentView)
        {
            XElement Children           = element.ElementsAfterSelf().FirstOrDefault();
            IEnumerable <XElement> keys = element.Elements("key");

            if (element.GetElementForKey("children").Value != "")
            {
                XElement children =
                    keys.Where(o => o.Value == "children").FirstOrDefault().ElementsAfterSelf().FirstOrDefault();
                foreach (XElement child in children.Elements())
                {
                    string subInstanceName = "";
                    string subView         = child.GetElementForKey("object-id").Value;
                    Dictionary <string, string> subViewObject = Objects[subView];
                    subInstanceName = InstanceNameForObject(subViewObject);


                    Dictionary <string, string> currentViewObject = Objects[currentView];

                    IClassProcessor classProcessor = ProcessorForClass(currentViewObject["__Helper__Class__"]);


                    string instanceName =
                        InstanceNameForObject(currentViewObject);


                    ParseChildren(child, subView);



                    Output += classProcessor.AddChild(String.Format("{0}{1}", instanceName,
                                                                    currentView), String.Format("{0}{1}", subInstanceName,
                                                                                                subView), subViewObject["__Helper__Class__"]) + ";\n";
                }
            }
        }
Example #3
0
        public Dictionary <string, string> ProcessDict(XElement dict2, string tabSpace)
        {
            IClassProcessor processor = ProcessorForClass(dict2.GetElementForKey("class").Value);

            return(processor.ProcessObject(dict2));
        }