Пример #1
0
            public static void Link(LinkedButton A, LinkedButton B, Control Parent)
            {
                if (A.Owner == B.Owner)
                {
                    return;
                }

                if ((A.IsInput && A.IsLinked()) || (B.IsInput && B.IsLinked()))
                {
                    throw new InvalidOperationException("Tried to double-link an input value.");
                }

                if (A.IsInput)
                {
                    if (!A.ValueType.IsAssignableFrom(B.ValueType))
                    {
                        throw new InvalidOperationException("Tried to link unlike variable types.");
                    }
                    Parent.Controls.Add(A.InboundConnection = new LinkLine(B, A, Parent));
                }
                else
                {
                    if (!B.ValueType.IsAssignableFrom(A.ValueType))
                    {
                        throw new InvalidOperationException("Tried to link unlike variable types.");
                    }
                    Parent.Controls.Add(B.InboundConnection = new LinkLine(A, B, Parent));
                }

                A.LinkedBtns.Add(B);
                B.LinkedBtns.Add(A);
            }
        public void ColorName(string name, LinkedButton button)
        {
            string checkedUser = UserCheck.UserCheck.CheckUser(button.name.Text);

            switch (checkedUser)
            {
            case "bureaucrat":
                button.name.ForeColor = Color.FromArgb(Int32.Parse("ff3f43", NumberStyles.HexNumber));
                break;

            case "sysop":
                button.name.ForeColor = Color.FromArgb(Int32.Parse("a431fc", NumberStyles.HexNumber));;
                break;

            case "codeeditor":
                button.name.ForeColor = Color.FromArgb(Int32.Parse("5874f3", NumberStyles.HexNumber));;
                break;

            case "content-moderator":
                button.name.ForeColor = Color.FromArgb(Int32.Parse("7FFFD4", NumberStyles.HexNumber));;
                break;

            case "threadmoderator":
                button.name.ForeColor = Color.FromArgb(Int32.Parse("1f9921", NumberStyles.HexNumber));;
                break;

            case "rollback":
                button.name.ForeColor = Color.FromArgb(Int32.Parse("ff992b", NumberStyles.HexNumber));;
                break;

            default:
                button.name.ForeColor = Color.LightGray;
                break;
            }
        }
        private void UpdateTimer_Tick(object sender, EventArgs e)
        {
            List <Post> posts = fm.RefreshData();

            for (int i = posts.Count - 1; i >= 0; i--)
            {
                LinkedButton button = new LinkedButton(posts[i].Link);
                button.Dock             = DockStyle.Top;
                button.Name             = "button";
                button.button.BackColor = Color.Transparent;
                button.button.FlatStyle = FlatStyle.Flat;
                button.BackColor        = Color.Transparent;
                button.button.FlatAppearance.MouseOverBackColor = Color.Transparent;
                button.button.FlatAppearance.BorderSize         = 0;
                button.button.ForeColor = Color.LightGray;
                button.tags.ForeColor   = Color.LightGray;
                button.name.ForeColor   = Color.LightGray;
                button.tags.BackColor   = Color.Transparent;
                button.tags.FlatStyle   = FlatStyle.Flat;
                button.name.BackColor   = Color.Transparent;
                button.name.FlatStyle   = FlatStyle.Flat;
                button.tags.FlatAppearance.MouseOverBackColor = Color.Transparent;
                button.tags.FlatAppearance.BorderSize         = 0;
                button.name.FlatAppearance.MouseOverBackColor = Color.Transparent;
                button.name.FlatAppearance.BorderSize         = 0;
                Tooltips.SetToolTip(button.button, button.link);
                button.Height = 30;
                if (!posts[i].IsReply)
                {
                    button.name.Text = posts[i].PosterName;
                    button.tags.Hide();
                    ColorName(posts[i].PosterName, button);
                    button.button.Text = $"posted {posts[i].PostTitle}: {posts[i].Content}";
                    Notify("Forum", $"{posts[i].PosterName} created post {posts[i].PostTitle}", posts[i].PosterName);
                }
                else
                {
                    button.name.Text = posts[i].PosterName;
                    button.tags.Hide();
                    ColorName(posts[i].PosterName, button);
                    button.button.Text = $"replied with {posts[i].Content} on {posts[i].PostTitle}";
                    Notify("Forum", $"{posts[i].PosterName} replied on {posts[i].PostTitle}", posts[i].PosterName);
                }
                button.button.TextAlign = ContentAlignment.TopLeft;
                Tooltips.SetToolTip(button.button, button.link);
                Controls.Add(button);
                buttons.Insert(0, button);
            }
            if (buttons.Count > 50)
            {
                for (int i = 50; i < buttons.Count; i++)
                {
                    buttons[i].Dispose();
                }
                buttons.RemoveAll(x => buttons.IndexOf(x) >= 50);
            }
            VerticalScroll.Value = 0;
        }
