/// <summary>
 ///   Initializes the control with the inspector property it is for and the current value.
 /// </summary>
 /// <param name="inspectorProperty">Inspector property the control is for.</param>
 /// <param name="editorContext">Editor context this control lives in.</param>
 /// <param name="localizationContext">Context used for showing and changing localized attribute values.</param>
 /// <param name="currentValue">Current value.</param>
 /// <param name="valueInherited">Indicates if the current value was inherited.</param>
 public virtual void Init(InspectorPropertyAttribute inspectorProperty, EditorContext editorContext, LocalizationContext localizationContext, object currentValue, bool valueInherited)
 {
     // Setup data context of control.
     this.dataContext = new InspectorPropertyData(inspectorProperty, localizationContext) { EditorContext = editorContext, Value = currentValue, ValueInherited = valueInherited };
     this.dataContext.ValueChanged += this.OnValueChanged;
     this.DataContext = this.dataContext;
 }
        public override void Init(
            InspectorPropertyAttribute inspectorProperty,
            EditorContext editorContext,
            LocalizationContext localizationContext,
            object currentValue, bool valueInherited)
        {
            base.Init(inspectorProperty, editorContext, localizationContext, currentValue, valueInherited);

            // Disable for localized strings.
            // TODO(np): Enable editing while not showing RAW values.
            var stringProperty = inspectorProperty as InspectorStringAttribute;
            if (stringProperty != null && stringProperty.Localized)
            {
                this.IsEnabled = false;
            }
        }
        /// <summary>
        ///   Creates and shows a new window that allows importing CSV data into the current project.
        /// </summary>
        /// <param name="context">Editor context holding the current model and project settings.</param>
        /// <param name="csvReader">CSV reader to use for the import.</param>
        /// <param name="importData">Custom CSV import settings for initializing the window.</param>
        /// <exception cref="ArgumentNullException">
        ///   <paramref name="context" /> or <paramref name="csvReader" /> is null.
        /// </exception>
        public ImportCsvDataWindow(EditorContext context, ICsvReader csvReader, CsvImportData importData)
        {
            this.InitializeComponent();

            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            if (csvReader == null)
            {
                throw new ArgumentNullException("csvReader");
            }

            this.context = context;
            this.csvReader = csvReader;
            this.importData = importData;

            this.InitializeWindow();
        }
 /// <summary>
 ///   Constructs a new factory for creating inspector controls.
 /// </summary>
 /// <param name="editorContext">Editor context the controls live in.</param>
 /// <param name="localizationContext">Context for localizing inspector values. <c>null</c> renders created controls unable to localize values.</param>
 public InspectorFactory(EditorContext editorContext, LocalizationContext localizationContext)
 {
     this.editorContext = editorContext;
     this.localizationContext = localizationContext;
 }
        public LocalizationContext(EditorContext context)
        {
            this.context = context;

            this.context.PropertyChanged += this.OnContextPropertyChanged;
        }