public void Initialize(IControlInfo controlInfo)
        {
            this.ControlInfo = controlInfo;
            
            this.HasBetaExamples = this.ControlInfo.TouchExamples.Count(ex => ex.Status == Enums.StatusMode.Beta) > 0;
            this.HasUpdatedExamples = this.ControlInfo.TouchExamples.Count(ex => ex.Status == Enums.StatusMode.Updated) > 0;
            this.HasCtpExamples = this.ControlInfo.TouchExamples.Count(ex => ex.Status == Enums.StatusMode.Ctp) > 0;
            this.HasNewExamples = this.ControlInfo.TouchExamples.Count(ex => ex.Status == Enums.StatusMode.New) > 0;

            this.NavigateCommand = new DelegateCommand(this.OnNavigateCommandExecuted);
        }
        /// <summary>
        /// Gets the correct group name for an item - highlighted controls go in one group, the others go to different group, based on their name.
        /// </summary>
        public string GetGroupNameForItem(IControlInfo generatedItem)
        {
            if (this.newControlsTouchCloned.Contains(generatedItem))
            {
                return NewControlsGroupName;
            }
            
            if (this.highlightedControlsTouchCloned.Contains(generatedItem))
            {
                return HighlightedControlsGroupName;
            }

            var groupNames = new string[] { "A-B", "C-D", "E-F", "G-H", "I-J", "K-L", "M-N", "O-P", "Q-R", "S-T", "U-V", "W-X", "Y-Z" };
            char itemNameStartingLetter = generatedItem.Name.First();
            var result = groupNames.Single(gn => gn.Contains(itemNameStartingLetter));
            return result;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Unregisters content by control info</summary>
 /// <param name="controlHostService">Control host service</param>
 /// <param name="info">Control info to unregister</param>
 public static void UnregisterContent(
     this IControlHostService controlHostService,
     IControlInfo info)
 {
     controlHostService.UnregisterContent(info.Content);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Shows a control by control info</summary>
 /// <param name="controlHostService">Control host service</param>
 /// <param name="info">Control info for control</param>
 public static void Show(
     this IControlHostService controlHostService,
     IControlInfo info)
 {
     controlHostService.Show(info.Content);
 }
 public ExampleFile(IControlInfo control, string relativePath)
 {
     this.control = control;
     this.relativePath = relativePath;
     this.Initialize();
 }
Exemplo n.º 6
0
 private void FillControlInfo(IControlInfo controlInfo)
 {
     dotNetPropertyGrid.SelectedObject = controlInfo;
     RefreshDotNetPropertyGridActions();
 }