public override IRenderedInstance PreRender(UimlDocument uimlDoc) { try { m_topWindow = new WxRenderedInstance("Uiml container"); Structure uiStruct = (Structure)uimlDoc.UInterface.UStructure[0]; Style uiStyle = (Style)uimlDoc.UInterface.UStyle[0]; Behavior uiBehavior = null; try{ uiBehavior = (Behavior)uimlDoc.UInterface.UBehavior[0]; }catch(Exception e){ /* no behavior specified */ } Top = uiStruct.Top; Voc = uimlDoc.SearchPeers(NAME).GetVocabulary(); Console.WriteLine("Calling TopFrame..."); Console.WriteLine("In Render; TopFrame is {0}", m_topWindow.TopFrame); Window c = Render(uiStruct.Top, uiStyle, m_topWindow.TopFrame); //Render has filled the part-tree with the concrete object references //to the individual widgets, now attach the behavior //c.Reparent((Window)m_topWindow.TopFrame); return m_topWindow; } catch(NullReferenceException nrfe) { Console.WriteLine("The Rendering Engine says: Check the input documents, they seem to be invalid"); Console.WriteLine(nrfe); throw nrfe; } }
public override IRenderedInstance PreRender(UimlDocument uimlDoc) { try { m_topWindow = new CompactSWFRenderedInstance(); m_topWindow.Title = uimlDoc.Title; Structure uiStruct = (Structure)uimlDoc.UInterface.UStructure[0]; Style uiStyle = (Style)uimlDoc.UInterface.UStyle[0]; Behavior uiBehavior = null; try{ uiBehavior = (Behavior)uimlDoc.UInterface.UBehavior[0]; }catch(Exception e){ /* no behavior specified */ } Top = uiStruct.Top; Voc = uimlDoc.SearchPeers(NAME).GetVocabulary(); Control c = Render(uiStruct.Top, uiStyle); //Render has filled the part-tree with the concrete object references //to the individual widgets, now attach the behavior //CompactSWFEventLinker sel = new CompactSWFEventLinker(this); EventLinker sel = new EventLinker(this); sel.Link(uiStruct, uiBehavior); m_topWindow.Add(c); return m_topWindow; } catch(NullReferenceException nrfe) { Console.WriteLine("The Rendering Engine says: Check the input documents, they seem to be invalid"); throw nrfe; } catch(Exception e) { Console.WriteLine("Unexpected failure ({0}) while processing {1}:", e.GetType(), uimlDoc); Console.WriteLine(e.ToString()); Console.WriteLine("Please contact the uiml.net maintainer with the above output."); throw e; } }