コード例 #1
0
        private void registerMB(MomentaryButton momentaryButton)
        {
            momentaryButton.PreviewMouseLeftButtonDown += (s, e) =>
            {
                tryConnect();

                if (connected)
                {
                    try
                    {
                        client.WriteSymbol(momentaryButton.VariableName, true, reloadSymbolInfo: true);
                        readWriteSuccess(momentaryButton.VariableName);
                    }
                    catch (AdsException)
                    {
                        readWriteError(momentaryButton.VariableName);
                    }
                }
            };
            momentaryButton.PreviewMouseLeftButtonUp += (s, e) =>
            {
                tryConnect();

                if (connected)
                {
                    try
                    {
                        client.WriteSymbol(momentaryButton.VariableName, false, reloadSymbolInfo: true);
                        readWriteSuccess(momentaryButton.VariableName);
                    }
                    catch (AdsException)
                    {
                        readWriteError(momentaryButton.VariableName);
                    }
                }
            };
        }
コード例 #2
0
ファイル: MainWindow.g.i.cs プロジェクト: msalas74/beck5725
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 8 "..\..\MainWindow.xaml"
                ((beckhoffExampleApp.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing);

            #line default
            #line hidden
                return;

            case 2:
                this.buttonTrue = ((System.Windows.Controls.Button)(target));

            #line 10 "..\..\MainWindow.xaml"
                this.buttonTrue.Click += new System.Windows.RoutedEventHandler(this.buttonTrue_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.buttonFalse = ((System.Windows.Controls.Button)(target));

            #line 11 "..\..\MainWindow.xaml"
                this.buttonFalse.Click += new System.Windows.RoutedEventHandler(this.buttonFalse_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.indicator = ((beckhoffExampleApp.Indicator)(target));
                return;

            case 5:
                this.label = ((System.Windows.Controls.Label)(target));
                return;

            case 6:
                this.label1 = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.textBox = ((System.Windows.Controls.TextBox)(target));

            #line 15 "..\..\MainWindow.xaml"
                this.textBox.PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.PreviewTextInput);

            #line default
            #line hidden
                return;

            case 8:
                this.labelErrorCode = ((System.Windows.Controls.Label)(target));
                return;

            case 9:
                this.labelPLCResult = ((System.Windows.Controls.Label)(target));
                return;

            case 10:
                this.textBoxPLCSetPosition = ((System.Windows.Controls.TextBox)(target));

            #line 18 "..\..\MainWindow.xaml"
                this.textBoxPLCSetPosition.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.textBoxPLCSetPosition_TextChanged);

            #line default
            #line hidden

            #line 18 "..\..\MainWindow.xaml"
                this.textBoxPLCSetPosition.PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.PreviewTextInput);

            #line default
            #line hidden

            #line 18 "..\..\MainWindow.xaml"
                this.textBoxPLCSetPosition.GotFocus += new System.Windows.RoutedEventHandler(this.textBoxPLCSetPosition_GotFocus);

            #line default
            #line hidden
                return;

            case 11:
                this.momentaryButton = ((beckhoffExampleApp.MomentaryButton)(target));
                return;

            case 12:
                this.Global_Bool = ((beckhoffExampleApp.MomentaryButton)(target));
                return;

            case 13:
                this.indicator1 = ((beckhoffExampleApp.Indicator)(target));
                return;
            }
            this._contentLoaded = true;
        }