Exemple #1
0
        private void DockExecuted(DockEventArgs e)
        {
            //dock can only be center or outer - no splits
            if (e.TargetDock != DockTarget.Center)
            {
                OuterDock(e);
                return;
            }

            var groups   = e.SourceContent.OfType <TabWellModelBase>().ToList();
            var newGroup = new DocumentWellModel();

            foreach (var group in groups)
            {
                var allChildren = group.Children.ToList();
                foreach (var item in allChildren)
                {
                    group.Children.Remove(item);
                    item.IsPinned = false;
                    item.IsActive = false;

                    newGroup.Children.Add(item);
                }
            }

            e.SourceWindow.Close();
            Children.Add(newGroup);
            newGroup.IsActive     = true;
            newGroup.SelectedItem = newGroup.Children[0];
        }
        private void DocksList_DockSelect(object sender, DockEventArgs e)
        {
            int id = Convert.ToInt32(e.ID);

            if (e.WaterService == true)
            {
                txtWater.Text = "Available";
            }
            else
            {
                txtWater.Text = "Not Available";
            }
            if (e.ElectricalService == true)
            {
                txtElectrical.Text = "Available";
            }
            else
            {
                txtElectrical.Text = "Not Available";
            }

            dropDownSlips.DataSource     = MainManager.GetAllSlipsAvailable(id);
            dropDownSlips.DataTextField  = "ID";
            dropDownSlips.DataValueField = "ID";
            dropDownSlips.DataBind();
            dropDownSlips.SelectedIndex = 0;
        }
        private void OuterDock(DockEventArgs e)
        {
            var groups   = e.SourceContent.OfType <TabWellModelBase>().ToList();
            var newGroup = new ToolWellModel()
            {
                Dock = (Dock)((int)e.TargetDock - 5)
            };

            foreach (var group in groups)
            {
                var allChildren = group.Children.ToList();
                foreach (var item in allChildren)
                {
                    group.Children.Remove(item);
                    item.IsPinned = false;
                    item.IsActive = false;

                    newGroup.Children.Add(item);
                }
            }

            var newSplit = new SplitPanelModel();

            newSplit.Orientation = e.TargetDock == DockTarget.DockLeft || e.TargetDock == DockTarget.DockRight
                ? Orientation.Horizontal
                : Orientation.Vertical;

            if (ParentPanel.ParentBranch == null)
            {
                ParentContainer.Content = newSplit;
            }
            else
            {
                ParentPanel.ParentBranch.Replace(ParentPanel, newSplit);
            }

            if (e.TargetDock == DockTarget.DockTop || e.TargetDock == DockTarget.DockLeft)
            {
                newSplit.Item1           = newGroup;
                newSplit.Item2           = ParentPanel;
                newSplit.Item1.PanelSize = new GridLength(e.DesiredSize);
            }
            else
            {
                newSplit.Item1           = ParentPanel;
                newSplit.Item2           = newGroup;
                newSplit.Item2.PanelSize = new GridLength(e.DesiredSize);
            }

            newGroup.IsActive     = true;
            newGroup.SelectedItem = newGroup.Children.First();

            e.SourceWindow.Close();
        }
        private void DockExecuted(DockEventArgs e)
        {
            var groups   = e.SourceContent.OfType <TabWellModelBase>().ToList();
            var newGroup = new ToolWellModel()
            {
                Dock = (Dock)((int)e.TargetDock - 5)
            };

            foreach (var group in groups)
            {
                var allChildren = group.Children.ToList();
                foreach (var item in allChildren)
                {
                    group.Children.Remove(item);
                    item.IsPinned = false;
                    item.IsActive = false;

                    newGroup.Children.Add(item);
                }
            }

            var newSplit = new SplitViewModel();

            newSplit.Orientation = e.TargetDock == DockTarget.DockLeft || e.TargetDock == DockTarget.DockRight
                ? Orientation.Horizontal
                : Orientation.Vertical;

            var existing = Content;

            Content = null;

            if (e.TargetDock == DockTarget.DockTop || e.TargetDock == DockTarget.DockLeft)
            {
                newSplit.Item1     = newGroup;
                newSplit.Item2     = existing;
                newSplit.Item1Size = new GridLength(e.DesiredSize);
            }
            else
            {
                newSplit.Item1     = existing;
                newSplit.Item2     = newGroup;
                newSplit.Item2Size = new GridLength(e.DesiredSize);
            }

            Content               = newSplit;
            newGroup.IsActive     = true;
            newGroup.SelectedItem = newGroup.Children.First();

            e.SourceWindow.Close();
        }
 protected override void DockExecuted(DockEventArgs e)
 {
     if (e.TargetDock == DockTarget.Center)
     {
         base.DockExecuted(e);
     }
     else if (e.TargetDock == DockTarget.SplitLeft || e.TargetDock == DockTarget.SplitTop || e.TargetDock == DockTarget.SplitRight || e.TargetDock == DockTarget.SplitBottom)
     {
         InnerDock(e);
     }
     else
     {
         OuterDock(e);
     }
 }
        /// <summary>
        /// Custom made event handler for dock selector
        /// </summary>
        /// <param name="sender">reference to the control/object that raisesthe event</param>
        /// <param name="e">event data</param>
        private void DockSelector_DockSelect(object sender, DockEventArgs e)
        {
            var dockID = e.ID;
            //found all available slips associated by ID
            var availableSlips = SlipManager.FindAvailableSlipByDock(dockID);

            //databound the available slip from the database
            uxAvailSlipSortedByDock1.DataSource = availableSlips;
            uxAvailSlipSortedByDock1.DataBind();
            //autogenerated select button, has 'Select' as default
            //changing default to "Lease"
            foreach (GridViewRow row in uxAvailSlipSortedByDock1.Rows)
            {
                LinkButton lb = (LinkButton)row.Cells[0].Controls[0];
                lb.Text = "Lease";
            }
        }
        // When a dock is selected, populate table and slip dropdown menu
        private void DockSelector_DockSelect(object sender, DockEventArgs e)
        {
            if (e.wService)
            {
                uxWater.Text = "Available";
            }
            else
            {
                uxWater.Text = "Unavailable";
            }
            if (e.eService)
            {
                uxElectric.Text = "Available";
            }
            else
            {
                uxElectric.Text = "Unavailable";
            }

            GetAvailableSlips(e.ID);
        }
        private void InnerDock(DockEventArgs e)
        {
            var index = ParentPanel.Children.IndexOf(this);

            if (e.TargetDock == DockTarget.SplitRight || e.TargetDock == DockTarget.SplitBottom)
            {
                index++;
            }

            var orientation = e.TargetDock == DockTarget.SplitLeft || e.TargetDock == DockTarget.SplitRight
                ? Orientation.Horizontal
                : Orientation.Vertical;

            var groups   = e.SourceContent.OfType <TabWellModelBase>().ToList();
            var newGroup = new DocumentWellModel();

            foreach (var group in groups)
            {
                var allChildren = group.Children.ToList();
                foreach (var item in allChildren)
                {
                    group.Children.Remove(item);
                    item.IsPinned = false;
                    item.IsActive = false;

                    newGroup.Children.Add(item);
                }
            }

            ParentPanel.Orientation = orientation;
            ParentPanel.Children.Insert(index, newGroup);

            foreach (var child in ParentPanel.Children)
            {
                child.PanelSize = new GridLength(1, GridUnitType.Star);
            }

            e.SourceWindow.Close();
        }
        private void DockExecuted(DockEventArgs e)
        {
            var groups   = e.SourceContent.OfType <TabWellModelBase>().ToList();
            var newGroup = new DocumentWellModel();

            foreach (var group in groups)
            {
                var allChildren = group.Children.ToList();
                foreach (var item in allChildren)
                {
                    group.Children.Remove(item);
                    item.IsPinned = false;
                    item.IsActive = false;

                    newGroup.Children.Add(item);
                }
            }

            e.SourceWindow.Close();
            Children.Add(newGroup);
            newGroup.IsActive     = true;
            newGroup.SelectedItem = newGroup.Children[0];
        }
        protected virtual void DockExecuted(DockEventArgs e)
        {
            //Reverse() to preserve tab order
            var groups = e.SourceContent.OfType <TabWellModelBase>().Reverse().ToList();
            var target = e.TargetItem as TabModel;
            var index  = target == null || target.IsPinned ? 0 : Children.IndexOf(target);

            foreach (var group in groups)
            {
                var allChildren = group.Children.Reverse().ToList();
                foreach (var item in allChildren)
                {
                    group.Children.Remove(item);
                    item.IsPinned = false;
                    item.IsActive = false;

                    Children.Insert(index, item);
                }
            }

            e.SourceWindow.Close();
            IsActive     = true;
            SelectedItem = Children[index];
        }
        protected override void DockExecuted(DockEventArgs e)
        {
            if (e.TargetDock == DockTarget.Center)
            {
                base.DockExecuted(e);
                return;
            }

            var groups   = e.SourceContent.OfType <TabWellModelBase>().ToList();
            var newGroup = new ToolWellModel()
            {
                Dock = Dock
            };

            foreach (var group in groups)
            {
                var allChildren = group.Children.ToList();
                foreach (var item in allChildren)
                {
                    group.Children.Remove(item);
                    item.IsPinned = false;
                    item.IsActive = false;

                    newGroup.Children.Add(item);
                }
            }

            var newSplit = new SplitPanelModel();

            double remainingSize;

            if (e.TargetDock == DockTarget.SplitLeft || e.TargetDock == DockTarget.SplitRight)
            {
                newSplit.Orientation = Orientation.Horizontal;
                remainingSize        = Width - e.DesiredSize;
            }
            else
            {
                newSplit.Orientation = Orientation.Vertical;
                remainingSize        = Height - e.DesiredSize;
            }

            ParentBranch.Replace(this, newSplit);
            if (e.TargetDock == DockTarget.SplitTop || e.TargetDock == DockTarget.SplitLeft)
            {
                newSplit.Item1           = newGroup;
                newSplit.Item2           = this;
                newSplit.Item1.PanelSize = new GridLength(e.DesiredSize, GridUnitType.Star);
                newSplit.Item2.PanelSize = new GridLength(remainingSize, GridUnitType.Star);
            }
            else
            {
                newSplit.Item1           = this;
                newSplit.Item2           = newGroup;
                newSplit.Item1.PanelSize = new GridLength(remainingSize, GridUnitType.Star);
                newSplit.Item2.PanelSize = new GridLength(e.DesiredSize, GridUnitType.Star);
            }

            newGroup.IsActive     = true;
            newGroup.SelectedItem = newGroup.Children.First();

            e.SourceWindow.Close();
        }
Exemple #12
0
 private void DockOperations_DockPositionChanging(object sender, DockEventArgs e)
 {
     this.silenced = true;
 }
Exemple #13
0
 private void DockOperations_DockPositionChanged(object sender, DockEventArgs e)
 {
     this.silenced = false;
 }