/// <summary>
 /// EndProcessing method.
 /// </summary>
 protected override void EndProcessing()
 {
     if (sam != null)
     {
         sam.Dispose();
         sam = null;
     }
 }
 /// <summary>
 /// BeginProcessing method.
 /// </summary>
 protected override void BeginProcessing()
 {
     if (this.HasParameter("AccountExpires") && AccountNeverExpires.IsPresent)
     {
         InvalidParametersException ex = new InvalidParametersException("AccountExpires", "AccountNeverExpires");
         ThrowTerminatingError(ex.MakeErrorRecord());
     }
     sam = new Sam();
 }
예제 #3
0
        // GET: Admin/Pages
        public ActionResult Index()
        {
            //Declare a list of pageVM

            List <PageVM> PageList;

            using (Sam db = new Sam())
            {
                //Initialise that list
                PageList = db.Pages.ToArray().OrderBy(x => x.Sorting).Select(x => new PageVM(x)).ToList();
            }
            //return the view with list
            return(View(PageList));
        }
예제 #4
0
        private static Sam InitializeSam(Room room)
        {
            var sam = new Sam();

            for (int row = 0; row < room.Field.Length; row++)
            {
                for (int col = 0; col < room.Field[row].Length; col++)
                {
                    if (room.Field[row][col] == 'S')
                    {
                        sam = new Sam(row, col);
                    }
                }
            }

            return(sam);
        }
예제 #5
0
            private void TakeSample()
            {
                RecordList_.Clear();
                SampleTime_  = DateTime.Now;
                SampleCount_ = 0;
                SampleSize_  = 0L;

                var Samples = Resources.FindObjectsOfTypeAll <UnityEngine.Object>();

                foreach (var Sam in Samples)
                {
                    var SampleSize = 0L;
#if UNITY_5_6_OR_NEWER
                    SampleSize = Profiler.GetRuntimeMemorySizeLong(Sam);
#else
                    SampleSize = Profiler.GetRuntimeMemorySize(Sam);
#endif
                    var Name = Sam.GetType().Name;
                    SampleCount_++;
                    SampleSize_ += SampleSize;

                    Record CurRec = null;
                    foreach (var Rec in RecordList_)
                    {
                        if (Rec.Name == Name)
                        {
                            CurRec = Rec;
                            break;
                        }
                    }

                    if (CurRec == null)
                    {
                        CurRec = new Record(Name);
                        RecordList_.Add(CurRec);
                    }

                    CurRec.Count++;
                    CurRec.Size += SampleSize;
                }

                RecordList_.Sort(RecordComparer);
            }
예제 #6
0
    public void StartMission()
    {
        Nikoladze.FindPosition(matrix);
        Sam.FindPostion(matrix);

        while (Sam.Directions.Count > 0)
        {
            Guard.MoveGuards(matrix);
            Sam.IsAlive(matrix);

            var direction = Sam.Directions.Dequeue();
            Sam.Move(matrix, direction);

            if (Sam.Row == Nikoladze.Row)
            {
                Nikoladze.SamWon(matrix);
                Sam.MissionOver("Nikoladze killed!", matrix);
            }
        }
    }
예제 #7
0
            private void TakeSample()
            {
                SampleTime_           = DateTime.Now;
                SampleSize_           = 0L;
                DuplicateSampleSize_  = 0L;
                DuplicateSimpleCount_ = 0;
                SampleList_.Clear();

                var Samples = Resources.FindObjectsOfTypeAll <T>();

                foreach (var Sam in Samples)
                {
                    var MemSize = 0L;
#if UNITY_5_6_OR_NEWER
                    MemSize = Profiler.GetRuntimeMemorySizeLong(Sam);
#else
                    MemSize = Profiler.GetRuntimeMemorySize(Sam);
#endif
                    SampleSize_ += MemSize;
                    SampleList_.Add(new Sample(Sam.name, Sam.GetType().Name, MemSize));
                }

                SampleList_.Sort(SampleComparer);

                for (var Index = 1; Index < SampleList_.Count; ++Index)
                {
                    if (SampleList_[Index].Name == SampleList_[Index - 1].Name &&
                        SampleList_[Index].Type == SampleList_[Index - 1].Type &&
                        SampleList_[Index].Size == SampleList_[Index - 1].Size)
                    {
                        SampleList_[Index].Highlight = true;
                        DuplicateSampleSize_        += SampleList_[Index].Size;
                        DuplicateSimpleCount_++;
                    }
                }
            }
 /// <summary>
 /// BeginProcessing method.
 /// </summary>
 protected override void BeginProcessing()
 {
     sam = new Sam();
 }