//按键列表 private void LoadPatternDataButton() { TabletComparerByTag TagComparer = new TabletComparerByTag(); foreach (Control ctl in this.Controls) { if (ctl is Tablet) { Tablet Tab = ctl as Tablet; if (Tab.Tag != null) { TabList.Add(Tab); } } } TabList.Sort(TagComparer); }
public void Push_when_no_bucket_exists_yet_creates_bucket_then_returns_hash() { var mock = new MockFileSystem(); mock.Directory.SetCurrentDirectory(@"C:\Temp"); var sut = new Tablet(mock); sut.Init(); var p1 = sut.Push(new Fake { Value = 1 }, k => k.Value); Assert.Equal("356a192b7913b04c54574d18c28d46e6395428ab", p1); Assert.True(mock.File.Exists(@"C:\Temp\.tablet\objects\35\6a192b7913b04c54574d18c28d46e6395428ab"), "File does not exist."); }
// GET: Tablets/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Tablet tablet = db.Tablets.Find(id); if (tablet == null) { return(HttpNotFound()); } var tabletViewModel = Mapper.Map <TabletViewModel>(tablet); return(View(tabletViewModel)); }
static Tablet Create() { Tablet t = new Tablet(); Console.WriteLine("Введите модель"); t.Model = Console.ReadLine(); Console.WriteLine("Введите объем памяти"); t.VolumeMemory = int.Parse(Console.ReadLine()); Console.WriteLine("Введите рейтинг"); t.Rating = int.Parse(Console.ReadLine()); Console.WriteLine("Введите стоимость"); t.Cost = decimal.Parse(Console.ReadLine()); return(t); }
/// <summary> /// Occurs when the stylus touches the digitizer surface. /// </summary> /// <param name="sender">The real time stylus associated with the notification</param> /// <param name="data">The notification data</param> void IStylusSyncPlugin.StylusDown(RealTimeStylus sender, StylusDownData data) { //Debug.WriteLine("StylusDown"); Tablet currentTablet = sender.GetTabletFromTabletContextId(data.Stylus.TabletContextId); if (currentTablet.DeviceKind == TabletDeviceKind.Touch) { // The stylus id int stylusId = data.Stylus.Id; // Store the packets in the collected packets List <int> collected = new List <int>(data.GetData()); this.collectedPacketsTable[stylusId] = collected; // Store the tablet properties this.tabletPropertiesTable[stylusId] = sender.GetTabletPropertyDescriptionCollection(data.Stylus.TabletContextId); } }
public ActionResult TabletMaintenance(Int32?Id) { ViewBag.Header = "Tablet"; if (Id.HasValue) { ViewBag.TabletId = Id; ViewBag.Caption = "Edit"; ApplicationDBContext db = new ApplicationDBContext(); Tablet Tablet = db.ProductModels.OfType <Tablet>().Where(t => t.Id == Id).FirstOrDefault(); return(View(Tablet)); } else { ViewBag.TabletId = 0; ViewBag.Caption = "New"; return(View(new Tablet())); } }
public async Task <IActionResult> Create([Bind("Model,SerialNumber,SoftWareId,EquipUserId,ManufactureId")] Tablet tablet) { int[] ids = _context.Tablets.Select(s => s.Id).ToArray(); tablet.Id = ids.Max() + 1; if (ModelState.IsValid) { _context.Add(tablet); await _context.SaveChangesAsync(); _logger.LogInformation("was created tablets " + tablet.Model + " " + tablet.SerialNumber); return(RedirectToAction(nameof(Index))); } ViewData["EquipUserId"] = new SelectList(_context.EquipUsers, "Id", "FullName", tablet.EquipUserId); ViewData["ManufactureId"] = new SelectList(_context.Manufactures, "Id", "Name", tablet.ManufactureId); ViewData["SoftWareId"] = new SelectList(_context.SoftWares, "Id", "Name", tablet.SoftWareId); return(View(tablet)); }
private void ManageTabletClick() { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Input.GetMouseButtonDown(0)) { RaycastHit hit; if (Physics.Raycast(ray, out hit, 200f)) { Tablet tablet = hit.collider.GetComponent <Tablet>(); if (tablet != null) { SM.Switch(WorldStateMachine.StateName.RollCall); Debug.Log("tablet"); } } } }
private void btnCreate_Click(object sender, EventArgs e) { Tablet t = new Tablet(); t.Model = txtBxModel.Text; t.Cost = decimal.Parse(txtBxCost.Text); t.Rating = int.Parse(txtBxRating.Text); t.VolumeMemory = int.Parse(txtBxMemory.Text); _tablets.Add(t); UpdateGrid(); txtBxCost.Clear(); txtBxMemory.Clear(); txtBxModel.Clear(); txtBxRating.Clear(); }
public static void PopulateAudioPrograms(Sim actor, ref InteractionInstanceParameters parameters, out List <ObjectPicker.TabInfo> listObjs, out List <ObjectPicker.HeaderInfo> headers, out int NumSelectableRows) { NumSelectableRows = 0x1; headers = new List <ObjectPicker.HeaderInfo>(); listObjs = new List <ObjectPicker.TabInfo>(); headers.Add(new ObjectPicker.HeaderInfo(Tablet.sLocalizationKeyAudio + ":Title", "Ui/Tooltip/ObjectPicker:Name", 0xfa)); List <ObjectPicker.RowInfo> rowInfo = new List <ObjectPicker.RowInfo>(); SkillNames[] collection = new SkillNames[] { SkillNames.Charisma, SkillNames.Cooking, SkillNames.Gardening, SkillNames.Guitar, SkillNames.Handiness, SkillNames.Nectar }; List <SkillNames> list2 = new List <SkillNames>(collection); foreach (Skill staticSkill in SkillManager.SkillDictionary) { if (staticSkill.IsHiddenSkill(actor.SimDescription.GetCASAGSAvailabilityFlags())) { continue; } // Don't include my custom skills as they increase points differently if (staticSkill.GetType().Assembly.FullName.Contains("NRaas")) { continue; } Skill element = actor.SkillManager.GetElement(staticSkill.Guid); if ((element == null) || !element.ReachedMaxLevel()) { string title = staticSkill.Name; if (Localization.HasLocalizationString(Tablet.sLocalizationKeyAudio + ":" + staticSkill.Guid)) { title = Localization.LocalizeString(Tablet.sLocalizationKeyAudio + ":" + staticSkill.Guid, new object[0]); } List <ObjectPicker.ColumnInfo> columnInfo = new List <ObjectPicker.ColumnInfo>(); ThumbnailKey thumbnail = new ThumbnailKey(staticSkill.IconKey, ThumbnailSize.Medium); columnInfo.Add(new ObjectPicker.ThumbAndTextColumn(thumbnail, title)); ObjectPicker.RowInfo info = new ObjectPicker.RowInfo(staticSkill.Guid, columnInfo); rowInfo.Add(info); } } ObjectPicker.TabInfo item = new ObjectPicker.TabInfo("Coupon", Tablet.LocalizeAudioProgram("TabName", new object[0x0]), rowInfo); listObjs.Add(item); }
private void Overlay_NewPackets(object sender, InkCollectorNewPacketsEventArgs e) { /*** THIS ROUTINE MUST BE EXTREMELY FAST ***/ /* * Since we are handling a flurry of packet * data, this routine should not perform any * significant processing, just data recording. * * Asynchronous invocation on the windows forms * thread is used to delay as much sample * processing as possible. */ //go over the packet data and store InkSamples int[] PacketData = e.PacketData; if (PacketData[2] == 0) //new stroke since timer is 0; use the internal timer to compute the time of the first packet { //check if the packets have pressure data Tablet CurrentTablet = e.Cursor.Tablet; Overlay_NewPackets_PacketsHavePressure = CurrentTablet != null && CurrentTablet.IsPacketPropertySupported(PacketProperty.NormalPressure); //raise the NewInkSample event with an invalid ink sample to signal a new stroke to listeners _Overlay.AttachedControl.BeginInvoke(new NewRawInkSampleHandler(OnNewRawInkSample), new RawInkSample(_Timer.Now())); } for (int i = 0; i < PacketData.Length;) { RawInkSample s = new RawInkSample(); s.Time = _Timer.Now(); s.X = PacketData[i++]; s.Y = PacketData[i++]; i++; //skip the timer sample s.Pressure = Overlay_NewPackets_PacketsHavePressure ? PacketData[i++] : 0; //have the form thread raise the NewInkSample event at its convenience _Overlay.AttachedControl.BeginInvoke(new NewRawInkSampleHandler(OnNewRawInkSample), s); } }
bool CreateTablet() { if (Tablet == null) { try { Tablet = new Tablet(); Tablet.PacketArrival += new Tablet.PacketArrivalEventHandler(Tablet_PacketArrival); Tablet.ProximityChange += new Tablet.ProximityChangeEventHandler(Tablet_ProximityChange); } catch (Exception e) { Tablet = null; FHost.Log(TLogType.Error, e.Message); return(false); } } return(true); }
//static void Main(string[] args) //{ // Console.WriteLine("Введите элементы первого множества (через пробел): "); // string enteredSet = Console.ReadLine(); // string[] items = enteredSet.Split(' '); // int[] enteredItems = new int[items.Length]; // for (int i = 0; i < items.Length; i++) // { // enteredItems[i] = Convert.ToInt32(items[i]); // } // Set firstSet = new Set(enteredItems); // Console.WriteLine(); // Console.WriteLine("Введите элементы второго множества (через пробел): "); // enteredSet = Console.ReadLine(); // items = enteredSet.Split(' '); // enteredItems = new int[items.Length]; // for (int i = 0; i < items.Length; i++) // { // enteredItems[i] = Convert.ToInt32(items[i]); // } // Set secondSet = new Set(enteredItems); // Console.WriteLine(); // bool exit = false; // do // { // Console.Write($"Выберите множество, на основе которого хотите проверить подмножество (0 для пропуска этого условия): "); // int choice = Convert.ToInt32(Console.ReadLine()); // switch (choice) // { // case 0: // { // exit = true; // break; // } // case 1: // { // Console.WriteLine($"Первое множество: "); // firstSet.ShowSet(); // Console.WriteLine($"Проверка на принадлежность подмножества первому множеству\n (Введите элементы подмножества через пробел): "); // enteredSet = Console.ReadLine(); // items = enteredSet.Split(' '); // enteredItems = new int[items.Length]; // for (int i = 0; i < items.Length; i++) // { // enteredItems[i] = Convert.ToInt32(items[i]); // } // Console.WriteLine(); // if (enteredItems > firstSet) Console.WriteLine($"Введённое множество является подмножеством данного множества\n"); // else Console.WriteLine($"Введённое множество не является подмножеством данного множества\n"); // break; // } // case 2: // { // Console.WriteLine($"Второе множество: "); // secondSet.ShowSet(); // Console.WriteLine($"Проверка на принадлежность подмножества второму множеству\n (Введите элементы подмножества через пробел): "); // enteredSet = Console.ReadLine(); // items = enteredSet.Split(' '); // enteredItems = new int[items.Length]; // for (int i = 0; i < items.Length; i++) // { // enteredItems[i] = Convert.ToInt32(items[i]); // } // Console.WriteLine(); // if (enteredItems > secondSet) Console.WriteLine($"Введённое множество является подмножеством данного множества\n"); // else Console.WriteLine($"Введённое множество не является подмножеством данного множества\n"); // break; // } // } // } while (!exit); // Console.WriteLine("\nПересечение двух введённых множеств: "); // Set crossedSet = firstSet % secondSet; // crossedSet.ShowSet(); // Console.WriteLine("\nРавенство или неравенство двух введённых множеств: : "); // int equalSet = firstSet != secondSet; // if (equalSet == 0) // Console.WriteLine("Множества не равны"); // else // Console.WriteLine("Множества равны"); // firstSet.SetOwner.ToString(); // secondSet.SetDate.ToString(); //} static void Main(string[] args) { try { int[] intArray = new int[] { 2, 4, 6, 8, 10 }; Set <int> intSet = new Set <int>(intArray); intSet.LookUp(); intSet.Delete(2); intSet.LookUp(); intSet.Add(9); intSet.Sort(); intSet.LookUp(); float[] floatArray = new float[] { 2.8f, 1.9f, 2.2f, 4.2f, 3.3f }; Set <float> floatSet = new Set <float>(floatArray); floatSet.LookUp(); floatSet.Delete(2); floatSet.LookUp(); floatSet.Add(10); floatSet.Sort(); floatSet.LookUp(); PrintDevice printObj = new PrintDevice("Canon", 5, "Устройство PIXMA MG2540S «Все в одном» для ежедневной печати, сканирования и копирования.", 760, "Китай"); Skaner skanObj = new Skaner("Canon CanoScan", 4, "Легкий и компактный планшетный сканер формата A4 со стильным дизайном Canon CanoScan LiDE 300.", 550, "Китай"); Computer compObj = new Computer("Asus Zenbook", 10, "Креативность, стиль, инновационность – эти качества воплощает новый ZenBook 14.", "AMD Ryzen 5", 1500, "Ультрабук"); Tablet tablObj = new Tablet("Lenovo M10 Plus", 6, "-", 10.3, 990, "Tab M10 (Lenovo)"); Product[] prArr = new Product[] { printObj, skanObj, compObj, tablObj }; Set <Product> prSet = new Set <Product>(prArr); prSet.LookUp(); prSet.Delete(skanObj); prSet.LookUp(); prSet.Add(printObj); prSet.Sort(); prSet.LookUp(); prSet.ToFile(@"D:\VisualStudio\OOP\Lab8\Set.txt"); } catch (Exception ex) { Console.WriteLine($"{ex.Message}\n{ex.StackTrace}"); } finally { Console.WriteLine("End of program"); } }
public bool InsertTablet(Tablet Tabletobj) { try { DataContext.Tablets.Add(Tabletobj); int result = DataContext.SaveChanges(); } catch (DbUpdateException ex) { dc.PCErrorLoggers.Add(new PCErrorLogger() { ErrorDate = DateTime.Now, ErrorMessage = ex.Message, ErrorSource = ex.Source }); dc.SaveChanges(); throw new DbUpdateException("Please enter valid Foreign keys"); } catch (System.FormatException fe) { dc.PCErrorLoggers.Add(new PCErrorLogger() { ErrorDate = DateTime.Now, ErrorMessage = fe.Message, ErrorSource = fe.Source }); dc.SaveChanges(); throw new System.FormatException(); } catch (Exception q) { dc.PCErrorLoggers.Add(new PCErrorLogger() { ErrorDate = DateTime.Now, ErrorMessage = q.Message, ErrorSource = q.Source }); dc.SaveChanges(); throw new Exception("Incorrect Format"); } return(true); }
protected virtual void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!FDisposed) { if (disposing) { // Dispose managed resources. if (Tablet != null) { Disconnect(); Tablet = null; } } // Release unmanaged resources. If disposing is false, // only the following code is executed. //.. } FDisposed = true; }
private void signaturePadView_Load(object sender, EventArgs e) { try { //// On Error GoTo errorload Digitizer = new Tablet(); //Actually create the tablet object //sldGranularity.Value = 2; //Set packet granularity value ////that uses a tablet attribute. Remember not everyone has _your_ tablet. Digitizer.UnavailableIsError = false; //Tablet.hWnd = frmMain.DefInstance.Handle //prgX.Maximum = Digitizer.Context.OutputExtentX - Digitizer.Context.OutputOriginX; //prgY.Maximum = Digitizer.Context.OutputExtentY - Digitizer.Context.OutputOriginY; //prgZ.Maximum = 255; //prgPressure.Maximum = (int)Digitizer.Device.NormalPressure.get_Max(true); //prgTangentPressure.Maximum = (int)Digitizer.Device.TangentPressure.get_Max(true); //Digitizer.ContextClosed += new VBTablet.Tablet.ContextClosedEventHandler(ContextClosed); //Digitizer.ContextOpened += new VBTablet.Tablet.ContextOpenedEventHandler(ContextOpened); //Digitizer.ContextRepositioned += new Tablet.ContextRepositionedEventHandler(ContextRepositioned); //Digitizer.ContextUpdated += new Tablet.ContextUpdatedEventHandler(ContextUpdated); //Digitizer.CursorChange += new Tablet.CursorChangeEventHandler(CursorChange); //Digitizer.InfoChange += new Tablet.InfoChangeEventHandler(InfoChange); //Digitizer.ProximityChange += new Tablet.ProximityChangeEventHandler(ProximityChange); Digitizer.PacketArrival += new Tablet.PacketArrivalEventHandler(PacketArrival); // bmp = new Bitmap(picDraw.Image); //initiation of the device and all others connectToDevice(); enableDevice(); enableDigitizeMode(); noidea(); } catch (Exception ex) { MessageBox.Show(ex.Message + ". Please Connect the Digitizer Device First !!"); } }
public void TestOnOrderUnassigned() { var context = MockContextFactory.Create(); var guest = new Tablet() { Id = 1, Identifier = "Hachim", Mode = Mode.Guest }; var waiter = new Tablet() { Id = 2, Identifier = "Karim", Mode = Mode.Waiter }; var testOrder = new Order() { Id = 1, OrderStatus = OrderStatus.New, CreationTime = new DateTime(2017, 2, 4, 17, 0, 0), UpdateTime = new DateTime(2017, 2, 4, 17, 0, 0), Waiter = waiter, Guests = new List <Tablet>() }; context.Tablet.Add(guest); context.Tablet.Add(waiter); context.Order.Add(testOrder); context.SaveChanges(); var service = new AssignOrderService(new MockDataService(context)); var result = service.OnOrderAssigned(guest.Identifier, testOrder.Id); result = service.OnOrderUnassigned(guest.Identifier, testOrder.Id); Assert.Equal(true, result); Assert.Empty(testOrder.Guests); }
public void ObtenerListaTablets(IngresoDetalleTablet detalleTraido) { cmbMarca.SelectedValue = detalleTraido.TabletIdMarca; cmbModelo.SelectedValue = detalleTraido.TabletIdModelo; cmbProcesador.SelectedValue = detalleTraido.TabletIdProcesador; cmbSO.SelectedValue = detalleTraido.TabletIdSO; cmbRAM.SelectedValue = detalleTraido.TabletIdRAM; cmbROM.SelectedValue = detalleTraido.TabletIdROM; tablet = detalleTraido.Tablet; chbGarantia.Checked = (tablet.Garantia == 1) ? true : false; txtPantalla.Text = tablet.TamanoPantalla.ToString(); txtPrecio.Text = detalleTraido.Precio.ToString(); txtCantidad.Text = detalleTraido.Cantidad.ToString(); foreach (String serie in detalleTraido.Series) { DataGridViewRow row = (DataGridViewRow)dgvSerieFabrica.Rows[0].Clone(); row.Cells[1].Value = serie; dgvSerieFabrica.Rows.Add(row); } }
public void AddToCart(Tablet tablet) { Cart cartItem = service.GetCart(ShoppingCartId, tablet.TabletId); if (cartItem == null) { cartItem = new Cart { TabletId = tablet.TabletId, CartId = ShoppingCartId, Count = 1, DataCreated = DateTime.Now }; service.AddCart(cartItem); } else { cartItem.Count++; service.EditCart(cartItem); } }
static void Main(string[] args) { var msgSender = new MessageSender(); var phone = new Mobile(msgSender); var tablet = new Tablet(msgSender); Console.WriteLine("Message body: "); string msg = Console.ReadLine(); string timeText; int time; do { Console.WriteLine("Send after (ms): "); timeText = Console.ReadLine(); } while (!int.TryParse(timeText, out time)); msgSender.SendMessage(msg, time); Console.ReadKey(); }
public ActionResult Create(TabletViewModel tabletViewModel) { //implicit conversion using implicit operator defined in TabletViewModel Class Tablet tablet = tabletViewModel; try { if (ModelState.IsValid) { db.Tablets.Add(tablet); db.SaveChanges(); return(RedirectToAction("Index")); } } catch (DataException dex) { if (dex.InnerException.InnerException.Message.Contains("IX_SerialNo")) { ModelState.AddModelError("SerialNo", "Unable to save changes. Serial Number must be unique"); } else if (dex.InnerException.InnerException.Message.Contains("IX_TabletName")) { ModelState.AddModelError("TabletName", "Unable to save changes. Tablet Name must be unique"); } else if (dex.InnerException.InnerException.Message.Contains("IX_AssetTag")) { ModelState.AddModelError("AssetTag", "Unable to save changes. Asset Tag must be unique"); } else { ModelState.AddModelError("", $" Database error occured (please copy the error and contact helpdesk)</br>: {dex.Message}. + {dex.InnerException.Message} + {dex.InnerException.Message}"); } } catch (Exception ex) { ModelState.AddModelError(string.Empty, $"Error occured Copy the error message and send it to Dima</br>: {ex.Message}. + {ex.InnerException.Message} + {ex.InnerException.InnerException.Message}"); } return(View(tabletViewModel)); }
public async Task <int> test_insert_tablet_async(Tablet tablet) { var client = client_lst.Take(); var req = gen_insert_tablet_req(tablet, client.sessionId); TSStatus status; try{ status = await client.client.testInsertTabletAsync(req); } catch (TException e) { client_lst.Add(client); var err_msg = String.Format("Tablet insertion failed"); throw new TException(err_msg, e); } if (debug_mode) { _logger.Info("insert one tablet to device {0}, server message: {1}", tablet.device_id, status.Message); } client_lst.Add(client); return(util_functions.verify_success(status, SUCCESS_CODE)); }
public void Get_when_bucket_exists_returns_list_of_objects_with_key() { var mock = new MockFileSystem(); mock.Directory.SetCurrentDirectory(@"C:\Temp"); var sut = new Tablet(mock); sut.Init(); sut.Push(new Fake { Value = 1 }, k => k.Value); var actual = sut.Get <Fake, int>(1); Assert.Equal(new List <Fake> { new Fake { Value = 1 } }, actual, new FakeComparer()); }
public void TestGetOrder() { var context = MockContextFactory.Create(); var tablet = new Tablet() { Id = 8, Identifier = "Brutus", Mode = Mode.Waiter }; var table = new Table() { Id = 5, Name = "Test" }; var order0 = new Order { Id = 3, OrderStatus = OrderStatus.New, PriceOrder = 1, Table = table, Waiter = tablet }; context.Table.Add(table); context.Tablet.Add(tablet); context.Order.Add(order0); context.SaveChanges(); var service = new OrderService(new MockDataService(context)); var result = service.GetOrder(3); Assert.Equal(1, result.PriceOrder); Assert.Equal(OrderStatus.New, result.OrderStatus); Assert.Equal(1, result.PriceOrder); }
public bool DeleteTablet(string pID) { try { Tablet oldTab = (from tab in DataContext.Tablets where tab.ProductID == pID select tab).First(); DataContext.Tablets.Remove(oldTab); int result = DataContext.SaveChanges(); if (result > 0) { return(true); } else { return(false); } } catch (DbUpdateException) { throw new DbUpdateException("Enter proper Primary key"); } }
//void SerialDataManager_Feedback(UartComdEventArgs lowerDataInfo) //{ // if (lowerDataInfo.LowerDataType == LowerDataType.MachineBasicDataType) { } //} private void ButtonData_Click(object sender, EventArgs e) { if (flowDrawManager.ModeChange) { if (sender is Tablet) { Tablet Tab = sender as Tablet; Calculator myCal = new Calculator(); myCal.InitStrNum = Tab.Content; myCal.PointButtonEnable = false; myCal.MinusButtonEnable = false; myCal.IsSercet = false; myCal.MaxValue = (double)1000; myCal.MinValue = 0; myCal.ShowDialog(); Tab.Content = myCal.LastNumber.ToString(); FlowDataDAO dataBaseDAO = new FlowDataDAO(); dataBaseDAO.SetDataBaseValue((SetDataEnum)Convert.ToInt16(Tab.Tag), Convert.ToInt32(Tab.Content)); } } }
static void Main(string[] args) { Deposito miDeposito = 7; Tablet t1 = new Tablet("Galaxy", "Samsung", EPais.Corea, ETipo.Mediano); Tablet t2 = new Tablet("Xperia", "Sony", EPais.China, ETipo.Chico); Fabricante f1 = new Fabricante("Huawei", EPais.China); Celular c1 = new Celular("A6", f1, EGama.Media); Celular c2 = new Celular("A20", f1, EGama.Alta); miDeposito += c1; //YA INGRESADO miDeposito += t1; miDeposito += t2; miDeposito += c2; Console.WriteLine(Deposito.Mostrar(miDeposito)); Console.ReadLine(); }
public override bool Test(Sim actor, Tablet target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if ((actor.GetObjectInRightHand() != target) && !actor.Inventory.Contains(target)) { return false; } else if (actor.BuffManager.HasElement(0x9a7f5f1919df86c1L)) { return false; } InteractionInstanceParameters parameters = new InteractionInstanceParameters(); List<ObjectPicker.TabInfo> list; List<ObjectPicker.HeaderInfo> list2; int num; // Custom TabletEx.PopulateAudioPrograms(actor, ref parameters, out list, out list2, out num); if (list.Count == 0x0) { return false; } return true; }
public override bool Test(Sim actor, Tablet target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if ((actor.GetObjectInRightHand() != target) && !actor.Inventory.Contains(target)) { return(false); } else if (actor.BuffManager.HasElement(0x9a7f5f1919df86c1L)) { return(false); } InteractionInstanceParameters parameters = new InteractionInstanceParameters(); List <ObjectPicker.TabInfo> list; List <ObjectPicker.HeaderInfo> list2; int num; // Custom TabletEx.PopulateAudioPrograms(actor, ref parameters, out list, out list2, out num); if (list.Count == 0x0) { return(false); } return(true); }
private void Tab_MouseDown(object sender, MouseEventArgs e) { if (sender is Tablet) { Tablet Tab = sender as Tablet; int Index = int.Parse(Tab.Tag.ToString()); int Row = Index % 10; foreach (Tablet Sel in TabList) { if (Sel.BackColor != Color.FromArgb(233, 233, 233)) { Sel.BackColor = Color.FromArgb(233, 233, 233); Sel.Invalidate(); } } TabList[Row].BackColor = Color.Silver; TabList[10 + Row].BackColor = Color.Silver; TabList[20 + Row].BackColor = Color.Silver; TabList[30 + Row].BackColor = Color.Silver; TabList[Index].BackColor = Color.MediumSeaGreen; } }
public void RandomlyShowOrHideStudyMaterialsOnDesk() { int yesOrNo; if (BoxFilled != null) { yesOrNo = Random.Range(0, 11) % 2; if (yesOrNo == 1) { BoxFilled.SetActive(true); } else { BoxFilled.SetActive(false); } } if (NoteBook != null) { yesOrNo = Random.Range(0, 11) % 2; if (yesOrNo == 1) { NoteBook.SetActive(true); } else { NoteBook.SetActive(false); } } if (Tablet != null) { yesOrNo = Random.Range(0, 11) % 2; if (yesOrNo == 1) { Tablet.SetActive(true); } else { Tablet.SetActive(false); } } if (Book != null) { yesOrNo = Random.Range(0, 11) % 2; if (yesOrNo == 1) { Book.SetActive(true); } else { Book.SetActive(false); } } if (PencilBox != null) { yesOrNo = Random.Range(0, 11) % 2; if (yesOrNo == 1) { PencilBox.SetActive(true); } else { PencilBox.SetActive(false); } } if (Pencil != null) { yesOrNo = Random.Range(0, 11) % 2; if (yesOrNo == 1) { Pencil.SetActive(true); } else { Pencil.SetActive(false); } } if (Pen != null) { yesOrNo = Random.Range(0, 11) % 2; if (yesOrNo == 1) { Pen.SetActive(true); } else { Pen.SetActive(false); } } if (LunchBox != null) { yesOrNo = Random.Range(0, 11) % 2; if (yesOrNo == 1) { LunchBox.SetActive(true); } else { LunchBox.SetActive(false); } } if (MilkBottle != null) { yesOrNo = Random.Range(0, 11) % 2; if (yesOrNo == 1) { MilkBottle.SetActive(true); } else { MilkBottle.SetActive(false); } } if (Ruler != null) { yesOrNo = Random.Range(0, 11) % 2; if (yesOrNo == 1) { Ruler.SetActive(true); } else { Ruler.SetActive(false); } } if (Eraser != null) { yesOrNo = Random.Range(0, 11) % 2; if (yesOrNo == 1) { Eraser.SetActive(true); } else { Eraser.SetActive(false); } } if (Glue != null) { yesOrNo = Random.Range(0, 11) % 2; if (yesOrNo == 1) { Glue.SetActive(true); } else { Glue.SetActive(false); } } if (Scissor != null) { yesOrNo = Random.Range(0, 11) % 2; if (yesOrNo == 1) { Scissor.SetActive(true); } else { Scissor.SetActive(false); } } if (Apple != null) { yesOrNo = Random.Range(0, 11) % 2; if (yesOrNo == 1) { Apple.SetActive(true); } else { Apple.SetActive(false); } } }
public override void Initialize(Game game) { base.Initialize(game); Tablet = Tablet.FromMetadata(game.Content.Load<TabletMetadata>(UpgradeName), game.Content); DrawRectangle = new Rectangle((int)(Position.X + ComponentOffsetLeft + MedcitShopItemOffset), (int)(Position.Y + ComponentOffsetTop), 64, 64); }