Exemple #1
0
        /*       public enum Clonestatus
         *     {
         *
         *     }
         */


        /*
         *    if ((clonestatus == status) && (clonestatus != null))
         *    {
         *        return clonestatus;
         *    }
         *    else
         *    {
         *        return 0;
         *    }
         * }
         *
         * set
         * {
         *    if ((clonestatus == status) && (clonestatus != null))
         *    {
         *
         *        clonestatus = value;
         *    }
         *    else
         *    {
         *        clonestatus = 0;
         *    }
         *
         * }
         * } */
        #endregion

        /*
         *
         *         public MeterStatus Clonestatus
         * {
         *  get
         *  {
         *
         *  }
         *
         *  set
         *  {
         *  }
         * }*/

        #region Constructors
        public MeterObject()
        {
            meter = new Texture2D[5];

            for (int a = 0; a < 0; a++)
            {
                meter = new Texture2D[a];
            }
            status = MeterStatus.neutral;
        }
Exemple #2
0
        public void CloneAssign(GameTime gameTime)
        {
            if (clonestatus != status)
            {
                status = clonestatus;
            }

            else
            {
            }
        }
        public IActionResult GetMHByUserId(string userId, MeterStatus meterStatus)
        {
            var viewModel = new MeterHistory();

            viewModel.PayRollID   = userId;
            viewModel.MeterStatus = meterStatus;

            var meterH = _repo.GetMeterHistoryByUserId(viewModel);

            if (meterH != null)
            {
                return(Ok(meterH));
            }
            return(Ok());
        }
Exemple #4
0
 public static MeterStatusData ToViewData(this MeterStatus node, CategoryDictionary suffix = CategoryDictionary.None)
 {
     if (node == null)
     {
         return(null);
     }
     return(new MeterStatusData()
     {
         Id = node.Id,
         MeterId = node.MeterId,
         MeterMessageTypeId = node.MeterMessageTypeId,
         Enabled = node.Enabled,
         Value = node.Value,
         UpdateTime = node.UpdateTime,
         IsFluctuationData = node.IsFluctuationData,
         MonitoringConfigId = node.MonitoringConfigId,
         Description = node.Description,
         Meter = ((suffix & CategoryDictionary.Meter) == CategoryDictionary.Meter?node.Meter.ToViewData():null),
         MeterMessageType = node.MeterMessageType == null?DictionaryCache.Get()[node.MeterMessageTypeId].ToViewData() : node.MeterMessageType.ToViewData(),
     });
 }
Exemple #5
0
        /// <summary>
        /// Defines the entry point of the application.
        /// </summary>
        /// <param name="args">Input parameters.</param>
        public static void Main(string[] args)
        {
            string       validationRules = DefaultValidationRules;
            ServiceType  serviceType     = ServiceType.Memory;
            MeterStatus  meter           = MeterStatus.Off;
            LoggerStatus logger          = LoggerStatus.Off;

            var parser = new Parser(with => with.CaseInsensitiveEnumValues = true);

            Parser.Default.ParseArguments <Options>(args)
            .WithParsed <Options>(o =>
            {
                validationRules = o.Validate.Equals(CustomValidationType, StringComparison.InvariantCultureIgnoreCase)
                            ? CustomValidationType : DefaultValidationRules;
                serviceType = (o.Storage == ServiceType.File)
                            ? ServiceType.File : ServiceType.Memory;
                meter = (o.Meter == MeterStatus.On)
                            ? MeterStatus.On : MeterStatus.Off;
                logger = (o.Logger == LoggerStatus.On)
                            ? LoggerStatus.On : LoggerStatus.Off;
            });
            parser?.Dispose();

            fileCabinetService = CreateServise(validationRules, serviceType, out converter, out validator);

            if (meter == MeterStatus.On)
            {
                fileCabinetService = new ServiceMeter(fileCabinetService, Write);
            }

            if (logger == LoggerStatus.On)
            {
                fileCabinetService = new ServiceLogger(fileCabinetService);
            }

            var commandHandler = CreateCommandHandlers();

            Write($"File Cabinet Application, developed by {Program.DeveloperName}" + Environment.NewLine +
                  $"Using {validationRules} validation rules." + Environment.NewLine +
                  $"The {serviceType.ToString()} service.");
            Write(HintMessage + Environment.NewLine);

            do
            {
                Console.Write("> ");
                var       inputs          = Console.ReadLine().Split(' ', 2);
                const int commandIndex    = 0;
                var       command         = inputs[commandIndex];
                const int parametersIndex = 1;
                var       parameters      = inputs.Length > 1 ? inputs[parametersIndex] : string.Empty;
                try
                {
                    commandHandler.Handle(new AppCommandRequest(command, parameters));
                }
                catch (ArgumentNullException anex)
                {
                    Write($"Error. {anex.Message}");
                }
                catch (ArgumentException aex)
                {
                    Write($"Error. {aex.Message}");
                }
                catch (InvalidOperationException ioex)
                {
                    Write($"Error. {ioex.Message}");
                }
            }while (isRunning);
        }