private void OnCreated() { Children.CollectionChanged += ChildrenOnCollectionChanged; // childrenView = CollectionViewSource.GetDefaultView(children) as ListCollectionView; if (Common.SHOW_DEBUG_MESSAGE1) { Debug.WriteLine("@ treenode|@ oncreated"); } // listen to parent, initialize Orator.Listen(OratorRooms.TN_INIT, OnAnnouncedTnInit); // listen to parent, changes have been saved Orator.Listen(OratorRooms.SAVED, OnAnnouncedSaved); // listen to parent, changes have been saved Orator.Listen(OratorRooms.SAVING, OnSavingAnnounce); RemExCollapseListenConfig(); onModifiedAnnouncer = Orator.GetAnnouncer(this, OratorRooms.MODIFIED); IsInitialized = true; }
// [OnSerializing] // private void Onerializing(StreamingContext c) // { // if (!rememberExpCollapseState) isExpanded = false; // } private void RemExCollapseListenConfig() { // listen to parent, changes have been saved Orator.Listen(OratorRooms.TN_REM_EXCOLLAPSE_STATE, OnAnnouncedRemExCollapseState); rememberExpCollapseState = (bool)(Orator.GetLastValue(OratorRooms.TN_REM_EXCOLLAPSE_STATE) ?? false); }
public Child() { Console.WriteLine("@ child| created"); /* * MiddleMan.Outgoing += MiddleManOnOutgoing; * MiddleMan.Initialize += MiddleManOnInitialize; * MiddleMan.MonitoredOut += MiddleManOnMonitoredOut; * MiddleMan.NonMonitoredOut += MiddleMan_NonMonitoredOut; * */ s0 = new SubChild(); s0.ConfigListener(Program.INIT_EVT_NAME); s1 = new SubChild(); s1.ConfigListener(Program.INIT_EVT_NAME); s2 = new SubChild(); s2.ConfigListener(Program.INIT_EVT_NAME); Orator.Listen(Program.INIT_EVT_NAME, OnIntEvent); // Modified = Orator.GetAnnouncer(Program.MODIFY_EVT_NAME); Modified2 = Orator.GetAnnouncer2(this, Program.MODIFY_EVT_NAME); }
public MainWindowClassifierEditor() { #if SHOWTICKS tickNow = System.DateTime.Now.Ticks; ticksStart = tickNow; tickPrior = tickNow; showTicks("start @1"); #endif InitializeComponent(); #if SHOWTICKS showTicks("start @2"); #endif OnSavedAnnouncer = Orator.GetAnnouncer(this, OratorRooms.SAVED, "Modifications have been saved"); OnSavingAnnouncer = Orator.GetAnnouncer(this, OratorRooms.SAVING, "Before Modifications get saved"); OnTnInitAnnouncer = Orator.GetAnnouncer(this, OratorRooms.TN_INIT, "Initialize"); OnRemExCollapseStateAnnouncer = Orator.GetAnnouncer(this, OratorRooms.TN_REM_EXCOLLAPSE_STATE, "Remember Exp-Collapse State"); // SampleData.SampleData SD = new SampleData.SampleData(); #if SHOWTICKS showTicks("start @3"); #endif }
static void Main(string[] args) { Input(); Rally r = new Rally(name, speakers, members); Orator o = new Orator(name, speakers, members, p); Output(r, o); Console.ReadKey(); }
private void OnCreated() { OnModifiedAnnouncer = Orator.GetAnnouncer(this, OratorRooms.MODIFIED); // listen to parent, changes have been saved Orator.Listen(OratorRooms.SAVED, OnOratorAnnouncedSaved); // listen to parent, initialize Orator.Listen(OratorRooms.TN_INIT, OnAnnounceTnInit); }
public void ConfigListener(string room) { Orator.Listen(room, OnIntEvent); object lv = Orator.GetLastValue(room); if (lv != null) { Console.WriteLine("@ subchild " + index + "| got lastValue| " + lv.ToString()); } }
public SubChild() { // MiddleMan.Outgoing += MiddleManOnOutgoing; index = ++Program.count; Console.WriteLine("@ subchild " + index + "| created"); // xModified = Orator.GetAnnouncer(Program.MODIFY_EVT_NAME); xModified2 = Orator.GetAnnouncer2(this, Program.MODIFY_EVT_NAME); }
static void Output(Rally r, Orator o) { r.GetInfo(); o.GetInfo(); foreach (string s in r.info) { Console.WriteLine(s); } foreach (string s in o.info) { Console.WriteLine(s); } }
public void Test3() { Console.WriteLine("\n@ program| Test 2"); Orator.Listen(MODIFY_EVT_NAME, OnModifiedEvent); // send message to children // Orator.ConfRoom.Announcer A = Orator.GetAnnouncer(INIT_EVT_NAME); Orator.ConfRoom.Announcer2 A2 = Orator.GetAnnouncer2(this, INIT_EVT_NAME); // AnnounceInit("init event sent"); Console.WriteLine("\n@ program| announcing on A2\n"); // A.Announce(this, true); A2.Announce("this is an A2 package"); }
private void OnCreated() { if (Common.SHOW_DEBUG_MESSAGE1) { Debug.WriteLine("@ sheetcat|@ oncreated"); } compareOps.CollectionChanged += CompareOpsOnCollectionChanged; // listen to parent, initialize Orator.Listen(OratorRooms.TN_INIT, OnAnnounceTnInit); // listen to parent, changes have been saved Orator.Listen(OratorRooms.SAVED, OnAnnounceSaved); onModifiedAnnouncer = Orator.GetAnnouncer(this, OratorRooms.MODIFIED); mergeItems = new ObservableCollection <MergeItem>(); // IsInitialized = true; }
static void Main(string[] args) { Program p = new Program(); c0 = new Child(); // p.Test1(); // p.Test2(); p.Test3(); c1 = new Child(); object lv = Orator.GetLastValue(MODIFY_EVT_NAME); Console.WriteLine("\n@ program| lastValue (before clear)| " + lv?.ToString() ?? "is null"); Orator.ClearLastValue(MODIFY_EVT_NAME); lv = Orator.GetLastValue(MODIFY_EVT_NAME); Console.WriteLine("\n@ program| lastValue (after clear)| " + (lv?.ToString() ?? "is null")); Console.WriteLine("\nWaiting...\n"); Console.ReadKey(); }
public Classify() { Orator.Listen("toClassify", OnGetAnnouncement); toParentAnnounce = Orator.GetAnnouncer(this, "fromClassify", ""); }
public ClassificationFile(string filePath, bool fileSelected = false) { #if SHOWTICKS tickNow = System.DateTime.Now.Ticks; ticksStart = tickNow; tickPrior = tickNow; showTicks("classF/start @1"); #endif FilePathLocal = new FilePath <FileNameUserAndId>(filePath); if (!filePathLocal.IsValid) { return; } // setup inter-class communication // tell parent, I have been modified announcer #if SHOWTICKS showTicks("classF/start @2"); #endif // listen to parent, initialize Orator.Listen(OratorRooms.TN_INIT, OnAnnounceTnInit); // listen to children - they have been modified Orator.Listen(OratorRooms.MODIFIED, OnAnnounceSubChildModified); // listen to parent, changes have been saved Orator.Listen(OratorRooms.SAVED, OnAnnounceSaved); // // announce to treenode (treebase) / and components initialized and to initialize // OnTnInitAnnouncer = Orator.GetAnnouncer(this, OratorRooms.TN_INIT, "Initialize treenode & components"); // bool a = !SettingsSupport.ValidateXmlFile(filePath); // bool b = !ValidateAgainstUsername(filePathLocal); #if SHOWTICKS showTicks("classF/start @3"); #endif if ((FilePathLocal.IsFound && !SettingsSupport.ValidateXmlFile(filePath)) || !ValidateAgainstUsername(filePathLocal) ) { FilePathLocal = FilePath <FileNameUserAndId> .Invalid; return; } #if SHOWTICKS showTicks("classF/start @4"); #endif PreInitialize(); #if SHOWTICKS showTicks("classF/start @5"); #endif InitailizeSample(FilePathLocal.FullFilePath); #if SHOWTICKS showTicks("classF/start @6"); #endif }