コード例 #1
0
ファイル: Membrane.cs プロジェクト: babann/HOPE
        public Membrane CreateInnerMembrane()
        {
            Membrane inner = new Membrane(SemanticTypeSystem, ApplicationController);

            Membranes.Add(inner);
            inner.ParentMembrane = this;
            NewMembrane.Fire(this, new MembraneEventArgs(inner));

            return(inner);
        }
コード例 #2
0
ファイル: Membrane.cs プロジェクト: babann/HOPE
        // TODO: Maintain a flat list to avoid this recursion.
        /// <summary>
        /// Recurse through membranes to find the membrane containing the desired receptor.
        /// </summary>
        public Membrane GetMembraneContaining(IReceptor searchFor)
        {
            Membrane ret = null;

            if (Receptors.Contains((Receptor)searchFor))
            {
                ret = this;
            }
            else
            {
                foreach (Membrane childMembrane in Membranes)
                {
                    ret = childMembrane.GetMembraneContaining(searchFor);

                    if (ret != null)
                    {
                        break;
                    }
                }
            }

            return(ret);
        }
コード例 #3
0
ファイル: Membrane.cs プロジェクト: keithshort/HOPE
		public Membrane CreateInnerMembrane()
		{
			Membrane inner = new Membrane(SemanticTypeSystem, ApplicationController);
			Membranes.Add(inner);
			inner.ParentMembrane = this;
			NewMembrane.Fire(this, new MembraneEventArgs(inner));

			return inner;
		}
コード例 #4
0
ファイル: Program.cs プロジェクト: keithshort/HOPE
        static void Main()
        {
            Application.AddMessageFilter(new MouseWheelMessageFilter());

            try
            {
                SemanticTypeSystem = new STS();
                Skin = new Membrane(SemanticTypeSystem, null);
                Skin.Name = "Skin";
                // Receptors = new ReceptorsContainer();
                // Receptors.SemanticTypeSystem = SemanticTypeSystem;

                DropReceptor = new DropReceptor(Skin.ReceptorSystem);
                // Program.Skin.RegisterReceptor("DropReceptor", dr);

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                AppState = new StatePersistence();
                AppState.ReadState("appState.xml");																	// Load the last application state.
                MainForm = MycroParser.InstantiateFromFile<Form>("mainform.xml", null);
                Application.Run(MainForm);
                AppState.WriteState("appState.xml");																// Save the application state.
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
                System.Diagnostics.Debugger.Break();
            }
        }