示例#1
0
    public void AddTask(string description, string tipText, string code, string helpKeyword
                       ,TaskPriority priority, TaskCategory category
                       ,TaskMarker marker, Guid outputPane
                       ,string projectName
                       ,string fileName, int startLine, int startColumn, int endLine, int endColumn 
                       ,ITaskCommands commands
                       )
    {
      // Add a new task
      Location span = new Location(projectName,fileName, startLine, startColumn, endLine, endColumn);
      Task task = new Task(this
                          ,description, tipText, code, helpKeyword
                          ,priority, category, marker
                          ,span
                          ,commands);
      tasks.Add(task);

      // show standard error in the build output pane
      if (outputPane != TaskOutputPane.None && description != null) {
        string kind;
        switch (category) {
          case TaskCategory.Error: kind = "error "; break;
          case TaskCategory.Warning: kind = "warning "; break;
          case TaskCategory.Message: kind = "message "; break;
          default: kind = ""; break;
        }
        OutputString(span + ": " + kind + (code != null ? code : "") + ": " + description + "\n", outputPane);
      }
    }
示例#2
0
        private async Task <Data.Models.Task> MapToDataModel(TaskServiceModel entity, string userId)
        {
            Data.Models.Task task = new Data.Models.Task
            {
                Id              = entity.Id,
                Name            = entity.Name,
                Description     = entity.Description,
                Budget          = entity.Budget,
                CompleationDate = entity.CompleationDate,
                DueDate         = entity.DueDate,
                PictureUrl      = entity.PictureUrl
            };

            User user = await this._userManager.FindByIdAsync(userId);

            task.Issuer = user;

            TaskCategory taskCategory = this._context.TaskCategories.Find(entity.TaskCategoryId);

            task.TaskCategory = taskCategory;

            Data.Models.TaskStatus taskStatus = this._context.TaskStatuses.Find(entity.TaskStatusId);
            task.TaskStatus = taskStatus;

            Location location = this._context.Locations.Find(entity.LocationId);

            task.Location = location;

            return(task);
        }
示例#3
0
        /// <summary>
        /// 任务监听
        /// </summary>
        /// <param name="m"></param>
        protected override void DefWndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case WM_COPYDATA:
            {
                COPYDATASTRUCT mystr  = new COPYDATASTRUCT();
                Type           mytype = mystr.GetType();
                mystr = (COPYDATASTRUCT)m.GetLParam(mytype);
                string taskInfo = mystr.lpData.Substring(0, mystr.cbData);
                taskInfo = taskInfo.Replace('$', ' ');
                string[]     pms            = taskInfo.Split('#');
                Guid         taskId         = Guid.Parse(pms[0]);
                string       sourceFileName = pms[1];
                string       destFileName   = pms[2];
                TaskType     taskType       = (TaskType)Enum.Parse(typeof(TaskType), pms[3]);
                RenameMode   taskRenameMode = (RenameMode)Enum.Parse(typeof(RenameMode), pms[4]);
                TaskCategory taskCategory   = (TaskCategory)Enum.Parse(typeof(TaskCategory), pms[5]);
                TransferTask task           = new TransferTask(taskId, sourceFileName, destFileName, taskType, taskRenameMode, taskCategory);
                AddTransferTask(task);
                break;
            }

            default:
                base.DefWndProc(ref m);
                break;
            }
        }
示例#4
0
        public void AddTask(string description, string tipText, string code, string helpKeyword
                            , TaskPriority priority, TaskCategory category
                            , TaskMarker marker, Guid outputPane
                            , string projectName
                            , string fileName, int startLine, int startColumn, int endLine, int endColumn
                            , ITaskCommands commands
                            )
        {
            // Add a new task
            Location span = new Location(projectName, fileName, startLine, startColumn, endLine, endColumn);
            Task     task = new Task(this
                                     , description, tipText, code, helpKeyword
                                     , priority, category, marker
                                     , span
                                     , commands);

            tasks.Add(task);

            // show standard error in the build output pane
            if (outputPane != TaskOutputPane.None && description != null)
            {
                string kind;
                switch (category)
                {
                case TaskCategory.Error: kind = "error "; break;

                case TaskCategory.Warning: kind = "warning "; break;

                case TaskCategory.Message: kind = "message "; break;

                default: kind = ""; break;
                }
                OutputString(span + ": " + kind + (code != null ? code : "") + ": " + description + "\n", outputPane);
            }
        }
示例#5
0
 internal void StartScheduler(TaskCategory cat)
 {
     if (!_physSchedulers[(int)cat].Started)
     {
         _physSchedulers[(int)cat].Start();
     }
 }
示例#6
0
        public Task(string title, int workProgressPercent, DateTime startDate, DateTime startTime, DateTime endTime, TaskCategory category, EntityActionType entityActionType, Guid syncId, bool syncedWithServer)
        {

            setProperties(title, workProgressPercent, startDate, startTime, endTime, category, entityActionType);
            setSyncStatus(syncedWithServer);
            setSyncId(syncId);
        }
            /// <summary>
            /// 构造函数 -- 封装数据
            /// </summary>
            /// <param name="eCategory">任务类别</param>
            /// <param name="eService">任务键名</param>
            public PacketHead(TaskCategory eCategory, TaskService eService)
            {
                this._eCategory = eCategory;
                this._eService  = eService;

                this.iPacketID = PacketID.Instance().CurrentID;
            }
示例#8
0
        public void Write(
            TaskCategory category,
            TaskErrorCategory errorCategory,
            string text,
            string document,
            int line,
            int column)
        {
            _errorsSinceSuspend++;

            ErrorTask task = new ErrorTask();

            task.Text          = text;
            task.ErrorCategory = errorCategory;
            //The task list does +1 before showing this numbers
            task.Line     = line - 1;
            task.Column   = column - 1;
            task.Document = document;
            task.Category = category;

            if (!string.IsNullOrEmpty(document))
            {
                //attach to the navigate event
                task.Navigate += NavigateDocument;
            }
            _errorProvider.Tasks.Add(task);
        }
