コード例 #1
0
        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));
        }
コード例 #2
0
 private string BrowseForXmlFile(string dialogTitle)
 {
     try
     {
         string path = this.dataPanelModel.XmlDataSourceFolderManager.Path;
         string str  = XmlDataSourceDialogModel.BrowseForXmlFile(dialogTitle, ref path);
         this.dataPanelModel.XmlDataSourceFolderManager.Path = path;
         return(str);
     }
     catch (Exception ex)
     {
         this.ViewModel.DesignerContext.MessageDisplayService.ShowError(new ErrorArgs()
         {
             Message = string.Format((IFormatProvider)CultureInfo.CurrentCulture, StringTable.CommandFailedDialogMessage, new object[1]
             {
                 (object)dialogTitle
             }),
             Exception = ex
         });
     }
     return((string)null);
 }
コード例 #3
0
 public DataSourceNameValidator(XmlDataSourceDialogModel model)
 {
     this.model = model;
 }