private void btnEkle_Click(object sender, EventArgs e) { ModelDTO dto = new ModelDTO() { Id = Guid.NewGuid(), ModelName = txtModel.Text, ModelYear = dtpModelYear.Value, BrandId = (Guid)cmbBrand.SelectedValue, }; var result = _mc.ModelAdd(dto); result.NotificationShow(); if (result.State == ResultState.Success) { txtModel.Text = ""; dtpModelYear.Value = DateTime.Today; ModelAdded.Raise(); } }
public void Add(IEffect effect) { if (effect == null) { return; } IEffect prev = getEffectAtPosition(effect.getPosition(this)); if (prev != null) { Remove(prev); } ModelCollection.Add(effect); if (effect is IMultiEffect && effect.getPosition(this) == EffectPosition.Into) { return; } ModelAdded?.Invoke(this, new ObjectAddedArgs(effect, this)); }
private void LoadModels() { if (enabled) { foreach (string ext in Extensions) { foreach (string file in Directory.GetFiles($"{IPA.Utilities.BeatSaber.InstallPath}/{Path}", $"*.{ext}")) { try { AssetBundle bundle = AssetBundle.LoadFromFile(file); Models.Add($"{Path}/{System.IO.Path.GetFileName(file)}", bundle); ModelAdded.Invoke(bundle); } catch { Logger.log.Error(Name.ToUpper() + "::: Could not load model from: " + file); } } } ModelsLoaded.Invoke(Models.Values.ToArray()); } }
public void Add(Chord chord) { ModelCollection.Add(chord); ModelAdded?.Invoke(this, new ObjectAddedArgs(chord, this)); }
public void Add(Measure measure) { ModelCollection.Add(measure); ModelAdded?.Invoke(this, new ObjectAddedArgs(measure, this)); }
public void Add(Note note) { ModelCollection.Add(note); ModelAdded?.Invoke(this, new ObjectAddedArgs(note, this)); }