Exemplo n.º 1
0
    void AddToDoItem(string desc)
    {
        var item = new ToDoItem(desc);

        _listItems.Add(item);
        ViewModel.ListItems.Add(item);
    }
Exemplo n.º 2
0
 internal void AddRecord(TNoteRecord aRecord, int aRow)
 {
     for (int i = Count; i <= aRow; i++)
     {
         FList.Add(CreateRecord());
     }
     this[aRow].Add(aRecord);
 }
Exemplo n.º 3
0
 internal void CopyFrom(TVPageBreakList aBreakList)
 {
     if (aBreakList == null)
     {
         return;
     }
     if (aBreakList.FList == FList)
     {
         XlsMessages.ThrowException(XlsErr.ErrInternal);                            //Should be different objects
     }
     for (int i = 0; i < aBreakList.RealCount(); i++)
     {
         FList.Add(aBreakList[i].CopyTo());
     }
 }
Exemplo n.º 4
0
        public async Task CheckAlt(SocketGuildUser arg)
        {
            if (IsAlt(arg))
            {
                EmbedBuilder b = new EmbedBuilder()
                {
                    Title       = "Alt Alert",
                    Description = $"The account **{arg.ToString()}** has been flagged down becuase it is was created less than 12 hours ago",
                    Fields      = new List <EmbedFieldBuilder>()
                    {
                        { new EmbedFieldBuilder()
                          {
                              IsInline = true,
                              Name     = "Username and ID",
                              Value    = $"{arg.ToString()} ({arg.Id})"
                          } },
                        { new EmbedFieldBuilder()
                          {
                              IsInline = true,
                              Name     = "Created at (UTC)",
                              Value    = arg.CreatedAt.UtcDateTime.ToString()
                          } },
                        { new EmbedFieldBuilder()
                          {
                              IsInline = true,
                              Name     = "Joined at (UTC)",
                              Value    = arg.JoinedAt.Value.UtcDateTime.ToString()
                          } }
                    },
                    Color = Color.Orange,
                };
                await _client.GetGuild(Global.SwissGuildId).GetTextChannel(665647956816429096).SendMessageAsync("", false, b.Build());

                if (!Global.VerifyAlts)
                {
                    EmbedBuilder eb = new EmbedBuilder()
                    {
                        Title       = "Manual Verification",
                        Description = "This user was flagged down because it was created less than 12 hours ago",
                        Color       = Color.Red
                    };
                    b.Fields.Add(new EmbedFieldBuilder()
                    {
                        Name  = "Join at UTC",
                        Value = arg.JoinedAt.Value.UtcDateTime
                    });
                    b.Fields.Add(new EmbedFieldBuilder()
                    {
                        Name  = "Created at UTC",
                        Value = arg.CreatedAt.UtcDateTime
                    });
                    b.Fields.Add(new EmbedFieldBuilder()
                    {
                        Name  = "Username",
                        Value = arg.ToString()
                    });
                    string anick = "None";
                    if (arg.Nickname != null)
                    {
                        anick = arg.Nickname;
                    }
                    b.Fields.Add(new EmbedFieldBuilder()
                    {
                        Name  = "Nickname",
                        Value = anick
                    });
                    b.Fields.Add(new EmbedFieldBuilder()
                    {
                        Name  = "ID",
                        Value = arg.Id
                    });

                    var msg = await _client.GetGuild(Global.SwissGuildId).GetTextChannel(692909459831390268).SendMessageAsync("", false, b.Build());

                    await msg.AddReactionAsync(new Emoji("✅"));

                    await msg.AddReactionAsync(new Emoji("❌"));

                    FList.Add(msg.Id, arg.Id);
                    Global.SaveAltCards();
                    await arg.SendMessageAsync("", false, new EmbedBuilder()
                    {
                        Color       = Color.Red,
                        Title       = "**Uh oh, am I smelling an alt?**",
                        Description = "Dont worry, you are not under arrest.\nYour account was detected to be an alt. The staff team will manually have to verify you.\n\nSit Tight!"
                    }.Build());

                    return;
                }
            }
        }
Exemplo n.º 5
0
 public override void AddBreak(int RowCol, int MinColRow, int MaxColRow, bool aGoesAfter)
 {
     FList.Add(new TVPageBreak(RowCol, MinColRow, MaxColRow, false, aGoesAfter));
 }
Exemplo n.º 6
0
        public string ToIndent()
        {
            Action<Node> na;
            Action<List<Node>> nsa = null;
            const string ind = "    ";
            FList<string> inds = new FList<string>();
            StringBuilder b = new StringBuilder();

            na = delegate(Node n)
            {
                if (n.Leaf != null)
                {
                    b
                        .Append(inds.Deriv(Cty.ToLine))
                        .Append(n.Leaf)
                        .AppendLine();
                }
                else if (n.Branches != null)
                {
                    if (n != this) inds.Add(ind);
                    nsa(n.Branches);
                    if (n != this) inds.RemoveAt(inds.Count - 1);
                }
            };

            nsa = delegate(List<Node> ns)
            {
                if (ns.Count == 0) return;

                bool isPrevBranch = ns[0].Branches != null;
                na(ns[0]);
                for (int i = 1; i < ns.Count; i++)
                {
                    if (isPrevBranch && ns[i].Branches != null)
                    {
                        b
                            .Append(inds.Deriv(Cty.ToLine))
                            .Append(ind)
                            .AppendLine();
                    }
                    isPrevBranch = ns[i].Branches != null;
                    na(ns[i]);
                }
            };

            na(this);

            return b.ToString();
        }