示例#9
0
 protected TaskItemViewModel(string subject, TaskCategory category, DateTime date)
 {
     Subject     = subject;
     Category    = category;
     CreatedDate = date;
     Priority    = TaskPriority.Medium;
 }
        private void AppendTaskCategory(TaskCategory tcat)
        {
            try
            {
                //Assert wait cursor
                Application.UseWaitCursor = true;

                using (OpsDatabaseAdapter dbLib = new OpsDatabaseAdapter())
                {
                    // Call OpsDataReader to get the details for the selected week
                    int x = dbLib.CreateTaskCategory(tcat);
                }
            }
            catch (Exception ex)
            {
                Application.UseWaitCursor = false;
                string errHead = GetType().Name + "  " + System.Reflection.MethodBase.GetCurrentMethod().Name + "() failed. \n\n";
                MessageBox.Show(errHead + "Source: " + ex.Source + "\n\n" + ex.Message, ProductName + " " + ProductVersion, MessageBoxButtons.OK);
                Application.Exit();
            }
            finally
            {
                //Deny the wait cursor
                Application.UseWaitCursor = false;
            }
        }
示例#11
0
        public static void WriteError(string message, string fileName, int lineNumber = 0,
                                      int columnNumber   = 0,
                                      string helpKeyword = null, TaskCategory taskCategory = TaskCategory.User,
                                      string projectFile = null,
                                      bool allowOpenFile = false,
                                      bool activatePane  = true)
        {
            SimpleVsHierarchy hierarchyItem = projectFile != null ? new SimpleVsHierarchy(projectFile) : null;
            ErrorTask         task          = new ErrorTask
            {
                HierarchyItem = hierarchyItem,
                Category      = taskCategory,
                Document      = fileName,
                Line          = lineNumber,
                ErrorCategory = TaskErrorCategory.Error,
                Text          = message,
                Column        = columnNumber,
                HelpKeyword   = helpKeyword
            };

            if (allowOpenFile)
            {
                task.Navigate += (sender, args) => VisualStudioDTE.TryOpenFile(fileName, lineNumber, hierarchyItem);
            }

            AddTask(task, activatePane);
        }
示例#12
0
        public void updateTaskCategory(TaskCategory oldTC, string newCategory)
        {
            oldTC.categoryName = newCategory;

            db.Entry <TaskCategory>(oldTC).State = System.Data.EntityState.Modified;
            db.SaveChanges();
        }
示例#13
0
        protected override void DefWndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case WM_COPYDATA:
            {
                COPYDATASTRUCT mystr  = new COPYDATASTRUCT();
                Type           mytype = mystr.GetType();
                mystr = (COPYDATASTRUCT)m.GetLParam(mytype);
                string taskInfo = mystr.lpData.Substring(0, mystr.cbData);
                taskInfo = taskInfo.Replace('$', ' ');
                string[] pms = taskInfo.Split('#');
                TaskId         = Guid.Parse(pms[0]);
                sourceFileName = pms[1];
                destFileName   = pms[2];
                type           = (TaskType)Enum.Parse(typeof(TaskType), pms[3]);
                renameMode     = (RenameMode)Enum.Parse(typeof(RenameMode), pms[4]);
                category       = (TaskCategory)Enum.Parse(typeof(TaskCategory), pms[5]);

                System.Threading.Thread td = new System.Threading.Thread(Excute);
                td.Start();
                break;
            }

            default:
                base.DefWndProc(ref m);
                break;
            }
        }
示例#14
0
 public SequentialTask(String Name, TaskCategory Category, TaskPriority Priority)
 {
     this.Name = System.Guid.NewGuid().ToString(); // OMG
     //this.NameFormat = Name + "{0} (Step {1} of {2})";
     this.Category = Category;
     this.Priority = Priority;
 }
示例#15
0
        private void buttonSaveTask_Click(object sender, EventArgs e)
        {
            Person       selected = persons[this.UI_personDataGrid.SelectedCells[0].RowIndex];
            string       category = this.UI_TaskCategory.Text;
            TaskCategory cat      = new TaskCategory();

            if (category.StartsWith("0"))
            {
                cat = TaskCategory.REQ_ANALYSIS;
            }
            else if (category.StartsWith("1"))
            {
                cat = TaskCategory.DESIGN;
            }
            else if (category.StartsWith("2"))
            {
                cat = TaskCategory.CODING;
            }
            else if (category.StartsWith("3"))
            {
                cat = TaskCategory.TESTING;
            }
            else if (category.StartsWith("4"))
            {
                cat = TaskCategory.PM;
            }

            float hrs = (float)Convert.ToDouble(this.UI_InitialHours.Text);

            Task t = new ProjectManagementTool.Task(this.UI_TaskName.Text, this.UI_TaskDescription.Text, selected, cat, hrs);

            currentProject.requirements[index].tasks.Add(t);
            data.updateProject(currentProject);
            this.Close();
        }
示例#16
0
        public Task(TaskManager taskManager
                    , string description, string tipText, string code, string helpKeyword
                    , TaskPriority priority, TaskCategory category, TaskMarker markerType
                    , Location loc
                    , ITaskCommands commands
                    )
        {
            this.taskManager = taskManager;
            this.code        = code;
            this.description = description;
            this.tipText     = ((tipText == null || tipText.Length == 0) ? description : tipText);
            this.helpKeyword = helpKeyword;
            this.priority    = priority;
            this.category    = category;
            this.markerType  = markerType;
            this.commands    = commands;

            location   = (loc == null ? new Location(null, null) : loc);
            initLoc    = location.Clone();
            persistLoc = location.Clone();

            // isChecked = false;
            // isDeleted = false;
            // marker = null;

            // Create markers if the document is already opened.
            IVsTextLines textLines = location.GetTextLines(false);

            if (textLines != null)
            {
                OnOpenFile(textLines, false);
            }
        }
