Ejemplo n.º 1
0
        private bool LoadSampleDataSetFromProjectInfo(SampleDataCollection.SampleDataSetProjectInfo sampleDataInfo)
        {
            if (sampleDataInfo.XsdItem == null || sampleDataInfo.XamlItem == null || (!Microsoft.Expression.Framework.Documents.PathHelper.FileExists(sampleDataInfo.XsdItem.DocumentReference.Path) || !Microsoft.Expression.Framework.Documents.PathHelper.FileExists(sampleDataInfo.XamlItem.DocumentReference.Path)))
            {
                return(false);
            }
            bool          enableAtRuntime = !string.Equals(sampleDataInfo.XamlItem.Properties["BuildAction"], SampleDataSet.DesignTimeBuildType);
            SampleDataSet dataSet         = this.InstantiateSampleDataSet(sampleDataInfo.DataSetContext, sampleDataInfo.Name, enableAtRuntime);

            dataSet.Load();
            if (!dataSet.IsValid)
            {
                dataSet.Close();
                return(false);
            }
            this.dataSets.Add(dataSet);
            this.OnSampleDataAdded(dataSet);
            return(true);
        }