예제 #1
0
        public void SelectObjects(ICollection <object> objects, bool updateForeachDocumentWindowContainers = true, bool updateSettingsWindowSelectObjects = true, bool forceUpdate = false)
        {
            if (objects == null)
            {
                objects = new object[0];
            }

            if (!Equal(objects, SelectedObjects) || forceUpdate)
            {
                var oldSelectedObjects = SelectedObjects;

                selectedObjects = new object[objects.Count];
                objects.CopyTo(selectedObjects, 0);
                selectedObjectsSet = new ESet <object>(selectedObjects);
                //SettingsWindow.Instance._SelectObjects( this, objects );

                //update ForeachDocumentWindowContainers
                if (updateForeachDocumentWindowContainers)
                {
                    var windows = new List <ForeachDocumentWindowContainer>();

                    foreach (var window in EditorForm.Instance.WorkspaceController.GetDockWindows())
                    {
                        var window2 = window as ForeachDocumentWindowContainer;
                        if (window2 != null)
                        {
                            windows.Add(window2);
                        }
                    }

                    foreach (var window in windows)
                    {
                        window.OnDocumentWindowSelectedObjectsChangedByUser(this);
                    }
                }

                //update Settings Window
                if (updateSettingsWindowSelectObjects)
                {
                    SettingsWindowSelectObjects();
                }

                SelectedObjectsChanged?.Invoke(this, oldSelectedObjects);
            }
        }
예제 #2
0
 internal void PerformSelectedObjectsChanged(object[] oldSelectedObjects)
 {
     SelectedObjectsChanged?.Invoke(this, oldSelectedObjects);
 }
예제 #3
0
 private void SetupSelectionChangedEvents()
 {
     designer.GetFields <IMainView>().ToList().ForEach(v => v.SelectionChanged += (s_, e_) => SelectedObjectsChanged?.Invoke(this, EventArgs.Empty));
 }