コード例 #1
0
        static void Main()
        {
            var bc = new BookCollection();

            bc.ListBooks();

            ref var book = ref bc.GetBookByTitle("Call of the Wild, The"); // ref local
コード例 #2
0
        public static void RefUse()
        {
            var bc = new BookCollection();

            bc.ListBooks();

            ref var book = ref bc.GetBookByTitle("Call of the wild, The");
コード例 #3
0
        // This method displays the following output:
        // Original values in Main.  Name: Fasteners, ID: 54321
        // Back in Main.  Name: Stapler, ID: 12345

        // </Snippet3>

        private static void BookCollectionExample()
        {
            // <Snippet5>
            var bc = new BookCollection();

            bc.ListBooks();

            ref var book = ref bc.GetBookByTitle("Call of the Wild, The");
コード例 #4
0
ファイル: Program.cs プロジェクト: alincak/CSharp
        static void Main(string[] args)
        {
            var bc = new BookCollection();

            bc.ListBooks();

            var     index = -1;
            ref var book  = ref bc.GetBookByTitle("Call of the Wild, The", ref index);