예제 #1
0
파일: BaseReceptor.cs 프로젝트: babann/HOPE
        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));
        }
예제 #2
0
        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);
        }
예제 #3
0
        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();
        }
예제 #4
0
		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);
		}
예제 #5
0
파일: BaseReceptor.cs 프로젝트: babann/HOPE
 public virtual void PrepopulateConfig(Clifton.MycroParser.MycroParser mp)
 {
 }
예제 #6
0
파일: XTree.cs 프로젝트: keithshort/HOPE
		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);
		}
예제 #7
0
		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();
		}