private void categorizeImages_Execute(object sender, SimpleActionExecuteEventArgs e) { ImageSourceBrowserBase browser = e.CurrentObject as ImageSourceBrowserBase; if (browser != null && !string.IsNullOrEmpty(browser.ImageSourceName)) { browser.BuildTreeNodes(); } }
private ChoiceActionItem CreateImagesLibraryObjectNavigationItem(string caption, string imageSourceName, string imageName) { IObjectSpace objectSpace = Application.CreateObjectSpace(typeof(ImageSourceBrowserBase)); ImageSourceBrowserBase browserObject = objectSpace.FindObject <ImageSourceBrowserBase>(new BinaryOperator("ImageSourceName", imageSourceName), false); string objectKey = objectSpace.GetKeyValueAsString(browserObject); ViewShortcut viewShortcut = new ViewShortcut(typeof(ImageSourceBrowserBase), objectKey, Application.GetDetailViewId(typeof(ImageSourceBrowserBase))); ChoiceActionItem newItem = new ChoiceActionItem(caption, caption, viewShortcut); newItem.ImageName = imageName; return(newItem); }