Example #1
0
        public void ChildStatus(string child, ChildFormStatus status)
        {
            Button button;

            if (this.dicButton.TryGetValue(child, out button))
            {
                if (status == ChildFormStatus.HasErrorInput)
                {
                    button.ImageIndex = 2;
                }
                else if (status == ChildFormStatus.NoErrorInput)
                {
                    button.ImageIndex = 0;
                }
                else if (status == ChildFormStatus.Activity)
                {
                    try
                    {
                        IEnumerable <KeyValuePair <string, Button> > source = from c in this.dicButton
                                                                              where c.Value.ImageIndex == 1
                                                                              select c;
                        if (source.Count <KeyValuePair <string, Button> >() > 0)
                        {
                            source.First <KeyValuePair <string, Button> >().Value.ImageIndex = 0;
                            this.panel1.Controls[0].Hide();
                        }
                    }
                    catch (Exception exception)
                    {
                        LogHelper.LogError(exception);
                    }
                    button.ImageIndex = 1;
                }
            }
        }
        public ChildFormStatus CheckErrorInput()
        {
            ChildFormStatus noErrorInput = ChildFormStatus.NoErrorInput;

            if (this.f1.EveryThingIsOk)
            {
                noErrorInput = this.f1.CheckErrorInput();
            }
            if (this.f2.EveryThingIsOk)
            {
                noErrorInput |= this.f2.CheckErrorInput();
            }
            if (this.f3.EveryThingIsOk)
            {
                noErrorInput |= this.f3.CheckErrorInput();
            }
            if (this.f4.EveryThingIsOk)
            {
                noErrorInput |= this.f4.CheckErrorInput();
            }
            return(noErrorInput);
        }