public void TestSave() { try { // task1 = new Task("testCre", "task1", new DateTime(2019, 12, 12)); int id = InterfaceLayer.CreateNewTask("testCre", "task1", new DateTime(2019, 12, 12)); Saved_Task = Task.GetTaskByID(id); Assert.AreEqual(Saved_Task.getDescription(), "task1"); List <int> list = TaskDAL.GetTaskByColumn(1); if (!list.Contains(Saved_Task.getID())) { Assert.Fail("didn't save the task to the correct column"); } } catch (MileStone4.AlmogException ex) { Assert.Fail((String)ex.Value, new object[] { ex }); } catch (Exception e) { Assert.Fail(e.Message, new object[] { e }); } }
public static void init(TestContext a) { DAL.CleanDB(); InterfaceLayer.registration("*****@*****.**", "aaaA1"); InterfaceLayer.login("aaa", "aaaA1"); InterfaceLayer.createBoard("board", Constants.InfiniteLimit, Constants.InfiniteLimit, Constants.InfiniteLimit, Constants.InfiniteLimit); }
public static void Initialize() { if (IHBase.ModOptions["InvButtons"]) { addLayers = (list) => { if (Main.localPlayer.chest != -1) { InterfaceLayer.Add(list, IHBase.Instance.ReplacerButtons, InterfaceLayer.LayerInventory, true); } // --haven't made a replacement for the separate chestbuttons yet else { InterfaceLayer.Add(list, IHBase.Instance.InventoryButtons, InterfaceLayer.LayerInventory, true); } } } ; else { addLayers = (list) => { if (Main.localPlayer.chest != -1) { InterfaceLayer.Add(list, IHBase.Instance.ReplacerButtons, InterfaceLayer.LayerInventory, true); } } }; }
/// <summary> /// Modifies the given interface layer list. /// </summary> /// <param name="list">The interface layer list to modify.</param> public override void ModifyInterfaceLayerList(List <InterfaceLayer> list) { base.ModifyInterfaceLayerList(list); InterfaceLayer.Add(list, MWorld.AccessoryLayer = new AccessorySlotLayer(), InterfaceLayer.LayerInventory, false); InterfaceLayer.Add(list, MWorld.TomeSlotLayer = new TomeSlotLayer(), MWorld.AccessoryLayer, false); }
protected void btnSubmit_Click(object sender, EventArgs e) { try { BE.Id = Convert.ToInt32(txtUserName.Text); BE.Password = txtPassword.Text.Trim(); InterfaceLayer IL = BL; DataSet dsDecrypt = IL.DecryptPassWord(); if (dsDecrypt.Tables[0].Rows.Count > 0) { lblMsg.Text = CryptUtil1.Decrypt(Convert.ToString(txtPassword.Text.Trim())); lblMsg.Visible = true; lblMsg.ForeColor = Color.Green; } else { lblMsg.Text = "Your Details Not Correctly...!"; lblMsg.Visible = true; lblMsg.ForeColor = Color.Red; } } catch (Exception ex) { lblMsg.Visible = true; lblMsg.Text = ex.Message.ToString(); lblMsg.ForeColor = Color.Red; } }
public override void Draw(InterfaceLayer layer, Microsoft.Xna.Framework.Graphics.SpriteBatch sb) { Main.inventoryScale = 0.85f; Drawing.DrawBox(sb, startPx - 235, startPy + 39, 415, 160); //h was 130 sb.DrawString(Main.fontMouseText, "", new Vector2(startPx + 89, startPy + 3), Color.White); sb.DrawString(Main.fontMouseText, "", new Vector2(startPx + 53, startPy + 55), Color.White); sb.DrawString(Main.fontMouseText, "", new Vector2(startPx + 113, startPy + 55), Color.White); sb.DrawString(Main.fontMouseText, "", new Vector2(startPx + 12, startPy + 27), Color.White); sb.DrawString(Main.fontMouseText, "", new Vector2(startPx + 68, startPy + 27), Color.White); sb.DrawString(Main.fontMouseText, "", new Vector2(startPx + 127, startPy + 27), Color.White); itemSlot[0].UpdateAndDraw(sb, new Vector2(startPx - 223, startPy + 47), Main.inventoryScale); itemSlot[1].UpdateAndDraw(sb, new Vector2(startPx - 223, startPy + 97), Main.inventoryScale); itemSlot[2].UpdateAndDraw(sb, new Vector2(startPx - 223, startPy + 147), Main.inventoryScale); itemSlot[3].UpdateAndDraw(sb, new Vector2(startPx - 165, startPy + 47), Main.inventoryScale); itemSlot[4].UpdateAndDraw(sb, new Vector2(startPx - 165, startPy + 97), Main.inventoryScale); itemSlot[5].UpdateAndDraw(sb, new Vector2(startPx - 165, startPy + 147), Main.inventoryScale); itemSlot[6].UpdateAndDraw(sb, new Vector2(startPx - 107, startPy + 47), Main.inventoryScale); itemSlot[7].UpdateAndDraw(sb, new Vector2(startPx - 107, startPy + 97), Main.inventoryScale); itemSlot[8].UpdateAndDraw(sb, new Vector2(startPx - 107, startPy + 147), Main.inventoryScale); itemSlot[9].UpdateAndDraw(sb, new Vector2(startPx - 49, startPy + 47), Main.inventoryScale); itemSlot[10].UpdateAndDraw(sb, new Vector2(startPx - 49, startPy + 97), Main.inventoryScale); itemSlot[11].UpdateAndDraw(sb, new Vector2(startPx - 49, startPy + 147), Main.inventoryScale); itemSlot[12].UpdateAndDraw(sb, new Vector2(startPx + 9, startPy + 47), Main.inventoryScale); itemSlot[13].UpdateAndDraw(sb, new Vector2(startPx + 9, startPy + 97), Main.inventoryScale); itemSlot[14].UpdateAndDraw(sb, new Vector2(startPx + 9, startPy + 147), Main.inventoryScale); itemSlot[15].UpdateAndDraw(sb, new Vector2(startPx + 67, startPy + 47), Main.inventoryScale); itemSlot[16].UpdateAndDraw(sb, new Vector2(startPx + 67, startPy + 97), Main.inventoryScale); itemSlot[17].UpdateAndDraw(sb, new Vector2(startPx + 67, startPy + 147), Main.inventoryScale); itemSlot[18].UpdateAndDraw(sb, new Vector2(startPx + 125, startPy + 47), Main.inventoryScale); itemSlot[19].UpdateAndDraw(sb, new Vector2(startPx + 125, startPy + 97), Main.inventoryScale); itemSlot[20].UpdateAndDraw(sb, new Vector2(startPx + 125, startPy + 147), Main.inventoryScale); }
private void InitInterface() { for (int i = 0; i < ConfigLayer.unitCount; i++) { _interfaceLayers[i] = new InterfaceLayer(i); //бд _interfaceLayers[i].LoadDataAtTime += _dataBaseLayer.GetDataAtTime; _interfaceLayers[i].LoadLastData += _dataBaseLayer.GetLastData; //вьюха _interfaceLayers[i].InitControl += _itemsControl[i].InitData; _interfaceLayers[i].UpdateDataInControl += _itemsControl[i].UpdateData; _interfaceLayers[i].UpdateDataInGraph += _itemsGraph[i].UpdateData; _interfaceLayers[i].ReloadDataInGraph += _itemsGraph[i].ReloadData; _itemsGraph[i].ResumeUpdateGraph += _interfaceLayers[i].ContinueUpdate; _itemsGraph[i].PauseUpdateGraph += _interfaceLayers[i].PauseUpdate; _itemsGraph[i].ChangeTimeGraph += _interfaceLayers[i].UserChangeTime; //порт //_interfaceLayers[i].UpdateData(); } }
public void TestBoardBadCreate() { try { InterfaceLayer.createBoard("test", 2, 2, 2, 1); Assert.Fail("managed to create bad board"); } catch (AlmogException e) { } catch (Exception e) { Assert.Fail("exception thrown during creation of bad board"); } try { Board b = new Board("test", Constants.InfiniteLimit, 1, 1, 5); Assert.Fail("managed to create bad board"); } catch (AlmogException e) { Assert.AreEqual((String)e.Value, "Limits problem"); } catch (Exception e) { Assert.Fail("exception thrown during creation of bad board"); } }
private void Button_Click_2(object sender, RoutedEventArgs e) { BoardMng window = new BoardMng(InterfaceLayer.getBoard() + ""); window.Show(); App.Current.MainWindow = window; this.Close(); }
public listOfColumns() { List <int> columns = InterfaceLayer.GetColumns(); this.Columns1 = new CollectionView(columns); this.Columns2 = new CollectionView(columns); this.Columns3 = new CollectionView(columns); }
public void move_Click(object sender, RoutedEventArgs e) { ((Button)sender).Background = new SolidColorBrush(Color.FromRgb(150, 20, 20)); int id = ((PresantationTask)((Button)sender).DataContext).ID; InterfaceLayer.MoveToNext(id); ((Button)sender).Content = this.ID; }
private void Button_Click(object sender, RoutedEventArgs e) { InterfaceLayer.logout(); login window = new login(); window.Show(); App.Current.MainWindow = window; this.Close(); }
public void refresh() { List <int> columns = InterfaceLayer.GetColumns(); this.Columns1 = new CollectionView(columns); this.Columns2 = new CollectionView(columns); this.Columns3 = new CollectionView(columns); OnPropertyChanged(); }
/// <summary> /// Initializes a new instance of the <see cref="ImportInterfaceCommand"/> class. /// </summary> /// <param name="element">The element.</param> public ImportInterfaceCommand(object element) { _shape = element as NodeShape; if (_shape == null) { return; } _layer = _shape.ModelElement as InterfaceLayer; }
/// <summary> /// Permet d'importer une assembly dans la couche modèle /// </summary> /// <param name="layer">Couche interface</param> public ReverseInterfaces(InterfaceLayer layer) { if (layer == null) { throw new ArgumentNullException("layer"); } // Namespace initial this._layer = layer; }
/* AddLayer() simply takes an InterfaceLayer object and checks it can be added to the list of layers. * It does this by checking if the layer's width and height are the same as the map's width and height. * If they are not the same, the layer cannot be added, as all the layers must match the map's size. * Otherwise, the new layer is added to the list. */ public void AddLayer(InterfaceLayer layer) { if (layer is MapLayer) { if (((MapLayer)layer).Width != widthInTiles && ((MapLayer)layer).Height != heightInTiles) { throw new Exception("Map Layer Size Exception while adding new Layer"); } } mapLayers.Add(layer); }
private void filter(object sender, RoutedEventArgs e) { InitializeComponent(); ILBoard ILb = new ILBoard(InterfaceLayer.getBoard(), Filter.Text); PresantationBoard Pb = new PresantationBoard(ILb); panles.panels = Pb.ToPanelList(); columns.refresh(); }
/// <summary> /// Apply all the properties from the scene we loaded onto the fixed layer /// </summary> /// <param name="targetLayer">The target fixed layer</param> /// <param name="fixedLayerProperties">The data object containing the loaded properties</param> private void SetFixedLayerProperties(InterfaceLayer targetLayer, SerializableScene.FixedLayer fixedLayerProperties) { //Apply all materials for (int i = 0; i < fixedLayerProperties.materials.Length; i++) { var materialProperties = fixedLayerProperties.materials[i]; Material materialInSlot = targetLayer.GetMaterialFromSlot(materialProperties.slotId); materialInSlot.SetColor("_BaseColor", new Color(materialProperties.r, materialProperties.g, materialProperties.b, materialProperties.a)); } targetLayer.UpdateLayerPrimaryColor(); }
private void Create_Click(object sender, RoutedEventArgs e) { try { // InterfaceLayer.createTask(taskC.title, taskC.des, taskC.due, InterfaceLayer.getBoard()); InterfaceLayer.CreateNewTask(taskC.title, taskC.des, taskC.due); errors.error = ""; refresh(); } catch (AlmogException exi) { errors.error = (String)exi.Value; } }
private void delCol(object sender, RoutedEventArgs e) { int id = int.Parse(columns.Columns3.CurrentItem.ToString()); try { InterfaceLayer.DelColumn(InterfaceLayer.getBoard(), id); errors.error = ""; refresh(); } catch (AlmogException exi) { errors.error = (String)exi.Value; } }
//private void sendemail(string to, string subject, string body) //{ // string sender = ConfigurationManager.AppSettings["EmailFromAddress"]; // try // { // var MailHelper = new MailHelper // { // Sender = sender, // Recipient = to, // RecipientCC = null, // Subject = subject, // Body = body, // }; // MailHelper.Send(); // } // catch (Exception) // { // throw; // } //} protected void btnSubmit_Click(object sender, EventArgs e) { try { string strPassWord = string.Empty; string[] GenerateList = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }; Random r = new Random(); for (int i = 0; i < 6; i++) { int j; j = r.Next(GenerateList.Length); strPassWord += GenerateList[j]; } BE.Id = Convert.ToInt32(txtUserName.Text); BE.Password = CryptUtil1.Encrypt(Convert.ToString(strPassWord.Trim())); InterfaceLayer IL = BL; int Result = IL.GetPassWord(); if (Result == 1) { //SendMails(); BE.Email = IL.GetMailId(); //em.SendEmail(BE.Email, BE.Password.ToString()); //sendemail(BE.Email, "Password", "Your Password Info is: " + BE.Password.ToString() + ""); //sendemail(Properties.EmailId, "Password", "Your Password Info is: " + password.ToString() + ""); Result1 = "Your Password is" + BE.Password.ToString(); //Result1 = "Your Password Info is " + CryptUtil1.Encrypt(Convert.ToString(strPassWord.Trim())).ToString(); Page.RegisterClientScriptBlock("balu", "<script>alert('" + Result1 + "')</script>"); txtUserName.Text = string.Empty; lblMsg.Text = string.Empty; } else { Result1 = "Already your password has been displayed"; Page.RegisterClientScriptBlock("Balu", "<script>alert('" + Result1 + "')</script>"); txtUserName.Text = string.Empty; lblMsg.Text = string.Empty; } } catch (Exception ex) { lblMsg.Visible = true; lblMsg.Text = ex.Message.ToString(); lblMsg.ForeColor = Color.Red; } }
/// <summary> /// Creates the layer. /// </summary> /// <param name="component">The component.</param> /// <param name="package">The package.</param> /// <returns></returns> public SoftwareLayer CreateLayer(SoftwareComponent component, LayerPackage package) { SoftwareLayer layer = null; if (rbPres.Checked) { layer = new PresentationLayer(component.Store); } else if (rbUI.Checked) { layer = new UIWorkflowLayer(component.Store); } else if (rbDAL.Checked) { layer = new DataAccessLayer(component.Store); } else if (rbBLL.Checked) { layer = new BusinessLayer(component.Store); } else if (rbModels.Checked) { layer = new DataLayer(component.Store); } else if (rbInterface.Checked) { layer = new InterfaceLayer(component.Store); ((InterfaceLayer)layer).Level = (short)(package.Level + 1); package.InterfaceLayer = (InterfaceLayer)layer; } Layer tmp = layer as Layer; if (tmp != null) { package = component.LayerPackages.Find(delegate(LayerPackage p) { return(p.Level == tmp.Level); }); if (package == null) { package = new LayerPackage(component.Store); package.Level = tmp.Level; component.LayerPackages.Add(package); } package.Layers.Add(tmp); } component.Layers.Add(layer); return(layer); }
private void SwitchButton_Click(object sender, RoutedEventArgs e) { int id1 = int.Parse(columns.Columns1.CurrentItem.ToString()); int id2 = int.Parse(columns.Columns2.CurrentItem.ToString()); try { InterfaceLayer.switchColumns(id1, id2); errors.error = ""; refresh(); } catch (AlmogException exi) { errors.error = (String)exi.Value; } }
/// <summary> /// Ensures the interface layer. /// </summary> /// <returns></returns> private InterfaceLayer EnsureInterfaceLayer() { LayerPackage lp = new LayerPackage(_component.Store); lp.Name = "PublicContracts"; lp.Level = 100; _component.LayerPackages.Add(lp); InterfaceLayer iLayer = new InterfaceLayer(_component.Store); iLayer.Level = 101; _component.Layers.Add(iLayer); lp.InterfaceLayer = iLayer; iLayer.Name = StrategyManager.GetInstance(lp.Store).NamingStrategy.CreateLayerName(lp, iLayer, "PublicContracts"); iLayer.Namespace = StrategyManager.GetInstance(lp.Store).NamingStrategy.CreateNamespace(_component.Namespace, iLayer.Name, iLayer); return(iLayer); }
public void move_Click(object sender, RoutedEventArgs e) { //InitializeComponent(); Button button = (Button)sender; PresantationTask task = (PresantationTask)button.DataContext; try { InterfaceLayer.MoveToNext(task.ID); errors.error = ""; refresh(); } catch (AlmogException exi) { errors.error = (String)exi.Value; } }
public void TestDelete() { try { InterfaceLayer.DeleteTask(Saved_Task.getID()); Task t2 = Task.GetTaskByID(Saved_Task.getID()); Assert.AreNotEqual(Saved_Task.getID(), t2.getID()); Assert.AreEqual(t2.getTitle(), null); } catch (MileStone4.AlmogException ex) { Assert.Fail((String)ex.Value, new object[] { ex }); } catch (Exception e) { Assert.Fail(e.Message, new object[] { e }); } }
public void TestBadCreation() { try { // note - createnewTask also saves the task. the error would accore when trying to save InterfaceLayer.CreateNewTask("testCre", "task1", new DateTime(2018, 12, 12)); Assert.Fail("saved although bad"); } catch (MileStone4.AlmogException ex) { //good } catch (Exception e) { Assert.Fail(e.Message, new object[] { e }); } }
protected void btnGetPwd_Click(object sender, EventArgs e) { try { lblResult.Visible = false; BE.Id = Convert.ToInt32(txtUname.Text); BE.Hint = ddlQtns.SelectedItem.Text; BE.Answer = txtAnswer.Text; InterfaceLayer IL = BL; string password = IL.RecoverPassWord(); Page.RegisterClientScriptBlock("balu", "<script>alert('Your Password: "******"')</script>"); } catch (Exception ex) { lblResult.Visible = true; lblResult.Text = ex.Message; } }
/* * public void start() * { * File.Delete("Boards.bin"); * File.Delete("Tasks.bin"); * File.Delete("Users.bin"); * DataAcces_Layer.PresistanTasks.load(); * DataAcces_Layer.PresistanBoard.load(); * DataAcces_Layer.PresistenceUser.load(); * * InterfaceLayer.registration("*****@*****.**", "aaaAAA1"); * InterfaceLayer.login("*****@*****.**", "aaaAAA1"); * InterfaceLayer.createTask("asadasd", "asdasd", DateTime.Now, InterfaceLayer.getBoard()); * InterfaceLayer.createTask("zzzzz", "aaaaa", DateTime.Now, InterfaceLayer.getBoard()); * * * * } */ private void refresh() { ILBoard ILb = new ILBoard(InterfaceLayer.getBoard()); ILb.Sort(comparer); PresantationBoard Pb = new PresantationBoard(ILb); panles.panels = Pb.ToPanelList(); columns.refresh(); // Binding binding = new Binding("panels"); // BindingOperations.SetBinding(itemControler, ItemsControl.ItemsSourceProperty, binding); // InitializeComponent(); // binding = new Binding("error"); // BindingOperations.SetBinding(this.ErrorsLabel, Label.ContentProperty, binding); }
private void add_column(object sender, RoutedEventArgs e) { int limit = int.Parse(ColumnCreator.limit); if (limit == 0) { limit = Constants.InfiniteLimit; } try { InterfaceLayer.addColumn(ColumnCreator.name, limit); ColumnCreator.limit = ""; ColumnCreator.name = ""; errors.error = ""; refresh(); } catch (AlmogException exi) { errors.error = (String)exi.Value; } }
public static void DebugDump(int indentLevel, InterfaceLayer ilayer) { string indent = new string(' ', indentLevel * 2); string msg = " " + ilayer.FrameStrata + "/" + ilayer.FrameLevel + "/" + ilayer.LayerLevel; if (ilayer is Region) log.DebugFormat("{0}{1}{2}", indent, ((Region)ilayer).Name, msg); else log.DebugFormat("{0} - {1}{2}", indent, ilayer, msg); if (ilayer is Frame) { Frame frame = (Frame)ilayer; foreach (InterfaceLayer childFrame in frame.Elements) { DebugDump(indentLevel + 1, childFrame); } } else if (ilayer is Layer) { Layer frame = (Layer)ilayer; foreach (InterfaceLayer childFrame in frame.Elements) { DebugDump(indentLevel + 1, childFrame); } } }