Пример #4
0
 /// <summary>
 ///     Initialize components. Called by framework after form created.
 /// </summary>
 public override void OnInitializeComponent()
 {
     this.StaticText0   = ((SAPbouiCOM.StaticText)(this.GetItem("Item_0").Specific));
     this.StaticText1   = ((SAPbouiCOM.StaticText)(this.GetItem("Item_1").Specific));
     this.EditText0     = ((SAPbouiCOM.EditText)(this.GetItem("Item_2").Specific));
     this.LinkedButton0 = ((SAPbouiCOM.LinkedButton)(this.GetItem("Item_3").Specific));
     this.EditText1     = ((SAPbouiCOM.EditText)(this.GetItem("Item_4").Specific));
     this.LinkedButton1 = ((SAPbouiCOM.LinkedButton)(this.GetItem("Item_5").Specific));
     this.StaticText8   = ((SAPbouiCOM.StaticText)(this.GetItem("Item_13").Specific));
     this.EditText3     = ((SAPbouiCOM.EditText)(this.GetItem("Item_14").Specific));
     this.StaticText9   = ((SAPbouiCOM.StaticText)(this.GetItem("Item_15").Specific));
     this.EditText4     = ((SAPbouiCOM.EditText)(this.GetItem("Item_16").Specific));
     this.StaticText10  = ((SAPbouiCOM.StaticText)(this.GetItem("Item_17").Specific));
     this.EditText5     = ((SAPbouiCOM.EditText)(this.GetItem("Item_18").Specific));
     this.StaticText11  = ((SAPbouiCOM.StaticText)(this.GetItem("Item_19").Specific));
     this.EditText6     = ((SAPbouiCOM.EditText)(this.GetItem("Item_20").Specific));
     this.StaticText12  = ((SAPbouiCOM.StaticText)(this.GetItem("Item_21").Specific));
     this.EditText7     = ((SAPbouiCOM.EditText)(this.GetItem("Item_22").Specific));
     this.StaticText13  = ((SAPbouiCOM.StaticText)(this.GetItem("Item_23").Specific));
     this.EditText8     = ((SAPbouiCOM.EditText)(this.GetItem("Item_24").Specific));
     this.StaticText14  = ((SAPbouiCOM.StaticText)(this.GetItem("Item_30").Specific));
     this.EditText9     = ((SAPbouiCOM.EditText)(this.GetItem("Item_31").Specific));
     this.StaticText15  = ((SAPbouiCOM.StaticText)(this.GetItem("Item_32").Specific));
     this.EditText10    = ((SAPbouiCOM.EditText)(this.GetItem("Item_33").Specific));
     this.StaticText16  = ((SAPbouiCOM.StaticText)(this.GetItem("Item_34").Specific));
     this.EditText11    = ((SAPbouiCOM.EditText)(this.GetItem("Item_35").Specific));
     this.StaticText17  = ((SAPbouiCOM.StaticText)(this.GetItem("Item_36").Specific));
     this.EditText12    = ((SAPbouiCOM.EditText)(this.GetItem("Item_37").Specific));
     this.StaticText18  = ((SAPbouiCOM.StaticText)(this.GetItem("Item_38").Specific));
     this.ComboBox0     = ((SAPbouiCOM.ComboBox)(this.GetItem("Item_42").Specific));
     this.ComboBox0.ComboSelectAfter += this.ComboBox0_ComboSelectAfter;
     this.StaticText20                    = ((SAPbouiCOM.StaticText)(this.GetItem("Item_43").Specific));
     this.Button0                         = ((SAPbouiCOM.Button)(this.GetItem("Item_44").Specific));
     this.Button0.PressedAfter           += this.Button0_PressedAfter;
     this.Matrix0                         = ((SAPbouiCOM.Matrix)(this.GetItem("Item_7").Specific));
     this.Folder3                         = ((SAPbouiCOM.Folder)(this.GetItem("Item_9").Specific));
     this.CheckBox0                       = ((SAPbouiCOM.CheckBox)(this.GetItem("Item_6").Specific));
     this.StaticText24                    = ((SAPbouiCOM.StaticText)(this.GetItem("Item_27").Specific));
     this.EditText16                      = ((SAPbouiCOM.EditText)(this.GetItem("Item_28").Specific));
     this.EditText17                      = ((SAPbouiCOM.EditText)(this.GetItem("Item_29").Specific));
     this.StaticText25                    = ((SAPbouiCOM.StaticText)(this.GetItem("Item_39").Specific));
     this.StaticText21                    = ((SAPbouiCOM.StaticText)(this.GetItem("Item_10").Specific));
     this.LinkedButton2                   = ((SAPbouiCOM.LinkedButton)(this.GetItem("Item_12").Specific));
     this.StaticText22                    = ((SAPbouiCOM.StaticText)(this.GetItem("Item_25").Specific));
     this.EditText19                      = ((SAPbouiCOM.EditText)(this.GetItem("Item_40").Specific));
     this.EditText19.ChooseFromListAfter += new SAPbouiCOM._IEditTextEvents_ChooseFromListAfterEventHandler(this.EditText19_ChooseFromListAfter);
     this.StaticText23                    = ((SAPbouiCOM.StaticText)(this.GetItem("Item_11").Specific));
     this.EditText15                      = ((SAPbouiCOM.EditText)(this.GetItem("Item_26").Specific));
     this.EditText15.ChooseFromListAfter += new SAPbouiCOM._IEditTextEvents_ChooseFromListAfterEventHandler(this.EditText15_ChooseFromListAfter);
     this.LinkedButton3                   = ((SAPbouiCOM.LinkedButton)(this.GetItem("Item_41").Specific));
     this.OnCustomInitialize();
 }
        public SBWikiForumForm(Settings settings, NotifyIcon notifications)
        {
            InitializeComponent();
            Notifications = notifications;
            Settings      = settings;
            List <Post> posts = fm.GetData();

            #region display
            for (int i = posts.Count - 1; i >= 0; i--)
            {
                LinkedButton button = new LinkedButton(posts[i].Link);
                button.Dock             = DockStyle.Top;
                button.Name             = "button";
                button.button.BackColor = Color.Transparent;
                button.button.FlatStyle = FlatStyle.Flat;
                button.BackColor        = Color.Transparent;
                button.button.FlatAppearance.MouseOverBackColor = Color.Transparent;
                button.button.FlatAppearance.BorderSize         = 0;
                button.button.ForeColor = Color.LightGray;
                button.tags.ForeColor   = Color.LightGray;
                button.name.ForeColor   = Color.LightGray;
                button.tags.BackColor   = Color.Transparent;
                button.tags.FlatStyle   = FlatStyle.Flat;
                button.name.BackColor   = Color.Transparent;
                button.name.FlatStyle   = FlatStyle.Flat;
                button.tags.FlatAppearance.MouseOverBackColor = Color.Transparent;
                button.tags.FlatAppearance.BorderSize         = 0;
                button.name.FlatAppearance.MouseOverBackColor = Color.Transparent;
                button.name.FlatAppearance.BorderSize         = 0;
                Tooltips.SetToolTip(button.button, button.link);
                button.Height = 30;
                if (!posts[i].IsReply)
                {
                    button.name.Text = posts[i].PosterName;
                    ColorName(posts[i].PosterName, button);
                    button.tags.Hide();
                    button.button.Text = $"posted {posts[i].PostTitle}: {posts[i].Content}";
                }
                else
                {
                    button.name.Text = posts[i].PosterName;
                    ColorName(posts[i].PosterName, button);
                    button.tags.Hide();
                    button.button.Text = $"replied with {posts[i].Content} on {posts[i].PostTitle}";
                }
                button.button.TextAlign = ContentAlignment.TopLeft;
                Tooltips.SetToolTip(button.button, button.link);
                Controls.Add(button);
                buttons.Insert(0, button);
            }
            #endregion
        }
