Exemple #1
0
 public static void Run()
 {
     // begin
     using (var ressource = new NCrafts())
     {
     }
     // end
 }
Exemple #2
0
        public decimal Run()
        {
            // begin
            var n = new NCrafts();

            return(DoSomething(in n));
            // end
        }
        public static void Run()
        {
            // begin
            var nCrafts = new NCrafts(3);
            nCrafts.Array[0] = 42;
            // end

            Logger.Log("Value: ", nCrafts.Array[0]);
        }
        public static unsafe void Run()
        {
            // begin
            var nCrafts = new NCrafts();
            *nCrafts.Array = 42;
            // end

            Logger.Log("Value: ", *nCrafts.Array);
        }
Exemple #5
0
        public static unsafe void Run()
        {
            // begin
            var nCrafts = new NCrafts();

            *nCrafts.Array = 42;
            // end

            Logger.Log("Value: ", *nCrafts.Array);
        }
Exemple #6
0
        public static void Run()
        {
            // begin
            var nCrafts = new NCrafts(3);

            nCrafts.Array[0] = 42;
            // end

            Logger.Log("Value: ", nCrafts.Array[0]);
        }
        public static unsafe void Run()
        {
            // begin
            var nCrafts = new NCrafts(3);
            fixed (int* p = nCrafts.Array)
            {
                *p = 42;
            }
            // end

            Logger.Log("Value: ", nCrafts.Array[0]);
        }
Exemple #8
0
        public static void Run()
        {
            // begin
            IDisposable resource = new NCrafts();

            try
            {
            }
            finally
            {
                resource.Dispose();
            }
            // end
        }
Exemple #9
0
        public static unsafe void Run()
        {
            // begin
            var nCrafts = new NCrafts(3);

            fixed(int *p = nCrafts.Array)
            {
                *p = 42;
            }

            // end

            Logger.Log("Value: ", nCrafts.Array[0]);
        }
        public static void Run()
        {
            // begin
            IDisposable ressource = new NCrafts();
            try
            {

            }
            finally
            {
                ressource.Dispose();
            }
            // end
        }
 public static void Run()
 {
     // begin
     var ressource = new NCrafts();
     try
     {
     }
     finally
     {
         var disposableResource = ressource as IDisposable;
         if (disposableResource != null)
             disposableResource.Dispose();
     }
     // end
 }
Exemple #12
0
        public static unsafe void Run()
        {
            var array = new NCrafts[10];

            // begin
            for (var i = 0; i < array.Length; i++)
            {
                var value = new NCrafts(3);
                value.Array[0] = 1;

                array[i] = value;
            }
            // end

            Logger.Log("Value: ", array.Length);
        }
Exemple #13
0
        public static void Run()
        {
            // begin
            var resource = new NCrafts();

            try
            {
            }
            finally
            {
                var disposableResource = resource as IDisposable;
                if (disposableResource != null)
                {
                    disposableResource.Dispose();
                }
            }
            // end
        }
Exemple #14
0
 private decimal DoSomething(NCrafts s) => s.Sum + s.Sum;