public void PlayAudio(FeedbackType type, bool overrideAudio = false)
    {
        if(type == FeedbackType.NONE){
            print ("Trying to play a FeedbackType.NONE audio. Why?");
            return;
        }

        int r, max, i = (int)type;
        List<AudioClip> useThis;
        switch(type){
        default:
            useThis = introAudio;
            break;
        case FeedbackType.YEAH:
            useThis = yeahAudio;
            break;
        case FeedbackType.OUCH:
            useThis = ouchAudio;
            break;
        case FeedbackType.END:
            useThis = endAudio;
            break;
        }
        max = useThis.Count;

        do{
            r = Random.Range(0, max);
        } while (r == lastPlayed[i]);
        lastPlayed[i] = r;

        StartCoroutine(PlayAudioClip(useThis[r], overrideAudio));
    }
 public FeedbackEventArgs(string filePath, int workProgress, string message, FeedbackType type)
 {
     file = filePath;
     WorkProgress = workProgress;
     msg = message;
     typ = type;
 }
Esempio n. 3
0
 public Feedback(FeedbackType feedbackType, string message, bool doFade, bool showClose)
 {
     FeedbackType = feedbackType;
     Message = message;
     DoFade = doFade;
     ShowClose = showClose;
 }
Esempio n. 4
0
 public Feedback(FeedbackType feedbackType, string message)
 {
     FeedbackType = feedbackType;
     Message = message;
     DoFade = true;
     ShowClose = false;
 }
Esempio n. 5
0
 private static Feedback CreateInternal(Guid from, Guid to, FeedbackType type, string note, int sellingHistoryId)
 {
     Feedback v = new Feedback();
     v.FromUserId = from;
     v.ToUserId = to;
     v.FeedbackType = type;
     v.Comment = note;
     v.SellingHistoryId = sellingHistoryId;
     return v;
 }
Esempio n. 6
0
 public void AddFeedback(string authorName, string message, FeedbackType type, string authorId, string email)
 {
     using (FeedbackModelContainer container = new FeedbackModelContainer())
     {
         Report report = new Report
                             {
                                 AuthorName = authorName,
                                 Text = message,
                                 Type = type,
                                 AuthorId = authorId,
                                 Email = email
                             };
         container.Reports.AddObject(report);
         container.SaveChanges();
     }
 }
Esempio n. 7
0
 public void Notify(FeedbackType type, string message, object[] args)
 {
     message = StringHelper.SafeFormat(message, args);
       switch(type) {
     case FeedbackType.Info:
     case FeedbackType.Warning:
       Console.WriteLine(message);
       break;
     case FeedbackType.Error:
       var saveColor = Console.ForegroundColor;
       Console.ForegroundColor = ConsoleColor.Red;
       Console.WriteLine("ERROR: " + message);
       Console.ForegroundColor = saveColor;
       break;
       }
 }
Esempio n. 8
0
        /// <summary>
        /// Plays a specific feedback pattern.
        /// </summary>
        /// <remarks>
        /// To play Vibration type, app should have http://tizen.org/privilege/haptic privilege.
        /// </remarks>
        /// <since_tizen> 3 </since_tizen>
        /// <param name="type">The feedback type.</param>
        /// <param name="pattern">The feedback pattern string.</param>
        /// <feature>
        /// http://tizen.org/feature/feedback.vibration for FeedbackType.Vibration
        /// </feature>
        /// <exception cref="Exception">Thrown when failed because feedback is not initialized.</exception>
        /// <exception cref="ArgumentException">Thrown when failed because of an invalid arguament.</exception>
        /// <exception cref="NotSupportedException">Thrown when failed because the device (haptic, sound) or a specific pattern is not supported.</exception>
        /// <exception cref="UnauthorizedAccessException">Thrown when failed because the access is not granted(No privilege)</exception>
        /// <exception cref="InvalidOperationException">Thrown when failed because of a system error.</exception>
        /// <privilege>http://tizen.org/privilege/haptic</privilege>
        /// <example>
        /// <code>
        /// Feedback feedback = new Feedback();
        /// feedback.Play(FeedbackType.All, "Tap");
        /// </code>
        /// </example>
        public void Play(FeedbackType type, String pattern)
        {
            int number;

            Interop.Feedback.FeedbackError res;

            if (!Pattern.TryGetValue(pattern, out number))
            {
                throw new ArgumentException($"Not supported pattern string : {pattern}", nameof(pattern));
            }

            if (type == FeedbackType.All)
            {
                res = (Interop.Feedback.FeedbackError)Interop.Feedback.Play(number);
            }
            else
            {
                res = (Interop.Feedback.FeedbackError)Interop.Feedback.PlayType((Interop.Feedback.FeedbackType)type, number);
            }

            if (res != Interop.Feedback.FeedbackError.None)
            {
                Log.Warn(LogTag, string.Format("Failed to play feedback. err = {0}", res));
                switch (res)
                {
                case Interop.Feedback.FeedbackError.NotInitialized:
                    throw new Exception("Not initialized");

                case Interop.Feedback.FeedbackError.InvalidParameter:
                    throw new ArgumentException("Invalid Arguments");

                case Interop.Feedback.FeedbackError.NotSupported:
                    throw new NotSupportedException("Not supported");

                case Interop.Feedback.FeedbackError.PermissionDenied:
                    throw new UnauthorizedAccessException("Access is not granted");

                case Interop.Feedback.FeedbackError.OperationFailed:
                default:
                    throw new InvalidOperationException("Failed to play pattern");
                }
            }
        }
        /// <summary>
        /// Returns true if ProAcousticFeedback instances are equal
        /// </summary>
        /// <param name="other">Instance of ProAcousticFeedback to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ProAcousticFeedback other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Phoneid == other.Phoneid ||
                     Phoneid != null &&
                     Phoneid.Equals(other.Phoneid)
                     ) &&
                 (
                     FeedbackType == other.FeedbackType ||
                     FeedbackType != null &&
                     FeedbackType.Equals(other.FeedbackType)
                 ) &&
                 (
                     FeedbackValue == other.FeedbackValue ||
                     FeedbackValue != null &&
                     FeedbackValue.Equals(other.FeedbackValue)
                 ) &&
                 (
                     FeedbackMessage == other.FeedbackMessage ||
                     FeedbackMessage != null &&
                     FeedbackMessage.Equals(other.FeedbackMessage)
                 ) &&
                 (
                     FeedbackLat == other.FeedbackLat ||
                     FeedbackLat != null &&
                     FeedbackLat.Equals(other.FeedbackLat)
                 ) &&
                 (
                     FeedbackLon == other.FeedbackLon ||
                     FeedbackLon != null &&
                     FeedbackLon.Equals(other.FeedbackLon)
                 ));
        }