示例#17
0
文件: Task.cs 项目: hesam/SketchSharp
    public Task( TaskManager taskManager
               , string description, string tipText, string code, string helpKeyword
               , TaskPriority priority, TaskCategory category, TaskMarker markerType
               , Location loc
               , ITaskCommands commands
               )
    {
      this.taskManager = taskManager;
      this.code = code;
      this.description = description;
      this.tipText = ((tipText == null || tipText.Length == 0) ? description : tipText);
      this.helpKeyword = helpKeyword;
      this.priority = priority;
      this.category = category;
      this.markerType = markerType;
      this.commands = commands;

      this.location = (loc == null ? new Location(null, null) : loc);
      this.initLoc = this.location.Clone();
      this.persistLoc = this.location.Clone();

      // isChecked = false;
      // isDeleted = false;
      // marker = null;

      // Create markers if the document is already opened.
      IVsTextLines textLines = this.location.GetTextLines(false);
      if (textLines != null) {
        OnOpenFile(textLines);
      }
    }
 private static void Main()
 {
     using (var taskMonitorContext = new TaskMonitorContext())
     {
         var taskCategory = new TaskCategory {
             CategoryName = "Meeting", CreatedUtc = DateTime.UtcNow
         };
         var user = new User {
             UserName = "******", Tasks = new List <Task>(), CreatedUtc = DateTime.UtcNow
         };
         var task = new Task
         {
             Category    = taskCategory,
             StartDate   = DateTime.UtcNow,
             EndDate     = DateTime.UtcNow.AddDays(2).AddHours(3).AddMinutes(30),
             Description = "This is a sample task!",
             User        = user,
             CreatedUtc  = DateTime.UtcNow
         };
         user.Tasks.Add(task);
         taskMonitorContext.Database.BeginTransaction(IsolationLevel.ReadCommitted);
         var transaction = taskMonitorContext.Database.CurrentTransaction;
         taskMonitorContext.Tasks.Add(task);
         taskMonitorContext.TaskCategories.Add(taskCategory);
         taskMonitorContext.Users.Add(user);
         taskMonitorContext.SaveChanges();
         transaction.Rollback();
     }
 }
示例#19
0
 public CompoundTask(String Name, TaskCategory Category, TaskPriority Priority)
 {
     this.NameFormat = Name + " ({0} left)";
     this.Name       = String.Format(NameFormat, 0);
     this.Category   = Category;
     this.Priority   = Priority;
 }
        public IHttpActionResult PutTaskCategory(int id, TaskCategory taskCategory)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != taskCategory.TaskCategoryId)
            {
                return(BadRequest());
            }

            db.Entry(taskCategory).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TaskCategoryExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public void Write(
            TaskCategory category,
            TaskErrorCategory errorCategory,
            string context, //used as an indicator when removing
            string text,
            string document,
            int line,
            int column)
        {
            ErrorTask task = new ErrorTask();

            task.Text          = text;
            task.ErrorCategory = errorCategory;
            //The task list does +1 before showing this numbers
            task.Line     = line - 1;
            task.Column   = column - 1;
            task.Document = document;
            task.Category = category;

            if (!string.IsNullOrEmpty(document))
            {
                //attach to the navigate event
                //task.Navigate += NavigateDocument;
            }
            GetErrorListProvider().Tasks.Add(task);//add it to the errorlistprovider
        }
        public List <TaskCategory> GetTaskCategories()
        {
            List <TaskCategory> cats = new List <TaskCategory>();

            try {
                using (SqlCommand cmd = new SqlCommand("Gsp_GetTaskCategories", _dbConn)) {
                    cmd.CommandType = CommandType.StoredProcedure;
                    SqlDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        TaskCategory tc = new TaskCategory();
                        tc.CategoryDescription = (string)reader["CategoryDescription"];
                        tc.CategoryId          = Convert.ToInt32(reader["CategoryId"]);
                        tc.CategoryName        = (string)reader["CategoryName"];
                        tc.IsOverheadYN        = (string)reader["IsOverheadYn"];
                        cats.Add(tc);
                    }
                    reader.Close();
                }
                return(cats);
            }
            catch (Exception ex) {
                string errTitle = this.GetType().Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name;
                LogHardErrorMessage(errTitle, ex.Source, ex.Message);
                throw;
            }
        }
示例#23
0
 public async Task Update(TaskCategory taskCategory)
 {
     await _sqlClient.RunSp("Task.TaskCategory_Update", new
     {
         TaskCategoryID = taskCategory.TaskCategoryID,
         CategoryName   = taskCategory.CategoryName
     });
 }
示例#24
0
 public Task(string name, string desc, Person owner, TaskCategory cat, float hours)
 {
     this.name     = name;
     description   = desc;
     taskOwner     = owner;
     category      = cat;
     hoursExpended = hours;
 }
示例#25
0
 public static TaskCategoryDto CreateFrom(TaskCategory taskCategory)
 {
     return  new TaskCategoryDto()
                 {
                     Id = taskCategory.Id,
                     Category = taskCategory.Category
                 };
 }
示例#26
0
 public UpdateTaskCommand(int taskId, string name, TaskType type, TaskCategory category, int orderId)
 {
     this.taskId = taskId;
     this.name = name;
     this.type = type;
     this.category = category;
     this.orderId = orderId;
 }
示例#27
0
 public Task(string text, TaskCategory category, string fileName, int line, int column)
 {
     Line     = line;
     Column   = column;
     Text     = text;
     Category = category;
     FileName = fileName;
 }
        public TaskCategory Create(TaskCategory item)
        {
            db.Create(item);

            var items = GetAll().ToList();

            return(items[items.Count - 1]);
        }
示例#29
0
 public async Task Create(TaskCategory newTaskCategory)
 {
     newTaskCategory.TaskCategoryID = Guid.NewGuid();
     await _sqlClient.RunSp("Task.TaskCategory_Insert", new {
         TaskCategoryID = newTaskCategory.TaskCategoryID,
         CategoryName   = newTaskCategory.CategoryName
     });
 }
 public static TaskCategoryDto Map(TaskCategory entity)
 {
     return new TaskCategoryDto()
            {
                Id = entity.Id,
                Category = entity.Category
            };
 }
        public TaskCategory Create(TaskCategory item)
        {
            db.Categories.Create(item);

            var categories = db.Categories.GetAll().ToList();

            return(categories[categories.Count - 1]);
        }
