Ejemplo n.º 1
0
        // return true = pending assembly added
        // return false = pending assembly is invalid
        // return null = no pending asesmbly
        private bool?AddPendingFrameworkAssembly()
        {
            // Blank assembly name but content in the supported framework textbox is an error
            if (string.IsNullOrWhiteSpace(NewAssemblyName.Text) && !string.IsNullOrWhiteSpace(NewSupportedFramework.Text))
            {
                return(false);
            }

            // blank in both is ok, nothing to add
            if (string.IsNullOrWhiteSpace(NewAssemblyName.Text))
            {
                return(null);
            }

            if (!NewFrameworkAssembly.UpdateSources())
            {
                return(false);
            }
            _frameworkAssemblies.Add(_newFrameworkAssembly.AsReadOnly());

            // after framework assembly is added, clear the textbox
            ClearFrameworkAssemblyTextBox();

            return(true);
        }
Ejemplo n.º 2
0
        private void AddFrameworkAssemblyButtonClicked(object sender, RoutedEventArgs args)
        {
            var bindingExpression = NewSupportedFramework.GetBindingExpression(TextBox.TextProperty);

            if (bindingExpression.HasError)
            {
                return;
            }

            _frameworkAssemblies.Add(_newFrameworkAssembly.AsReadOnly());

            // after framework assembly is added, clear the textbox
            ClearFrameworkAssemblyTextBox();
        }
Ejemplo n.º 3
0
        // return true = pending assembly added
        // return false = pending assembly is invalid
        // return null = no pending asesmbly
        private bool?AddPendingFrameworkAssembly()
        {
            if (string.IsNullOrEmpty(NewAssemblyName.Text) &&
                string.IsNullOrEmpty(NewSupportedFramework.Text))
            {
                return(null);
            }

            if (!NewFrameworkAssembly.UpdateSources())
            {
                return(false);
            }
            _frameworkAssemblies.Add(_newFrameworkAssembly.AsReadOnly());

            // after framework assembly is added, clear the textbox
            ClearFrameworkAssemblyTextBox();

            return(true);
        }