Esempio n. 10
0
        public ActionResult FeedbackType(int id = 0)
        {
            var feedbackList = FindEducatorsRepository.GetAllFeedbackTypes();
            var feedbackType = new FeedbackType();

            if (id > 0)
            {
                feedbackType = FindEducatorsRepository.GetFeedBackTypeById(id);
            }
            else
            {
                feedbackType.Id = -1;
                feedbackType.FeedbackTypeName = "";
            }

            ViewBag.FeedbackTypeList = feedbackList;
            ViewBag.FeedbackType     = feedbackType;
            return(View(feedbackType));
        }
Esempio n. 11
0
        public ApiResult GetListByType(FeedbackType type, int pageNo = 1, int limit = 10)
        {
            if (!Enum.IsDefined(typeof(FeedbackType), type))
            {
                throw new WebApiInnerException("0001", "请求类型参数无效");
            }

            int totalCount;
            var list   = _feedbackService.GetFeedbackList(AuthorizedUser.Id.ToGuid(), type, SourceTpye, pageNo, limit, out totalCount);
            var result = new ApiResult();
            var data   = new
            {
                TotalCount = totalCount,
                Feedbacks  = list.Select(item => new FeedbackListModel(item)).ToList()
            };

            result.SetData(data);
            return(result);
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            FeedbackType feedbackType = (FeedbackType)value;

            switch (feedbackType)
            {
            case FeedbackType.Error:
                return(new SolidColorBrush(Colors.Red));

            case FeedbackType.Info:
                return(new SolidColorBrush(Colors.Blue));

            case FeedbackType.Success:
                return(new SolidColorBrush(Colors.Green));

            default:
                throw new Exception("Invalid feedback type for converter. Please contact support.");
            }
        }
Esempio n. 13
0
    public void CameraShaking(FeedbackType whichSlowMo = FeedbackType.Default)
    {
        if (GlobalVariables.Instance.demoEnabled)
        {
            return;
        }

        if (GlobalVariables.Instance.GameState != GameStateEnum.Playing)
        {
            return;
        }

        DOTween.Kill("ResetScreenShake");
        StopAllCoroutines();

        float   shakeDuration = 0;
        Vector3 shakeStrenth  = Vector3.zero;
        bool    exactType     = true;

        for (int i = 0; i < screenShakeList.Count; i++)
        {
            if (screenShakeList[i].whichScreenShake == whichSlowMo)
            {
                shakeDuration = screenShakeList[i].shakeDuration;
                shakeStrenth  = screenShakeList[i].shakeStrenth;
                exactType     = true;
                break;
            }
        }

        if (!exactType)
        {
            shakeDuration = screenShakeList[0].shakeDuration;
            shakeStrenth  = screenShakeList[0].shakeStrenth;
        }

        shake = false;

        if (GlobalVariables.Instance.GameState == GameStateEnum.Playing)
        {
            transform.DOShakeRotation(shakeDuration, shakeStrenth, shakeVibrato, shakeRandomness).SetId("ScreenShake").OnComplete(ResetCameraRotation).SetUpdate(false);
        }
    }
