Esempio n. 1
0
        public void InitializeSteppedCollections()
        {
            int totalMinutes = (int) (TimeRangeInclusiveStartExclusiveEnd.EndTime -
                                      TimeRangeInclusiveStartExclusiveEnd.StartTime).TotalMinutes;
            var collSizes = totalMinutes / StepSizeInMinutes;
            ProcessorUsages = new ProcessorUsageCollection();
            StorageTransactionUsages = new StorageTransactionUsageCollection();
            StorageUsages = new StorageUsageCollection();
            NetworkUsages = new NetworkUsageCollection();

            for (int i = 0; i < collSizes; i++)
            {
                var processorUsage = new ProcessorUsage();
                processorUsage.TimeRange = new TimeRange { StartTime = DateTime.MinValue.ToUniversalTime(), EndTime = DateTime.MinValue.ToUniversalTime() };
                ProcessorUsages.CollectionContent.Add(processorUsage);
                var storageTransactionUsage = new StorageTransactionUsage();
                StorageTransactionUsages.CollectionContent.Add(storageTransactionUsage);
                var networkUsage = new NetworkUsage();
                NetworkUsages.CollectionContent.Add(networkUsage);
                var storageUsage = new StorageUsage();
                storageUsage.SnapshotTime = DateTime.MinValue.ToUniversalTime();
                StorageUsages.CollectionContent.Add(storageUsage);
            }
        }
 private void CopyContentFrom(StorageUsage sourceObject)
 {
     SnapshotTime = sourceObject.SnapshotTime;
             UsageType = sourceObject.UsageType;
             UsageUnit = sourceObject.UsageUnit;
             AmountOfUnits = sourceObject.AmountOfUnits;
 }
partial         static void CreateCustomDemo(ref StorageUsage customDemoObject);
        public static StorageUsage CreateDemoDefault()
        {
            StorageUsage customDemo = null;
                    StorageUsage.CreateCustomDemo(ref customDemo);
                    if(customDemo != null)
                        return customDemo;
                    var result = new StorageUsage();
                    result.UsageType = @"StorageUsage.UsageType";

                    result.UsageUnit = @"StorageUsage.UsageUnit";

                    return result;
        }
 public static StorageUsage CreateDefault()
 {
     var result = new StorageUsage();
             return result;
 }
Esempio n. 6
0
 private void setStorageUsageToTarget(StorageUsage target, StorageUsage source)
 {
     target.AmountOfUnits = source.AmountOfUnits;
     target.SnapshotTime = source.SnapshotTime;
     if (target.SnapshotTime == DateTime.MinValue)
         target.SnapshotTime = DateTime.MinValue.ToUniversalTime();
 }