Ejemplo n.º 1
0
        //=====================================================================
        // HELPER FUNCTIONS
        //=====================================================================

        public List <string> GetCategories(SfKanban kanban)
        {
            // Add column categories to a list
            // Displayed in a combobox in TaskDialog for the user to choose
            // which column for the task to be in
            List <string> lstCategories = new List <string>();

            foreach (var col in kanban.ActualColumns)
            {
                // Fill categories list with the categories from the col
                var strCategories = col.Categories;
                if (strCategories.Contains(","))
                {
                    // >1 sections in col, split into separate sections
                    var tokens = strCategories.Split(",");
                    foreach (var token in tokens)
                    {
                        lstCategories.Add(token);
                    }
                }
                else // 1 section in column
                {
                    lstCategories.Add(strCategories);
                }
            }
            return(lstCategories);
        }
Ejemplo n.º 2
0
        private void ExpandedChanged(bool isExpanded)
        {
            if (Tags != null)
            {
                Tags.IsExpanded = IsExpanded;
            }

            if (!isExpanded)
            {
                ClearValue(Control.WidthProperty);
                Width = 50;

                ClearValue(Control.TemplateProperty);

                if (CollapsedColumnTemplate != null)
                {
                    Template = CollapsedColumnTemplate;
                }
                else if (collapsedTemplate != null)
                {
                    Template = collapsedTemplate;
                }

                foreach (KanbanCardItem card in Cards)
                {
                    card.Visibility = Visibility.Collapsed;
                }
            }
            else
            {
                ClearValue(Control.WidthProperty);

                PropertyInfo propInfo = typeof(KanbanColumn).GetProperty("Area", BindingFlags.Instance |
                                                                         BindingFlags.NonPublic |
                                                                         BindingFlags.Public);

                SfKanban area = propInfo.GetValue(this) as SfKanban;

                if (area != null)
                {
                    Binding binding = new Binding()
                    {
                        Source = area,
                        Path   = new PropertyPath("ActualColumnWidth")
                    };
                    SetBinding(Control.WidthProperty, binding);
                }

                if (expandedTemplate != null)
                {
                    Template = expandedTemplate;
                }

                foreach (KanbanCardItem card in Cards)
                {
                    card.Visibility = Visibility.Visible;
                }
            }
        }
Ejemplo n.º 3
0
        public List <string> GetColorKeys(SfKanban kanban)
        {
            // Add color keys to a list
            // Displayed in a combobox in TaskDialog for user to choose
            // the color key for a task
            List <string> lstColorKeys = new List <string>();

            foreach (var colorMap in kanban.IndicatorColorPalette)
            {
                // Add each key from the color palette to the combobox
                var key = colorMap.Key;
                lstColorKeys.Add(key.ToString());
            }
            return(lstColorKeys);
        }
Ejemplo n.º 4
0
        public override View GetSampleContent(Context context)
        {
            var kanban = new SfKanban(context);

            kanban.SetBackgroundColor(Color.ParseColor("#F2F2F2"));
            kanban.PlaceholderStyle.SelectedBackgroundColor = Color.ParseColor("#FBC7AB");

            menu = new KanbanColumn(context)
            {
                Categories = new List <object>()
                {
                    "Menu"
                }
            };
            menu.Title     = "Menu";
            menu.AllowDrop = false;
            menu.ErrorBarSettings.Color = Color.ParseColor("#D53130");
            kanban.Columns.Add(menu);

            order = new KanbanColumn(context)
            {
                Categories = new List <object>()
                {
                    "Dining", "Delivery"
                }
            };
            order.Title = "Order";
            order.ErrorBarSettings.Color = Color.ParseColor("#D53130");
            kanban.Columns.Add(order);

            ready = new KanbanColumn(context)
            {
                Categories = new List <object>()
                {
                    "Ready"
                }
            };
            ready.Title     = "Ready to Serve";
            ready.AllowDrag = false;
            ready.ErrorBarSettings.Color = Color.ParseColor("#D53130");
            kanban.Columns.Add(ready);

            delivery = new KanbanColumn(context)
            {
                Categories = new List <object>()
                {
                    "Door Delivery"
                }
            };
            delivery.Title     = "Delivery";
            delivery.AllowDrag = false;
            delivery.ErrorBarSettings.Color = Color.ParseColor("#D53130");
            kanban.Columns.Add(delivery);

            kanban.ItemsSource = new KanbanData().Data;

            kanban.Workflows.Add(new KanbanWorkflow("Menu", new List <object> {
                "Dining", "Delivery"
            }));

            kanban.Workflows.Add(new KanbanWorkflow("Dining", new List <object> {
                "Ready"
            }));

            kanban.Workflows.Add(new KanbanWorkflow("Delivery", new List <object> {
                "Door Delivery"
            }));

            kanban.DragStart += Kanban_DragStart;

            kanban.DragEnd += Kanban_DragEnd;

            kanban.DragOver += Kanban_DragOver;

            kanban.Adapter = new CustomizationAdapter(kanban);

            return(kanban);
        }
