Ejemplo n.º 1
0
        public void CreateProcess()
        {
            this.State = TypeControl.Create;
            using (DBContext context = new DBContext(false)) {
                CurrentStartProcess = StartProcess.New();
                ProcessControlWindow pcw = new ProcessControlWindow();
                this.IsFolderPath = false;
                WindowPositionBehaviour.SetWindowPosition(pcw, WindowPosition.None);
                WindowVisibilityBehaviour.SetIsDialogVisible(pcw, true);
                if (pcw.DialogResult == true)
                {
                    CurrentStartProcess.IdUser = App.CurrentUser.ID;
                    context.StartProcesses.AddObject(CurrentStartProcess);
                    context.SaveChanges();

                    _processCollection.Add(CurrentStartProcess);
                }
                CurrentStartProcess = null;
            }
            this.State = TypeControl.Normal;
        }
Ejemplo n.º 2
0
        public void InsertItem(int index, ControlMenuItem item)
        {
            WindowPosition wp = WindowPositionBehaviour.GetWindowPosition(this);

            if (item.Element != null)
            {
                switch (wp)
                {
                case WindowPosition.LeftTop:
                case WindowPosition.LeftBottom:
                    wp = WindowPosition.Left;
                    break;

                case WindowPosition.RightTop:
                case WindowPosition.RightBottom:
                    wp = WindowPosition.Right;
                    break;
                }
                WindowPositionBehaviour.SetWindowPosition(item.Element, wp);
            }

            this.Items.Insert(index, item);
        }
Ejemplo n.º 3
0
        public void EntryAddItem(ControlMenuItem item)
        {
            int screen = WindowPositionBehaviour.GetWindowScreen(this);

            WindowPosition wp = WindowPositionBehaviour.GetWindowPosition(this);

            WindowPosition wpe = wp;

            if (item.Element != null)
            {
                switch (wp)
                {
                case WindowPosition.LeftTop:
                case WindowPosition.LeftBottom:
                    wpe = WindowPosition.Left;
                    break;

                case WindowPosition.RightTop:
                case WindowPosition.RightBottom:
                    wpe = WindowPosition.Right;
                    break;
                }
                if (WindowPositionBehaviour.GetWindowPosition(item.Element) != WindowPosition.None)
                {
                    WindowPositionBehaviour.SetWindowPosition(item.Element, wpe);
                }

                WindowPositionBehaviour.SetWindowScreen(item.Element, WindowPositionBehaviour.GetWindowScreen(this));
            }

            this.Items.Add(item);

            PanelSettings.Build(wp, screen, this.Items.Where(x => x.Parent != null).Select(x => new PanelItemParametry()
            {
                Element = x.TypeElement, Position = wpe, Bounds = new Rect(GetStartSizeByTypePanel(x.TypeElement))
            }));
        }