コード例 #1
0
        private void WorkspaceUpdatedEventHandler(object sender, WorkspaceUpdatedEventArgs e)

        {
            CollectionViewSource.GetDefaultView(Workspaces).Refresh();
            CollectionViewSource.GetDefaultView(e.Workspace.CurrentSolution.Projects).Refresh();
            WorkspacesMenu.ItemsSource = null;
            WorkspacesMenu.ItemsSource = Workspaces;
            return;

            foreach (var workspacesMenuItem in WorkspacesMenu.Items)
            {
                var container0 = WorkspacesMenu.ItemContainerGenerator.ContainerFromItem(workspacesMenuItem);
            }
            int i = 0;

            foreach (object item in WorkspacesMenu.ItemContainerGenerator.Items)
            {
                if (Equals(item, e.Workspace))
                {
                    var container0 = WorkspacesMenu.ItemContainerGenerator.ContainerFromIndex(i);
                }

                i++;
            }
            var container = WorkspacesMenu.ItemContainerGenerator.ContainerFromItem(e.Workspace);

            if (container is MenuItem menuItem)
            {
                menuItem.GetBindingExpression(ItemsControl.ItemsSourceProperty)?.UpdateTarget();
            }
            // WorkspacesMenu.GetBindingExpression(ItemsControl.ItemsSourceProperty)?.UpdateTarget();
        }
        public void TheIsRefreshProperty(string title1, string title2, bool expectedResult)
        {
            var workspace1 = !string.IsNullOrEmpty(title1) ? new Workspace { Title = title1 } : null;
            var workspace2 = !string.IsNullOrEmpty(title2) ? new Workspace { Title = title2 } : null;

            var workspaceUpdatedEventArgs = new WorkspaceUpdatedEventArgs(workspace1, workspace2);

            Assert.AreEqual(expectedResult, workspaceUpdatedEventArgs.IsRefresh);
        }
コード例 #3
0
 private void OnCurrentWorkspaceChanged(object sender, WorkspaceUpdatedEventArgs e)
 {
     UpdateCurrentWorkspace();
 }
コード例 #4
0
 private void Add(WorkspaceUpdatedEventArgs pEvent)
 {
     _objWaitTimer.Start();
     Updates.Add(pEvent);
 }
コード例 #5
0
 private void WorkspaceContainer_WorkspaceItemUpdated(object sender, WorkspaceUpdatedEventArgs e)
 {
     Add(e);
 }
コード例 #6
0
 private void OnCurrentWorkspaceChanged(object sender, WorkspaceUpdatedEventArgs e)
 {
     UpdateCurrentWorkspace();
 }