示例#32
0
        private void btnSaveChanges_Click(object sender, EventArgs e)
        {
            //Remove any whitespace from the text in the control
            textBox1.Text = textBox1.Text.Trim();
            textBox2.Text = textBox2.Text.Trim();
            textBox4.Text = textBox4.Text.Trim();
            textBox5.Text = textBox5.Text.Trim();

            //If we fail validation, abort the save procedure and return
            if (!ValidateForm())
            {
                return;
            }

            textBox1.Text = textBox1.Text.Substring(0, 1).ToUpper() + textBox1.Text.Substring(1);

            //
            //MessageBox.Show("TEST PASSED!!", ProductName, MessageBoxButtons.OK);
            foreach (SsOpsDatabaseLibrary.Entity.Task task in _tasks)
            {
                if (task.TaskName.ToUpper() == textBox1.Text.ToUpper())
                {
                    MessageBox.Show("This task already exists in the grid.", "Attention", MessageBoxButtons.OK);
                    textBox1.Focus();
                    textBox1.SelectionStart  = 0;
                    textBox1.SelectionLength = textBox1.Text.Length;
                    return;
                }
            }
            //Uppercase the first character of each to ensure title case
            textBox1.Text = textBox1.Text.Substring(0, 1).ToUpper() + textBox1.Text.Substring(1);

            //We have to connect each of the columns in the table to recognize the text from the textbox should be in there now
            SsOpsDatabaseLibrary.Entity.Task tsk = new SsOpsDatabaseLibrary.Entity.Task();
            tsk.BudgetHours = textBox2.Text;
            tsk.TaskName    = textBox1.Text;
            tsk.StartDate   = DateFormat_UK(textBox4.Text);
            tsk.EndDate     = (String.IsNullOrEmpty(textBox5.Text) ? null : DateFormat_UK(textBox5.Text));
            tsk.ActualHours = "0";

            TaskCategory tc = (TaskCategory)cbxCategories.SelectedItem;

            tsk.CategoryId = tc.CategoryId;
            AppendTask(tsk);
            _isNewTask = true;

            //Once task is appended, clear the text boxes
            textBox1.Clear();
            textBox2.Clear();
            textBox4.Clear();
            textBox5.Clear();

            //Get the list of all tasks
            GetAllTasks();
            dataGridView1.DataSource = _tasks;
            //refresh the data so you can see the new task
            dataGridView1.Refresh();
        }
示例#33
0
        public void Given_documents_are_included_in_request_When_Create_Then_should_set_properties_correctly()
        {
            //Given
            var user = new UserForAuditing();
            var assignedTo = new Employee();
            const string reference = "ref";
            const string title = "title";
            const string description = "desc";
            const TaskStatus taskStatus = TaskStatus.Outstanding;
            var taskcompletionduedate = DateTime.Now;
            var furtherControlMeasureTaskCategory = new TaskCategory();

            //When
            var target = MultiHazardRiskAssessmentFurtherControlMeasureTask.Create(
                reference,
                title,
                description,
                taskcompletionduedate,
                taskStatus,
                assignedTo,
                user,
                new List<CreateDocumentParameters>
                    {
                        new CreateDocumentParameters
                            {
                                DocumentLibraryId = 20L,
                                Description = "Test Document 1"
                            },
                        new CreateDocumentParameters
                            {
                                DocumentLibraryId = 21L,
                                Description = "Test Document 2"
                            }
                    },
                furtherControlMeasureTaskCategory,
                0,
                null,
                false,
                false,
                false,
                false,
                Guid.NewGuid());

            //Then
            Assert.That(target.Reference, Is.EqualTo(reference));
            Assert.That(target.Title, Is.EqualTo(title));
            Assert.That(target.Description, Is.EqualTo(description));
            Assert.That(target.TaskAssignedTo, Is.EqualTo(assignedTo));
            Assert.That(target.TaskStatus, Is.EqualTo(taskStatus));
            Assert.That(target.TaskCompletionDueDate, Is.EqualTo(taskcompletionduedate));
            Assert.That(target.CreatedOn.Value.Date, Is.EqualTo(DateTime.Now.Date));
            Assert.That(target.CreatedBy, Is.EqualTo(user));
            Assert.That(target.Documents.Count, Is.EqualTo(2));
            Assert.That(target.Documents[0].DocumentLibraryId, Is.EqualTo(20L));
            Assert.That(target.Documents[0].Description, Is.EqualTo("Test Document 1"));
            Assert.That(target.Documents[1].DocumentLibraryId, Is.EqualTo(21L));
            Assert.That(target.Documents[1].Description, Is.EqualTo("Test Document 2"));
        }
示例#34
0
 private void dataGridView1_SelectionChanged(object sender, EventArgs e)
 {
     if (dataGridView1.CurrentRow != null && dataGridView1.CurrentRow.Index != -1)
     {
         int categoryTaskId = Convert.ToInt32(dataGridView1.CurrentRow.Cells["Id"].Value.ToString());
         currentTaskCategory = taskCategories.Find(t => t.Id == categoryTaskId);
         loadCurrentTaskCategoryToControls();
     }
 }
示例#35
0
        /// <summary>
        /// 查询该任务是否今天完成
        /// </summary>
        public int QueryTaskUserToday(string userId, TaskCategory taskCategory)
        {
            var query = from f in DB.CreateQuery <E_TaskList>()
                        where f.UserId == userId && f.TaskCategory == (int)taskCategory &&
                        f.CreateTime >= new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0)
                        select f;

            return(query.Count());
        }
示例#36
0
        public TaskCategory ToTaskCategory(ListItem listItem)
        {
            var result = new TaskCategory(listItem)
            {
                RelativeItemsCount = DaoFactory.GetListItemDao().GetRelativeItemsCount(ListType.TaskCategory, listItem.ID)
            };

            return(result);
        }
        public TaskCategory CreateTaskCategory(User Owner, string Name, string Description, string Color)
        {
            int          currentTaskCategoryID = 1;
            TaskCategory taskCategory          = new TaskCategory(currentTaskCategoryID, Owner, Name, Description, Color);

            currentTaskCategoryID++;
            _taskCategories.Add(taskCategory);
            return(taskCategory);
        }
