Exemplo n.º 1
0
        private void ExampleList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ExampleList.SelectedIndex != -1)
            {
                ErrorExample info = this.CurrentErrorInfo.Examples[ExampleList.SelectedIndex];

                this.CurrentExample = info;

                this.ExamplesGroup.Enabled = true;

                this.ErrorCode.Text = info.ErrorCode;
                this.FixedCode.Text = info.FixedCode;
                this.Brief.Text     = info.ExplanationOfFix;
            }
            else
            {
                this.CurrentExample = null;

                this.ExamplesGroup.Enabled = false;

                this.ErrorCode.Text = "";
                this.FixedCode.Text = "";
                this.Brief.Text     = "";
            }
        }
Exemplo n.º 2
0
        public void TestWithResultAndError()
        {
            Result <int, ErrorExample> a = 1;
            Result <int, ErrorExample> b = new ErrorExample();

            var r = from x in a
                    from y in b
                    select x + y;

            r.Match(
                ok: v => Debug.Log(v),
                error: e => Debug.Log("Error")
                );
        }