internal CreateControlDialog(DesignerContext designerContext, CreateResourceModel model)
     : base(designerContext, model)
 {
     this.Title = StringTable.MakeControlDialogTitle;
     this.typeChooserContainer            = (Grid)LogicalTreeHelper.FindLogicalNode((DependencyObject)this, "TypeSelectorComponent");
     this.typeChooserContainer.Visibility = Visibility.Visible;
     this.assetViewContainer             = (OnDemandControl)LogicalTreeHelper.FindLogicalNode((DependencyObject)this, "AssetViewContainer");
     this.assetViewContainer.DataContext = (object)designerContext.AssetLibrary;
     this.assetViewContainer.Visibility  = Visibility.Visible;
 }
        public int IndexInResourceSite(DocumentNode node)
        {
            ResourceSite currentResourceSite = this.CurrentResourceSite;

            if (currentResourceSite != null)
            {
                DocumentCompositeNode resourcesDictionary = currentResourceSite.ResourcesDictionary;
                if (resourcesDictionary != null)
                {
                    return(CreateResourceModel.IndexInResourceSite(node, resourcesDictionary));
                }
            }
            return(-1);
        }
 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);
     }
 }
 public KeyNameValidator(CreateResourceModel model)
 {
     this.model = model;
     this.model.PropertyChanged += new PropertyChangedEventHandler(this.model_PropertyChanged);
 }