Пример #6
0
        private Control[] CreateOperatorLayout(Operator Op)
        {
            // Start at position 0
            // For $, create an output button
            // For #, create an input button
            // For @, create a label with the corresponding string for its text

            List <Control> ToReturn = new List <Control>();

            mInputs = new LinkedButton[Op.InputCount()];

            int lbl   = 0;
            int input = 0;

            for (int i = 0; i < Op.Layout.Length; i++)
            {
                switch (Op.Layout[i])
                {
                case OP_LAYOUT_RETURN:
                    mOutput          = new LinkedButton(this, typeof(object), false);
                    mOutput.Location = new Point(i * 100, 0);
                    mOutput.Text     = "OUT";

                    ToReturn.Add(mOutput);
                    break;

                case OP_LAYOUT_INPUT:
                    mInputs[input]          = new LinkedButton(this, typeof(object), true);
                    mInputs[input].Location = new Point(i * 100, 0);
                    mInputs[input].Text     = "" + (char)((int)'a' + input);

                    ToReturn.Add(mInputs[input]);
                    input++;
                    break;

                case OP_LAYOUT_LABEL:
                    Label l = new Label();
                    l.Location = new Point(i * 100, 0);
                    l.Text     = Op.Labels[lbl];
                    l.AutoSize = true;
                    l.Parent   = this;

                    ToReturn.Add(l);
                    lbl++;
                    break;
                }
            }

            return(ToReturn.ToArray());
        }
Пример #7
0
            public static void Unlink(LinkedButton A, LinkedButton B)
            {
                if (A.IsInput)
                {
                    A.InboundConnection.Delete();
                }
                else
                {
                    B.InboundConnection.Delete();
                }

                A.LinkedBtns.Remove(B);
                B.LinkedBtns.Remove(A);
            }
