//override
        public void onRecieveResult(Dictionary<String, Object> bundle)
        {
            Object senderName;
            Object senderValue;
            bundle.TryGetValue( PageDataExchange.KEY_SENDER_NAME, out senderName);
            bundle.TryGetValue( PageDataExchange.KEY_SENDER_VALUE, out senderValue);

            PageDataExchange context = PageDataExchange.getInstance();
            String observerName = senderName.ToString();

            if (ACTIONBAR_REGISTER.Equals(senderValue))
            {
                mActoinbarObserver =  context.getResultObserverByTag(observerName);
            }
            else if (ACTIONBAR_UNREGISTER.Equals(senderValue))
            {
                mActoinbarObserver = null;
            }
            else if (ACTIONBAR_SETTING_SHOW.Equals(senderValue))
            {
                this.btn_setting.Visibility = Visibility.Visible;
            }
            else if (ACTIONBAR_SETTING_HIDE.Equals(senderValue))
            {
                this.btn_setting.Visibility = Visibility.Hidden;
            }
            //UpdateHelpState();
        }
Beispiel #2
0
        //override
        public void onRecieveResult(Dictionary <String, Object> bundle)
        {
            Object senderName;
            Object senderValue;

            bundle.TryGetValue(PageDataExchange.KEY_SENDER_NAME, out senderName);
            bundle.TryGetValue(PageDataExchange.KEY_SENDER_VALUE, out senderValue);

            PageDataExchange context      = PageDataExchange.getInstance();
            String           observerName = senderName.ToString();

            if (ACTIONBAR_REGISTER.Equals(senderValue))
            {
                mActoinbarObserver = context.getResultObserverByTag(observerName);
            }
            else if (ACTIONBAR_UNREGISTER.Equals(senderValue))
            {
                mActoinbarObserver = null;
            }
            else if (ACTIONBAR_SETTING_SHOW.Equals(senderValue))
            {
                this.btn_setting.Visibility = Visibility.Visible;
            }
            else if (ACTIONBAR_SETTING_HIDE.Equals(senderValue))
            {
                this.btn_setting.Visibility = Visibility.Hidden;
            }
            //UpdateHelpState();
        }
Beispiel #3
0
        public void CommandObserver(String ObserverTag, String senderKey, Object command)
        {
            Dictionary <String, Object> bundle = new Dictionary <string, object>();

            bundle.Add(PageDataExchange.KEY_SENDER_NAME, senderKey);
            bundle.Add(PageDataExchange.KEY_SENDER_VALUE, command);

            IObserverResult observer = this.getResultObserverByTag(ObserverTag);

            if (observer != null)
            {
                observer.onRecieveResult(bundle);
            }
        }
Beispiel #4
0
        public void NotifyObserverChanged(String ObserverName, String senderName, Object value)
        {
            Dictionary <String, Object> bundle = new Dictionary <string, object>();

            bundle.Add(PageDataExchange.KEY_SENDER_NAME, senderName);
            bundle.Add(PageDataExchange.KEY_SENDER_VALUE, value);

            IObserverResult observer = this.getResultObserverByTag(ObserverName);

            if (observer != null)
            {
                observer.onRecieveResult(bundle);
            }
        }
Beispiel #5
0
        private void DispatchChanges(String plcVarName)
        {
            Dictionary <String, Object> bundle = new Dictionary <string, object>();

            bundle.Add(PageDataExchange.KEY_SENDER_NAME, TAG);
            bundle.Add(PageDataExchange.KEY_SENDER_VALUE, plcVarName);

            //notify observers
            foreach (KeyValuePair <String, IObserverResult> item in mObserverCache)
            {
                IObserverResult observer = item.Value;
                observer.onRecieveResult(bundle);
            }
        }
Beispiel #6
0
        public void NotifyAllObeservers(String senderKey, Object command)
        {
            Dictionary <String, Object> bundle = new Dictionary <string, object>();

            bundle.Add(PageDataExchange.KEY_SENDER_NAME, senderKey);
            bundle.Add(PageDataExchange.KEY_SENDER_VALUE, command);

            foreach (KeyValuePair <String, IObserverResult> entry in mResultObserverCache)
            {
                IObserverResult observer = entry.Value;
                if (observer != null)
                {
                    observer.onRecieveResult(bundle);
                }
            }
        }
Beispiel #7
0
        private void NotifyObservers(String info)
        {
            PageDataExchange context = PageDataExchange.getInstance();

            String[] logoutObservers           = new String[] { PageUserRegister.TAG, PageLogin.TAG, PageStatus.TAG };
            Dictionary <String, Object> bundle = new Dictionary <string, object>();

            bundle.Add(PageDataExchange.KEY_SENDER_NAME, TAG);
            bundle.Add(PageDataExchange.KEY_SENDER_VALUE, info);

            foreach (String tag in logoutObservers)
            {
                IObserverResult observer = context.getResultObserverByTag(tag);
                if (observer != null)
                {
                    observer.onRecieveResult(bundle);
                }
            }
        }
Beispiel #8
0
        private void help_MouseUp(object sender, RoutedEventArgs e)
        {
            //Utils.NavigateToPage(MainWindow.sFrameReportName, Utils.uriPagePopup);

            String name = ToolbarMain.BUTTON_HELP;
            Dictionary <String, Object> bundle = new Dictionary <string, object>();

            bundle.Add(PageDataExchange.KEY_SENDER_NAME, TAG);
            bundle.Add(PageDataExchange.KEY_SENDER_VALUE, name);

            PageDataExchange context = PageDataExchange.getInstance();

            String[] observerTags = new String[] { ToolTipHelper.TAG, PageParameterHelper.TAG };

            foreach (String tag in observerTags)
            {
                IObserverResult tooltiphelper = context.getResultObserverByTag(tag);

                if (tooltiphelper != null)
                {
                    tooltiphelper.onRecieveResult(bundle);
                }
            }
        }
 public void RegisterObeserver(IObserverResult observer)
 {
     mToolControl.RegisterObeserver(observer);
 }
Beispiel #10
0
 public void RegisterObeserver(IObserverResult observer)
 {
     mObserver = observer;
 }
Beispiel #11
0
 public void addResultObserver(string pageTag, IObserverResult observer)
 {
     mResultObserverCache.Add(pageTag, observer);
 }
Beispiel #12
0
 public void RegisterActionBarObserver(IObserverResult observer)
 {
     mActoinbarObserver = observer;
 }
Beispiel #13
0
 public void RegisterObserver(String pageTag, IObserverResult observer)
 {
     mObserverCache.Add(pageTag, observer);
 }
Beispiel #14
0
 public void UnregisterActionBarObserver()
 {
     mActoinbarObserver = null;
 }
Beispiel #15
0
 public void RegisterObserver(String pageTag, IObserverResult observer)
 {
     mObserverCache.Add(pageTag, observer);
 }
Beispiel #16
0
 public void registerObserver(IObserverResult observer)
 {
     mObserver = observer;
 }
Beispiel #17
0
 public void UnregisterActionBarObserver()
 {
     mActoinbarObserver = null;
 }
Beispiel #18
0
 public void RegisterActionBarObserver(IObserverResult observer)
 {
     mActoinbarObserver = observer;
 }
Beispiel #19
0
 public void RegisterObeserver(IObserverResult observer)
 {
     mToolControlObserver.RegisterObeserver(observer);
 }
Beispiel #20
0
 public void addResultObserver(string pageTag, IObserverResult observer)
 {
     mResultObserverCache.Add(pageTag, observer);
 }