Example #1
0
 public void ShowReport(Microsoft.Reporting.WinForms.ReportViewer rptViewer)
 {
     var report=GenerateRdl();
     DumpRdl(report);
     rptViewer.Reset();
     rptViewer.LocalReport.DisplayName = string.IsNullOrEmpty(BuildReport.PageHeaderText) ? "Report" : BuildReport.PageHeaderText;
     rptViewer.LocalReport.LoadReportDefinition(report);
     rptViewer.LocalReport.DataSources.Clear();
     rptViewer.RefreshReport();
 }
 private bool CopyFileWithLogging(Microsoft.Build.Tasks.FileState sourceFileState, Microsoft.Build.Tasks.FileState destinationFileState)
 {
     bool exists = false;
     if (Directory.Exists(destinationFileState.Name))
     {
         base.Log.LogErrorWithCodeFromResources("Copy.DestinationIsDirectory", new object[] { sourceFileState.Name, destinationFileState.Name });
         return false;
     }
     if (Directory.Exists(sourceFileState.Name))
     {
         base.Log.LogErrorWithCodeFromResources("Copy.SourceIsDirectory", new object[] { sourceFileState.Name });
         return false;
     }
     string directoryName = Path.GetDirectoryName(destinationFileState.Name);
     if (((directoryName != null) && (directoryName.Length > 0)) && !Directory.Exists(directoryName))
     {
         base.Log.LogMessageFromResources(MessageImportance.Normal, "Copy.CreatesDirectory", new object[] { directoryName });
         Directory.CreateDirectory(directoryName);
     }
     if (this.overwriteReadOnlyFiles)
     {
         this.MakeFileWriteable(destinationFileState, true);
         exists = destinationFileState.Exists;
     }
     bool flag2 = false;
     if (this.UseHardlinksIfPossible)
     {
         base.Log.LogMessageFromResources(MessageImportance.Normal, "Copy.HardLinkComment", new object[] { sourceFileState.Name, destinationFileState.Name });
         if (!this.overwriteReadOnlyFiles)
         {
             exists = destinationFileState.Exists;
         }
         if (exists && !IsMatchingSizeAndTimeStamp(sourceFileState, destinationFileState))
         {
             Microsoft.Build.Shared.FileUtilities.DeleteNoThrow(destinationFileState.Name);
         }
         flag2 = Microsoft.Build.Tasks.NativeMethods.CreateHardLink(destinationFileState.Name, sourceFileState.Name, IntPtr.Zero);
         if (!flag2)
         {
             Exception exceptionForHR = Marshal.GetExceptionForHR(Marshal.GetHRForLastWin32Error());
             base.Log.LogMessageFromResources(MessageImportance.Low, "Copy.RetryingAsFileCopy", new object[] { sourceFileState.Name, destinationFileState.Name, exceptionForHR.Message });
         }
     }
     if (!flag2)
     {
         base.Log.LogMessageFromResources(MessageImportance.Normal, "Copy.FileComment", new object[] { sourceFileState.Name, destinationFileState.Name });
         File.Copy(sourceFileState.Name, destinationFileState.Name, true);
     }
     destinationFileState.Reset();
     this.MakeFileWriteable(destinationFileState, false);
     return true;
 }
 private void MakeFileWriteable(Microsoft.Build.Tasks.FileState file, bool logActivity)
 {
     if (file.Exists && file.IsReadOnly)
     {
         if (logActivity)
         {
             base.Log.LogMessageFromResources(MessageImportance.Low, "Copy.RemovingReadOnlyAttribute", new object[] { file.Name });
         }
         File.SetAttributes(file.Name, FileAttributes.Normal);
         file.Reset();
     }
 }
Example #4
0
 public void ShowReport(Microsoft.Reporting.WinForms.ReportViewer rptViewer)
 {
     if (m_dataSet == null)
     {
         m_dataSet = new DataTable();
         m_dataSet.Columns.Add("JustForNoError");
     }
     GetColumns();
     rptViewer.Reset();
     rptViewer.LocalReport.DisplayName = string.IsNullOrEmpty(Rdl.PageHeaderText) ? "Report" : Rdl.PageHeaderText;
     rptViewer.LocalReport.LoadReportDefinition(m_rdl);
     rptViewer.LocalReport.DataSources.Clear();
     rptViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("MyData", m_dataSet));
     rptViewer.RefreshReport();
 }