Beispiel #1
0
        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);
            textBoxEditor.Text = DynamicDelegateGenerator <TDelegate> .GenerateCode();

            listBoxReferences.ItemsSource =
                DynamicDelegateGenerator <TDelegate> .GetDefaultReferenceAssemblies();
        }
Beispiel #2
0
        private void ButtonCreate_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var del =
                    DynamicDelegateGenerator <TDelegate> .CreateDelegateFromSource(textBoxEditor.Text);

                SetValue(DelegateDependencyPropertyKey, del);
            }
            catch (Exception exception)
            {
                textBoxError.Text = exception.Message;
                SetValue(DelegateDependencyPropertyKey, null);
            }
        }