|
using System;
using System.Windows.Forms;
using Microsoft.VisualStudio.Modeling;
using Dawliasoft.Sculpture;
using Dawliasoft.Sculpture.MoldInterfaces;
using Dawliasoft.Sculpture.CommonHelpers;
using Dawliasoft.Sculpture.SerializableTypes;
using WPFMold.Helpers;
namespace WPFMold
{
public partial class ThemeEditor : UserControl, ISelectionMonitor
{
private ModelElement _selectedElement;
public ThemeEditor()
{
InitializeComponent();
}
#region IMonitor Members
public string Title
{
get { return "Theme"; }
}
public void NotifySelectionChanged(ModelElement element)
{
_selectedElement = element;
if (element is DataContract)
comboBox1.Text = MoldHelper.GetPropertyValue(element, "GridTheme");
}
public Nullable<ElementType> FocusOn
{
get { return ElementType.DataContract; }
}
#endregion
private void changeNameBtn_Click(object sender, EventArgs e)
{
if (_selectedElement == null) return;
if(_selectedElement is DataContract)
MoldHelper.SetPropertyValue(_selectedElement, "GridTheme", comboBox1.Text);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Program Manager in Sculpture project, Interesting in .NET Model driven development.