Exemple #1
0
 internal void InitializeDialog()
 {
     this.itemListMessageBubble = new MessageBubbleHelper((UIElement)this.ProjectItemTypeList, (IMessageBubbleValidator) new ProjectItemTypeValidator());
     this.itemNameMessageBubble = new MessageBubbleHelper((UIElement)this.NameTextBox, (IMessageBubbleValidator) new ProjectItemNameValidator(this.project));
     using (TemporaryCursor.SetWaitCursor())
         this.InitializeDialogInternal();
 }
Exemple #2
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);
 }
        public XmlDataSourceDialog(DataPanelModel dataPanelModel, string initialDataSourceName, DataSourceDialogMode mode)
        {
            this.model = new XmlDataSourceDialogModel(dataPanelModel, initialDataSourceName, mode);
            FrameworkElement element = FileTable.GetElement("Resources\\DataPane\\XmlDataSourceDialog.xaml");

            ((UIElement)element.FindName("XmlDataSourceUrlTextBox")).LostFocus += new RoutedEventHandler(this.DataSourceUrlTextBox_LostFocus);
            element.DataContext           = (object)this.model;
            this.DialogContent            = (UIElement)element;
            this.Title                    = this.DialogTitle;
            this.SizeToContent            = SizeToContent.WidthAndHeight;
            this.controlNameMessageBubble = new MessageBubbleHelper((UIElement)(element.FindName("DataSourceNameTextBox") as TextBox), (IMessageBubbleValidator) new DataSourceNameValidator(this.model));
        }
        internal MakeUserControlDialog(DesignerContext designerContext, string dialogTitle, TemplateItemHelper templateItemHelper, string recommendedName)
        {
            this.InitializeComponent();
            this.userControlItem = templateItemHelper.FindTemplateItem("UserControl");
            this.designerContext = designerContext;
            this.Title           = dialogTitle;
            this.DataContext     = (object)this;
            string str1 = designerContext.ProjectManager.TargetFolderForProject(designerContext.ActiveProject);

            if (!string.IsNullOrEmpty(recommendedName))
            {
                string            str2 = recommendedName + ".xaml";
                DocumentReference documentReference = DocumentReference.Create(Path.Combine(str1, str2));
                this.name = designerContext.ActiveProject.FindItem(documentReference) == null ? recommendedName : Path.GetFileNameWithoutExtension(ProjectPathHelper.GetAvailableFilePath(str2, str1, designerContext.ActiveProject));
            }
            else if (this.userControlItem != null)
            {
                this.name = Path.GetFileNameWithoutExtension(ProjectPathHelper.GetAvailableFilePath(this.userControlItem.DefaultName, str1, designerContext.ActiveProject));
            }
            this.controlNameMessageBubble = new MessageBubbleHelper((UIElement)this.Control_Name, (IMessageBubbleValidator) new ProjectItemNameValidator(designerContext.ActiveProject));
        }
 internal CreateResourceDialog(DesignerContext designerContext, CreateResourceModel model)
 {
     this.model                              = model;
     this.designerContext                    = designerContext;
     this.content                            = Microsoft.Expression.DesignSurface.FileTable.GetElement("Resources\\ResourcePane\\CreateResourceDialog.xaml");
     this.content.DataContext                = (object)model;
     this.DialogContent                      = (UIElement)this.content;
     this.newResourceDictionaryButton        = (Button)LogicalTreeHelper.FindLogicalNode((DependencyObject)this, "NewResourceDialog");
     this.newResourceDictionaryButton.Click += new RoutedEventHandler(this.NewResourceDictionaryButton_Click);
     ((UIElement)LogicalTreeHelper.FindLogicalNode((DependencyObject)this, "DefineIn_WhichResDict")).GotKeyboardFocus  += new KeyboardFocusChangedEventHandler(this.defineInThisDocumentComboBox_GotKeyboardFocus);
     ((UIElement)LogicalTreeHelper.FindLogicalNode((DependencyObject)this, "DefineIn_WhichDocument")).GotKeyboardFocus += new KeyboardFocusChangedEventHandler(this.defineInOtherDocumentComboBox_GotKeyboardFocus);
     this.applicationRootRadioButton          = (RadioButton)LogicalTreeHelper.FindLogicalNode((DependencyObject)this, "DefineIn_ApplicationRoot");
     this.applicationRootRadioButton.Checked += new RoutedEventHandler(this.OnDefineRadioButtonCheck);
     this.thisDocumentRadioButton             = (RadioButton)LogicalTreeHelper.FindLogicalNode((DependencyObject)this, "DefineIn_ThisDocument");
     this.thisDocumentRadioButton.Checked    += new RoutedEventHandler(this.OnDefineRadioButtonCheck);
     this.otherDocumentRadioButton            = (RadioButton)LogicalTreeHelper.FindLogicalNode((DependencyObject)this, "DefineIn_OtherDocument");
     this.otherDocumentRadioButton.Checked   += new RoutedEventHandler(this.OnDefineRadioButtonCheck);
     this.Title = string.Format((IFormatProvider)CultureInfo.CurrentCulture, this.model.CanPickResourceOrName ? StringTable.CreateResourceDialogTitleResourceOptional : StringTable.CreateResourceDialogTitle, new object[1]
     {
         (object)this.model.ResourceType.Name
     });
     this.SizeToContent = SizeToContent.WidthAndHeight;
     this.keyNameWarningMessageBubble = new MessageBubbleHelper(LogicalTreeHelper.FindLogicalNode((DependencyObject)this, "Key_IsNamed") as UIElement, (IMessageBubbleValidator) new CreateResourceDialog.KeyNameValidator(this.model));
     if (!this.model.CanPickScope)
     {
         return;
     }
     if (this.model.SelectedLocation == this.model.ThisDocumentResourceDictionaries)
     {
         this.thisDocumentRadioButton.IsChecked = new bool?(true);
     }
     else if (this.model.SelectedLocation == this.model.ApplicationDocument)
     {
         this.applicationRootRadioButton.IsChecked = new bool?(true);
     }
     else
     {
         this.otherDocumentRadioButton.IsChecked = new bool?(true);
     }
 }
Exemple #7
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);
 }