Пример #8
0
        private Control[] CreateOperatorLayout(Operator Op)
        {
            // Start at position 0
            // For $, create an output button
            // For #, create an input button
            // For @, create a label with the corresponding string for its text

            List<Control> ToReturn = new List<Control>();
            mInputs = new LinkedButton[Op.InputCount()];

            int lbl = 0;
            int input = 0;

            for (int i = 0; i < Op.Layout.Length; i++)
            {
                switch (Op.Layout[i])
                {
                    case OP_LAYOUT_RETURN:
                        mOutput = new LinkedButton(this, typeof(object), false);
                        mOutput.Location = new Point(i * 100, 0);
                        mOutput.Text = "OUT";

                        ToReturn.Add(mOutput);
                        break;

                    case OP_LAYOUT_INPUT:
                        mInputs[input] = new LinkedButton(this, typeof(object), true);
                        mInputs[input].Location = new Point(i * 100, 0);
                        mInputs[input].Text = "" + (char)((int)'a' + input);

                        ToReturn.Add(mInputs[input]);
                        input++;
                        break;

                    case OP_LAYOUT_LABEL:
                        Label l = new Label();
                        l.Location = new Point(i * 100, 0);
                        l.Text = Op.Labels[lbl];
                        l.AutoSize = true;
                        l.Parent = this;

                        ToReturn.Add(l);
                        lbl++;
                        break;
                }
            }

            return ToReturn.ToArray();
        }
        private void RefreshTimer_Tick(object sender, EventArgs e)
        {
            List <SBWikiSocial.Social> newset     = sm.GetData();
            List <SBWikiSocial.Social> newentries = newset.Where(x => !entries.Any(y => x.Text == y.Text)).ToList();

            for (int i = newentries.Count - 1; i >= 0; i--)
            {
                LinkedButton button = new LinkedButton(newentries[i].Link);
                button.Dock             = DockStyle.Top;
                button.Name             = "button";
                button.button.BackColor = Color.Transparent;
                button.button.FlatStyle = FlatStyle.Flat;
                button.BackColor        = Color.Transparent;
                button.button.FlatAppearance.MouseOverBackColor = Color.Transparent;
                button.button.FlatAppearance.BorderSize         = 0;
                button.button.ForeColor = Color.LightGray;
                button.Height           = 30;
                button.button.Text      = newentries[i].Text;
                button.name.Text        = newentries[i].User;
                ColorName(newentries[i].User, button);
                button.button.TextAlign = ContentAlignment.TopLeft;
                button.button.BackColor = Color.Transparent;
                button.tags.ForeColor   = Color.LightGray;
                button.name.ForeColor   = Color.LightGray;
                button.tags.BackColor   = Color.Transparent;
                button.tags.FlatStyle   = FlatStyle.Flat;
                button.name.BackColor   = Color.Transparent;
                button.name.FlatStyle   = FlatStyle.Flat;
                button.tags.FlatAppearance.MouseOverBackColor = Color.Transparent;
                button.tags.FlatAppearance.BorderSize         = 0;
                button.name.FlatAppearance.MouseOverBackColor = Color.Transparent;
                button.name.FlatAppearance.BorderSize         = 0;
                Tooltips.SetToolTip(button.button, button.link);
                Controls.Add(button);
                entries.Insert(0, newentries[i]);
                buttons.Insert(0, button);
                Notify("Social", button.button.Text, newentries[i].User, newentries[i].Action);
            }
            if (buttons.Count > 100)
            {
                for (int i = 100; i < buttons.Count; i++)
                {
                    buttons[i].Dispose();
                }
                buttons.RemoveAll(x => buttons.IndexOf(x) >= 100);
                entries.RemoveAll(x => entries.IndexOf(x) >= 100);
            }
            VerticalScroll.Value = 0;
        }
Пример #10
0
        public FunctionNode(MethodInfo Method)
            : base()
        {
            mMethod = Method;

            InitializeComponent();
            bool HasReturn = Method.ReturnType != typeof(void);

            if (HasReturn)
            {
                lblMethodName.Location = new Point(lblMethodName.Location.X + 100, lblMethodName.Location.Y);
            }

            if (Method.IsStatic)
            {
                lblMethodName.Text = Method.DeclaringType.Name + "." + Method.Name;
            }
            else
            {
                lblMethodName.Text = Method.Name;
            }

            mInputs = new LinkedButton[Method.GetParameters().Length];
            int CurPos = lblMethodName.Right + 25;

            for (int i = 0; i < Method.GetParameters().Length; i++)
            {
                mInputs[i]          = new LinkedButton(this, Method.GetParameters()[i].ParameterType, true);
                mInputs[i].Location = new Point(CurPos, 0);
                mInputs[i].Text     = Method.GetParameters()[i].ParameterType.ToString() + " " + Method.GetParameters()[i].Name;

                CurPos += 100;
                this.Controls.Add(mInputs[i]);
            }

            if (HasReturn)
            {
                LinkedButton b = new LinkedButton(this, Method.ReturnType, false);
                b.Location = new Point(lblMethodName.Left - 100, 0);
                b.Text     = Method.ReturnType.Name;

                mOutput = b;
                this.Controls.Add(b);
            }
            else
            {
                mOutput = null;
            }
        }
Пример #11
0
        public ConstantNode(Type T)
            : base()
        {
            InitializeComponent();

            textBox1.TextChanged += new EventHandler(textBox1_TextChanged);
            mInputs = new LinkedButton[0];

            mOutput          = new LinkedButton(this, T, false);
            mOutput.Location = new Point(textBox1.Left - 100, 0);
            mOutput.Text     = T.Name;

            this.Controls.Add(mOutput);

            mT = T;
        }
