Esempio n. 1
0
        /// <summary>
        /// Change the ink mode option
        /// </summary>
        /// <param name="option"></param>
        private void ChangeInkModeOption(OptionId option)
        {
            // Change the option setting.
            SetValue(CurrentInkModeOptionPropertyKey, option);

            // If the InkCanvas is under one of any inking mode, we need to update the new inking mode at once.
            InkCanvasEditingMode currentEditingMode = MyInkCanvas.EditingMode;

            if (currentEditingMode == InkCanvasEditingMode.Ink ||
                currentEditingMode == InkCanvasEditingMode.InkAndGesture ||
                currentEditingMode == InkCanvasEditingMode.GestureOnly)
            {
                EnsureEditingMode(_inkModeOptions[CurrentInkModeOption - OptionId.InkAndGesture]);
            }
        }
Esempio n. 2
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null)
            {
                return(null);
            }

            // Get the current ink mode which is one of the values - OptionId.Ink, OptionId.GestureOnly and OptionId.InkAndGesture
            OptionId currentOptionId = (OptionId)value;

            // Get the expected Id which the menu item expects.
            OptionId expectedOptionId = (OptionId)parameter;

            // return true if the active option id is same as the item's
            return(expectedOptionId == currentOptionId);
        }
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + EntityID.GetHashCode();
            hash = hash * 23 + EpisodeNumber.GetHashCode();
            hash = hash * 23 + ErrorCode.GetHashCode();
            hash = hash * 23 + ErrorMesg.GetHashCode();
            hash = hash * 23 + Facility.GetHashCode();
            hash = hash * 23 + OptionId.GetHashCode();
            hash = hash * 23 + OptionStaffId.GetHashCode();
            hash = hash * 23 + OptionUserId.GetHashCode();
            hash = hash * 23 + SystemCode.GetHashCode();
            foreach (var form in this.Forms)
            {
                hash = hash * 23 + form.GetHashCode();
            }
            return(hash);
        }
Esempio n. 4
0
        public void Handle(AnswerSingleAnswerQuestionCommand command)
        {
            var gameId   = GameId.NewGameId(command.GameId);
            var playerId = PlayerId.NewPlayerId(command.PlayerId);
            var optionId = OptionId.NewOptionId(command.OptionId);

            var game        = gameRepository.GetById(gameId);
            var answerEvent = Domain.Game.answerQuestion(
                game,
                playerId,
                DomainTypes.Answer.NewSingleAnswer(
                    new DomainTypes.SingleAnswer(
                        optionId)));

            if (answerEvent != null)
            {
                eventStore.Add(gameId, answerEvent.Value);
            }
        }
Esempio n. 5
0
        public async Task <ActionResult <IEnumerable <Sys_Dm_Company> > > r1PostUpdateThongBao(OptionId thongbao)
        {
            try
            {
                var userId = Convert.ToInt32(User.Claims.First(c => c.Type == "UserId").Value);
                var tables = await _context.Sys_QT_ThongBao.FindAsync(thongbao.Id);

                tables.DaDoc   = true;
                tables.NgayDoc = DateTime.Now;
                await _context.SaveChangesAsync();

                return(new ObjectResult(new { error = 0 }));
            }
            catch (Exception)
            {
                return(new ObjectResult(new { error = 1 }));
            }
        }
 /// <summary>
 /// Get Option from OPtionId enumeration
 /// </summary>
 /// <param name="optionId"></param>
 /// <returns></returns>
 public Option GetOption(OptionId optionId)
 {
     return(Options[(int)optionId - 1]); // Off by one
 }
        /// <summary>
        /// Determines whether the specified Object is equal to the current Object.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }


            var other = (VLQuestionOption)obj;

            //reference types
            if (!Object.Equals(OptionText, other.OptionText))
            {
                return(false);
            }
            if (!Object.Equals(CustomId, other.CustomId))
            {
                return(false);
            }
            if (!Object.Equals(SkipToWebUrl, other.SkipToWebUrl))
            {
                return(false);
            }
            //value types
            if (!Survey.Equals(other.Survey))
            {
                return(false);
            }
            if (!Question.Equals(other.Question))
            {
                return(false);
            }
            if (!OptionId.Equals(other.OptionId))
            {
                return(false);
            }
            if (!OptionType.Equals(other.OptionType))
            {
                return(false);
            }
            if (!DisplayOrder.Equals(other.DisplayOrder))
            {
                return(false);
            }
            if (!OptionValue.Equals(other.OptionValue))
            {
                return(false);
            }
            if (!AttributeFlags.Equals(other.AttributeFlags))
            {
                return(false);
            }
            if (!SkipTo.Equals(other.SkipTo))
            {
                return(false);
            }
            if (!SkipToPage.Equals(other.SkipToPage))
            {
                return(false);
            }
            if (!SkipToQuestion.Equals(other.SkipToQuestion))
            {
                return(false);
            }

            return(true);
        }
 /// <summary>
 /// Get Option from OPtionId enumeration 
 /// </summary>
 /// <param name="optionId"></param>
 /// <returns></returns>
 public Option GetOption(OptionId optionId)
 {
    return Options[(int)optionId -1]; // Off by one
 }
Esempio n. 9
0
        public async Task <ActionResult <IEnumerable <Sys_Dm_Company> > > r1PostUpdateThongBao(OptionId thongbao)
        {
            try
            {
                RequestToken token  = CommonData.GetDataFromToken(User);
                var          tables = await _context.Sys_QT_ThongBao.FindAsync(thongbao.Id);

                tables.DaDoc   = true;
                tables.NgayDoc = DateTime.Now;
                await _context.SaveChangesAsync();

                return(new ObjectResult(new { error = 0 }));
            }
            catch (Exception)
            {
                return(new ObjectResult(new { error = 1 }));
            }
        }