Ejemplo n.º 5
0
 internal CustomizationAdapter(SfKanban kanban) : base(kanban)
 {
 }
        public GettingStartedKanban()
        {
            KanbanColumn column1;
            KanbanColumn column2;
            KanbanColumn column3;
            KanbanColumn column4;

            kanban = new SfKanban();

            column1 = new KanbanColumn()
            {
                Categories = new List <object>()
                {
                    "Open", "Postponed", "Validated"
                }
            };
            column1.Title        = "To Do";
            column1.MinimumLimit = 5;
            column1.MaximumLimit = 15;
            kanban.Columns.Add(column1);

            column2 = new KanbanColumn()
            {
                Categories = new List <object>()
                {
                    "In Progress"
                }
            };
            column2.Title        = "In Progress";
            column2.MinimumLimit = 3;
            column2.MaximumLimit = 8;
            kanban.Columns.Add(column2);

            column3 = new KanbanColumn()
            {
                Categories = new List <object>()
                {
                    "Code Review"
                }
            };
            column3.Title        = "Code Review";
            column3.MinimumLimit = 5;
            column3.MaximumLimit = 10;
            kanban.Columns.Add(column3);

            column4 = new KanbanColumn()
            {
                Categories = new List <object>()
                {
                    "Closed", "Closed-No Code Changes", "Resolved"
                }
            };
            column4.Title        = "Done";
            column4.MinimumLimit = 8;
            column4.MaximumLimit = 12;
            kanban.Columns.Add(column4);

            kanban.ItemsSource = new KanbanDataSource().Data;

            List <KanbanColorMapping> colormodels = new List <KanbanColorMapping>();

            colormodels.Add(new KanbanColorMapping("Purple", UIColor.Purple));
            colormodels.Add(new KanbanColorMapping("Red", UIColor.Red));
            colormodels.Add(new KanbanColorMapping("Orange", UIColor.Orange));
            colormodels.Add(new KanbanColorMapping("Brown", UIColor.Brown));
            kanban.IndicatorColorPalette = colormodels;

            List <KanbanWorkflow> keyfield = new List <KanbanWorkflow>();

            keyfield.Add(new KanbanWorkflow("Open", new List <object> {
                "In Progress"
            }));
            keyfield.Add(new KanbanWorkflow("In Progress", new List <object> {
                "Postponed", "Validated", "Code Review", "Closed-No Code Changes"
            }));
            keyfield.Add(new KanbanWorkflow("Code Review", new List <object> {
                "Closed", "Resolved"
            }));
            keyfield.Add(new KanbanWorkflow("Closed", new List <object> {
                "Open"
            }));
            keyfield.Add(new KanbanWorkflow("Postponed", new List <object> {
                "In Progress"
            }));
            keyfield.Add(new KanbanWorkflow("Validated", new List <object> {
                "In Progress"
            }));
            keyfield.Add(new KanbanWorkflow("Closed-No Code Changes", new List <object> {
            }));
            keyfield.Add(new KanbanWorkflow("Resolved", new List <object> {
            }));
            kanban.Workflows = keyfield;

            this.AddSubview(kanban);
        }
