Beispiel #1
0
 public void Initialize(UIElement dialogContent)
 {
     this.DialogContent                   = dialogContent;
     this.propertyNameEditor              = LogicalTreeHelper.FindLogicalNode((DependencyObject)this.DialogContent, "PropertyName") as StringEditor;
     this.acceptButton                    = LogicalTreeHelper.FindLogicalNode((DependencyObject)this.DialogContent, "AcceptButton") as Button;
     this.propertyNameValidator           = new MessageBubbleValidator <string, TextChangedEventArgs>((Func <string>)(() => this.propertyNameEditor.Text), new Func <string, string>(this.ValidatePropertyName));
     this.propertyNameMessageBubble       = new MessageBubbleHelper((UIElement)this.propertyNameEditor, (IMessageBubbleValidator)this.propertyNameValidator);
     this.propertyNameEditor.TextChanged += new TextChangedEventHandler(this.propertyNameValidator.EventHook);
     this.acceptButton.IsEnabled          = false;
 }
 public NewNamePathDialog()
 {
     this.InitializeComponent();
     this.showName                 = true;
     this.pathValidator            = new MessageBubbleValidator <string, TextChangedEventArgs>(() => this.PathTextBox.Text, new Func <string, string>(PathHelper.ValidatePath));
     this.projectPathMessageBubble = new MessageBubbleHelper(this.PathTextBox, this.pathValidator);
     this.PathTextBox.TextChanged += new TextChangedEventHandler(this.pathValidator.EventHook);
     this.nameValidator            = new MessageBubbleValidator <string, TextChangedEventArgs>(() => this.NameTextBox.Text, new Func <string, string>(ProjectPathHelper.ValidateProjectFileName));
     this.projectNameMessageBubble = new MessageBubbleHelper(this.NameTextBox, this.nameValidator);
     this.NameTextBox.TextChanged += new TextChangedEventHandler(this.nameValidator.EventHook);
 }
Beispiel #3
0
 public CreateProjectDialog(IEnumerable <IProjectTemplate> creatableProjectTemplates, ITemplateManager templateManager, string title, string defaultProjectPath, bool willCreateNewSolution, IServiceProvider services)
 {
     this.InitializeComponent();
     this.services                        = services;
     base.Style                           = (Style)base.Resources["CreateProjectDialogStyle"];
     this.TemplateManager                 = templateManager;
     this.defaultProjectPath              = defaultProjectPath;
     this.projectPath                     = defaultProjectPath;
     this.creatableProjectTemplates       = creatableProjectTemplates;
     base.Activated                      += new EventHandler(this.OnCreateProjectDialogActivated);
     this.willCreateNewSolution           = willCreateNewSolution;
     this.pathValidator                   = new MessageBubbleValidator <string, TextChangedEventArgs>(() => this.PathTextBox.Text, new Func <string, string>(ProjectPathHelper.ValidatePath));
     this.projectPathMessageBubble        = new MessageBubbleHelper(this.PathTextBox, this.pathValidator);
     this.PathTextBox.TextChanged        += new TextChangedEventHandler(this.pathValidator.EventHook);
     this.nameValidator                   = new MessageBubbleValidator <string, TextChangedEventArgs>(() => this.NameTextBox.Text, new Func <string, string>(ProjectPathHelper.ValidateProjectFileName));
     this.projectNameMessageBubble        = new MessageBubbleHelper(this.NameTextBox, this.nameValidator);
     this.NameTextBox.TextChanged        += new TextChangedEventHandler(this.nameValidator.EventHook);
     this.solutionValidator               = new MessageBubbleValidator <string, TextChangedEventArgs>(() => this.SolutionPathFileName, new Func <string, string>(ProjectPathHelper.ValidateNewSolutionPathFileName));
     this.solutionMessageBubble           = new MessageBubbleHelper(this.NameTextBox, this.solutionValidator);
     this.NameTextBox.TextChanged        += new TextChangedEventHandler(this.solutionValidator.EventHook);
     base.Title                           = title;
     base.SizeToContent                   = SizeToContent.Height;
     base.Width                           = 550;
     base.DataContext                     = this;
     this.projectTemplateCategoryTreeRoot = new ProjectTemplateCategoryTreeItem(string.Empty, creatableProjectTemplates, this)
     {
         IsExpanded = true
     };
     this.projectTemplateCategoryFlattener           = new VirtualizingTreeItemFlattener <ProjectTemplateCategoryTreeItem>(this);
     this.projectTemplateCategorySelection           = this.projectTemplateCategoryTreeRoot;
     this.IsCategoryTreeVisible                      = false;
     this.projectTemplateCategoryTreeRoot.IsSelected = true;
     this.UpdateLanguageList();
     this.OnPropertyChanged("LicenseButtonCommand");
     this.OnPropertyChanged("LicenseButtonText");
     this.LicenseStatusBarBorder.Visibility = (this.ProjectTemplate == null || LicensingHelper.ProjectLicense(this.ProjectTemplate, this.services).FullyLicensed ? Visibility.Collapsed : Visibility.Visible);
 }