Artemis.ViewModels.Profiles.LayerEditorViewModel.Apply C# (CSharp) Method

Apply() public method

public Apply ( ) : void
return void
        public void Apply()
        {
            LayerPropertiesViewModel?.ApplyProperties();

            Layer.Properties.DynamicProperties.Clear();
            JsonConvert.PopulateObject(JsonConvert.SerializeObject(ProposedLayer), Layer);
            Layer.Properties.Conditions.Clear();
            foreach (var conditionViewModel in LayerConditionVms)
                Layer.Properties.Conditions.Add(conditionViewModel.LayerConditionModel);

            // TODO: EventPropVM must have layer too
            if (EventPropertiesViewModel != null)
                Layer.EventProperties = EventPropertiesViewModel.GetAppliedProperties();

            Layer.SetupCondition();

            // Don't bother checking for a GIF path unless the type is GIF
            if (!(Layer.LayerType is KeyboardGifType))
                return;
            if (!File.Exists(((KeyboardPropertiesModel) Layer.Properties).GifFile))
                DialogService.ShowErrorMessageBox("Couldn't find or access the provided GIF file.");
        }