Ejemplo n.º 7
0
        public override View GetSampleContent(Context context)
        {
            var kanban = new SfKanban(context);

            column1 = new KanbanColumn(context)
            {
                Categories = new List <object>()
                {
                    "Open", "Postponed", "Validated"
                }
            };
            column1.Title        = "To Do";
            column1.MinimumLimit = 5;
            column1.MaximumLimit = 20;
            kanban.Columns.Add(column1);

            column2 = new KanbanColumn(context)
            {
                Categories = new List <object>()
                {
                    "In Progress"
                }
            };
            column2.Title        = "In Progress";
            column2.MinimumLimit = 5;
            column2.MaximumLimit = 10;
            kanban.Columns.Add(column2);

            column3 = new KanbanColumn(context)
            {
                Categories = new List <object>()
                {
                    "Code Review"
                }
            };
            column3.Title        = "Code Review";
            column3.MinimumLimit = 10;
            column3.MaximumLimit = 15;
            kanban.Columns.Add(column3);

            column4 = new KanbanColumn(context)
            {
                Categories = new List <object>()
                {
                    "Closed", "Closed-No Code Changes", "Resolved"
                }
            };
            column4.Title        = "Done";
            column4.MinimumLimit = 10;
            column4.MaximumLimit = 15;
            kanban.Columns.Add(column4);

            kanban.ItemsSource = new KanbanData().Data;

            List <KanbanColorMapping> colormodels = new List <KanbanColorMapping>();

            colormodels.Add(new KanbanColorMapping("Green", Color.Green));
            colormodels.Add(new KanbanColorMapping("Red", Color.Red));
            colormodels.Add(new KanbanColorMapping("Orange", Color.Orange));
            colormodels.Add(new KanbanColorMapping("Brown", Color.Brown));

            kanban.IndicatorColorPalette = colormodels;

            List <KanbanWorkflow> keyfield = new List <KanbanWorkflow>();

            keyfield.Add(new KanbanWorkflow("Open", new List <object> {
                "In Progress"
            }));
            keyfield.Add(new KanbanWorkflow("In Progress", new List <object> {
                "Postponed", "Validated", "Code Review", "Closed-No Code Changes"
            }));
            keyfield.Add(new KanbanWorkflow("Code Review", new List <object> {
                "Closed", "Resolved"
            }));
            keyfield.Add(new KanbanWorkflow("Closed", new List <object> {
                "Open"
            }));
            keyfield.Add(new KanbanWorkflow("Postponed", new List <object> {
                "In Progress"
            }));
            keyfield.Add(new KanbanWorkflow("Validated", new List <object> {
                "In Progress"
            }));
            keyfield.Add(new KanbanWorkflow("Closed-No Code Changes", new List <object> {
            }));
            keyfield.Add(new KanbanWorkflow("Resolved", new List <object> {
            }));
            kanban.Workflows = keyfield;

            return(kanban);
        }