Пример #12
0
        public ConstantNode(Type T)
            : base()
        {
            InitializeComponent();

            textBox1.TextChanged += new EventHandler(textBox1_TextChanged);
            mInputs = new LinkedButton[0];

            mOutput = new LinkedButton(this, T, false);
            mOutput.Location = new Point(textBox1.Left - 100, 0);
            mOutput.Text = T.Name;

            this.Controls.Add(mOutput);

            mT = T;
        }
Пример #13
0
 private void UnlinkNode()
 {
     if (mOutput != null)
     {
         foreach (LinkedButton l in mOutput.GetLinks())
         {
             LinkedButton.Unlink(mOutput, l);
         }
     }
     foreach (LinkedButton l in mInputs)
     {
         if (l.IsLinked())
         {
             LinkedButton.Unlink(l.GetLinks()[0], l);
         }
     }
 }
Пример #14
0
        public FunctionNode(MethodInfo Method)
            : base()
        {
            mMethod = Method;

            InitializeComponent();
            bool HasReturn = Method.ReturnType != typeof(void);

            if (HasReturn)
            {
                lblMethodName.Location = new Point(lblMethodName.Location.X + 100, lblMethodName.Location.Y);
            }

            if (Method.IsStatic)
                lblMethodName.Text = Method.DeclaringType.Name + "." + Method.Name;
            else
                lblMethodName.Text = Method.Name;

            mInputs = new LinkedButton[Method.GetParameters().Length];
            int CurPos = lblMethodName.Right + 25;

            for (int i = 0; i < Method.GetParameters().Length; i++)
            {
                mInputs[i] = new LinkedButton(this, Method.GetParameters()[i].ParameterType, true);
                mInputs[i].Location = new Point(CurPos, 0);
                mInputs[i].Text = Method.GetParameters()[i].ParameterType.ToString() + " " + Method.GetParameters()[i].Name;

                CurPos += 100;
                this.Controls.Add(mInputs[i]);
            }

            if (HasReturn)
            {
                LinkedButton b = new LinkedButton(this, Method.ReturnType, false);
                b.Location = new Point(lblMethodName.Left - 100, 0);
                b.Text = Method.ReturnType.Name;

                mOutput = b;
                this.Controls.Add(b);
            }
            else
            {
                mOutput = null;
            }
        }
Пример #15
0
        private void AddMatrixNoForm()
        {
            LinkedButton oLink = null;

            oItem        = oForm.Items.Add("Matrix1", BoFormItemTypes.it_MATRIX);
            oItem.Left   = 5;
            oItem.Width  = 500;
            oItem.Top    = 5;
            oItem.Height = 150;

            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));

            oColumns = oMatrix.Columns;

            oColumn = oColumns.Add("#", BoFormItemTypes.it_EDIT);
            oColumn.TitleObject.Caption = "#";
            oColumn.Width    = 30;
            oColumn.Editable = false;

            oColumn = oColumns.Add("DSCardCode", BoFormItemTypes.it_LINKED_BUTTON);
            oColumn.TitleObject.Caption = "Card Code";
            oColumn.Width    = 40;
            oColumn.Editable = true;

            oLink = (oColumn).ExtendedObject;
            oLink.LinkedObject = BoLinkedObject.lf_BusinessPartner;

            oColumn = oColumns.Add("DSCardName", BoFormItemTypes.it_EDIT);
            oColumn.TitleObject.Caption = "Name";
            oColumn.Width    = 40;
            oColumn.Editable = true;


            oColumn = oColumns.Add("DSPhone", BoFormItemTypes.it_EDIT);
            oColumn.TitleObject.Caption = "Phone";
            oColumn.Width    = 40;
            oColumn.Editable = true;


            //oColumn = oColumns.Add("DSPhone", BoFormItemTypes.it_EDIT);
            //oColumn.TitleObject.Caption = "Int.Phone";
            //oColumn.Width = 40;
            //oColumn.Editable = true;
        }
 public SBWikiSocialForm(Settings settings, NotifyIcon notifications)
 {
     InitializeComponent();
     Notifications = notifications;
     Settings      = settings;
     entries       = sm.GetData();
     for (int i = entries.Count - 1; i >= 0; i--)
     {
         LinkedButton button = new LinkedButton(entries[i].Link);
         button.Dock        = DockStyle.Top;
         button.Name        = "button";
         button.button.Text = entries[i].Text.Trim();
         button.name.Text   = entries[i].User.Trim();
         ColorName(entries[i].User.Trim(), button);
         button.button.TextAlign = ContentAlignment.TopLeft;
         button.button.BackColor = Color.Transparent;
         button.button.FlatStyle = FlatStyle.Flat;
         button.BackColor        = Color.Transparent;
         button.button.FlatAppearance.MouseOverBackColor = Color.Transparent;
         button.button.FlatAppearance.BorderSize         = 0;
         button.button.ForeColor = Color.LightGray;
         button.tags.ForeColor   = Color.LightGray;
         button.tags.BackColor   = Color.Transparent;
         button.tags.FlatStyle   = FlatStyle.Flat;
         button.name.BackColor   = Color.Transparent;
         button.name.FlatStyle   = FlatStyle.Flat;
         button.tags.FlatAppearance.MouseOverBackColor = Color.Transparent;
         button.tags.FlatAppearance.BorderSize         = 0;
         button.name.FlatAppearance.MouseOverBackColor = Color.Transparent;
         button.name.FlatAppearance.BorderSize         = 0;
         Tooltips.SetToolTip(button.button, button.link);
         button.Height = 30;
         Tooltips.SetToolTip(button.button, button.link);
         Controls.Add(button);
         buttons.Insert(0, button);
     }
 }
