Пример #1
0
 protected void OnAdvisorAdded(RegisteredAdvisor newAdvisor)
 {
     if (AdvisorsAdded != null)
     {
         AdvisorsAdded(this, new HostEventArgs(newAdvisor));
     }
 }
Пример #2
0
        private void RegisterAdvisor(Type advisorClass, string advisorName)
        {
            RegisteredAdvisor advisorWrapper = new RegisteredAdvisor(hostUrl, advisorClass, advisorName);

            eventLog.AddEntry("Found advisor class: " + advisorWrapper.Name, EventSeverity.Info);
            advisors.Add(advisorWrapper);
            OnAdvisorAdded(advisorWrapper);
        }
Пример #3
0
 private void updateAdvisorDetails()
 {
     listView1.BeginUpdate();
     foreach (ListViewItem item in this.listView1.Items)
     {
         RegisteredAdvisor regAdv = (RegisteredAdvisor)item.Tag;
         item.SubItems[2].Text = regAdv.Instance.Operations.ToString();
     }
     listView1.EndUpdate();
 }
Пример #4
0
        IAdvisorProxy IHost.GetAdvisor(string name)
        {
            Host host = Host.Instance;

            if (host == null)
            {
                return(null);
            }

            RegisteredAdvisor registrationEntry = host.GetRegisteredAdvisorByName(name);

            if (registrationEntry == null)
            {
                return(null);
            }

            return(registrationEntry.Instance);
        }
Пример #5
0
 public HostEventArgs(RegisteredAdvisor advisor)
 {
     this.registeredAdvisor = advisor;
 }