public CheckoutForm(decimal subtotal, decimal tax, decimal total)
 {
     InitializeComponent();
     Subtotal.Text = subtotal.ToString();
     Tax.Text      = tax.ToString();
     Total.Text    = total.ToString();
     TrivialBehinds.CreateComponentBehind(this);
 }
示例#2
0
        public ScfProjectForm()
        {
            InitializeComponent();
            // boilerplate starts
            var disposer = TrivialBehinds.CreateBehind(this, new ScfProjectUi
            {
                button1 = button1,
                label1  = label1
            });

            this.FormClosed += (o, e) =>
                               disposer.Dispose();
            // boilerplate ends
        }
示例#3
0
        public Form1()
        {
            InitializeComponent();
            // this is only thing you need to add to your form, to expose ui controls
            var d = TrivialBehinds.CreateBehind(this, new CalcUi
            {
                btnMinus = btnMinus,
                btnPlus  = btnPlus,
                label1   = label1
            });

            Deactivate += (o, e) => d.Dispose();
            // boilerplate ends
        }
示例#4
0
        public Form1()
        {
            InitializeComponent();
            // this is only thing you need to add to your form, to expose ui controls
            var d = TrivialBehinds.CreateBehind(this, new Form1Ui
            {
                btnMinus        = btnMinus,
                btnPlus         = btnPlus,
                label1          = label1,
                btnLaunchDirect = btnLaunchDirect
            });

            this.Disposed += (o, e) => d.Dispose();
            // boilerplate ends
        }
示例#5
0
        public MainForm()
        {
            InitializeComponent();

            behindDisposer = TrivialBehinds.CreateBehind(this, new MainFormUi
            {
                searchControl          = searchControl,
                form                   = this,
                dirSelector            = dirSelector,
                searchTextBox          = searchTextBox,
                btnAbort               = btnAbort,
                tableLayout            = tableLayoutPanel1,
                statusLabel            = statusLabel1,
                rgArgsComboBox         = rgArgsComboBox,
                statusLabelCurrentArgs = statusLabelCurrentArgs
            });
            this.Deactivate += (o, e) => behindDisposer.Dispose();
        }
示例#6
0
        public static void InitApp()
        {
            var extraArgs = Environment.GetCommandLineArgs().Skip(1).ToList();

            var launchDir = extraArgs.FirstOrDefault() == "--launch" ? extraArgs[1] : null;

            if (launchDir != null)
            {
                // launch from shell is "special", nothing else to consider
                extraArgs.Clear();
            }
            var lastArg = extraArgs.LastOrDefault();

            if (lastArg != null && !lastArg.StartsWith("-"))
            {
                InitialSearchString = lastArg;
                extraArgs.Remove(lastArg);
            }

            // --smart-case is a sensible default behavior
            if (extraArgs.Count == 0)
            {
                extraArgs = new List <string> {
                    "--smart-case"
                };
            }

            Logic.RgExtraArgs = string.Join(" ", extraArgs);
            Logic.WorkDir     = launchDir == null?Directory.GetCurrentDirectory() : launchDir;

            var rc = ScriptRunner.FindScript();

            if (rc != null)
            {
                ScriptRunner.RunScript(rc);
            }
            TrivialBehinds.RegisterBehind <MainFormUi, MainFormBehind>();
        }
 public CashRegisterMain()
 {
     InitializeComponent();
     TrivialBehinds.CreateComponentBehind(this);
 }
示例#8
0
 public UserControl1()
 {
     InitializeComponent();
     TrivialBehinds.CreateComponentBehind(this);
 }
示例#9
0
 public DirectForm()
 {
     InitializeComponent();
     TrivialBehinds.CreateComponentBehind(this);
 }
 public CheckoutForm()
 {
     InitializeComponent();
     TrivialBehinds.CreateComponentBehind(this);
 }