Ejemplo n.º 8
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            kanban             = new SfKanban();
            kanban.ItemsSource = model.Cards;

            KanbanColumn column1 = new KanbanColumn();

            column1.Title        = "To Do";
            column1.MinimumLimit = 5;
            column1.MaximumLimit = 15;
            column1.Categories   = new List <object> {
                "Open", "Postponed", "Validated"
            };
            kanban.Columns.Add(column1);

            KanbanColumn column2 = new KanbanColumn();

            column2.Title        = "In Progress";
            column2.MinimumLimit = 3;
            column2.MaximumLimit = 8;
            column2.Categories   = new List <object> {
                "In Progress"
            };
            kanban.Columns.Add(column2);

            KanbanColumn column3 = new KanbanColumn();

            column3.Title        = "Code Review";
            column3.MinimumLimit = 5;
            column3.MaximumLimit = 10;
            column3.Categories   = new List <object> {
                "Code Review"
            };
            kanban.Columns.Add(column3);

            KanbanColumn column4 = new KanbanColumn();

            column4.Title        = "Done";
            column4.MinimumLimit = 8;
            column4.MaximumLimit = 12;
            column4.Categories   = new List <object> {
                "Closed", "Closed-No Code Changes", "Resolved"
            };
            kanban.Columns.Add(column4);

            List <KanbanColorMapping> colormodels = new List <KanbanColorMapping>();

            colormodels.Add(new KanbanColorMapping("Purple", UIColor.Purple));
            colormodels.Add(new KanbanColorMapping("Red", UIColor.Red));
            colormodels.Add(new KanbanColorMapping("Orange", UIColor.Brown));
            colormodels.Add(new KanbanColorMapping("Brown", UIColor.Green));
            kanban.IndicatorColorPalette = colormodels;

            List <KanbanWorkflow> keyfield = new List <KanbanWorkflow>();

            keyfield.Add(new KanbanWorkflow("Open", new List <object> {
                "In Progress"
            }));
            keyfield.Add(new KanbanWorkflow("In Progress", new List <object> {
                "Postponed", "Validated", "Code Review", "Closed-No Code Changes"
            }));
            keyfield.Add(new KanbanWorkflow("Code Review", new List <object> {
                "Closed", "Resolved"
            }));
            keyfield.Add(new KanbanWorkflow("Closed", new List <object> {
                "Open"
            }));
            keyfield.Add(new KanbanWorkflow("Postponed", new List <object> {
                "In Progress"
            }));
            keyfield.Add(new KanbanWorkflow("Validated", new List <object> {
                "In Progress"
            }));
            keyfield.Add(new KanbanWorkflow("Closed-No Code Changes", new List <object> {
            }));
            keyfield.Add(new KanbanWorkflow("Resolved", new List <object> {
            }));

            kanban.Workflows = keyfield;
            kanban.Frame     = View.Frame;

            this.View.AddSubviews(kanban);
        }
Ejemplo n.º 9
0
        public CustomizationKanban()
        {
            kanban = new SfKanban();

            KanbanErrorBarSettings errorBar = new KanbanErrorBarSettings();

            errorBar.Height             = 2;
            errorBar.Color              = UIColor.FromRGB(179.0f / 255.0f, 71.0f / 255.0f, 36.0f / 255.0f);
            errorBar.MaxValidationColor = UIColor.FromRGB(211.0f / 255.0f, 51.0f / 255.0f, 54.0f / 255.0f);
            errorBar.MinValidationColor = UIColor.FromRGB(67.0f / 255.0f, 188.0f / 255.0f, 131.0f / 255.0f);

            KanbanPlaceholderStyle style = new KanbanPlaceholderStyle();

            style.SelectedBackgroundColor = UIColor.FromRGB(250.0f / 255.0f, 199.0f / 255.0f, 173.0f / 255.0f);
            kanban.PlaceholderStyle       = style;

            KanbanColumn column1 = new KanbanColumn()
            {
                Categories = new List <object>()
                {
                    "Menu"
                }
            };

            column1.Title            = "Menu";
            column1.ErrorBarSettings = errorBar;
            kanban.Columns.Add(column1);

            KanbanColumn column2 = new KanbanColumn()
            {
                Categories = new List <object>()
                {
                    "Dining", "Delivery"
                }
            };

            column2.Title            = "Order";
            column2.ErrorBarSettings = errorBar;
            kanban.Columns.Add(column2);

            KanbanColumn column3 = new KanbanColumn()
            {
                Categories = new List <object>()
                {
                    "Ready to Serve"
                }
            };

            column3.Title            = "Ready to Serve";
            column3.AllowDrag        = false;
            column3.ErrorBarSettings = errorBar;
            kanban.Columns.Add(column3);

            KanbanColumn column4 = new KanbanColumn()
            {
                Categories = new List <object>()
                {
                    "Door Delivery"
                }
            };

            column4.Title            = "Delivery";
            column4.AllowDrag        = false;
            column4.ErrorBarSettings = errorBar;
            kanban.Columns.Add(column4);

            kanban.ItemsSource = this.ItemsSourceCards();

            List <KanbanWorkflow> flows = new List <KanbanWorkflow>();

            flows.Add(new KanbanWorkflow("Menu", new List <object>()
            {
                "Dining", "Delivery"
            }));
            flows.Add(new KanbanWorkflow("Dining", new List <object>()
            {
                "Ready to Serve"
            }));
            flows.Add(new KanbanWorkflow("Delivery", new List <object>()
            {
                "Door Delivery"
            }));
            flows.Add(new KanbanWorkflow("Ready to Serve", new List <object>()
            {
            }));
            flows.Add(new KanbanWorkflow("Door Delivery", new List <object>()
            {
            }));

            kanban.Workflows = flows;

            kanban.DragStart += (object sender, KanbanDragStartEventArgs e) =>
            {
                if ((e.Data as KanbanModel).Category.ToString() == "Menu")
                {
                    e.KeepItem = true;
                }
            };

            kanban.DragEnd += (object sender, KanbanDragEndEventArgs e) =>
            {
                if (e.TargetColumn != null && e.SourceColumn.Categories.Contains("Menu"))
                {
                    e.Cancel = true;
                    e.TargetColumn.InsertItem(CloneModel((e.Data as KanbanModel), e.TargetCategory), e.TargetIndex);
                }

                else if (e.TargetColumn != null && e.TargetCategory != null)
                {
                    (e.Data as KanbanModel).Category = e.TargetCategory;
                }
            };

            this.AddSubview(kanban);
        }
