Exemplo n.º 1
0
        /// <summary>
        /// Add or replace Report Info
        /// If exists, replace existing item with fresh object.
        /// If new, create one and add to the list.
        /// Replace should not come to play, but if neeeded here it is
        /// </summary>
        /// <param name="reportPath">Report to add to list</param>
        public void AddOrReplaceReport(string reportPath)
        {
            RndReportInfo repInfo = new RndReportInfo(reportPath, false, false);

            lock (objectlock)
            {
                if (Reports.Contains(reportPath))
                {
                    if (ReportsInfo.ContainsKey(reportPath))
                    {
                        ReportsInfo[repInfo.ItemPath] = repInfo;
                    }
                }
                else
                {
                    Reports.Add(reportPath);
                    if (ReportsInfo.ContainsKey(reportPath))
                    {
                        ReportsInfo[repInfo.ItemPath] = repInfo;
                    }
                    else
                    {
                        ReportsInfo.Add(reportPath, repInfo);
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Add report info to the list as well as to Reports List
        /// </summary>
        /// <param name="info">Report Information Object</param>
        public void AddReportInfo(RndReportInfo info)
        {
            string reportPath = info.ItemPath;

            lock (objectlock)
            {
                if (Reports.Contains(reportPath))
                {
                    if (ReportsInfo.ContainsKey(reportPath))
                    {
                        ReportsInfo[reportPath] = info;
                    }
                }
                else
                {
                    if (ReportsInfo.ContainsKey(reportPath))
                    {
                        ReportsInfo[reportPath] = info;
                    }
                    else
                    {
                        ReportsInfo.Add(reportPath, info);
                    }
                }
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Update report information.
 /// If aleady exists, just replace, else add
 /// </summary>
 /// <param name="repInfo">Report Information</param>
 public void UpdateReport(RndReportInfo repInfo)
 {
     lock (objectlock)
     {
         if (!Reports.Contains(repInfo.ItemPath))
         {
             Reports.Add(repInfo.ItemPath);
             ReportsInfo.Add(repInfo.ItemPath, repInfo);
         }
         else
         {
             if (ReportsInfo.ContainsKey(repInfo.ItemPath))
             {
                 ReportsInfo[repInfo.ItemPath] = repInfo;
             }
         }
     }
 }