示例#1
0
        /////////////////////////////////////////////////////////////////////////////
        // Overriden Package Implementation
        #region Package Members

        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initilaization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
            base.Initialize();

            VSTalkCore = new VSTalkCore(
                InitilizeWindowManager(),
                InitilizeEnvironmentManager(),
                InitializeModelContext());

            // Add our command handlers for menu (commands must exist in the .vsct file)
            OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            if (null != mcs)
            {
                // Create the command for the menu item.
                CommandID   menuCommandID = new CommandID(GuidList.guidVSTalkCmdSet, (int)PkgCmdIDList.cmdidVSTalk);
                MenuCommand menuItem      = new MenuCommand(ShowToolWindow, menuCommandID);
                mcs.AddCommand(menuItem);
                // Create the command for the tool window
                CommandID   toolwndCommandID = new CommandID(GuidList.guidVSTalkCmdSet, (int)PkgCmdIDList.cmdidBaseToolWindow);
                MenuCommand menuToolWin      = new MenuCommand(ShowToolWindow, toolwndCommandID);
                mcs.AddCommand(menuToolWin);
            }
        }
示例#2
0
        public ContactListViewModel(VSTalkCore core)
        {
            _core = core;

            SetCommands();

            FillContactList();
        }
示例#3
0
 public AddContactWindow(VSTalkCore core, Client client = null)
 {
     InitializeComponent();
     DataContext    = this;
     _core          = core;
     Clients        = new ObservableCollection <Client>(core.AvailableClients);
     SelectedClient = client ?? Clients.FirstOrDefault();
     SetCommands();
 }
示例#4
0
        public MainViewModel(VSTalkCore core)
        {
            _core = core;

            ContactList      = new ContactListViewModel(core);
            NotificationView = new NotificationViewModel(core.NotificationQueue);

            SetHandlers();
            SetCommands();
        }
示例#5
0
        public ControlRepository(VSTalkCore core)
        {
            _chatFrame = new CommonChatFrame
            {
                DataContext = new ChatFrameViewModel(core)
            };

            _contactList = new MainControl
            {
                DataContext = new MainViewModel(core)
            };
        }
示例#6
0
        public ControlRepository(VSTalkCore core)
        {
            _chatFrame = new CommonChatFrame
            {
                    DataContext = new ChatFrameViewModel(core)
            };

            _contactList = new MainControl
            {
                    DataContext = new MainViewModel(core)
            };
        }
示例#7
0
        public ChatFrameViewModel(VSTalkCore core)
        {
            _core = core;

            SetCommands();

            ViewContacts = new ObservableCollection <InterlocutorChatViewModel>();
            this.SubscribeToChange(() => SelectedInterlocutor,
                                   param =>
            {
                if (SelectedInterlocutor != null)
                {
                    SelectedInterlocutor.Interlocutor.HasUnreadMessages = false;
                }
            });
        }