Ejemplo n.º 10
0
        public override void ViewDidLoad()
        {
            var toolbar = new UIView()
            {
                Frame           = new CGRect(0, 0, View.Bounds.Width, 80),
                BackgroundColor = UIColor.FromRGB(139, 166, 244)
            };

            var returnBtn = new UIButton()
            {
                Frame = new CGRect(5, 40, 70, 40)
            };

            returnBtn.SetTitle("Return", UIControlState.Normal);
            returnBtn.SetTitleColor(UIColor.White, UIControlState.Normal);
            returnBtn.TouchUpInside += delegate
            {
                DismissViewController(true, null);
            };

            var addDeckBtn = new UIButton()
            {
                Frame = new CGRect(toolbar.Bounds.Width - 200, 40, 100, 40)
            };

            addDeckBtn.SetTitle("Add Deck", UIControlState.Normal);
            addDeckBtn.SetTitleColor(UIColor.White, UIControlState.Normal);
            addDeckBtn.TouchUpInside += delegate {
                View.AddSubview(Dialog.MakeDialog(nameof(Deck), this, Dialog.CreateSolitiareType.CreateDeck));
            };

            var addCardBtn = new UIButton()
            {
                Frame = new CGRect(toolbar.Bounds.Width - 100, 40, 100, 40)
            };

            addCardBtn.SetTitle("Add Card", UIControlState.Normal);
            addCardBtn.SetTitleColor(UIColor.White, UIControlState.Normal);
            addCardBtn.TouchUpInside += delegate {
                View.AddSubview(Dialog.MakeDialog(nameof(Card), this, Dialog.CreateSolitiareType.CreateCard));
                //AddCard("Card", "Some Card Text", "Name");
            };


            thisKanban = new SfKanban()
            {
                Frame = new CGRect(0, toolbar.Bounds.Height, View.Bounds.Width, View.Bounds.Height - toolbar.Bounds.Height)
            };

            // Calling our initalizer
            new SetupBoardAndSfkanban(this).InvokeInitEvent();


            List <Contributor> ree = new List <Contributor>();

            ree.Add(new Contributor("Kyle", "Murphy", "*****@*****.**"));
            ree.Add(new Contributor("re", "goddamn", "fuuuuck"));

            thisBoard.Contributors = ree;

            toolbar.AddSubviews(returnBtn, addDeckBtn, addCardBtn);
            View.AddSubviews(toolbar, thisKanban);
        }