Пример #17
0
 public LinkLine(LinkedButton Start, LinkedButton End, Control Parent)
     : base(Start, End, Parent)
 {
 }
Пример #18
0
        internal static void FormLoad(ref MenuEvent oMenuEvent, SAPbobsCOM.Company sbo_company, ref Application sbo_application, out bool bBubbleEvent, string sessionId)
        {
            bBubbleEvent = true;

            FormCreationParams FormCreationPackage;
            Form oForm = null;

            if (oMenuEvent.BeforeAction)
            {
                FormCreationPackage = (FormCreationParams)sbo_application.CreateObject(BoCreatableObjectType.cot_FormCreationParams);

                try
                {
                    if (string.IsNullOrEmpty(sessionId))
                    {
                        sessionId = sbo_application.Company.GetServiceLayerConnectionContext(ServiceLayer.Address);
                    }

                    string      contenidoArchivo = Properties.Resources.ResourceManager.GetString(pluginForm.FormType);
                    XmlDocument xmlFormulario    = new XmlDocument();
                    xmlFormulario.LoadXml(contenidoArchivo);

                    FormCreationPackage.XmlData = xmlFormulario.InnerXml;

                    FormCreationPackage.UniqueID = pluginForm.FormType + CommonFunctions.Random().ToString();
                    oForm = sbo_application.Forms.AddEx(FormCreationPackage);

                    FormCreationPackage.UniqueID = "ConsumoMP" + CommonFunctions.Random().ToString();
                    oForm = sbo_application.Forms.AddEx(FormCreationPackage);

                    oForm.Mode = BoFormMode.fm_OK_MODE;

                    for (int i = 3; i < oForm.Items.Count; i++)
                    {
                        oForm.Items.Item(i).AffectsFormMode = false;
                    }
                    // oForm.DataBrowser.BrowseBy = pluginForm.TxtNroOrden.Uid;
                    //SAPbouiCOM.StaticText Lote = (SAPbouiCOM.StaticText)oForm.Items.Item(pluginForm.StaticLote).Specific;
                    EditText Lote = (EditText)oForm.Items.Item(pluginForm.TxtNroLote.Uid).Specific;
                    Lote.Item.Top       = 90;
                    Lote.Item.Left      = 25;
                    Lote.Item.Height    = 100;
                    Lote.Item.Width     = 656;
                    Lote.Item.FontSize  = 60;
                    Lote.Item.BackColor = Colores.White;

                    //SAPbouiCOM.Item oLink;
                    //oLink = oForm.Items.Add("Link", BoFormItemTypes.it_LINKED_BUTTON);
                    //oLink.LinkTo = pluginForm.TxtNroOrden.Uid;
                    //SAPbouiCOM.LinkedButton Linked = (SAPbouiCOM.LinkedButton)oForm.Items.Item("Link").Specific;
                    //Linked.LinkedObject = BoLinkedObject.lf_ProductionOrder;

                    Item oItem;

                    oItem      = oForm.Items.Add("OF", BoFormItemTypes.it_EDIT);
                    oItem.Left = 800;
                    EditText OF = (EditText)oForm.Items.Item("OF").Specific;
                    OF.Item.Enabled = false;

                    oItem      = oForm.Items.Add("OV", BoFormItemTypes.it_EDIT);
                    oItem.Left = 800;
                    EditText OV = (EditText)oForm.Items.Item("OV").Specific;
                    OV.Item.Enabled = false;

                    LinkedButton Linked = (LinkedButton)oForm.Items.Item(pluginForm.LinkedNroOrden).Specific;
                    Linked.Item.LinkTo  = "OF";
                    Linked.LinkedObject = BoLinkedObject.lf_ProductionOrder;

                    Linked              = (LinkedButton)oForm.Items.Item(pluginForm.LinkedOV).Specific;
                    Linked.Item.LinkTo  = "OV";
                    Linked.LinkedObject = BoLinkedObject.lf_Order;

                    Linked              = (LinkedButton)oForm.Items.Item(pluginForm.LinkedCardCode).Specific;
                    Linked.Item.LinkTo  = pluginForm.TxtCardCode.Uid;
                    Linked.LinkedObject = BoLinkedObject.lf_BusinessPartner;

                    Linked              = (LinkedButton)oForm.Items.Item(pluginForm.LinkedItemCode).Specific;
                    Linked.Item.LinkTo  = pluginForm.TxtItemCode.Uid;
                    Linked.LinkedObject = BoLinkedObject.lf_Items;

                    oItem           = oForm.Items.Add("40", BoFormItemTypes.it_RECTANGLE);
                    oItem.Top       = 85;
                    oItem.Left      = 20;
                    oItem.Width     = 666;
                    oItem.Height    = 110;
                    oItem.BackColor = Colores.Green;

                    ChooseFromList oCFL  = oForm.ChooseFromLists.Item(pluginForm.CFLOrdenFab);
                    Conditions     oCons = oCFL.GetConditions();

                    Condition oCon = oCons.Add();
                    oCon.Alias     = "Status";
                    oCon.Operation = BoConditionOperation.co_EQUAL;
                    oCon.CondVal   = "R";

                    //oCon.Relationship = BoConditionRelationship.cr_AND;
                    //oCon = oCons.Add();
                    //oCon.Alias = "ItemCode";
                    //oCon.Operation = BoConditionOperation.co_CONTAIN;
                    //oCon.CondVal = "SE";

                    oCFL.SetConditions(oCons);

                    try
                    {
                        oForm.Freeze(true);

                        DataTable oDT  = oForm.DataSources.DataTables.Add(pluginForm.GridConsumo.Dt);
                        Grid      grid = (Grid)oForm.Items.Item(pluginForm.GridConsumo.Uid).Specific;
                        grid.DataTable = oDT;

                        Button ButtonAddConsumo = (Button)oForm.Items.Item(pluginForm.ButtonAddConsumo).Specific;
                        ButtonAddConsumo.Item.Enabled = true;
                    }
                    finally { oForm.Freeze(false); }

                    oForm.Visible = true;
                }
                catch (Exception e)
                {
                    throw new Exception(string.Format("FormLoad {0}", e.Message));
                }
            }
        }
        private void RefeshTimer_Tick(object sender, EventArgs e)
        {
            List <Entry> entries = cm.RefreshData();

            for (int i = entries.Count - 1; i >= 0; i--)
            {
                LinkedButton button = new LinkedButton(entries[i].link);
                button.Dock             = DockStyle.Top;
                button.Name             = "button";
                button.button.BackColor = Color.Transparent;
                button.button.FlatStyle = FlatStyle.Flat;
                button.BackColor        = Color.Transparent;
                button.button.FlatAppearance.MouseOverBackColor = Color.Transparent;
                button.button.FlatAppearance.BorderSize         = 0;
                button.button.ForeColor = Color.LightGray;
                button.tags.ForeColor   = Color.LightGray;
                button.name.ForeColor   = Color.LightGray;
                button.tags.BackColor   = Color.Transparent;
                button.tags.FlatStyle   = FlatStyle.Flat;
                button.name.BackColor   = Color.Transparent;
                button.name.FlatStyle   = FlatStyle.Flat;
                button.tags.FlatAppearance.MouseOverBackColor = Color.Transparent;
                button.tags.FlatAppearance.BorderSize         = 0;
                button.name.FlatAppearance.MouseOverBackColor = Color.Transparent;
                button.name.FlatAppearance.BorderSize         = 0;
                Tooltips.SetToolTip(button.button, button.link);
                button.Height = 30;
                switch (entries[i].type)
                {
                case "edit":
                    if (!entries[i].HasMinorFlag)
                    {
                        button.name.Text = entries[i].user;
                        button.tags.Hide();
                        ColorName(entries[i].user, button);
                        button.button.Text = $"edited {entries[i].title} description {entries[i].commentshort}";
                        if (Settings.Content.ArticleNotifications)
                        {
                            Notify("Content|Edit", $"{entries[i].user} done an edit on {entries[i].title}", entries[i].user);
                        }
                    }
                    else
                    {
                        button.tags.Text = "[minor]";
                        button.name.Text = entries[i].user;
                        ColorName(entries[i].user, button);
                        button.button.Text = $"edited {entries[i].title} description {entries[i].commentshort}";
                        if (Settings.Content.ArticleNotifications)
                        {
                            Notify("Content|Minor Edit", $"{entries[i].user} done a minor edit on {entries[i].title}", entries[i].user);
                        }
                    }
                    break;

                case "log":
                    button.tags.Text = $"[LOG|{entries[i].logtype}]";
                    button.name.Text = entries[i].user;
                    ColorName(entries[i].user, button);
                    button.button.Text = $"logged action {entries[i].logaction} {entries[i].title} description: {entries[i].commentshort}";
                    if (Settings.Content.LogNotifications)
                    {
                        Notify("Content|Log", $"[LOG|{entries[i].logtype}] {entries[i].user} logged action {entries[i].logaction}", entries[i].user);
                    }
                    break;

                case "new":
                    button.tags.Hide();
                    button.name.Text = entries[i].user;
                    ColorName(entries[i].user, button);
                    button.button.Text = $"created {entries[i].title} description {entries[i].commentshort}";
                    if (Settings.Content.ArticleNotifications)
                    {
                        Notify("Content|New Article", $"{entries[i].user} created {entries[i].title}", entries[i].user);
                    }
                    break;
                } // set text
                button.button.TextAlign = ContentAlignment.TopLeft;
                Tooltips.SetToolTip(button.button, button.link);
                Controls.Add(button);
                buttons.Add(button);
            }
            if (buttons.Count > 100)
            {
                buttons.Reverse();
                for (int i = 100; i < buttons.Count; i++)
                {
                    buttons[i].Dispose();
                }
                buttons.RemoveAll(x => buttons.IndexOf(x) >= 100);
                buttons.Reverse();
            }
            VerticalScroll.Value = 0;
        }
        public SBWikiContentForm(Settings settings, NotifyIcon notifications)
        {
            InitializeComponent();
            Notifications = notifications;
            Settings      = settings;
            List <Entry> entries = cm.GetData();

            #region display
            for (int i = entries.Count - 1; i >= 0; i--)
            {
                LinkedButton button = new LinkedButton(entries[i].link);
                button.Dock             = DockStyle.Top;
                button.Name             = "button";
                button.button.BackColor = Color.Transparent;
                button.button.FlatStyle = FlatStyle.Flat;
                button.BackColor        = Color.Transparent;
                button.button.FlatAppearance.MouseOverBackColor = Color.Transparent;
                button.button.FlatAppearance.BorderSize         = 0;
                button.button.ForeColor = Color.LightGray;
                button.tags.ForeColor   = Color.LightGray;
                button.tags.BackColor   = Color.Transparent;
                button.tags.FlatStyle   = FlatStyle.Flat;
                button.name.BackColor   = Color.Transparent;
                button.name.FlatStyle   = FlatStyle.Flat;
                button.tags.FlatAppearance.MouseOverBackColor = Color.Transparent;
                button.tags.FlatAppearance.BorderSize         = 0;
                button.name.FlatAppearance.MouseOverBackColor = Color.Transparent;
                button.name.FlatAppearance.BorderSize         = 0;
                Tooltips.SetToolTip(button.button, button.link);
                button.Height = 30;
                switch (entries[i].type)
                {
                case "edit":
                    if (!entries[i].HasMinorFlag)
                    {
                        button.tags.Hide();
                        button.name.Text = entries[i].user;
                        ColorName(entries[i].user, button);
                        button.button.Text = $"edited {entries[i].title} description {entries[i].commentshort}";
                    }
                    else
                    {
                        button.tags.Text = "[minor]";
                        button.name.Text = entries[i].user;
                        ColorName(entries[i].user, button);
                        button.button.Text = $"edited {entries[i].title} description {entries[i].commentshort}";
                    }
                    break;

                case "log":
                    button.tags.Text = $"[LOG|{entries[i].logtype}]";
                    button.name.Text = entries[i].user;
                    ColorName(entries[i].user, button);
                    button.button.Text = $"logged action {entries[i].logaction} {entries[i].title} description: {entries[i].commentshort}";
                    break;

                case "new":
                    button.name.Text = entries[i].user;
                    button.tags.Hide();
                    ColorName(entries[i].user, button);
                    button.button.Text = $"created {entries[i].title} description {entries[i].commentshort}";
                    break;
                } // set text
                button.button.TextAlign = ContentAlignment.TopLeft;
                Tooltips.SetToolTip(button.button, button.link);
                Controls.Add(button);
                buttons.Add(button);
            }
            #endregion
        }
