Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PropertyViewer" /> class.
        /// </summary>
        public PropertyViewer()
        {
            this.InitializeComponent();

            // Windows Forms hosting -- TODO: Phase this out
            this.propertyGrid = new System.Windows.Forms.PropertyGrid();

            // Use reflection to set all propertygrid colors to dark, since some are otherwise not publically accessible
            PropertyInfo[]             allProperties   = this.propertyGrid.GetType().GetProperties();
            IEnumerable <PropertyInfo> colorProperties = allProperties.Select(x => x).Where(x => x.PropertyType == typeof(Color));

            colorProperties.ForEach(x => x.SetValue(this.propertyGrid, DarkBrushes.SqualrColorPanel, null));

            this.propertyGrid.BackColor         = DarkBrushes.SqualrColorPanel;
            this.propertyGrid.CommandsBackColor = DarkBrushes.SqualrColorPanel;
            this.propertyGrid.HelpBackColor     = DarkBrushes.SqualrColorPanel;
            this.propertyGrid.SelectedItemWithFocusBackColor = DarkBrushes.SqualrColorPanel;
            this.propertyGrid.ViewBackColor = DarkBrushes.SqualrColorPanel;

            this.propertyGrid.CommandsActiveLinkColor   = DarkBrushes.SqualrColorPanel;
            this.propertyGrid.CommandsDisabledLinkColor = DarkBrushes.SqualrColorPanel;

            this.propertyGrid.CategorySplitterColor = DarkBrushes.SqualrColorWhite;

            this.propertyGrid.CommandsBorderColor = DarkBrushes.SqualrColorFrame;
            this.propertyGrid.HelpBorderColor     = DarkBrushes.SqualrColorFrame;
            this.propertyGrid.ViewBorderColor     = DarkBrushes.SqualrColorFrame;

            this.propertyGrid.CategoryForeColor              = DarkBrushes.SqualrColorWhite;
            this.propertyGrid.CommandsForeColor              = DarkBrushes.SqualrColorWhite;
            this.propertyGrid.DisabledItemForeColor          = DarkBrushes.SqualrColorWhite;
            this.propertyGrid.HelpForeColor                  = DarkBrushes.SqualrColorWhite;
            this.propertyGrid.SelectedItemWithFocusForeColor = DarkBrushes.SqualrColorWhite;
            this.propertyGrid.ViewForeColor                  = DarkBrushes.SqualrColorWhite;

            PropertyViewerViewModel.GetInstance().Subscribe(this);

            this.propertyViewer.Children.Add(WinformsHostingHelper.CreateHostedControl(this.propertyGrid));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Selects a given cheat.
 /// </summary>
 /// <param name="cheat">The cheat to select</param>
 private void SelectCheat(Cheat cheat)
 {
     PropertyViewerViewModel.GetInstance().SetTargetObjects(cheat);
 }
 private void InitDesignData()
 {
     DataContext = new PropertyViewerViewModel();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Invoked when this view model is selected.
 /// </summary>
 protected override void OnSelected()
 {
     PropertyViewerViewModel.GetInstance().SetTargetObjects(this.DotNetObject);
 }
Exemplo n.º 5
0
 public PropertyViewerController(IEventManager eventManager)
 {
     _eventManager = eventManager;
     Model         = new PropertyViewerViewModel();
     _eventManager.RegisterEventListener <SelectedSceneItemChanged>(SelectedItemChanged);
 }