protected virtual Tuple <Form, Clifton.MycroParser.MycroParser> InitializeViewer(string formName) { Clifton.MycroParser.MycroParser mp = new Clifton.MycroParser.MycroParser(); XmlDocument doc = new XmlDocument(); doc.Load(formName); mp.Load(doc, "Form", null); Form form = (Form)mp.Process(); return(new Tuple <Form, MycroParser.MycroParser>(form, mp)); }
public static T InstantiateFromFile <T>(string filename, Action <MycroParser> AddInstances = null, object eventSink = null) { MycroParser mp = new MycroParser(); AddInstances.IfNotNull(t => t(mp)); XmlDocument doc = new XmlDocument(); doc.Load(filename); mp.Load(doc, "Form", eventSink); T obj = (T)mp.Process(); // Pass object collection to the instantiated class if it implements IMycroParserInstantiatedObject. if (obj is IMycroParserInstantiatedObject) { ((IMycroParserInstantiatedObject)obj).ObjectCollection = mp.ObjectCollection; } return(obj); }
protected virtual void InitializeUI() { mycroParser = new Clifton.MycroParser.MycroParser(); mycroParser.AddInstance("form", this); form = mycroParser.Load <Form>(displayFormFilename, this); PostFormCreate(); #if DockingForm rsys.Membrane.ApplicationController.AddAppletUI(form, LayoutId); #else form.Show(); // Wire up the location changed event after the form has initialized, // so we don't generate this event during form creation. That way, // the user's config will be preserved and used when the system // finishes initialization. form.LocationChanged += OnLocationChanged; form.SizeChanged += OnSizeChanged; form.FormClosing += OnFormClosing; #endif UpdateCaption(); }
protected virtual Tuple<Form, Clifton.MycroParser.MycroParser> InitializeViewer(string formName) { Clifton.MycroParser.MycroParser mp = new Clifton.MycroParser.MycroParser(); XmlDocument doc = new XmlDocument(); doc.Load(formName); mp.Load(doc, "Form", null); Form form = (Form)mp.Process(); return new Tuple<Form, MycroParser.MycroParser>(form, mp); }
public void Initialize(XmlDocument xdoc) { nodeList = new Dictionary<string, NodeDef>(); controllerToNodeDefMap = new Dictionary<ControllerInfo, NodeDef>(); nameToNodeDefMap = new Dictionary<string, NodeDef>(); // LabelEdit = true; ImageList = new ImageList(); Clifton.MycroParser.MycroParser mp = new Clifton.MycroParser.MycroParser(); mp.Load(xdoc, null, null); // Type t = typeof(RootNode); // string qname = t.AssemblyQualifiedName; // TODO: Fix this by getting the correct qname (minus the ".RootNode") from the above commented-out code. mp.NamespaceMap[""] = "Clifton.Windows.Forms.XmlTree, Clifton.Windows.Forms"; // object ret = mp.Process(); // MessageBox.Show(ret.GetType().AssemblyQualifiedName+"\r\n"+typeof(RootNode).AssemblyQualifiedName); rootNode=(RootNode)mp.Process(); nodeList[rootNode.Name] = rootNode; BuildFlatNodeList(rootNode); // TreeNode tn=CreateNodeAndRequiredChildren(rootNode); // Nodes.Add(tn); }
protected virtual void InitializeUI() { mycroParser = new Clifton.MycroParser.MycroParser(); mycroParser.AddInstance("form", this); form = mycroParser.Load<Form>(displayFormFilename, this); PostFormCreate(); #if DockingForm rsys.Membrane.ApplicationController.AddAppletUI(form, LayoutId); #else form.Show(); // Wire up the location changed event after the form has initialized, // so we don't generate this event during form creation. That way, // the user's config will be preserved and used when the system // finishes initialization. form.LocationChanged += OnLocationChanged; form.SizeChanged += OnSizeChanged; form.FormClosing += OnFormClosing; #endif UpdateCaption(); }