示例#38
0
 private void setProperties(string title, int workProgressPercent, DateTime startDate, DateTime startTime, DateTime endTime, TaskCategory category, EntityActionType entityActionType)
 {
     this.WorkProgressPercent = workProgressPercent;
     this.StartDate = startDate;
     this.StartTime = startTime;
     this.EndTime = endTime;
     this.Title = title;
     this.Category = category;
     this.SyncedWithServer = false;
     this.ActionType = entityActionType;
 }
        public void When_CloneForReoccurring_Then_should_set_properties_correctly()
        {
            //Given
            var user = new UserForAuditing();
            var assignedTo = new Employee();
            const string reference = "ref";
            const string title = "title";
            const string description = "desc";
            const TaskStatus taskStatus = TaskStatus.Outstanding;
            var taskcompletionduedate = DateTime.Now;
            var furtherControlMeasureTaskCategory = new TaskCategory();


            var target = MultiHazardRiskAssessmentFurtherControlMeasureTask.Create(
                reference,
                title,
                description,
                taskcompletionduedate,
                taskStatus,
                assignedTo,
                user,
                new List<CreateDocumentParameters>(),
                furtherControlMeasureTaskCategory,
                0,
                null,
                false,
                false,
                false,
                false,
                Guid.NewGuid());

            //When
            var expectedCompletionDueDate = DateTime.Today;
            var result = target.CloneForReoccurring(user, expectedCompletionDueDate);
            

            //Then
            Assert.That(result.Reference, Is.EqualTo(target.Reference));
            Assert.That(result.Title, Is.EqualTo(target.Title));
            Assert.That(result.Description, Is.EqualTo(target.Description));
            Assert.That(result.TaskAssignedTo, Is.EqualTo(target.TaskAssignedTo));
            Assert.That(result.TaskStatus, Is.EqualTo(TaskStatus.Outstanding));
            Assert.That(result.TaskCompletionDueDate, Is.EqualTo(expectedCompletionDueDate));
            Assert.That(result.CreatedOn.Value.Date, Is.EqualTo(DateTime.Now.Date));
            Assert.That(result.CreatedBy, Is.EqualTo(user));
            Assert.That(result.OriginalTask, Is.EqualTo(target.OriginalTask));
            Assert.That(result.SendTaskCompletedNotification, Is.EqualTo(target.SendTaskCompletedNotification));
            Assert.That(result.SendTaskNotification, Is.EqualTo(target.SendTaskNotification));
            Assert.That(result.SendTaskOverdueNotification, Is.EqualTo(target.SendTaskOverdueNotification));
            Assert.That(result.SendTaskDueTomorrowNotification, Is.EqualTo(target.SendTaskDueTomorrowNotification));
        }
示例#40
0
 public static String ToString(TaskCategory taskCategory)
 {
     switch (taskCategory)
     {
         case TaskCategory.STUDY:
             return STUDY;
         case TaskCategory.WORK:
             return WORK;
         case TaskCategory.TEST:
             return TEST;
         default:
             throw new ArgumentOutOfRangeException("taskCategory");
     }
 }
示例#41
0
        public void Given_notification_settings_When_Update_Then_should_set_properties_correctly(bool sendTaskCompletedNotification, bool sendTaskNotification, bool sendTaskOverdueNotification, bool sendTaskDueTomorrowNotification)
        {
            //Given
            var user = new UserForAuditing();
            var assignedTo = new Employee();
            const string reference = "ref";
            const string title = "title";
            const string description = "desc";
            const TaskStatus taskStatus = TaskStatus.Completed;
            var taskcompletionduedate = DateTime.Now;
            var furtherControlMeasureTaskCategory = new TaskCategory();

            var target = MultiHazardRiskAssessmentFurtherControlMeasureTask.Create("",
                "",
                "",
                DateTime.Now,
                TaskStatus.Outstanding,
                null,
                user,
                new List<CreateDocumentParameters>(),
                furtherControlMeasureTaskCategory,
                0,
                null,
                false,
                false,
                false,
                false,
                Guid.NewGuid());

            //When
            target.Update(reference, title, description, taskcompletionduedate, taskStatus, new List<CreateDocumentParameters>(), new List<long>(), 0, null, assignedTo, user, sendTaskCompletedNotification, sendTaskNotification, sendTaskOverdueNotification, sendTaskDueTomorrowNotification);

            //Then
            Assert.That(target.Reference, Is.EqualTo(reference));
            Assert.That(target.Title, Is.EqualTo(title));
            Assert.That(target.Description, Is.EqualTo(description));
            Assert.That(target.TaskAssignedTo, Is.EqualTo(assignedTo));
            Assert.That(target.TaskStatus, Is.EqualTo(taskStatus));
            Assert.That(target.TaskCompletionDueDate, Is.EqualTo(taskcompletionduedate));
            Assert.That(target.LastModifiedOn.Value.Date, Is.EqualTo(DateTime.Now.Date));
            Assert.That(target.LastModifiedBy, Is.EqualTo(user));
            Assert.That(target.SendTaskCompletedNotification, Is.EqualTo(sendTaskCompletedNotification));
            Assert.That(target.SendTaskNotification, Is.EqualTo(sendTaskNotification));
            Assert.That(target.SendTaskOverdueNotification, Is.EqualTo(sendTaskOverdueNotification));
            Assert.That(target.SendTaskDueTomorrowNotification, Is.EqualTo(sendTaskDueTomorrowNotification));
        }
示例#42
0
        public static ActionTask Create(string reference,
            string title,
            string description,
            DateTime? taskCompletionDueDate,
            TaskStatus taskStatus, 
            Employee assignedTo,
            UserForAuditing user,
            IEnumerable<CreateDocumentParameters> createDocumentParameterObjects,
            TaskCategory taskCategory,
            int taskReoccurringTypeId,
            DateTime? taskReoccurringEndDate,
            bool sendTaskNotification,
            bool sendTaskCompletedNotification,
            bool sendTaskOverdueNotification,
            bool sendTaskDueTomorrowNotification,
            Guid taskGuid,
            Site site,
            Action action)
        {
            var task = new ActionTask();

            task.SetValuesForCreate(
                reference,
                title,
                description,
                taskCompletionDueDate,
                taskStatus,
                assignedTo,
                user,
                createDocumentParameterObjects,
                taskCategory,
                taskReoccurringTypeId,
                taskReoccurringEndDate,
                sendTaskNotification,
                sendTaskCompletedNotification,
                sendTaskOverdueNotification,
                sendTaskDueTomorrowNotification,
                taskGuid,
                site);

            task.Action = action;
            action.AddTask(task);
            action.SetLastModifiedBy(user);
            return task;
        }
        public static new RiskAssessmentReviewTask Create(
            string reference,
            string title,
            string description,
            DateTime? taskCompletionDueDate,
            TaskStatus taskStatus,
            Employee assignedTo,
            UserForAuditing user,
            IEnumerable<CreateDocumentParameters> createDocumentParameterObjects,
            TaskCategory taskCategory,
            int taskReoccurringTypeId,
            DateTime? taskReoccurringEndDate,
            RiskAssessmentReview riskAssessmentReview,
            bool sendTaskNotification,
            bool sendTaskCompletedNotification,
            bool sendTaskOverdueNotification,
            bool sendTaskDueTomorrowNotification,
            Guid taskGuid
            )
        {
            var riskAssessmentReviewTask = new RiskAssessmentReviewTask();

            riskAssessmentReviewTask.SetValuesForCreate(
                reference,
                title,
                description,
                taskCompletionDueDate,
                taskStatus,
                assignedTo,
                user,
                createDocumentParameterObjects,
                taskCategory,
                taskReoccurringTypeId,
                taskReoccurringEndDate,
                sendTaskNotification,
                sendTaskCompletedNotification,
                sendTaskOverdueNotification,
                sendTaskDueTomorrowNotification,
                taskGuid,null);

            riskAssessmentReviewTask.RiskAssessmentReview = riskAssessmentReview;

            return riskAssessmentReviewTask;
        }