Пример #21
0
            public static void Link(LinkedButton A, LinkedButton B, Control Parent)
            {
                if (A.Owner == B.Owner)
                    return;

                if ((A.IsInput && A.IsLinked()) || (B.IsInput && B.IsLinked()))
                    throw new InvalidOperationException("Tried to double-link an input value.");

                if (A.IsInput)
                {
                    if(!A.ValueType.IsAssignableFrom(B.ValueType))
                        throw new InvalidOperationException("Tried to link unlike variable types.");
                    Parent.Controls.Add(A.InboundConnection = new LinkLine(B, A, Parent));
                }
                else
                {
                    if (!B.ValueType.IsAssignableFrom(A.ValueType))
                        throw new InvalidOperationException("Tried to link unlike variable types.");
                    Parent.Controls.Add(B.InboundConnection = new LinkLine(A, B, Parent));
                }

                A.LinkedBtns.Add(B);
                B.LinkedBtns.Add(A);
            }
Пример #22
0
            public static void Unlink(LinkedButton A, LinkedButton B)
            {
                if (A.IsInput)
                    A.InboundConnection.Delete();
                else
                    B.InboundConnection.Delete();

                A.LinkedBtns.Remove(B);
                B.LinkedBtns.Remove(A);
            }
Пример #23
0
 public LinkLine(LinkedButton Start, LinkedButton End, Control Parent)
     : base(Start, End, Parent)
 {
 }