Exemple #1
0
        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();
            }
        }
Exemple #2
0
        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));
        }
Exemple #3
0
 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());
     }
 }
Exemple #4
0
 public void Add(Chord chord)
 {
     ModelCollection.Add(chord);
     ModelAdded?.Invoke(this, new ObjectAddedArgs(chord, this));
 }
Exemple #5
0
 public void Add(Measure measure)
 {
     ModelCollection.Add(measure);
     ModelAdded?.Invoke(this, new ObjectAddedArgs(measure, this));
 }
Exemple #6
0
 public void Add(Note note)
 {
     ModelCollection.Add(note);
     ModelAdded?.Invoke(this, new ObjectAddedArgs(note, this));
 }