示例#44
0
        public void When_Create_Then_should_set_properties_correctly()
        {
            //Given
            var user = new UserForAuditing();
            var assignedTo = new Employee();
            const string reference = "ref";
            const string title = "title";
            const string description = "desc";
            const TaskStatus taskStatus = TaskStatus.Outstanding;
            var taskcompletionduedate = DateTime.Now;
            var furtherControlMeasureTaskCategory = new TaskCategory();

            //When
            var target = MultiHazardRiskAssessmentFurtherControlMeasureTask.Create(
                reference,
                title,
                description,
                taskcompletionduedate,
                taskStatus,
                assignedTo,
                user,
                new List<CreateDocumentParameters>(),
                furtherControlMeasureTaskCategory,
                0,
                null,
                false,
                false,
                false,
                false,
                Guid.NewGuid());

            //Then
            Assert.That(target.Reference, Is.EqualTo(reference));
            Assert.That(target.Title, Is.EqualTo(title));
            Assert.That(target.Description, Is.EqualTo(description));
            Assert.That(target.TaskAssignedTo, Is.EqualTo(assignedTo));
            Assert.That(target.TaskStatus, Is.EqualTo(taskStatus));
            Assert.That(target.TaskCompletionDueDate, Is.EqualTo(taskcompletionduedate));
            Assert.That(target.CreatedOn.Value.Date, Is.EqualTo(DateTime.Now.Date));
            Assert.That(target.CreatedBy, Is.EqualTo(user));
            Assert.That(target.OriginalTask, Is.EqualTo(target));
            Assert.That(target.TaskGuid, Is.Not.EqualTo(default(Guid)));
        }
        public static MultiHazardRiskAssessmentFurtherControlMeasureTask Create(
            string reference,
            string title,
            string description,
            DateTime? taskCompletionDueDate,
            TaskStatus taskStatus,
            Employee assignedTo,
            UserForAuditing user,
            IEnumerable<CreateDocumentParameters> createDocumentParameterObjects,
            TaskCategory furtherControlMeasureTaskCategory,
            int taskReoccurringTypeId,
            DateTime? taskReoccurringEndDate,
            bool sendTaskNotification,
            bool sendTaskCompletedNotification,
            bool sendTaskOverdueNotification,
            bool sendTaskDueTomorrowNotification,
            Guid taskGuid
            )
        {
            var furtherControlMeasureTask = new MultiHazardRiskAssessmentFurtherControlMeasureTask();

            furtherControlMeasureTask.SetValuesForCreate(
                reference,
                title,
                description,
                taskCompletionDueDate,
                taskStatus,
                assignedTo,
                user,
                createDocumentParameterObjects,
                furtherControlMeasureTaskCategory,
                taskReoccurringTypeId,
                taskReoccurringEndDate,
                sendTaskNotification,
                sendTaskCompletedNotification,
                sendTaskOverdueNotification,
                sendTaskDueTomorrowNotification,
                taskGuid,
                null
                );

            return furtherControlMeasureTask;
        }
示例#46
0
    public void Write(TaskCategory category, TaskErrorCategory errorCategory, string text, string document, int? line = null, int? column = null)
    {
      ErrorTask task = new ErrorTask();
      task.Text = text;
      task.ErrorCategory = errorCategory;

      int? startLine, startColumn, endLine, endColumn;
      ParseErrorLocation(text, out startLine, out startColumn, out endLine, out endColumn);

      task.Line = (line ?? startLine ?? 1) - 1;
      task.Column = (column ?? startColumn ?? 1) - 1;
      task.Document = document;
      task.Category = category;

      if (!string.IsNullOrEmpty(document))
      {
        task.Navigate += NavigateDocument;
      }
      _errorListProvider.Tasks.Add(task);
    }
        // Above 


        /// <summary>
        /// Parses the error or warning.
        /// </summary>
        /// <param name="singleLine">Single line of text of the messages file</param>
        /// <param name="messagesFilename">Filename of the messages file for simple errors and warnings in context</param>
        /// <param name="messagesLine">Line number in the messages file</param>
        /// <param name="ignoreList">List of regular expressions for message lines that should be ignored</param>
        /// <param name="category">The category: error or warning.</param>
        /// <param name="message">Resulting message in MSBuild message format</param>
        /// <returns>
        /// True if it was an error or warning line, false otherwise
        /// </returns>
        public static bool ParseErrorOrWarning(string singleLine, string messagesFilename, int messagesLine, Regex[] ignoreList, out TaskCategory category,  out string message)
        {
            string text;
            string code;
            string filename;
            int line;
            int column;

            message = String.Empty;

            bool isMessage = ParseErrorOrWarning(singleLine, messagesFilename, messagesLine, ignoreList, out category,
                                                 out text, out code, out filename, out line, out column);
            if (isMessage)
            {
                // Construct a proper message
                message = MessageGeneration.Generate(category, text, code, filename, line, column);
            }

            return isMessage;
        }
        public virtual void Update(
            string title,
            string description,
            DateTime? taskCompletionDueDate,
            TaskStatus taskStatus,
            Employee assignedTo,
            UserForAuditing user,
            IEnumerable<CreateDocumentParameters> createDocumentParameterObjects,
            TaskCategory taskCategory,
            int taskReoccurringTypeId,
            DateTime? taskReoccurringEndDate,
            bool sendTaskNotification,
            bool sendTaskCompletedNotification,
            bool sendTaskOverdueNotification,
            bool sendTaskDueTomorrowNotification,
            Guid taskGuid,
            Site site)
        {
            
            Title = title;
            Description = description;
            TaskCompletionDueDate = taskCompletionDueDate.HasValue ? taskCompletionDueDate.Value : (DateTime?) null;
            TaskAssignedTo = assignedTo;
            TaskStatus = taskStatus;
            CreatedOn = DateTime.Now;
            CreatedBy = user;
            SetTaskReoccurringType((TaskReoccurringType) taskReoccurringTypeId);
            TaskReoccurringEndDate = taskReoccurringEndDate;
            OriginalTask = this;
            LastModifiedBy = user;
            LastModifiedOn = DateTime.Now;
            AddDocumentsToTask(createDocumentParameterObjects, user);
            TaskGuid = taskGuid;
            SendTaskNotification = sendTaskNotification;
            SendTaskCompletedNotification = sendTaskCompletedNotification;
            SendTaskOverdueNotification = sendTaskOverdueNotification;
            SendTaskDueTomorrowNotification = sendTaskDueTomorrowNotification;
            Site = site;
            Responsibility.SetLastModifiedBy(user);

        }
        /// <summary>
        /// Format an error or warning message in standard Microsoft format.
        /// </summary>
        /// <param name="category">Category: Error or Warning</param>
        /// <param name="text">The text of the error or warning</param>
        /// <param name="code">The code of the error or warning</param>
        /// <param name="path">The path to the file containing the error</param>
        /// <param name="line">The line in the file where the error occured</param>
        /// <param name="column">The column in the file where the error occured</param>
        /// <returns>The composed error or warning string</returns>
        public static string Generate(TaskCategory category, string text, string code, string path, int line, int column)
        {
            string categoryString = category == TaskCategory.Error ? "error" : "warning";
            string textline;
            if (string.IsNullOrEmpty(path))
            {
                textline = string.Format(" {0} {1}: {2}", categoryString, code, text);
            }
            else
            {
                if (column == 0)
                {
                    textline = string.Format("{0}({1}): {2} {3}: {4}", path, line, categoryString, code, text);
                }
                else
                {
                    textline = string.Format("{0}({1},{2}): {3} {4}: {5}", path, line, column, categoryString, code, text);
                }
            }

            return textline;
        }