Esempio n. 14
0
        protected override BaseHUD GetHUDScene(FeedbackType feedbackType)
        {
            var         hudScenesPath = "res://Scenes/HUD/Gamified/";
            PackedScene packedScene;

            switch (feedbackType)
            {
            case FeedbackType.Simple:
                packedScene = (PackedScene)GD.Load($"{hudScenesPath}GamifiedSimpleHUD.tscn");
                return((GamifiedSimpleHUD)packedScene.Instance());

            case FeedbackType.Quality:
                packedScene = (PackedScene)GD.Load($"{hudScenesPath}GamifiedQualityHUD.tscn");
                return((GamifiedQualityHUD)packedScene.Instance());

            default:
                throw new ArgumentOutOfRangeException("Specified feedback type does not exist.");
            }
        }
 public void ProvideHapticFeedback(float locationAngle, float locationHeight, FeedbackType effect, bool waitToPlay, FeedbackType secondEffect)
 {
     if (effect != FeedbackType.NoFeedback)
     {
         float intensityMultiplier = Config.GetIntensityMultiplier(effect);
         if (intensityMultiplier > 0.01f)
         {
             Thread thread = new Thread(() =>
                                        ProvideHapticFeedbackThread(locationAngle, locationHeight, effect, intensityMultiplier, waitToPlay));
             thread.Start();
             if (secondEffect != FeedbackType.NoFeedback)
             {
                 Thread thread2 = new Thread(() =>
                                             ProvideHapticFeedbackThread(locationAngle, locationHeight, secondEffect, intensityMultiplier, waitToPlay));
                 thread2.Start();
             }
         }
     }
 }
Esempio n. 16
0
    IEnumerator ZoomCoroutine(FeedbackType whichZoom)
    {
        if (DOTween.IsTweening("ZoomCamera"))
        {
            DOTween.Kill("ZoomCamera");
        }

        float newFOV        = 60;
        float zoomDuration  = 0;
        float resetDuration = 0;
        float delay         = 0;

        for (int i = 0; i < zoomList.Count; i++)
        {
            if (zoomList [i].whichZoom == whichZoom)
            {
                newFOV        = zoomList [i].newFOV;
                zoomDuration  = zoomList [i].zoomDuration;
                resetDuration = zoomList [i].resetDuration;
                delay         = zoomList [i].delay;
                break;
            }
        }

        if (GlobalVariables.Instance.GameState != GameStateEnum.Playing)
        {
            if (DOTween.IsTweening("ZoomCamera"))
            {
                DOTween.Kill("ZoomCamera");
            }

            yield break;
        }

        Tween tween = cam.DOFieldOfView(newFOV, zoomDuration).SetEase(zoomEase).SetId("ZoomCamera");

        yield return(tween.WaitForCompletion());

        yield return(new WaitForSecondsRealtime(delay));

        tween = cam.DOFieldOfView(initialFOV, resetDuration).SetEase(zoomEase).SetId("ZoomCamera");
    }
Esempio n. 17
0
        public IEnumerable <string> Get(FeedbackType type = FeedbackType.Error)
        {
            List <String> Data = new List <String>();

            switch (type)
            {
            case FeedbackType.Debug: Data = OldFeedback.DebugRecords; break;

            case FeedbackType.Error: Data = OldFeedback.ErrorRecords; break;

            case FeedbackType.Info: Data = OldFeedback.InfoRecords; break;

            case FeedbackType.Message: Data = OldFeedback.MessageRecords; break;

            case FeedbackType.Success: Data = OldFeedback.SuccessRecords; break;

            case FeedbackType.Warning: Data = OldFeedback.WarningRecords; break;
            }
            return(Data);
        }
Esempio n. 18
0
        /// <summary>
        /// Create a new Feedback window with extra text added to the message.
        /// </summary>
        /// <param name="type"></param>
        /// <param name="addend">the text to append to the end of the message</param>
        public Feedback(FeedbackType type, string addend)
        {
            InitializeComponent();

            _type   = type;
            _addend = addend;

            if (type == FeedbackType.Smile)
            {
                header.Text            = "We appreciate your feedback. What did you like?";
                detailsTip.Description = "Tell us what you liked about Daytimer.";
            }
            else if (type == FeedbackType.Error)
            {
                header.Text            = "We're extremely sorry this happened. Can you give us more information about the problem?";
                detailsTip.Description = "Tell us what you were doing when the error occurred.";
            }

            SpellChecking.HandleSpellChecking(details);
        }
Esempio n. 19
0
        public void PerformDiscreteSignalAction(int signal, FeedbackType feedbackType)
        {
            if (feedbackType == FeedbackType.Visual)
            {
                ActivateVisEffectSetter(SignalType.Discrete);
            }
            else if (feedbackType == FeedbackType.Audio)
            {
                ActivateVolEffectSetter(SignalType.Discrete);
            }

            if (signal == 0)
            {
                //PerformFailSignalActions(feedbackType);
            }
            else if (signal == 1)
            {
                //PerformPassSignalActions(feedbackType);
            }
        }
        private IndexViewModel CreateModel(string key, string url, FeedbackType feedback)
        {
            IndexViewModel model = new IndexViewModel();

            model.FeedbackType = feedback;

            if (feedback == FeedbackType.Positive && !string.IsNullOrWhiteSpace(url))
            {
                model.Message = this.localizationProvider.GetLocalizedString("Core", key, Thread.CurrentThread.CurrentCulture.Name, url);
            }
            else
            {
                model.Message = this.localizationProvider.GetLocalizedString(key);
            }

            if (!string.IsNullOrEmpty(url))
            {
                model.Redirect = new Uri(url);
            }
            return(model);
        }
