Ejemplo n.º 1
0
        protected void GridViewTask_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                HyperLink lnk = (HyperLink)e.Row.FindControl("lnkTaskTitle");
                lnk.EnableViewState = false;
                lnk.Text            = Server.HtmlEncode((string)DataBinder.Eval(e.Row.DataItem, "TASK_TITLE"));

                if (this.gridViewTask.ExportingDeluxeGrid)
                {
                    lnk.NavigateUrl = "";
                }
                else
                {
                    lnk.NavigateUrl              = "javascript:void(0)";
                    lnk.Attributes["taskid"]     = (string)DataBinder.Eval(e.Row.DataItem, "TASK_GUID");
                    lnk.Attributes["unreadflag"] = object.Equals(DateTime.MinValue, DataBinder.Eval(e.Row.DataItem, "READ_TIME")) ? "True" : "False";
                    string     appName = (string)DataBinder.Eval(e.Row.DataItem, "APPLICATION_NAME");
                    string     url     = (string)DataBinder.Eval(e.Row.DataItem, "URL");
                    TaskLevel  level   = (TaskLevel)DataBinder.Eval(e.Row.DataItem, "TASK_LEVEL");
                    TaskStatus status;
                    Enum.TryParse <TaskStatus>(DataBinder.Eval(e.Row.DataItem, "STATUS").ToString(), out status);

                    lnk.Attributes["onclick"] = "onTaskLinkClick('" + UserTask.GetNormalizedUrl(url) + "','" + GetFeature(appName, level, status, url) + "');";
                }
            }
        }
