zoukankan      html  css  js  c++  java
  • 第七次作业

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Reflection;
    using System.Diagnostics;


    namespace ConsoleApplication9
    {}
    class Program
    {
    Book book;
    FootBall football;

    static void Main(string[] args)
    {

    FieldInfo[] fi = typeof(Program).GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
    for (int i = 0; i < fi.Length; i++)
    {
    object[] obj = fi[i].FieldType.GetCustomAttributes(typeof(PlayAttribute), false);
    if (obj != null && obj.Length > 0)
    {
    Console.WriteLine("Name:{0} Type:{1}", fi[i].Name, fi[i].FieldType);
    }
    }

    Console.Read();
    }
    }
    public class PlayAttribute : Attribute
    {
    }
    [Play]
    public class Book { }
    public class FootBall { }

    <Window x:Class="WpfApplication1.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Window1" Height="300" Width="300">
        <Grid>
            <Grid.Background>
                <LinearGradientBrush>
                    <GradientStop Offset="0" Color="Blue"></GradientStop>
                    <GradientStop Offset="0.5" Color="LightBlue"></GradientStop>
                </LinearGradientBrush>
            </Grid.Background>
            <TextBox Height="23" Margin="10,10,10,0" Name="textBox1" VerticalAlignment="Top" Text="{Binding ElementName=slider1, Path=Value, UpdateSourceTrigger=PropertyChanged}" />
            <Slider Height="21" Margin="10,40,10,0" Name="slider1" VerticalAlignment="Top" Maximum="100" />
        </Grid>
    </Window>
  • 相关阅读:
    leetcode Reverse Words in a String
    leetcode[150] Evaluate Reverse Polish Notation
    leetcode Max Points on a Line
    leetcode Sort List
    leetcode Insertion Sort List
    vs 中一些快捷键
    leetcode LRU Cache
    leetcode[145] Binary Tree Postorder Traversal
    leetcode Binary Tree Preorder Traversal
    Leetcode Reorder List
  • 原文地址:https://www.cnblogs.com/zeromaiko/p/4475364.html
Copyright © 2011-2022 走看看