private string SetRank(EnumCategory category) { char r; // char[] rk = { '\u25CF', '\u25BC', '\u2605' }; switch (category) { case EnumCategory.Circle: r = rk[0]; break; case EnumCategory.Triangle: r = rk[1]; break; case EnumCategory.Star: r = rk[2]; break; default: r = rk[0]; break; } return(r.ToString()); }
public void CarInstance() { //Arrange string manufacturerNameEx = "NewManufacturer"; Manufacturer manuEx = new Manufacturer { Name = manufacturerNameEx }; string modelNameEx = "NewModel"; double engineEx = 2; EnumCategory catEx = EnumCategory.Intermediate; Model model = new Model { Name = modelNameEx, Manufacturer = manuEx, Engine = engineEx, Category = catEx }; EnumColor colorEx = EnumColor.White; string plateEx = "qwe1234"; decimal priceEx = 50; //Act Car found = new Car { CarColor = colorEx, LicensePlate = plateEx, Model = model, Price = priceEx }; //Assert Assert.AreEqual(colorEx, found.CarColor); Assert.AreEqual(plateEx, found.LicensePlate); Assert.AreEqual(priceEx, found.Price); }
/* * PROCESS DESCRIPTION: Set the next state in the pipeline to the given value. * INPUT: { None } * PARAMETERS: { Next State Number (INT), Qualifier (BOOL), Enum Category (STRING), Enum List (STRING[]) } * OUTPUT: { None } */ public override void Process() { // Set the input to be the output by default this.Output = this.Input; // Determine whether or not the current input configuration is contained in the list of given series bool result = false; if (EnumCategory.Equals("Configuration", StringComparison.OrdinalIgnoreCase)) { result = EnumList.Contains((Configuration)this.Parameters["Configuration"]); } else if (EnumCategory.Equals("GlassType", StringComparison.OrdinalIgnoreCase)) { result = EnumList.Contains((GlassType)this.Parameters["GlassType"]); } else if (EnumCategory.Equals("Series", StringComparison.OrdinalIgnoreCase)) { result = EnumList.Contains((Series)this.Parameters["Series"]); } else if (EnumCategory.Equals("WallJamb", StringComparison.OrdinalIgnoreCase)) { result = EnumList.Contains((WallJamb)this.Parameters["WallJamb"]); } // Compare the results to the desired qualifer if (result == this.Qualifier) { // If the result matches the qualifier adjust the next state this.NextState = this.NextStateNumber; } }
public FullTime(String fname, String lname, String social_security, EnumDepartment department, EnumCategory category, Date hire_date, Date birthday, Address address, Phone home_ph, Phone cel_ph, String email, EnumPosition position, double asalary) : base(fname, lname, social_security, department, category, hire_date, birthday, address, home_ph, cel_ph, email) { this.position = position; this.annual_salary = asalary; }
public Internship(String fname, String lname, String social_security, EnumDepartment department, EnumCategory category, Date hire_date, Date birthday, Address address, Phone home_ph, Phone cel_ph, String email, EnumContractType temp_position, int contract_months, Double trimester_salary) : base(fname, lname, social_security, department, category, hire_date, birthday, address, home_ph, cel_ph, email, temp_position, contract_months) { this.trimester_salary = trimester_salary; }
public PartTime(String fname, String lname, String social_security, EnumDepartment department, EnumCategory category, Date hire_date, Date birthday, Address address, Phone home_ph, Phone cel_ph, String email, EnumContractType temp_position, int contract_months) : base(fname, lname, social_security, department, category, hire_date, birthday, address, home_ph, cel_ph, email) { this.temp_position = temp_position; this.contract_months = contract_months; }
public ConsultantTrainer(String fname, String lname, String social_security, EnumDepartment department, EnumCategory category, Date hire_date, Date birthday, Address address, Phone home_ph, Phone cel_ph, String email, EnumContractType temp_position, int contract_months, double hourly_salary, double week_hours) : base(fname, lname, social_security, department, category, hire_date, birthday, address, home_ph, cel_ph, email, temp_position, contract_months) { this.hourly_salary = hourly_salary; this.week_hours = week_hours; }
private (int Left, int Top) GetCoortinates(EnumCategory category, TrickCoordinate privateCoordinate) { int newLeft; int newTop; int x; if (privateCoordinate.Row == 1) { if (category == EnumCategory.Label) { newTop = 2; } else { newTop = 27;// i think 15 pixels for label. if i am wrong, can fix. } newLeft = 2; if (privateCoordinate.Column == 1) { return(newLeft, newTop); } var loopTo = privateCoordinate.Column; for (x = 2; x <= loopTo; x++) { newLeft += 150;// will do 150 pixels. that can always change as well. } return(newLeft, newTop); } if (privateCoordinate.Row != 2) { throw new BasicBlankException("Row not supported"); } if (category == EnumCategory.Label) { newTop = 200; } else { newTop = 225; } newLeft = 2; if (privateCoordinate.Column == 1) { return(newLeft, newTop); } var loopTo1 = privateCoordinate.Column; for (x = 2; x <= loopTo1; x++) { newLeft += 150;// will do 150 pixels. that can always change as well. } return(newLeft, newTop); }
private void CreateEmployee(string[] employee) { string name = employee[1].ToUpper().Trim(); //string stGrade = employee[0].ToLower().Trim(); int qty = employee[0].ToLower().Trim().Length; EnumCategory category = GetEnumCategory(employee[0].ToLower().Trim()); //switch (stGrade.Substring(0, 1)) //{ // case "o": // category = EnumCategory.Circle; // break; // case "^": // category = EnumCategory.Triangle; // break; // case "*": // category = EnumCategory.Star; // break; // default: // category = EnumCategory.Circle; // break; //} ////DbCorporationRepository corpoRepository = new DbCorporationRepository(); //corpoRepository.Create(name); ////_idCorporation = corpoRepository.Id; ////corpoRepository.Save(); //corpoRepository.Dispose(); //DbGradeRepository gradeRepository = new DbGradeRepository(); //_idGrade = gradeRepository.GetId(SetRank(category), qty); //gradeRepository.Dispose(); using (ILifetimeScope scope = _container.BeginLifetimeScope()) { IModel<Corporation> corpo = scope.Resolve<IModel<Corporation>>(); IGrade grade = scope.Resolve<IGrade>(); //grade.Category = category; grade.Quantity = qty; grade.Category = SetRank(category); corpo.Name = name; //corpo.Grade = grade; //Corporation = corpo; } }
public Employee(Employee emp) { this.fname = emp.fname; this.lname = emp.lname; this.social_security = emp.social_security; this.department = emp.department; this.category = emp.category; this.hire_date = emp.hire_date; this.birthday = emp.birthday; this.address = emp.address; this.home_ph = emp.home_ph; this.cel_ph = emp.cel_ph; this.email = emp.email; }
public Employee(String fname, String lname, String social_security, EnumDepartment department, EnumCategory category, Date hire_date, Date birthday, Address address, Phone home_ph, Phone cel_ph, String email) { this.fname = fname; this.lname = lname; this.social_security = social_security; this.department = department; this.category = category; this.hire_date = hire_date; this.birthday = birthday; this.address = address; this.home_ph = home_ph; this.cel_ph = cel_ph; this.email = email; }
public static Models.ImageSearchResult Search(string apikey, string searchTerm = "", EnumLanguage language = EnumLanguage.en, string id = "", EnumResponseGroup responseGroup = EnumResponseGroup.Image_Details, EnumImageType imageType = EnumImageType.All, EnumOrientation orientation = EnumOrientation.All, EnumCategory category = EnumCategory.All, int minWidth = 0, int minHeight = 0, bool EditorsChoice = false, bool SafeSearch = false, int Page = 1, int PerPage = 20 ) { if (string.IsNullOrEmpty(apikey)) { throw new System.ArgumentNullException("apiKey"); } try { Models.ImageSearchOptions options = new Models.ImageSearchOptions() { ApiKey = apikey, SearchTerm = searchTerm, Language = language, Id = id, ResponseGroup = responseGroup, ImageType = imageType, Orientation = orientation, Category = category, MinWidth = minWidth, MinHeight = minHeight, EditorsChoice = EditorsChoice, SafeSearch = SafeSearch, Page = Page, PerPage = PerPage }; return(SearchWithOptions(options)); } catch (System.Exception ex) { throw ex; } }
// This constructor is made for FileHandler purposes public Employee(String id, String fname, String lname, String social_security, String department, String category, Date hire_date, Date birthday, Address address, Phone home_ph, Phone cel_ph, String email, String contract) { this.id = Convert.ToInt16(id); this.fname = fname; this.lname = lname; this.social_security = social_security; this.department = (EnumDepartment)Enum.Parse(typeof(EnumDepartment), department); this.category = (EnumCategory)Enum.Parse(typeof(EnumCategory), category); this.hire_date = hire_date; this.birthday = birthday; this.address = address; this.home_ph = home_ph; this.cel_ph = cel_ph; this.email = email; this.contract = contract; }
public void ModelInstance() { //Arrange string manufacturerNameEx = "NewManufacturer"; Manufacturer manuEx = new Manufacturer { Name = manufacturerNameEx }; string modelNameEx = "NewModel"; double engineEx = 2; EnumCategory catEx = EnumCategory.Intermediate; //Act Model found = new Model { Name = modelNameEx, Manufacturer = manuEx, Engine = engineEx, Category = catEx }; //Assert Assert.AreEqual(modelNameEx, found.Name); Assert.AreEqual(engineEx, found.Engine); Assert.AreEqual(catEx, found.Category); Assert.AreEqual(manufacturerNameEx, found.Manufacturer.Name); }
private Corporation CreateEmployee(string[] employee) { string name = employee[1].ToUpper().Trim(); //string stGrade = employee[0].ToLower().Trim(); int qty = employee[0].ToLower().Trim().Length; EnumCategory category = GetEnumCategory(employee[0].ToLower().Trim()); Corporation corporation = Activator.CreateInstance <Corporation>(); using (ILifetimeScope scope = _container.BeginLifetimeScope()) { IModel <Corporation> corpo = scope.Resolve <IModel <Corporation> >(); IGrade grade = scope.Resolve <IGrade>(); //grade.Category = category; grade.Quantity = qty; grade.Category = SetRank(category); corporation.Name = name; corporation.Grade = (Grade)grade; return(corporation); } }
private static void CategoryPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { var thisItem = (CardGraphicsWPF)sender; thisItem.MainObject !.Category = (EnumCategory)e.NewValue; }
public void setCategory(EnumCategory category) { this.category = category; }
public Car(EnumCategory category, EnumModel model, int year) { Category = category; Model = model; Year = year; }
private static void CategoryPropertyChanged(BindableObject bindable, object oldValue, object newValue) { var thisItem = (CardGraphicsXF)bindable; thisItem.MainObject !.Category = (EnumCategory)newValue; }