Exemple #1
0
        public static UserControl ShowDialog(UserControl userControl, confirm confirm)
        {
            Form prompt = new Form()
            {
                Width           = 500,
                Height          = userControl.Height + 80,
                FormBorderStyle = FormBorderStyle.FixedDialog,
                StartPosition   = FormStartPosition.CenterScreen
            };

            Button confirmation = new Button()
            {
                Text = "Ok", Left = 350, Width = 100, Top = 70, DialogResult = DialogResult.OK
            };

            confirmation.Click += (sender, e) => {
            };

            var margin = confirmation.Margin;

            margin.Left         = 350;
            confirmation.Margin = margin;

            FlowLayoutPanel f = new FlowLayoutPanel();

            prompt.Controls.Add(f);
            f.Dock = DockStyle.Fill;
            f.Controls.Add(userControl);
            f.Controls.Add(confirmation);

            prompt.AcceptButton = confirmation;

            return(prompt.ShowDialog() == DialogResult.OK ? userControl : null);
        }
Exemple #2
0
 private void Awake()
 {
     if (instance != null)
     {
         Debug.LogWarning("More than one instance of confirm found!");
         return;
     }
     instance = this;
 }
 protected const float tooltip_termination_time = 3500f; // time since hover start when tooltip is no longer shown
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="id">element string id for lookup</param>
 /// <param name="parent">parent container object</param>
 /// <param name="f">type of the element</param>
 /// <param name="c">action assigned to the element</param>
 /// <param name="safety">confirm or no</param>
 /// <param name="dimension">element size and position inside the container</param>
 /// <param name="icon">does it have an icon? null if not</param>
 /// <param name="label">string label to write on top of the proper sector</param>
 /// <param name="tooltip">tooltip to show on hover</param>
 public UIElementBase(string id, Container parent, type f, actions?c, confirm safety, Rectangle dimension, Texture2D icon, String label, String tooltip)
 {
     this.element_id   = id;
     this.parent       = parent;
     background        = null;
     bounds            = dimension;
     bg_color          = Color.White; // default color placeholder
     bg_transparency   = 1f;
     this.label        = label;
     this.icon         = icon;
     this.visible      = true; // all stored_elements should be visible
     _action           = c;
     current_state     = state.default_state;
     function          = f;
     this.tooltip_text = tooltip.ToString();
     zones             = new List <horizontal_sector>();
     label_positioning = orientation.both;                  //default
     //create_sectors(f);
     confirmation = (safety == confirm.yes) ? true : false; // assign confirmation dialog box
 }
        private async Task ModeSelection(IDialogContext context, IAwaitable <Selection> result)
        {
            var    selection = await result;
            String msg       = "";

            chance = 0;
            Array.Clear(uwords, 0, 21);
            score = 100;
            if (selection.ToString().ToLower().Equals("easy"))
            {
                mode = "Easy";
                msg  = "I will imagine a 4 letter word, start guessing ";
            }
            else
            {
                mode = "Difficult";
                msg  = "I will imagine a 5 letter word, start guessing ";
            }
            var options      = new confirm[] { confirm.Start, confirm.Quit };
            var descriptions = new string[] { "Start", "Quit" };

            PromptDialog.Choice <confirm>(context, StartGame, options, msg, descriptions: descriptions);
        }
Exemple #5
0
        public JsonResult tp1()
        {
            var u = context.users.FirstOrDefault(a => a.UserName == app.username);
            var j = context.productjd.FirstOrDefault(a => a.State != "-1");
            tj  t = new Entity.tj();

            t.MemberId = u.ID;
            t.JDId     = j.ID;
            t.Date     = DateTime.Now;
            if (j.State == "2")
            {
                t.state = 2;
            }
            else
            {
                t.state = 3;
            }
            context.tj.Add(t);
            context.SaveChanges();
            var       l  = context.users.Where(a => a.groups.privilege1.Review == 1 && a.State == "1").ToList();
            List <tj> l2 = new List <Entity.tj>();

            if (j.State == "2")
            {
                l2 = context.tj.Where(a => a.state == 2 && a.JDId == j.ID).ToList();
            }
            else
            {
                l2 = context.tj.Where(a => a.state == 3 && a.JDId == j.ID).ToList();
            }
            bool flag = false;

            foreach (var i in l)
            {
                bool f2 = false;
                foreach (var k in l2)
                {
                    if (k.MemberId == i.ID)
                    {
                        f2 = true;
                        break;
                    }
                }
                if (f2 == false)
                {
                    flag = true;
                }
            }
            if (flag == false)
            {
                j = context.productjd.FirstOrDefault(a => a.State != "-1");
                if (j.State == "2")
                {
                    j.State     = "2.5";
                    j.NextState = "等待全部提交";
                }
                else
                {
                    j.State     = "3";
                    j.NextState = "等待总工确认";
                }

                context.SaveChanges();
                confirm c = new confirm();
                c.addDate = DateTime.Now;
                c.jdId    = j.ID;
                if (j.State == "2.5")
                {
                    c.source = 1;
                }
                else
                {
                    c.source = 2;
                }
                c.state = 0;
                context.confirm.Add(c);
                context.SaveChanges();
            }
            return(Json(new { success = true }));
        }
 StartCoroutine(ShowImporter(bitmap, rect, resultSize, confirm, cancel));
Exemple #7
0
 internal void goTo(confirm state)
 {
     currState = state;
 }
Exemple #8
0
 internal confirm update()
 {
     return(currState = getNextState[((int)currState)]());
 }
Exemple #9
0
 internal ConformationStateMachine()
 {
     currState = confirm.sleep;
     //fill array with functions
     getNextState = new machine[] { Sleep, Yes, No };
 }
Exemple #10
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            confirm exec = new confirm();

            exec.method(dataGridView1, label1);
        }