Exemple #1
0
        //フォーカス時に文字列全部を選択
        private void MyTextBox_GotFocus(object sender, RoutedEventArgs e)
        {
            var tb = sender as TextBox;

            tb.Text = MyValue.ToString();
            tb.SelectAll();
        }
Exemple #2
0
        public async Task Post([FromBody] MyValue value)
        {
            var queueClient  = new QueueClient(ServiceBusConnectionString, QueueName);
            var queueMessage = new Message(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(value)));

            _logger.LogInformation($"Sending message:\n{value.ToString()}");
            await queueClient.SendAsync(queueMessage);
        }
    static void Main()
    {
        // Create value
        MyValue myval = new MyValue();

        myval.x = 123;

        // box it
        object obj = myval;

        System.Console.WriteLine("{0}", obj.ToString());

        // modify the contents in the box.
        IModifyMyValue iface = (IModifyMyValue)obj;

        iface.X = 456;
        System.Console.WriteLine("{0}", obj.ToString());

        // unbox it and see what it is.
        MyValue newval = (MyValue)obj;

        System.Console.WriteLine("{0}", newval.ToString());
    }
Exemple #4
0
        //ロストフォーカス時に書式適用
        private void MyTextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            var tb = sender as TextBox;

            tb.Text = MyValue.ToString(MyStringFormat);
        }
Exemple #5
0
        //public double MyWidth
        //{
        //    get { return (double)GetValue(MyWidthProperty); }
        //    set { SetValue(MyWidthProperty, value); }
        //}

        //// Using a DependencyProperty as the backing store for MyWidth.  This enables animation, styling, binding, etc...
        //public static readonly DependencyProperty MyWidthProperty =
        //    DependencyProperty.Register("MyWidth", typeof(double), typeof(NumericUpDown), new PropertyMetadata(16.0));

        //private static void OnMyWidthPropertyChanged(DependencyObject d,DependencyPropertyChangedEventArgs e)
        //{

        //}



        public override string ToString()
        {
            string s = "MyText = " + MyText + ", MyValue = " + MyValue.ToString();

            return(s);
        }