示例#50
0
 internal void AddTask(TaskCategory cat, PhysicsTask task, int Delay)
 {
     _physSchedulers[(int)cat].AddTask(task, Delay);
 }
示例#51
0
 internal void StartScheduler(TaskCategory cat)
 {
     if (!_physSchedulers[(int)cat].Started)
         _physSchedulers[(int)cat].Start();
 }
        /// <summary>
        /// Parse a line of text for error or warning, return the components of the message for construction of new message.
        /// All lines containing error or warning as a whole word are checked against an ignore list. If the line
        /// should not be ignored there are two possibilities:
        /// </summary>
        /// <param name="singleLine">Single line of text of the messages file</param>
        /// <param name="messagesFilename">Filename of the messages file for simple errors and warnings in context</param>
        /// <param name="messagesLine">Line number in the messages file</param>
        /// <param name="ignoreList">List of regular expressions for message lines that should be ignored</param>
        /// <param name="category">The category.</param>
        /// <param name="text">The text.</param>
        /// <param name="code">The code.</param>
        /// <param name="filename">The filename.</param>
        /// <param name="line">The line.</param>
        /// <param name="column">The column.</param>
        /// <returns>
        /// True if it was an error or warning line, false otherwise
        /// </returns>
        public static bool ParseErrorOrWarning(
            string singleLine, string messagesFilename, int messagesLine, Regex[] ignoreList,
            out TaskCategory category, 
            out string text, 
            out string code, 
            out string filename, 
            out int line, 
            out int column)
        {
            category = TaskCategory.Unknown;
            text = String.Empty;
            code = String.Empty;
            filename = String.Empty;
            line = 0;
            column = 0;

            // Quick test is it might be a message line
            Match simple = simpleMessageExpression.Match(singleLine);
            if (simple.Success)
            {
                // Check against the ignoreList
                if (ignoreList != null)
                {
                    foreach (Regex ignore in ignoreList)
                    {
                        if (ignore.IsMatch(singleLine))
                        {
                            // Get out of here fast
                            return false;
                        }
                    }
                }
                
                // Test for MSBuild compliant message
                Match m = originCategoryCodeTextExpression.Match(singleLine);
                if (m.Success)
                {
                    string origin;
                    string categoryText;

                    // additional values that can come out of the message but which are ignored
                    string subcategory;
                    int endLine, endColumn;

                    // Message is MSBuild format compliant
                    origin = m.Groups[originCategoryCodeTextExpression.GroupNumberFromName("ORIGIN")].Value;
                    categoryText = m.Groups[originCategoryCodeTextExpression.GroupNumberFromName("CATEGORY")].Value;
                    code = m.Groups[originCategoryCodeTextExpression.GroupNumberFromName("CODE")].Value;
                    subcategory = m.Groups[originCategoryCodeTextExpression.GroupNumberFromName("SUBCATEGORY")].Value;
                    text = m.Groups[originCategoryCodeTextExpression.GroupNumberFromName("TEXT")].Value;

                    ParseOrigin(origin, out filename, out line, out column, out endLine, out endColumn);

                    category = GetCategory(categoryText);
                }
                else
                {
                    // Message is not MSBuild message format compliant, return the components in the context of the messages file
                    string categoryText = simple.Groups[simpleMessageExpression.GroupNumberFromName("CATEGORY")].Value;
                    category = GetCategory(categoryText);
                    text = singleLine;
                    code = "NoCode";
                    filename = messagesFilename;
                    line = messagesLine;
                    column = 1;
                }
                return true;
             
            }
            else
            {
                return false;
            }
        }
