Ejemplo n.º 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));
		}
Ejemplo n.º 2
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));
		}
Ejemplo n.º 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
             }
         }
         ;
     }
 }
Ejemplo n.º 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)));
        }
Ejemplo n.º 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)));
        }
Ejemplo n.º 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)));
        }
Ejemplo n.º 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;
			});
		}
Ejemplo n.º 9
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);
     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;
     });
 }
Ejemplo n.º 10
0
		public virtual IEnumerable<string> GetFlags(CollaborationContext context)
		{
			return sources.SelectMany(f => f.GetFlags(context));
		}
Ejemplo n.º 11
0
		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 };
		}
Ejemplo n.º 12
0
 public virtual IEnumerable <string> GetFlags(CollaborationContext context)
 {
     return(sources.SelectMany(f => f.GetFlags(context)));
 }
Ejemplo n.º 13
0
 public override IEnumerable <CollaborationMessage> GetMessages(N2.Edit.Collaboration.CollaborationContext context)
 {
     return(messages.Reverse().ToList());
 }
Ejemplo n.º 14
0
		public IEnumerable<string> GetFlags(CollaborationContext context)
		{
			return Children.FindParts("Collaboration")
				.OfType<IFlagSource>()
				.SelectMany(ms => ms.GetFlags(context));
		}
Ejemplo n.º 15
0
		public IEnumerable<CollaborationMessage> GetMessages(CollaborationContext context)
		{
			return Children.FindParts("Collaboration")
				.OfType<IMessageSource>()
				.SelectMany(ms => ms.GetMessages(context));
		}
Ejemplo n.º 16
0
 public abstract IEnumerable <CollaborationMessage> GetMessages(CollaborationContext context);
Ejemplo n.º 17
0
		public abstract IEnumerable<CollaborationMessage> GetMessages(CollaborationContext context);
Ejemplo n.º 18
0
		public IEnumerable<string> GetFlags(CollaborationContext context)
		{
			if (Flag != ManagementControlFlag.None)
				yield return Flag.ToString();
		}