Пример #1
0
        /// <summary>
        /// Creates a new object that is a deep copy of the current instance.
        /// </summary>
        public object Clone()
        {
            ActivityFilter clone = this.MemberwiseClone() as ActivityFilter;

            clone.SectorIds      = new List <int>(this.SectorIds);
            clone.ActivityIds    = new List <int>(this.ActivityIds);
            clone.SubActivityIds = new List <int>(this.SubActivityIds);

            return(clone);
        }
Пример #2
0
 /// <summary>
 /// Will set the layerlist based on activityfilter
 /// </summary>
 public void SetLayers(ActivityFilter activityfilter)
 {
     if (activityfilter != null)
     {
         if (!activityfilter.ActivityType.Equals(ActivityFilter.Type.AnnexI))
         {
             this.Layers = ActivityFilter.AllSectorsID.ToString();
         }
         else if (activityfilter.SearchLevel() == ActivityFilter.Level.All)
         {
             this.Layers = ActivityFilter.AllSectorsID.ToString();
         }
         else
         {
             IEnumerable <LOV_ANNEXIACTIVITY> list = ListOfValues.GetAnnexIActivities(activityfilter.SectorIds);
             if (list.Count() > 0)
             {
                 this.Layers = String.Empty;
                 foreach (LOV_ANNEXIACTIVITY item in list)
                 {
                     if (String.IsNullOrEmpty(this.Layers))
                     {
                         this.Layers += "sector" + item.Code;
                     }
                     else
                     {
                         this.Layers += ",sector" + item.Code;
                     }
                 }
             }
             else
             {
                 this.Layers = ActivityFilter.AllSectorsID.ToString();
             }
         }
     }
     else
     {
         this.Layers = ActivityFilter.AllSectorsID.ToString(); //all sectors
     }
 }