Ejemplo n.º 2
0
        internal TaskProviderItem(
            IServiceProvider serviceProvider,
            string message,
            SourceSpan rawSpan,
            VSTASKPRIORITY priority,
            VSTASKCATEGORY category,
            bool squiggle,
            ITextSnapshot snapshot,
            TaskLevel level,
            ErrorType errorType
            )
        {
            _serviceProvider = serviceProvider;
            _message         = message;
            _rawSpan         = rawSpan;
            _snapshot        = snapshot;
            _span            = snapshot != null?CreateSpan(snapshot, rawSpan) : null;

            _rawSpan   = rawSpan;
            _priority  = priority;
            _category  = category;
            _squiggle  = squiggle;
            _level     = level;
            _errorType = errorType;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取应用对应的窗口控制代码
        /// </summary>
        /// <param name="task">消息对象</param>
        /// <returns>用于JS的弹出窗口控制代码</returns>
        internal static string GetFeature(string appName, TaskLevel level, TaskStatus status, string url)
        {
            string feature   = string.Empty;
            string featureID = string.Empty;

            //判断消息级别,同时消息状态是阅
            //老系统中的url会自动添加 http:// 字符串,新系统中没有
            if ((level < TaskLevel.Normal && status == TaskStatus.Yue && !url.StartsWith("http://")) ||
                url.StartsWith("/MCSWebApp/MCSOAPortal/TaskList/NoticeTaskDetail.aspx"))
            {
                if (ResourceUriSettings.GetConfig().Features.ContainsKey("MessageRemind"))
                {
                    feature = ResourceUriSettings.GetConfig().Features["MessageRemind"].Feature.ToWindowFeatureClientString();
                }
                else
                {
                    feature = "width=800,height=600,left=' + ((window.screen.width - 800) / 2) + ',top=' + ((window.screen.height - 600) / 2) + ',resizable=yes,scrollbars=yes,toolbar=no,location=no";
                }
            }
            else
            { //Note:获取js的窗口形态(待办)ApplicationInfoConfig.GetConfig().Applications.ContainsKey(appName) ? ApplicationInfoConfig.GetConfig().Applications[appName].FeatureID : string.Empty;
                feature = "width=800,height=600,left=' + ((window.screen.width - 800) / 2) + ',top=' + ((window.screen.height - 600) / 2) + ',resizable=yes,scrollbars=yes,toolbar=no,location=no";
            }
            return(feature);
        }
        public TaskInterceptorAttribute(string taskName = null, TaskLevel taskLevel = TaskLevel.Two, bool rethrowWhenException = true)
        {
            _taskName             = taskName;
            _taskLevel            = taskLevel;
            _rethrowWhenException = rethrowWhenException;

            _logger = Global.ServiceProviderRoot.GetRequiredService <ILogger <TaskInterceptorAttribute> >();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Removes all items for the specified entry.
        /// </summary>
        public void Clear(string filePath, string moniker, TaskLevel taskLevel = TaskLevel.All)
        {
            List <EntryKey> remKeys = null;

            lock (_errorSources)
            {
                remKeys = _errorSources.Where(x => x.Key.Filepath.StartsWith(filePath, StringComparison.OrdinalIgnoreCase)).Select(x => x.Key).ToList();
            }
            for (int i = 0; i < remKeys.Count; i++)
            {
                SendMessage(WorkerMessage.Clear(remKeys[i].Filepath, moniker, taskLevel));
            }
        }
Ejemplo n.º 6
0
        public static string GetDescription(this TaskLevel level)
        {
            switch (level)
            {
            case TaskLevel.Critical:
                return("Критичный");

            case TaskLevel.Low:
                return("Низкий");

            case TaskLevel.Normal:
                return("Нормальный");

            default:
                throw new NotImplementedException();
            }
        }
Ejemplo n.º 7
0
        private static string TaskLevelEnumToString(TaskLevel type)
        {
            var ret = $"неизвестный тип ({type.ToString()})";

            switch (type)
            {
            case TaskLevel.Low:
                ret = "Низкийё";
                break;

            case TaskLevel.Critical:
                ret = "Нормальный";
                break;

            case TaskLevel.Normal:
                ret = "Критичный";
                break;
            }

            return(ret);
        }
Ejemplo n.º 8
0
 public TaskProviderItem FromErrorResult(IServiceProvider serviceProvider, ErrorResult result, VSTASKPRIORITY priority, VSTASKCATEGORY category, TaskLevel level, ErrorType errorType)
 {
     return(new TaskProviderItem(
                serviceProvider,
                result.Message,
                result.Span,
                priority,
                category,
                true,
                _snapshot,
                level,
                errorType
                ));
 }
Ejemplo n.º 9
0
 public PossibleTask(TaskLevel[] Levels)
 {
     this.Levels = Levels;
 }
Ejemplo n.º 10
0
 public static WorkerMessage Clear(string filepath, string moniker, TaskLevel taskLevel = TaskLevel.All)
 {
     return(new ClearMessage(new EntryKey(filepath, moniker), taskLevel));
 }
		/// <summary>
		/// 获取应用对应的窗口控制代码
		/// </summary>
		/// <param name="task">消息对象</param>
		/// <returns>用于JS的弹出窗口控制代码</returns>
		internal static string GetFeature(string appName, TaskLevel level, TaskStatus status, string url)
		{
			string feature = string.Empty;
			string featureID = string.Empty;
			//判断消息级别,同时消息状态是阅
			//老系统中的url会自动添加 http:// 字符串,新系统中没有
			if ((level < TaskLevel.Normal && status == TaskStatus.Yue && !url.StartsWith("http://"))
				|| url.StartsWith("/MCSWebApp/MCSOAPortal/TaskList/NoticeTaskDetail.aspx"))
			{
				if (ResourceUriSettings.GetConfig().Features.ContainsKey("MessageRemind"))
				{
					feature = ResourceUriSettings.GetConfig().Features["MessageRemind"].Feature.ToWindowFeatureClientString();
				}
				else
				{
					feature = "width=800,height=600,left=' + ((window.screen.width - 800) / 2) + ',top=' + ((window.screen.height - 600) / 2) + ',resizable=yes,scrollbars=yes,toolbar=no,location=no";
				}
			}
			else
			{ //Note:获取js的窗口形态(待办)ApplicationInfoConfig.GetConfig().Applications.ContainsKey(appName) ? ApplicationInfoConfig.GetConfig().Applications[appName].FeatureID : string.Empty;
				feature = "width=800,height=600,left=' + ((window.screen.width - 800) / 2) + ',top=' + ((window.screen.height - 600) / 2) + ',resizable=yes,scrollbars=yes,toolbar=no,location=no";
			}
			return feature;
		}
Ejemplo n.º 12
0
 public static WorkerMessage Replace(string filepath, string moniker, List <TaskProviderItem> items, TaskLevel level)
 {
     return(new ReplaceMessage(new EntryKey(filepath, moniker), items, level));
 }
Ejemplo n.º 13
0
 public ReplaceMessage(EntryKey key, List <TaskProviderItem> items, TaskLevel level)
     : base(key, items)
 {
     _level = level;
 }
Ejemplo n.º 14
0
 // Factory methods
 public static WorkerMessage Clear(TaskLevel taskLevel = TaskLevel.All)
 {
     return(new ClearMessage(EntryKey.Empty, taskLevel));
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Removes all items from all entries.
 /// </summary>
 public void ClearAll(TaskLevel taskLevel = TaskLevel.All)
 {
     SendMessage(WorkerMessage.Clear(taskLevel));
 }
Ejemplo n.º 16
0
        /// <summary>
        /// Replaces the items for the specified entry.
        /// </summary>
        public void ReplaceItems(string filepath, string moniker, List <TaskProviderItem> items, TaskLevel level)
        {
            if (!HasErrorSource(filepath, moniker))
            {
                AddErrorSource(filepath, moniker);
            }

            SendMessage(WorkerMessage.Replace(filepath, moniker, items, level));
        }
Ejemplo n.º 17
0
 public ClearMessage(EntryKey key, TaskLevel taskLevel)
     : base(key, null)
 {
     _taskLevel = taskLevel;
 }