Пример #1
0
		public IEnumerable<string> GetFlags(CollaborationContext context)
		{
			if (context.SelectedItem == null)
				return new string[0];

			return N2.Find.EnumerateParents(context.SelectedItem, lastAncestor: null, includeSelf: true)
				.OfType<IFlagSource>()
				.SelectMany(ms => ms.GetFlags(context));
		}
		public override IEnumerable<CollaborationMessage> GetMessages(CollaborationContext context)
		{
			if (context.SelectedItem == null)
				return CollaborationMessage.None;

			return Find.EnumerateParents(context.SelectedItem, null, includeSelf: true)
				.OfType<IMessageSource>()
				.SelectMany(ms => ms.GetMessages(context));
		}
Пример #3
0
		public IEnumerable<string> GetFlags(CollaborationContext context)
		{
			if (context.SelectedItem == null)
				return new string[0];

			return Content.Traverse.Ancestors(context.SelectedItem, lastAncestor: null)
				.OfType<IFlagSource>()
				.SelectMany(ms => ms.GetFlags(context));
		}
     public override IEnumerable <CollaborationMessage> GetMessages(N2.Edit.Collaboration.CollaborationContext context)
     {
         if (SqlBucketRepository.AdoExceptionDetected.HasValue)
         {
             yield return new CollaborationMessage {
                        Title = "Statistics error", Updated = SqlBucketRepository.AdoExceptionDetected.Value, Alert = false, Text = "An error was logged when saving or retrieving statistics. <a href='/n2/installation/upgrade.aspx'>An upgrade might be required to set up statistics. <b class='ico fa fa-external-link'></b></a>", RequiredPermission = Security.Permission.Administer
             }
         }
         ;
     }
 }
Пример #5
0
        public IEnumerable <string> GetFlags(CollaborationContext context)
        {
            if (context.SelectedItem == null)
            {
                return(new string[0]);
            }

            return(N2.Find.EnumerateParents(context.SelectedItem, lastAncestor: null, includeSelf: true)
                   .OfType <IFlagSource>()
                   .SelectMany(ms => ms.GetFlags(context)));
        }
Пример #6
0
        public override IEnumerable <CollaborationMessage> GetMessages(CollaborationContext context)
        {
            if (context.SelectedItem == null)
            {
                return(CollaborationMessage.None);
            }

            return(Find.EnumerateParents(context.SelectedItem, null, includeSelf: true)
                   .OfType <IMessageSource>()
                   .SelectMany(ms => ms.GetMessages(context)));
        }
Пример #7
0
        public IEnumerable <string> GetFlags(CollaborationContext context)
        {
            if (context.SelectedItem == null)
            {
                return(new string[0]);
            }

            return(Content.Traverse.Ancestors(context.SelectedItem, lastAncestor: null)
                   .OfType <IFlagSource>()
                   .SelectMany(ms => ms.GetFlags(context)));
        }
Пример #8
0
		public override IEnumerable<CollaborationMessage> GetMessages(CollaborationContext context)
		{
			var messages = sources.SelectMany(s => s.GetMessages(context).Select(m => new { m, s }));
			if (context.LastDismissed > DateTime.MinValue)
				messages = messages.Where(x => x.m.Updated > context.LastDismissed);
			return messages.Select(x => 
			{ 
				x.m.Source = x.s.GetInfo();
				if (x.m.Source.SupportsDelete && !security.IsAdmin(context.User))
					x.m.Source.SupportsDelete = false;
				return x.m;
			});
		}
 public override IEnumerable<CollaborationMessage> GetMessages(CollaborationContext context)
 {
     var messages = sources.SelectMany(s => s.GetMessages(context).Select(m => new { m, s }));
     if (context.LastDismissed > DateTime.MinValue)
         messages = messages.Where(x => x.m.Updated > context.LastDismissed);
     messages = messages.Where(m => security.IsAuthorized(context.User, m.m.RequiredPermission));
     return messages.Select(x =>
     {
         x.m.Source = x.s.GetInfo();
         if (x.m.Source.SupportsDelete && !security.IsAdmin(context.User))
             x.m.Source.SupportsDelete = false;
         return x.m;
     });
 }
Пример #10
0
		public virtual IEnumerable<string> GetFlags(CollaborationContext context)
		{
			return sources.SelectMany(f => f.GetFlags(context));
		}
		public IEnumerable<CollaborationMessage> GetMessages(CollaborationContext context)
		{
			if (this.IsPublished())
				yield return new CollaborationMessage { ID = ID.ToString(), Title = Title, Alert = Alert, Text = (Text ?? "").Replace(Environment.NewLine, "<br/>"), Updated = Updated };
		}
Пример #12
0
 public virtual IEnumerable <string> GetFlags(CollaborationContext context)
 {
     return(sources.SelectMany(f => f.GetFlags(context)));
 }
Пример #13
0
 public override IEnumerable <CollaborationMessage> GetMessages(N2.Edit.Collaboration.CollaborationContext context)
 {
     return(messages.Reverse().ToList());
 }
Пример #14
0
		public IEnumerable<string> GetFlags(CollaborationContext context)
		{
			return Children.FindParts("Collaboration")
				.OfType<IFlagSource>()
				.SelectMany(ms => ms.GetFlags(context));
		}
Пример #15
0
		public IEnumerable<CollaborationMessage> GetMessages(CollaborationContext context)
		{
			return Children.FindParts("Collaboration")
				.OfType<IMessageSource>()
				.SelectMany(ms => ms.GetMessages(context));
		}
Пример #16
0
 public abstract IEnumerable <CollaborationMessage> GetMessages(CollaborationContext context);
Пример #17
0
		public abstract IEnumerable<CollaborationMessage> GetMessages(CollaborationContext context);
Пример #18
0
		public IEnumerable<string> GetFlags(CollaborationContext context)
		{
			if (Flag != ManagementControlFlag.None)
				yield return Flag.ToString();
		}