예제 #1
0
        public User(string incomeName, DateTime incomeAge, ENSex incomeSex, ENCountry incomeCountry, bool drivingLicence, List <ENDriverLicence> driverLicences, bool childDiseases, List <ENChildDiseases> childrenDiseasesList, bool chronicDiseases, List <ENChronicDiseases> chronicDiseasesList)
        {
            Name            = incomeName;
            Age             = incomeAge;
            Sex             = incomeSex;
            Country         = incomeCountry;
            DrivingLicence  = drivingLicence;
            ChildDiseases   = childDiseases;
            ChronicDiseases = chronicDiseases;

            Parameters = new List <ParametresOfUser>();
            Products   = new List <Product>();
            Alcohols   = new List <Alcohol>();
            Cigarettes = new List <Cigarette>();

            DriverLicence        = new List <ENDriverLicence>();
            DriverLicence        = driverLicences;
            ChildrenDiseasesList = new List <ENChildDiseases>();
            ChildrenDiseasesList = childrenDiseasesList;
            ChronicDiseasesList  = new List <ENChronicDiseases> ();
            ChronicDiseasesList  = chronicDiseasesList;
        }
        protected override NWidget CreateExampleContent()
        {
            // create a view and get its grid
            m_View = new NTableGridView();
            NTableGrid grid = m_View.Grid;

            // bind the grid to the data source
            grid.DataSource = NDummyDataSource.CreatePersonsDataSource();

            // configure the master grid
            grid.AllowEdit = false;

            // assign some icons to the columns
            for (int i = 0; i < grid.Columns.Count; i++)
            {
                NDataColumn dataColumn = grid.Columns[i] as NDataColumn;
                if (dataColumn == null)
                {
                    continue;
                }

                NImage image = null;
                switch (dataColumn.FieldName)
                {
                case "Name":
                    image = NResources.Image__16x16_Contacts_png;
                    break;

                case "Gender":
                    image = NResources.Image__16x16_Gender_png;
                    break;

                case "Birthday":
                    image = NResources.Image__16x16_Birthday_png;
                    break;

                case "Country":
                    image = NResources.Image__16x16_Globe_png;
                    break;

                case "Phone":
                    image = NResources.Image__16x16_Phone_png;
                    break;

                case "Email":
                    image = NResources.Image__16x16_Mail_png;
                    break;

                default:
                    continue;
                }

                // NOTE: The CreateHeaderContentDelegate is invoked whenever the Title changes or the UpdateHeaderContent() is called.
                // you can use this event to create custom column header content
                dataColumn.CreateHeaderContentDelegate = delegate(NColumn theColumn)
                {
                    NPairBox pairBox = new NPairBox(image, theColumn.Title, ENPairBoxRelation.Box1BeforeBox2);
                    pairBox.Spacing = 2;
                    return(pairBox);
                };
                dataColumn.UpdateHeaderContent();
            }

            // create the custom detail that creates a widget displaying information about the row.
            // NOTE: The widget is created by the OnCustomDetailCreateWidget event handler.
            NMasterDetails masterDetails = grid.MasterDetails;

            NCustomDetail customDetail = new NCustomDetail();

            masterDetails.Details.Add(customDetail);

            customDetail.CreateWidgetDelegate = delegate(NCustomDetailCreateWidgetArgs arg)
            {
                // get information about the data source row
                string    name     = (string)arg.DataSource.GetValue(arg.RowIndex, "Name");
                ENGender  gender   = (ENGender)arg.DataSource.GetValue(arg.RowIndex, "Gender");
                DateTime  birthday = (DateTime)arg.DataSource.GetValue(arg.RowIndex, "Birthday");
                ENCountry country  = (ENCountry)arg.DataSource.GetValue(arg.RowIndex, "Country");
                string    phone    = (string)arg.DataSource.GetValue(arg.RowIndex, "Phone");
                string    email    = (string)arg.DataSource.GetValue(arg.RowIndex, "Email");

                // display the information as a widget
                NPairBox namePair     = new NPairBox("Name:", name);
                NPairBox genderPair   = new NPairBox("Gender:", gender.ToString());
                NPairBox birthdayPair = new NPairBox("Birthday:", birthday.ToString());
                NPairBox countryPair  = new NPairBox("Country:", country.ToString());
                NPairBox phonePair    = new NPairBox("Phone:", phone.ToString());
                NPairBox emailPair    = new NPairBox("Email:", email.ToString());

                NImageBox image = new NImageBox();
                switch (gender)
                {
                case ENGender.Male:
                    image.Image = Nevron.Nov.Examples.NResources.Image__256x256_MaleIcon_jpg;
                    break;

                case ENGender.Female:
                    image.Image = Nevron.Nov.Examples.NResources.Image__256x256_FemaleIcon_jpg;
                    break;

                default:
                    break;
                }

                NStackPanel infoStack = new NStackPanel();
                infoStack.VerticalSpacing = 2.0d;
                infoStack.Add(namePair);
                infoStack.Add(genderPair);
                infoStack.Add(birthdayPair);
                infoStack.Add(countryPair);
                infoStack.Add(phonePair);
                infoStack.Add(emailPair);

                NDockPanel dock = new NDockPanel();
                dock.Add(image, ENDockArea.Left);
                dock.Add(infoStack, ENDockArea.Center);

                // assign the widget to the event arguments.
                return(dock);
            };

            return(m_View);
        }
예제 #3
0
 public NAddressInfo(ENCountry country, string city, string address)
 {
     Country = country;
     City    = city;
     Address = address;
 }