Example #1
0
 static void Postfix(EntityControl __instance)
 {
     if (__instance.playerentity)
     {
         __instance.ccol.enabled = !MainManager_Ext.toggleCollision;
     }
 }
Example #2
0
        private void AddConnection(EntityControl e1, EntityControl e2, RealtionShipType t)
        {
            System.Windows.Shapes.Line l = new System.Windows.Shapes.Line();
            l.Stroke          = new SolidColorBrush(Colors.Black);
            l.StrokeThickness = 2.0;


            l.X1 = Canvas.GetLeft(e1) + e1.Width;
            l.X2 = Canvas.GetLeft(e2);
            l.Y1 = Canvas.GetTop(e1) + e1.Height / 2;
            l.Y2 = Canvas.GetTop(e2) + e2.Height / 2;
            Editor.Children.Add(l);

            Ellipse e = new Ellipse();

            e.Height = 15;
            e.Fill   = new SolidColorBrush(Colors.Black);
            e.Width  = 15;

            if (t == RealtionShipType.OneToMany)
            {
                Canvas.SetLeft(e, l.X2 - 15 / 2);
                Canvas.SetTop(e, l.Y2 - 15 / 2);
            }
            else
            {
                Canvas.SetLeft(e, l.X1 - 15 / 2);
                Canvas.SetTop(e, l.Y1 - 15 / 2);
            }

            Editor.Children.Add(e);
        }
Example #3
0
        private void btnEntity_Click(object sender, EventArgs e)
        {
            EntityControl control = new EntityControl();

            CleanControls();
            pnlControls.Controls.Add(control);
        }
Example #4
0
 private void OnWorldEntityClicked(EntityContainerControl sender, EntityControl entityControl)
 {
     if (Game.TryGoToEntity(entityControl.EntityObject))
     {
         return;
     }
     Game.TryPickEntity(entityControl.EntityObject);
 }
Example #5
0
 protected virtual bool ValidateEntity()
 {
     if (EntityControl != null)
     {
         return(EntityControl.IsValid());
     }
     return(true);
 }
Example #6
0
 /// <summary>
 /// Does the after validate.
 /// Save data after validate on press OK
 /// </summary>
 /// <returns></returns>
 protected virtual bool SaveEntity()
 {
     if (EntityControl != null)
     {
         return(EntityControl.Commit());
     }
     return(true);
 }
Example #7
0
 public EntityCollection(EntityControl <T> entityCtrl, Predicate <T> filter)
     : base()
 {
     EntityCtrl = entityCtrl;
     _filter    = filter;
     if (_filter == null)
     {
         _filter = (t) => true;
     }
     RefreshData();
 }
Example #8
0
        public void EntityControlTest()
        {
            Entity        player = new Player();
            EntityControl ec     = new EntityControl(player);

            Entity expected = player;
            Entity actual   = ec.Entity;

            Assert.AreEqual <Entity>(expected, actual);
            Assert.AreSame(expected, actual);
        }
Example #9
0
        public void SetEntityTest()
        {
            Entity        player = new Player();
            EntityControl ec     = new EntityControl(player);
            Entity        enemy  = new Enemy();

            ec.SetEntity(enemy);

            Entity expected = enemy;
            Entity actual   = ec.Entity;

            Assert.AreEqual <Entity>(expected, actual);
            Assert.AreSame(expected, actual);
        }
Example #10
0
        private void GONEXT_Click(object sender, RoutedEventArgs e)
        {
            List <TableRelationShips> templist;

            if (Root.NextRelationShips.Count == 0)
            {
                templist = Root.LoadNextParentForChildren();
            }

            else
            {
                templist = Root.LoadNextParentFromParent();
            }

            int i = 0;

            foreach (var item in templist)
            {
                EntityControl en = new EntityControl(new Entity(item.Parent_Table));

                double size = getWidhOfBusyArea();
                double newleft, newtop;
                if (size + 400 < (Editor.ActualWidth - 80))
                {
                    newleft = size + 400;
                    newtop  = 30;
                }
                else
                {
                    newtop  = 530;
                    newleft = size + i * 300;
                    i++;
                }
                Canvas.SetLeft(en, newleft);
                Canvas.SetTop(en, newtop);

                Editor.Children.Add(en);
                AddConnection(LastControl, en, RealtionShipType.ManyToOne);

                if (templist.Count == 1)
                {
                    LastControl = en;
                }
            }
        }