Esempio n. 21
0
        private IEnumerator SendEnhancementAsync()
        {
            WWWForm form = new WWWForm();

            form.AddField(m_googleFormSettings.FeedbackTypeFieldID, FeedbackType.ToString());
            form.AddField(m_googleFormSettings.EmailFieldID, SanitiseString(Email));
            form.AddField(m_googleFormSettings.SubjectFieldID, SanitiseString(Subject));
            form.AddField(m_googleFormSettings.FeedbackFieldID, SanitiseString(Feedback));
            form.AddField(m_googleFormSettings.ScreenshotFieldID, NOT_ASSIGNED);
            form.AddField(m_googleFormSettings.SystemInfoFieldID, NOT_ASSIGNED);

            WWW www = new WWW(m_googleFormSettings.FormURL, form.data);

            yield return(www);

            if (m_onDone != null)
            {
                m_onDone(new FeedbackFormResult(www.error));
                m_onDone = null;
            }
        }
Esempio n. 22
0
        public void Feedback(FeedbackType type, IParser parser, string format, params object[] args)
        {
            switch (type)
            {
            case FeedbackType.Debug:
                logger.Debug($"{parser.ChannelName}: " + format, args);
                break;

            case FeedbackType.Info:
                logger.Information($"{parser.ChannelName}: " + format, args);
                break;

            case FeedbackType.Warning:
                logger.Warning($"{parser.ChannelName}: " + format, args);
                break;

            case FeedbackType.Error:
                logger.Error($"{parser.ChannelName}: " + format, args);
                break;
            }
        }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Count != null)
         {
             hashCode = hashCode * 59 + Count.GetHashCode();
         }
         if (FeedbackType != null)
         {
             hashCode = hashCode * 59 + FeedbackType.GetHashCode();
         }
         if (FeedbackMeanvalue != null)
         {
             hashCode = hashCode * 59 + FeedbackMeanvalue.GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 24
0
        public ActionResult FeedbackType(FeedbackType feedbackType)
        {
            if (feedbackType.Id > -1)
            {
                FindEducatorsRepository.UpdateFeedbackType(feedbackType);
            }
            else
            {
                FindEducatorsRepository.InsertFeedbackType(feedbackType);
            }

            var feedbackTypeList = FindEducatorsRepository.GetAllFeedbackTypes();

            ViewBag.FeedbackTypeList = feedbackTypeList;

            feedbackType.Id = -1;
            feedbackType.FeedbackTypeName = "";

            ViewBag.FeedbackType = feedbackType;

            return(View());
        }
    public void PlayAudio(FeedbackType type, bool overrideAudio = false)
    {
        if (type == FeedbackType.NONE)
        {
            print("Trying to play a FeedbackType.NONE audio. Why?");
            return;
        }

        int r, max, i = (int)type;
        List <AudioClip> useThis;

        switch (type)
        {
        default:
            useThis = introAudio;
            break;

        case FeedbackType.YEAH:
            useThis = yeahAudio;
            break;

        case FeedbackType.OUCH:
            useThis = ouchAudio;
            break;

        case FeedbackType.END:
            useThis = endAudio;
            break;
        }
        max = useThis.Count;

        do
        {
            r = Random.Range(0, max);
        } while (r == lastPlayed[i]);
        lastPlayed[i] = r;

        StartCoroutine(PlayAudioClip(useThis[r], overrideAudio));
    }
    public void ShowFeedback(string message, FeedbackType feedbacktype)
    {
        fbtype = feedbacktype;

        switch (fbtype)
        {
        case FeedbackType.Error:
            pnlFeedback.CssClass = "error";
            break;

        case FeedbackType.Warning:
            pnlFeedback.CssClass = "warning";
            break;

        default:
            pnlFeedback.CssClass = "information";
            break;
        }

        lblFeedback.Text    = message;
        pnlFeedback.Visible = true;
    }
Esempio n. 27
0
        public static Promise Feedback(FeedbackType type, string content, string name = "", string contact = "")
        {
            var userId = UserInfoManager.isLogin() ? UserInfoManager.initUserInfo().userId : "";
            var device = AnalyticsManager.deviceId() + (SystemInfo.deviceModel ?? "");
            var dict   = new Dictionary <string, string> {
                { "userId", userId }, { "device", device }
            };
            var data    = JsonConvert.SerializeObject(value: dict);
            var promise = new Promise();
            var para    = new FeedbackParameter {
                type    = type.Value,
                contact = contact,
                name    = name,
                content = content,
                data    = data
            };
            var request = HttpManager.POST($"{Config.apiAddress}{Config.apiPath}/feedback", parameter: para);

            HttpManager.resume(request: request).Then(responseText => { promise.Resolve(); })
            .Catch(exception => promise.Reject(ex: exception));
            return(promise);
        }
Esempio n. 28
0
        /// <summary>
        /// Gets the supported information about a specific type and pattern.
        /// </summary>
        /// <remarks>
        /// Now, IsSupportedPattern is not working for FeedbackType.All.
        /// This API is working for FeedbackType.Sound and FeedbackType.Vibration only.
        /// If you use FeedbackType.All for type parameter, this API will throw ArgumentException.
        /// To get the supported information for Vibration type, the application should have http://tizen.org/privilege/haptic privilege.
        /// </remarks>
        /// <since_tizen> 3 </since_tizen>
        /// <param name="type">The feedback type.</param>
        /// <param name="pattern">The feedback pattern string.</param>
        /// <feature>
        /// http://tizen.org/feature/feedback.vibration for FeedbackType.Vibration
        /// </feature>
        /// <returns>Information whether a pattern is supported.</returns>
        /// <exception cref="Exception">Thrown when failed because the feedback is not initialized.</exception>
        /// <exception cref="ArgumentException">Thrown when failed because of an invalid arguament.</exception>
        /// <exception cref="NotSupportedException">Thrown when failed becuase the device (haptic, sound) is not supported.</exception>
        /// <exception cref="UnauthorizedAccessException">Thrown when failed because the access is not granted (No privilege).</exception>
        /// <exception cref="InvalidOperationException">Thrown when failed because of a system error.</exception>
        /// <privilege>http://tizen.org/privilege/haptic</privilege>
        /// <example>
        /// <code>
        /// Feedback feedback = new Feedback();
        /// bool res = feedback.IsSupportedPattern(FeedbackType.Vibration, "Tap");
        /// </code>
        /// </example>
        public bool IsSupportedPattern(FeedbackType type, String pattern)
        {
            bool supported = false;
            int  number;

            Interop.Feedback.FeedbackError res;

            if (!Pattern.TryGetValue(pattern, out number))
            {
                throw new ArgumentException($"Not supported pattern string : {pattern}", nameof(pattern));
            }

            res = (Interop.Feedback.FeedbackError)Interop.Feedback.IsSupportedPattern((Interop.Feedback.FeedbackType)type, number, out supported);

            if (res != Interop.Feedback.FeedbackError.None)
            {
                Log.Warn(LogTag, string.Format("Failed to get supported information. err = {0}", res));
                switch (res)
                {
                case Interop.Feedback.FeedbackError.NotInitialized:
                    throw new Exception("Not initialized");

                case Interop.Feedback.FeedbackError.InvalidParameter:
                    throw new ArgumentException("Invalid Arguments");

                case Interop.Feedback.FeedbackError.NotSupported:
                    throw new NotSupportedException("Device is not supported");

                case Interop.Feedback.FeedbackError.PermissionDenied:
                    throw new UnauthorizedAccessException("Access is not granted");

                case Interop.Feedback.FeedbackError.OperationFailed:
                default:
                    throw new InvalidOperationException("Failed to get supported information");
                }
            }
            return(supported);
        }
Esempio n. 29
0
        Widget _buildTypeItem(FeedbackType type)
        {
            var    isCheck = this.viewModel.feedbackType.Value.Equals(value: type.Value);
            Widget checkWidget;

            if (isCheck)
            {
                checkWidget = new Icon(
                    icon: Icons.check,
                    size: 24,
                    color: CColors.PrimaryBlue
                    );
            }
            else
            {
                checkWidget = new Container();
            }

            return(new GestureDetector(
                       onTap: () => this.actionModel.changeFeedbackType(obj: type),
                       child: new Container(
                           color: CColors.White,
                           height: 44,
                           padding: EdgeInsets.symmetric(horizontal: 16),
                           child: new Row(
                               mainAxisAlignment: MainAxisAlignment.spaceBetween,
                               children: new List <Widget> {
                new Text(
                    data: type.Description,
                    style: isCheck ? CTextStyle.PLargeBlue : CTextStyle.PLargeBody
                    ),
                checkWidget
            }
                               )
                           )
                       ));
        }
Esempio n. 30
0
		public static void FeedbackBuffer(FeedbackType type, params float[] buffer)
		{
			unsafe {
				fixed (float* p_buffer = buffer)
				{
					Debug.Assert(Delegates.pglFeedbackBuffer != null, "pglFeedbackBuffer not implemented");
					Delegates.pglFeedbackBuffer((Int32)buffer.Length, (Int32)type, p_buffer);
					CallLog("glFeedbackBuffer({0}, {1}, {2})", buffer.Length, type, buffer);
				}
			}
			DebugCheckErrors();
		}
Esempio n. 31
0
 /// <summary>
 /// Gets the paged feedback.
 /// </summary>
 /// <param name="pageIndex">Index of the page.</param>
 /// <param name="pageSize">Size of the page.</param>
 /// <param name="status">A flag for the status types to return.</param>
 /// <param name="excludeStatusMask">A flag for the statuses to exclude.</param>
 /// <param name="type">The type of feedback to return.</param>
 /// <returns></returns>
 public override IPagedCollection<FeedbackItem> GetPagedFeedback(int pageIndex, int pageSize, FeedbackStatusFlag status, FeedbackStatusFlag excludeStatusMask, FeedbackType type)
 {
     IDataReader reader = DbProvider.Instance().GetPagedFeedback(pageIndex, pageSize, status, excludeStatusMask, type);
     IPagedCollection<FeedbackItem> pec = new PagedCollection<FeedbackItem>();
     while(reader.Read())
     {
         pec.Add(DataHelper.LoadFeedbackItem(reader));
     }
     reader.NextResult();
     pec.MaxItems = DataHelper.GetMaxItems(reader);
     return pec;
 }
Esempio n. 32
0
 public FeedbackModel(string ruleId, string toolName, string toolVersion, IEnumerable <string> snippets, FeedbackType feedbackType, string summary, SarifLog log)
 {
     this.RuleId       = ruleId;
     this.ToolName     = toolName;
     this.ToolVersion  = toolVersion;
     this.SendSnippet  = true;
     this.Snippets     = snippets;
     this.Comment      = string.Empty;
     this.FeedbackType = feedbackType;
     this.Summary      = summary;
     this.SarifLog     = log;
 }
 /// <summary>
 /// Initialises a new Feedback object with the values provided by the input parameters.
 /// </summary>
 /// <param name="message">The message of the Feedback object.</param>
 /// <param name="type">The type of the Feedback object.</param>
 public Feedback(string message, FeedbackType type) : this(message, type, TimeSpan.Zero)
 {
 }
Esempio n. 34
0
 /// <summary>
 /// Returns correct HUD scene, according to current game type and provided feedback type.
 /// </summary>
 /// <param name="feedbackType">Current game's feedback type.</param>
 /// <returns>HUD scene according to current game type and provided feedback type.</returns>
 protected abstract BaseHUD GetHUDScene(FeedbackType feedbackType);
 public FeedbackEventArgs(string feedback, bool succes, FeedbackType myFeedbackType)
 {
     this.Feedback = feedback;
     this.Succes = succes;
     this.MyFeedbackType = myFeedbackType;
 }
Esempio n. 36
0
 /// <summary>
 /// Ctor. Creates a new <see cref="FeedbackItem"/> instance.
 /// </summary>
 /// <param name="type">Ptype.</param>
 public FeedbackItem(FeedbackType type)
 {
     Id = NullValue.NullInt32;
     EntryId = NullValue.NullInt32;
     FeedbackType = type;
     Status = FeedbackStatusFlag.None;
     DateCreatedUtc = NullValue.NullDateTime;
     DateModifiedUtc = NullValue.NullDateTime;
     Author = string.Empty;
 }
Esempio n. 37
0
 public static void glFeedbackBuffer(Int32 size, FeedbackType type, ref Single[] buffer)
 {
     i_OpenGL1_0.glFeedbackBuffer(size, type, ref buffer);
 }
Esempio n. 38
0
 public static void AddFeedback(string authorName, string message, FeedbackType type, string email = null, string authorId = null)
 {
     _feedbackService.AddFeedback(authorName, message, type, email, authorId);
 }
Esempio n. 39
0
		public static void FeedbackBuffer(Int32 size, FeedbackType type, params float[] buffer)
		{
			Debug.Assert(buffer.Length >= size);
			unsafe {
				fixed (float* p_buffer = buffer)
				{
					Debug.Assert(Delegates.pglFeedbackBuffer != null, "pglFeedbackBuffer not implemented");
					Delegates.pglFeedbackBuffer(size, (Int32)type, p_buffer);
					LogFunction("glFeedbackBuffer({0}, {1}, {2})", size, type, LogValue(buffer));
				}
			}
			DebugCheckErrors(null);
		}
Esempio n. 40
0
 public static Feedback CreateSellerToBuyer(Guid sellerId, Guid buyerId, FeedbackType type, string note, int sellingHistoryId)
 {
     return CreateInternal(sellerId, buyerId, type, note, sellingHistoryId);
 }
Esempio n. 41
0
 public void GiveFeedback(FeedbackType feedbackType, string message)
 {
     CommandResponseHandler.TellSource(this, string.Format("[{0}] {1}", feedbackType, message));
 }
Esempio n. 42
0
 public void GiveFeedback(FeedbackType feedbackType, string message, params object[] args)
 {
     CommandResponseHandler.TellSource(this, string.Format("[{0}] {1}", feedbackType, string.Format(message, args)));
 }
        public SiteUrl FeedbackPage(FeedbackType feedback, string localizationKey, SiteUrl redirect)
        {
            var parameters = new Dictionary<string, string>
                                 {
                                     { "key", localizationKey },
                                     { "url", redirect }
                                 };

            return new SiteUrl(this.Domain, this.HttpPort, false, "Dxt-Admin", "Feedback", feedback.ToString(), null, parameters);
        }
Esempio n. 44
0
 /// <summary>
 /// Creates a new <see cref="FeedbackItem"/> instance.
 /// </summary>
 /// <param name="type">Ptype.</param>
 public FeedbackItem(FeedbackType type)
 {
     this.feedbackType = type;
 }
Esempio n. 45
0
        static FeedbackItem CreateAndUpdateFeedbackWithExactStatus(Entry entry, FeedbackType type,
                                                                   FeedbackStatusFlag status)
        {
            var repository = new DatabaseObjectProvider();
            var feedback = new FeedbackItem(type);
            feedback.Title = UnitTestHelper.GenerateUniqueString();
            feedback.Body = UnitTestHelper.GenerateUniqueString();
            feedback.EntryId = entry.Id;
            feedback.Author = "TestAuthor";

            var subtextContext = new Mock<ISubtextContext>();
            subtextContext.Setup(c => c.Cache).Returns(new TestCache());
            subtextContext.SetupBlog(Config.CurrentBlog);
            subtextContext.SetupRepository(repository);
            subtextContext.Setup(c => c.HttpContext.Items).Returns(new Hashtable());
            subtextContext.Setup(c => c.HttpContext).Returns(new HttpContextWrapper(HttpContext.Current));

            var service = new CommentService(subtextContext.Object, null);
            int id = service.Create(feedback, true/*runFilters*/);

            feedback = repository.Get(id);
            feedback.Status = status;
            repository.Update(feedback);

            return repository.Get(id);
        }
Esempio n. 46
0
 public string GetCurrentQuery(int page, FeedbackStatusFlag status, FeedbackType type)
 {
     string query = "page={0}&status={1}&type={2}";
     return String.Format(query, page, status, type);
 }
Esempio n. 47
0
 public FeedbackHistoryItem(FeedbackType type, FeedbackPeriod period, int value)
 {
     Type   = type;
     Period = period;
     Value  = value;
 }
Esempio n. 48
0
 public string ListUrl(FeedbackType filter)
 {
     return ListUrl(PageIndex, FeedbackStatus, filter);
 }
Esempio n. 49
0
 /// <summary>
 /// Returns a data reader (<see cref="IDataReader" />) pointing to all the comments 
 /// ordered by ID Descending for the specified page index (0-based) and page size.
 /// </summary>
 /// <param name="pageIndex"></param>
 /// <param name="pageSize"></param>
 /// <param name="excludeStatusMask">A flag for the statuses to exclude.</param>
 /// <param name="status">Status flag for the feedback to return.</param>
 /// <param name="type">Feedback Type (comment, comment api, etc..) for the feedback to return.</param>
 /// <returns></returns>
 public abstract IDataReader GetPagedFeedback(int pageIndex, int pageSize, FeedbackStatusFlag status, FeedbackStatusFlag excludeStatusMask, FeedbackType type);
Esempio n. 50
0
 public string ListUrl(int page, FeedbackStatusFlag status, FeedbackType type)
 {
     return "Default.aspx?" + GetCurrentQuery(page, status, type);
 }
Esempio n. 51
0
 /// <summary>
 /// Gets the paged feedback.
 /// </summary>
 /// <param name="pageIndex">Index of the page.</param>
 /// <param name="pageSize">Size of the page.</param>
 /// <param name="status">A flag for the status types to return.</param>
 /// <param name="excludeStatusMask">A flag for the statuses to exclude.</param>
 /// <param name="type">The type of feedback to return.</param>
 /// <returns></returns>
 public override IPagedCollection<FeedbackItem> GetPagedFeedback(int pageIndex, int pageSize, FeedbackStatusFlag status, FeedbackStatusFlag excludeStatusMask, FeedbackType type)
 {
     int? feedbackType = (type == FeedbackType.None ? null : (int?)type);
     int? excludeStatus = (excludeStatusMask == FeedbackStatusFlag.None ? null : (int?)excludeStatusMask);
     using (IDataReader reader = _procedures.GetPageableFeedback(BlogId, pageIndex, pageSize, (int)status, excludeStatus, feedbackType))
     {
         return reader.ReadPagedCollection(r => reader.ReadFeedbackItem());
     }
 }
 public void CreateFeedback(string feedback, int answerId, int questionId, FeedbackType feedbackType, string feedbackToken)
 {
     this.manager.CreateFeedback(feedback, answerId, questionId, feedbackType, feedbackToken);
 }
Esempio n. 53
0
        /// <summary>
        /// Processes the feedback.
        /// </summary>
        /// <param name="feedbackMessage">The feedback message.</param>
        /// <param name="originalMessage">The original message.</param>
        /// <param name="feedbackType">Type of the feedback.</param>
        /// <returns>
        /// The feedback type corresponding the the message.
        /// </returns>
        internal Reply ProcessFeedback(Message feedbackMessage, Message originalMessage, out FeedbackType feedbackType)
        {
            Reply reply = new Reply();

            feedbackType = FeedbackType.NotProvided;
            string feedback = feedbackMessage.Content.ToLower();

            if (Regex.IsMatch(feedback, this.PositiveFeedbackPattern))
            {
                feedbackType = FeedbackType.Positive;
            }
            else if (Regex.IsMatch(feedback, this.NegativeFeedbackPattern))
            {
                feedbackType = FeedbackType.Negative;
            }

            if (FeedbackCollected != null)
            {
                reply = FeedbackCollected(this, new FeedbackCollectedEventArgs(feedbackType, feedbackMessage, originalMessage));
            }

            return(reply);
        }
Esempio n. 54
0
		internal static extern void glFeedbackBuffer(Int32 size, FeedbackType type, [OutAttribute] Single* buffer);
Esempio n. 55
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FeedbackContent" /> class.
 /// </summary>
 /// <param name="targetEventId">The ID of the event the feedback relates to.</param>
 /// <param name="type">The type of feedback.</param>
 public FeedbackContent(string targetEventId, FeedbackType type)
 {
     TargetEventId = targetEventId;
     Type          = type;
 }
Esempio n. 56
0
 /// <summary>
 /// Gets the paged feedback.
 /// </summary>
 /// <param name="pageIndex">Index of the page.</param>
 /// <param name="pageSize">Size of the page.</param>
 /// <param name="status">A flag for the status types to return.</param>
 /// <param name="excludeStatusMask">A flag for the statuses to exclude.</param>
 /// <param name="type">The type of feedback to return.</param>
 /// <returns></returns>
 public abstract IPagedCollection<FeedbackItem> GetPagedFeedback(int pageIndex, int pageSize,
                                                                 FeedbackStatusFlag status,
                                                                 FeedbackStatusFlag excludeStatusMask,
                                                                 FeedbackType type);
        /// <summary>
        /// Method used for saving user feedback for an answer.
        /// </summary>
        /// <param name="feedback">The textual feedback given by the user.</param>
        /// <param name="answerId">The id of the answer for which the feedback has been given.</param>
        /// <param name="questionId">The id of the question to which the answer is assigned.</param>
        /// <param name="feedbackType">The type of feedback which indicates if the user accepted or declined the answer.</param>
        /// <param name="feedbackToken">The feedback token is required to provide feedback to answers on a question. It
        /// is used to make sure the user that asked the question is also the user giving the feedback and that feedback
        /// can only be given once.</param>
        public void CreateFeedback(string feedback, int answerId, int questionId, FeedbackType feedbackType, string feedbackToken)
        {
            // Validate input data
            Validation.StringCheck(feedback);
            Validation.IdCheck(answerId);
            Validation.IdCheck(questionId);
            Validation.StringCheck(feedbackToken);

            using (IntelliCloudContext context = new IntelliCloudContext())
            {
                // Get the answer entity from the context
                AnswerEntity answer = context.Answers
                    .Include(a => a.User)
                    .Include(a => a.User.Sources)
                    .Include(a => a.LanguageDefinition)
                    .SingleOrDefault(a => a.Id == answerId);

                if (answer == null)
                    throw new NotFoundException("No answer entity exists with the specified ID.");

                // Set the state of the answer to UnderReview - employee needs to process the feedback given by the user
                answer.AnswerState = AnswerState.UnderReview;

                // Get the question entity from the context
                QuestionEntity question = context.Questions
                                          .Include(q => q.User)
                                          .Include(q => q.User.Sources)
                                          .Include(q => q.Source)
                                          .Include(q => q.LanguageDefinition)
                                          .Include(q => q.Answer)
                                          .Include(q => q.Answer.LanguageDefinition)
                                          .Include(q => q.Answer.User)
                                          .Include(q => q.Answer.User.Sources)
                                          .Include(q => q.Answerer)
                                          .Include(q => q.Answerer.Sources)
                                          .SingleOrDefault(q => q.Id == questionId);

                if (question == null)
                    throw new NotFoundException("No question entity exists with the specified ID.");

                // Check if the user who asked the question is the one to posted the feedback and make sure feedback is
                // only given once.
                if (question.FeedbackToken != feedbackToken)
                    throw new InvalidOperationException(
                        "Feedback can only be given once by the user who asked the question.");
                
                // Set the state of the question to Open - employee needs to process the feedback given by the user
                question.QuestionState = QuestionState.Open;
                // Reset token so feedback can only be given once.
                question.FeedbackToken = null;

                // Store the user's feedback for the given answer
                FeedbackEntity feedbackEntity = new FeedbackEntity();
                feedbackEntity.Question = question;
                feedbackEntity.Answer = answer;
                feedbackEntity.Content = feedback;
                feedbackEntity.CreationTime = DateTime.UtcNow;
                feedbackEntity.FeedbackState = FeedbackState.Open;
                feedbackEntity.FeedbackType = feedbackType;
                feedbackEntity.User = question.User;
                context.Feedbacks.Add(feedbackEntity);

                // Save the changes to the context
                context.SaveChanges();
            }
        }
 internal FeedbackStreamingEventArgs(FeedbackType type, byte[] buffer)
 {
     FeedbackType = type;
     Buffer       = buffer;
 }
Esempio n. 59
0
 /// <summary>
 /// Returns a pageable collection of comments.
 /// </summary>
 /// <param name="pageIndex"></param>
 /// <param name="pageSize"></param>
 /// <param name="status">A flag for the status types to return.</param>
 /// <param name="excludeStatusMask">A flag for the statuses to exclude.</param>
 /// <param name="type">The type of feedback to return.</param>
 /// <returns></returns>
 public static IPagedCollection<FeedbackItem> GetPagedFeedback(int pageIndex, int pageSize, FeedbackStatusFlag status, FeedbackStatusFlag excludeStatusMask, FeedbackType type)
 {
     return ObjectProvider.Instance().GetPagedFeedback(pageIndex, pageSize, status, excludeStatusMask, type);
 }
Esempio n. 60
0
 protected Feedback[] GetFeedbacks(FeedbackType type)
 {
     return _feedbacks.Value.Where(f => f.FeedbackType == type).ToArray();
 }