Example #1
0
        private void btnAnull_MouseUp(object sender, EventArgs e)
        {
            toolIcon _toolicon = (toolIcon)sender;

            _toolicon.Focus();
            if (btnAnull_Click != null)
            {
                btnAnull_Click(this);
            }
        }
Example #2
0
 public void btnEdit_MouseUp(object sender, EventArgs e)
 {
     if (sender != null)
     {
         toolIcon _toolicon = (toolIcon)sender;
         _toolicon.Focus();
     }
     if (btnEdit_Click != null)
     {
         btnEdit_Click(sender);
     }
 }
Example #3
0
        private toolIcon bind_toolIcon(toolIcon toolIcon, string property, bool do_opposite)
        {
            Binding Binding = new Binding();

            Binding.Source = this;
            Binding.Path   = new PropertyPath(property);
            Binding.Mode   = BindingMode.TwoWay;

            if (do_opposite)
            {
                Cognitivo.Converters.TrueToFalseConverter True2False = new Cognitivo.Converters.TrueToFalseConverter();
                Binding.Converter = True2False;
            }

            Binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
            toolIcon.SetBinding(IsEnabledProperty, Binding);
            return(toolIcon);
        }
Example #4
0
 private toolIcon check_Icons(toolIcon toolIcon, string iconName, ref entity.Brillo.Security security)
 {
     //Check if Icon should be shown, bind, and rout events.
     if (btnNew_Click != null & iconName == "New" && security.create)
     {
         toolIcon.Click += btnNew_MouseUp;
     }
     else if (btnDelete_Click != null & iconName == "Delete" && security.delete)
     {
         toolIcon.Click += btnDelete_MouseUp;
         toolIcon        = bind_toolIcon(toolIcon, "Delete_IsEnabled", false);
     }
     else if (btnEdit_Click != null & iconName == "Edit" && security.edit)
     {
         toolIcon.Click += btnEdit_MouseUp;
         toolIcon        = bind_toolIcon(toolIcon, "Edit_IsEnabled", false);
     }
     else if (btnSave_Click != null & iconName == "Save")
     {
         toolIcon.Click += btnSave_MouseUp;
         toolIcon        = bind_toolIcon(toolIcon, "IsEditable", false);
     }
     else if (btnCancel_Click != null & iconName == "Cancel")
     {
         toolIcon.Click += btnCancel_MouseUp;
         toolIcon        = bind_toolIcon(toolIcon, "IsEditable", false);
     }
     else if (btnApprove_Click != null & iconName == "Approve" && security.approve)
     {
         toolIcon.Click += btnApprove_MouseUp;
         toolIcon        = bind_toolIcon(toolIcon, "Approve_IsEnabled", false);
     }
     else if (btnAnull_Click != null & iconName == "Annul" && security.annul)
     {
         toolIcon.Click += btnAnull_MouseUp;
         toolIcon        = bind_toolIcon(toolIcon, "Annul_IsEnabled", false);
     }
     else
     {
         toolIcon.Foreground = Brushes.Gainsboro;
         return(null);
     }
     return(toolIcon);
 }
Example #5
0
        private void get_Icons(string mod_name, ref entity.Brillo.Security security)
        {
            toolBarData t = new toolBarData();

            foreach (DataRow row in t.dtIconList_property.Select("modIcon = '" + mod_name + "'"))
            {
                toolIcon ico = new toolIcon();

                string _toolTip            = row["tooltip"].ToString();
                var    appLocTextExtension = new LocTextExtension("COGNITIVO:local:" + _toolTip + "").SetBinding(ico, toolIcon.icoNameProperty);
                ico.imgSource = row["img"].ToString();
                ico.Cursor    = Cursors.Hand;
                ico           = check_Icons(ico, _toolTip, ref security);

                if (ico != null && row["placement"].ToString() == "m")
                {
                    if (_toolTip == "Delete")
                    {
                        System.Windows.Shapes.Rectangle rect;
                        rect        = new System.Windows.Shapes.Rectangle();
                        rect.Fill   = new SolidColorBrush(Colors.Gainsboro);
                        rect.Width  = 0.5;
                        rect.Margin = new Thickness(4);
                        stackMain.Children.Add(rect);
                        stackMain.Children.Add(ico);
                    }
                    else
                    {
                        stackMain.Children.Add(ico);
                    }
                }
                else if (ico != null && row["placement"].ToString() == "s")
                { //Then Secondary Stack
                    stackSide.Children.Add(ico);
                }
            }
        }