Ejemplo n.º 1
0
        /// <summary>
        /// Creates the control for use in NAV RTC
        /// </summary>
        /// <returns>The control inbstance</returns>
        protected override Control CreateControl()
        {
            this.searchAllowed            = true;
            this.lyncCommunicationControl = new LyncCommunicationControl();
            this.lyncCommunicationControl.ContactChanged += this.OnPresenceContactChanged;
            this.presenceHost = new ElementHost
            {
                Child    = this.lyncCommunicationControl,
                AutoSize = false,
            };

            // NOTE: This means that the context menu for the host control would be dissabled and if by any
            //       chance we host another control in the same host control, the control would not be able to use
            //       the host control context menu... thus it should declare one of its own
            var contextMenuStrip = this.presenceHost.ContextMenuStrip ?? (this.presenceHost.ContextMenuStrip = new ContextMenuStrip());

            contextMenuStrip.Opening += (sender, e) => { e.Cancel = true; };

            this.presenceHost.EnabledChanged += delegate { this.lyncCommunicationControl.CanEnable = this.presenceHost.Enabled; };
            this.presenceHost.ParentChanged  += delegate
            {
                if (this.AddInReady != null)
                {
                    this.AddInReady();
                }
            };
            return(this.presenceHost);
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.LyncCommunicationPresenceControl = ((LyncCommunicationAddIn.LyncCommunicationControl)(target));
     return;
     case 2:
     this.InputHelperContextMenu = ((System.Windows.Controls.ContextMenu)(target));
     return;
     case 3:
     this.LookupMenuHeader = ((System.Windows.Controls.MenuItem)(target));
     return;
     case 4:
     this.LookupMenuHeaderText = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 5:
     this.SearchContextMenuSeparator = ((System.Windows.Controls.Separator)(target));
     return;
     case 6:
     this.CustomSearch = ((System.Windows.Controls.MenuItem)(target));
     
     #line 29 "..\..\LyncCommunicationControl.xaml"
     this.CustomSearch.Click += new System.Windows.RoutedEventHandler(this.OnCustomSearchMenuClick);
     
     #line default
     #line hidden
     return;
     case 7:
     this.ContactMenuHeader = ((System.Windows.Controls.MenuItem)(target));
     return;
     case 8:
     this.ContactMenuHeaderText = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 9:
     this.ShowContact = ((System.Windows.Controls.MenuItem)(target));
     
     #line 36 "..\..\LyncCommunicationControl.xaml"
     this.ShowContact.Click += new System.Windows.RoutedEventHandler(this.OnOpenContactDetailsMenuClick);
     
     #line default
     #line hidden
     return;
     case 10:
     this.RemoveContact = ((System.Windows.Controls.MenuItem)(target));
     
     #line 37 "..\..\LyncCommunicationControl.xaml"
     this.RemoveContact.Click += new System.Windows.RoutedEventHandler(this.OnRemoveContactMenuClick);
     
     #line default
     #line hidden
     return;
     case 11:
     this.LayoutGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 12:
     this.PresenceVisualColumn = ((System.Windows.Controls.ColumnDefinition)(target));
     return;
     case 13:
     this.DisplayNameColumn = ((System.Windows.Controls.ColumnDefinition)(target));
     return;
     case 14:
     this.PresenceIndicator = ((LyncCommunicationAddIn.CustomizedPresenceIndicator)(target));
     return;
     case 15:
     this.DisplayName = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 16:
     this.InputHelper = ((System.Windows.Controls.Button)(target));
     
     #line 53 "..\..\LyncCommunicationControl.xaml"
     this.InputHelper.Click += new System.Windows.RoutedEventHandler(this.OnInputHelperButtonClick);
     
     #line default
     #line hidden
     return;
     case 17:
     this.SearchPopup = ((System.Windows.Controls.Primitives.Popup)(target));
     return;
     case 18:
     this.contactSearchBox = ((LyncCommunicationAddIn.CustomizedContactSearch)(target));
     return;
     case 19:
     this.SignInError = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 20:
     this.LyncIcon = ((System.Windows.Controls.Viewbox)(target));
     return;
     case 21:
     this.LyncIconImage = ((System.Windows.Controls.Image)(target));
     return;
     }
     this._contentLoaded = true;
 }