Example #1
0
 void Menu_Click(object sender, RoutedEventArgs e)
 {
     if (!CheckInputs())
     {
         this.popup.IsOpen         = true;
         this.popup_textblock.Text = string.Empty;
         if (!CheckTextBlock(inputNumber))
         {
             this.popup_textblock.Text += "Проверьте свой идентифиционный номер\n";
         }
         if (!CheckTextBlock(inputLastName))
         {
             this.popup_textblock.Text += "Проверьте свою фамилию\n";
         }
         if (!CheckTextBlock(inputFirstName))
         {
             this.popup_textblock.Text += "Проверьте свое имя\n";
         }
         if (!CheckTextBlock(inputPName))
         {
             this.popup_textblock.Text += "Проверьте свое отчество\n";
         }
         e.Handled = true;
         return;
     }
     try {
         MemberFactory.Create(uint.Parse(inputNumber.Text)
                              , string.Format("{0} {1} {2}", inputLastName.Text, inputFirstName.Text, inputPName.Text));
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message);
     }
 }
 protected override void AddOrRemoveMembersFrom(List <IMember> selectedMembers, INode parent, string parentPath, MemberSelectionContext context)
 {
     foreach (MemberInfo memberInfo in context.Type.GetNonPrivateMembers(MemberVisibility.Public | MemberVisibility.Internal))
     {
         var memberPath = new MemberPath(context.Type, memberInfo.DeclaringType, parentPath.Combine(memberInfo.Name));
         if (memberToInclude.IsSameAs(memberPath) || memberToInclude.IsParentOrChildOf(memberPath))
         {
             selectedMembers.Add(MemberFactory.Create(memberInfo, parent));
         }
     }
 }
Example #3
0
        public IEnumerable <IMember> SelectMembers(INode currentNode, IEnumerable <IMember> selectedMembers,
                                                   MemberSelectionContext context)
        {
            var members = new List <IMember>(selectedMembers);

            foreach (MemberInfo memberInfo in currentNode.Type.GetNonPrivateMembers(MemberVisibility.Public | MemberVisibility.Internal))
            {
                IMember member = MemberFactory.Create(memberInfo, currentNode);
                if (predicate(new MemberToMemberInfoAdapter(member)))
                {
                    if (!members.Any(p => p.IsEquivalentTo(member)))
                    {
                        members.Add(member);
                    }
                }
            }

            return(members);
        }