示例#53
0
        // helper methods.
        public DocumentTask CreateErrorTaskItem(TextSpan span, string filename, string subcategory, string message, TaskPriority priority, TaskCategory category, MARKERTYPE markerType, TaskErrorCategory errorCategory)
        {
            // create task item

            //TODO this src obj may not be the one matching filename.
            //find the src for the filename only then call ValidSpan.
            //Debug.Assert(TextSpanHelper.ValidSpan(this, span)); 

            DocumentTask taskItem = new DocumentTask(this.service.Site, this.textLines, markerType, span, filename, subcategory);
            taskItem.Priority = priority;
            taskItem.Category = category;
            taskItem.ErrorCategory = errorCategory;
            message = NewlineifyErrorString(message);
            taskItem.Text = message;
            taskItem.IsTextEditable = false;
            taskItem.IsCheckedEditable = false;
            return taskItem;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProductStoreTaskValidationMessage"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="description">The description.</param>
 /// <param name="category">The category.</param>
 /// <param name="code">The code.</param>
 /// <param name="violationType">Type of the violation.</param>
 /// <param name="helpKeyword">The help keyword.</param>
 public ProductStoreTaskValidationMessage(ValidationContext context, string description, TaskCategory category, string code, ViolationType violationType, string helpKeyword)
     : base(context, description, code, violationType)
 {
     this.category = category;
     this.HelpKeyword = helpKeyword;
 }
示例#55
0
文件: World.cs 项目: 727021/800craft
 internal void StartScheduler(TaskCategory cat)
 {
     try
     {
         if (!_physSchedulers[(int)cat].Started)
             _physSchedulers[(int)cat].Start();
     }
     catch (Exception e)
     {
         Logger.Log(LogType.Error, "PhySched: " + e);
     }
 }
示例#56
0
文件: World.cs 项目: 727021/800craft
 internal void AddTask(TaskCategory cat, PhysicsTask task, int Delay)
 {
     try
     {
         _physSchedulers[(int)cat].AddTask(task, Delay);
     }
     catch (Exception e)
     {
         Logger.Log(LogType.Error, "PhySchedAddTask: " + e);
     }
 }
示例#57
0
    public void OutputError(TaskCategory category, string description, string code, string help, string proofOutcome, bool additional, string subCategory, string fullPath, int startLine, int startColumn, int endLine, int endColumn)
    {
#if !NoVS
      if (taskManager != null) {
        // Show a full task item for this error 
        TaskMarker marker = TaskMarker.Invisible;
        TaskPriority priority = TaskPriority.Normal;

        if (category == TaskCategory.Warning) {
          marker = TaskMarker.Other;  // purple
        }
        else if (category == TaskCategory.Error) {
          marker = TaskMarker.Error; // blue
          priority = TaskPriority.High;
          if (!options.keepErrors) category = TaskCategory.Warning; // show all contract errors as warnings
        }

        if (options.hideMarkers || (additional && !options.showRelatedMarkers)) {
          marker = TaskMarker.Invisible;
        }

        if (!options.multiLineMarkers && startLine < endLine) {
          endLine = startLine;
          endColumn = startColumn + 100; // bug: should really look at the source to determine the end of the line
        }

        if (additional && options.additionalOutputPrefix != null) {
          description = options.additionalOutputPrefix + description;
        }
        else if (options.outputPrefix != null) {
          description = options.outputPrefix + description;
        }

        ITaskCommands commands = null;
        if (!additional) {
          relatedLocation = new Location();
          commands = new TaskCommands(relatedLocation);
        }
        else {
          if (relatedLocation != null) {
            // set related location slots from the previous error
            relatedLocation.projectName = options.projectName;
            relatedLocation.fileName = fullPath;
            relatedLocation.startLine = startLine;
            relatedLocation.startColumn = startColumn;
            relatedLocation.endLine = endLine;
            relatedLocation.endColumn = endColumn;
            // and set the related location to null again
            relatedLocation = null;
          }
        }

        try
        {
          taskManager.AddTask(
              description, null,
              code, help,
              priority, category, marker,
              (options.hideOutput ? TaskOutputPane.None : TaskOutputPane.Build),
              options.projectName, fullPath,
              startLine, startColumn, endLine, endColumn,
              commands
              );
        }
        catch { }

        //taskManager.Refresh();        
      }
      else
#endif
        if (log != null && !options.runInBackground) {
          if (options.outputPrefix != null) {
            description = options.outputPrefix + description;
          }

          if (category == TaskCategory.Warning || (category == TaskCategory.Error && !options.keepErrors))
            log.LogWarning("", code, help, fullPath,
                            startLine, startColumn, endLine, endColumn,
                            description, null);
          else if (category == TaskCategory.Error )
          {
            Contract.Assert(options.keepErrors, "Follows from the check above");
            log.LogError("", code, help, fullPath,
                          startLine, startColumn, endLine, endColumn,
                          description, null);
          }
          else
            log.LogMessage(MessageImportance.High, description);
        }
    }
        /// <summary>
        /// Add a task to the task list.
        /// </summary>
        /// <param name="tasksource"></param>
        /// <param name="category"></param>
        /// <param name="text"></param>
        /// <param name="code"></param>
        /// <param name="filename"></param>
        /// <param name="linenumber"></param>
        /// <param name="column"></param>
        public void AddTask(string tasksource, TaskCategory category, string text, string code, string filename, int linenumber, int column)
        {
            this.Dispatcher.Invoke(new Action(() =>
             {
                 string helplink = GetHelpLink(text);
                 string absoluteFilename = MakeWorkspaceRelativeFilenameAbsoluteIfPossible(filename);
                 _tasks.Add(new TaskItem
                 {
                     TaskSource = tasksource,
                     Category = category,
                     Text = text,
                     HasHelpLink = helplink != null,
                     HelpLink = helplink,
                     Code = code,
                     WorkspaceRelativeFilename = WebMatrixContext.GetWorkspaceRelativeFilename(absoluteFilename),
                     Filename = absoluteFilename,
                     Linenumber = linenumber,
                     Column = column
                 });

                 // If this task source is not in the list of task sources, add it
                 if (_tasksources.Where(n => n == tasksource).FirstOrDefault() == null)
                 {
                     _tasksources.Add(tasksource);
                 }

             }));
        }
示例#59
0
        public void Write(
            TaskCategory category,
            TaskErrorCategory errorCategory,
            string text,
            string document,
            int line,
            int column)
        {
            _errorsSinceSuspend++;

            ErrorTask task = new ErrorTask();
            task.Text = text;
            task.ErrorCategory = errorCategory;
            //The task list does +1 before showing this numbers
            task.Line = line - 1;
            task.Column = column - 1;
            task.Document = document;
            task.Category = category;

            if (!string.IsNullOrEmpty(document))
            {
                //attach to the navigate event
                task.Navigate += NavigateDocument;
            }
            _errorProvider.Tasks.Add(task);
        }
示例#60
0
 public virtual void Update(string title, DateTime startDate, DateTime startTime, DateTime endTime, int workProgressPercent, TaskCategory category, bool syncWithServer)
 {
     setProperties(title, workProgressPercent, startDate, startTime, endTime, category,EntityActionType.Modify);
     setSyncStatus(syncWithServer);
     
 }