Example #11
0
        private void CreateInitialSchema()
        {
            Editor.Children.Clear();

            EntityControl b = new EntityControl(entity);

            Canvas.SetLeft(b, 20);
            Canvas.SetTop(b, 30);
            Editor.Children.Add(b);

            EntityControl firstchildren = new EntityControl(new Entity(Root.Child_Table));
            var           leftpos       = Canvas.GetLeft(b) + b.Width + 200;

            Canvas.SetLeft(firstchildren, leftpos);
            Canvas.SetTop(firstchildren, Canvas.GetTop(b));
            Editor.Children.Add(firstchildren);
            AddConnection(b, firstchildren, RealtionShipType.OneToMany);
            LastControl = firstchildren;
        }
Example #12
0
 public MeetingDAL()
 {
     this.control = EntityControl.CreateEntityControl("WC.Model");
 }
Example #13
0
 public ZEX2DAL()
 {
     this.control = EntityControl.CreateEntityControl("WC.Model");
 }
Example #14
0
        private void LoadRedactor(string path, string name)
        {
            try
            {
                foreach (TabPage tab in RedactorsTabControl.TabPages)
                {
                    if (tab.Controls.Count == 1)
                    {
                        var redactor = tab.Controls[0] as IResourceControl;
                        if (redactor != null)
                        {
                            if (redactor.ResourcePath == path)
                            {
                                RedactorsTabControl.SelectedTab = tab;
                                return;
                            }
                        }
                    }
                }

                var     type    = Resource.GetType(path);
                Control control = null;
                switch (type)
                {
                case ResourceType.Texture: control = new TextureControl(path); break;

                case ResourceType.Sprite: control = new SpriteControl(path); break;

                case ResourceType.Ragdoll: control = new RagdollControl(path); break;

                case ResourceType.Animation: control = new AnimationControl(path); break;

                case ResourceType.Tool: control = new ToolControl(path); break;

                case ResourceType.Entity: control = new EntityControl(path); break;

                case ResourceType.Tile: control = new TileControl(path); break;

                case ResourceType.Event: control = new EventControl(path); break;

                case ResourceType.Outfit: control = new OutfitControl(path); break;

                default:
                    MessageBox.Show(this, "Resource [" + Resource.TypeToString(type) +
                                    "] redactor does not implemented!", "Warning!",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning); break;
                }

                if (control == null)
                {
                    return;
                }
                control.Dock = DockStyle.Fill;

                var page = new TabPage(name);
                page.ImageIndex = Resource.TypeToIcon(type);
                bool refresh = RedactorsTabControl.TabPages.Count == 0;
                RedactorsTabControl.TabPages.Add(page);

                page.Controls.Add(control);

                var iresource = control as IResourceControl;
                iresource.StateChanged += Redactor_StateChanged;

                RedactorsTabControl.SelectedTab = page;
                if (RedactorsTabControl.TabPages.Count == 1)
                {
                    RedactorsTabControl.SelectedTab.Text = iresource.ResourceName + (iresource.Saved ? "" : "*");
                    UndoToolStripMenuItem.Enabled        = iresource.UndoEnabled;
                    RedoToolStripMenuItem.Enabled        = iresource.RedoEnabled;
                    CloseToolStripMenuItem.Enabled       = true;
                    SaveToolStripMenuItem.Enabled        = !iresource.Saved;
                    SaveAsToolStripMenuItem.Enabled      = true;
                    CloseOthersToolStripMenuItem.Enabled = true;
                    ResourceToolStripMenuItem.DropDownItems.Clear();
                    ResourceToolStripMenuItem.DropDownItems.AddRange(iresource.MenuTabs);
                    ResourceToolStripMenuItem.Enabled = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.ToString(), "Error: Can not load resource redactor [" + name + "].",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #15
0
 public CRM_ContactDAL()
 {
     this.control = EntityControl.CreateEntityControl("WC.Model");
 }
Example #16
0
 public Mails_DetailDAL()
 {
     this.control = EntityControl.CreateEntityControl("WC.Model");
 }
Example #17
0
 public Flows_StepActionDAL()
 {
     this.control = EntityControl.CreateEntityControl("WC.Model");
 }
 private void DeleteConnections(EntityControl clickSource)
 {
     List<Line> lines = (List<Line>) _connections[clickSource];
     foreach (Line line in lines)
     {
         _container.Children.Remove(line);
     }
     _connections.Remove(clickSource);
 }
 private void DrawConnections(EntityControl clickSource, BaseEntity sourceItem)
 {
     List<Line> lines = new List<Line>(sourceItem.Items.Count);
     _connections.Add(clickSource, lines);
     foreach (Item item in sourceItem.Items)
     {
         EntityControl destination = _elementMapping[item];
         Line connection = DrawConnection(clickSource, destination);
         _container.Children.Add(connection);
         lines.Add(connection);
     }
 }
Example #20
0
 public void AddEnemy(EntityControl o)
 {
     Enemies.Add(o);
     o.transform.parent = transform;
 }
Example #21
0
 public Gov_StepDAL()
 {
     this.control = EntityControl.CreateEntityControl("WC.Model");
 }
Example #22
0
 public PaperDownloadDAL()
 {
     this.control = EntityControl.CreateEntityControl("WC.Model");
 }
        private void SetupEntityControl(double rowHeight, EntityControl entityCtl, int year)
        {
            entityCtl.MouseLeftButtonDown += item_Click;
            entityCtl.MouseEnter += entity_Over;
            entityCtl.MouseLeave += entity_Out;
            entityCtl.RandomDisplacement = RandomDisplacement(-1, 1);
            entityCtl.RowHeight = rowHeight;

            entityCtl.X = AbsoluteYearToPixel(year);
            entityCtl.RowMiddleTop = CalculateRowMiddle(rowHeight, entityCtl.RowNumber);
        }
 private void DrawPullout(EntityControl control, string name)
 {
     Point sourcePosition = control.Position;
     DrawPullout(sourcePosition, control, name);
 }
Example #25
0
 public Sys_RoleDAL()
 {
     this.control = EntityControl.CreateEntityControl("WC.Model");
 }
Example #26
0
 public WorkLogDAL()
 {
     this.control = EntityControl.CreateEntityControl("WC.Model");
 }
Example #27
0
 public EntityCollection(EntityControl <T> entityCtrl)
     : this(entityCtrl, null)
 {
 }
 private Line DrawConnection(EntityControl source, EntityControl destination)
 {
     Point sourceCenter = source.Position;
     Point destCenter = destination.Position;
     Line connector = new Line();
     connector.X1 = sourceCenter.X;
     connector.Y1 = sourceCenter.Y;
     connector.X2 = destCenter.X;
     connector.Y2 = destCenter.Y;
     connector.SetValue(Line.StrokeProperty, "#000000");
     connector.SetValue(Line.StrokeThicknessProperty, 2*ZoomFactor);
     connector.Opacity = 0.5;
     connector.SetValue(ZIndexProperty, -1);
     return connector;
 }
Example #29
0
 public News_ArticleDAL()
 {
     this.control = EntityControl.CreateEntityControl("WC.Model");
 }
Example #30
0
 public OnLoadSystemCommonData()
 {
     _control = EntityControl.CreateEntityControl();
 }
Example #31
0
 public Tasks_UserDAL()
 {
     this.control = EntityControl.CreateEntityControl("WC.Model");
 }
Example #32
0
 public Gov_Model_TypeDAL()
 {
     this.control = EntityControl.CreateEntityControl("WC.Model");
 }
Example #33
0
 public Docs_DocDAL()
 {
     this.control = EntityControl.CreateEntityControl("WC.Model");
 }
Example #34
0
 private void OnBackpackEntityClicked(EntityContainerControl sender, EntityControl entityControl)
 {
     Game.TryDropEntity(entityControl.EntityObject);
 }
Example #35
0
 public Flows_ModelStepDAL()
 {
     this.control = EntityControl.CreateEntityControl("WC.Model");
 }
Example #36
0
 public Bas_ComDAL()
 {
     this.control = EntityControl.CreateEntityControl("WC.Model");
 }