private SQLiteConnection CreateConnection(DataLinkParams dlp)
        {
            ConnectionStringParser csp = ConnectionStringParser.Parse(dlp.ConnectionString);

            if (csp == null)
            {
                return(null);
            }
            string dataBasePath = csp.GetDataLocation();

            if (string.IsNullOrEmpty(dataBasePath))
            {
                return(null);
            }
            StorageFolder basePath     = C1FlexReport.GetActualBasePath(dlp.Report);
            StorageFile   dataBaseFile = FileNameParser.ReplaceSpecialFolderTags(dataBasePath, basePath);

            if (dataBaseFile == null)
            {
                return(null);
            }

            try
            {
                return(new SQLiteConnection(dataBaseFile.Path, SQLiteOpenFlags.ReadOnly));
            }
            catch
            {
                return(null);
            }
        }
示例#2
0
 public void ApplyChanges()
 {
     if (radioNone.Checked)
     {
         _pictureHolder = PictureHolder.FromObject(null, null);
     }
     else if (radioFile.Checked)
     {
         _pictureHolder = PictureHolder.FromFile(txtFile.Text, C1FlexReport.GetActualBasePath(_report));
     }
     else if (radioURL.Checked)
     {
         _pictureHolder = PictureHolder.FromUrl(txtURL.Text, C1FlexReport.GetActualBasePath(_report));
     }
     else if (radioExpression.Checked)
     {
         _pictureHolder = PictureHolder.FromExpression(cmbExpression.Expression);
     }
 }