Example #1
0
        private void Load_DLLs()
        {
            // Gets the folder path in which your .exe is located
            var parentFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
            // Makes the absolute path
            var absolutePath = Path.Combine(parentFolder, @"dlls");

            foreach (string dll in Directory.GetFiles(absolutePath, "*.dll"))
            {
                Assembly asm = Assembly.LoadFile(dll);
                //la dll ahora tendria que tener 3 types.. la config, la animation y la animation on execution.. filtrar por tipo "padre" y crear 3 listas distintas!
                Type[] typesList = asm.GetTypes();

                foreach (var t in typesList)
                {
                    //ver si se puede meter un switch
                    //validar que siempre vengan estos 3 tipos -> flag?
                    if (t.BaseType == typeof(AnimationConfigurationBase))
                    {
                        var config = Activator.CreateInstance(t, Variables.ToList()) as AnimationConfigurationBase;
                        DllConfigurations.Add(config);
                    }
                    //comentado para que siga funcionando ok
                    if (t.BaseType == typeof(AnimationViewModel))
                    {
                        var animation = Activator.CreateInstance(t) as AnimationViewModel;
                        DllAnimations.Add(animation);
                    }
                }
            }
        }
Example #2
0
        private void btnAccept_OnClick(object sender, RoutedEventArgs e)
        {
            ResultConfig = DllConfigurations.First(x => x.AnimationType == AnimationType);
            ResultConfig.BindProperties();
            ResultConfig.AnimationName = AnimationName;
            ResultConfig.CanExecute    = this.CanExecute;
            ResultConfig.Variables     = Variables;

            this.Result = UI.SharedWPF.DialogResult.Accept;
            this.Close();
        }
Example #3
0
        private void AnimationTypes_SelectionChanged(object sender, RoutedEventArgs e)
        {
            extraConfigsContainer.Children.Clear();

            var animationTypeSelected = ((System.Windows.Controls.ComboBox)sender).SelectedValue.ToString();

            var configurationType = DllConfigurations.First(x => x.AnimationType == animationTypeSelected);

            if (configurationType.DllExtraConfigurations != null && configurationType.DllExtraConfigurations.Any())
            {
                foreach (var extraField in configurationType.DllExtraConfigurations)
                {
                    extraConfigsContainer.Children.Add(extraField);
                }
            }
        }