예제 #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
        public ICancellable Enqueue(Action<CancellationToken> task, TaskPriority priority)
        {
            var entry = new TaskEventLoopEntry(task);

            lock (this)
            {
                var entries = default(Queue<TaskEventLoopEntry>);

                if (!_queues.TryGetValue(priority, out entries))
                {
                    entries = new Queue<TaskEventLoopEntry>();
                    _queues.Add(priority, entries);
                }

                if (_current == null)
                {
                    SetCurrent(entry);
                }
                else
                {
                    entries.Enqueue(entry);
                }
            }

            return entry;
        }
예제 #3
0
        public Task(string name, bool isimportant, bool ishard, int estimatetomato, 
            TaskType  tasktype, TaskPriority taskpri,
            TaskStatus taskstatus = TaskStatus.INQUEUE, DateTime? reminder = null)
        {
            this.name = name;
            this.isImportant = isimportant ? "important" : "not important";
            this.isHard = ishard ? "hard" : "easy";
            this.estimateToamto = estimatetomato;

            this.completeTomato = 0;
            this.incompleteTomato = 0;
            this.innerBreak = 0;
            this.outterBreak = 0;
            this.completeness = 0;
            this.difficulties = 0;
            this.satisfaction = 0;
            this.efficiency = 0;
            this.improvement = 0;
            this.achivement = 0;
            this.focusness = 0;

            this.taskStatus = taskstatus;
            this.taskType = tasktype;
            this.taskPriority = taskpri;
        }
예제 #4
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);
      }
    }
예제 #5
0
파일: Task.cs 프로젝트: SymphonyX/VAST
    public Task( TaskManager taskManager, TaskPriority t_taskPriority )
    {
        setTaskPriority ( t_taskPriority ); // the first signal will go nowhere

        registerObserver(Event.CHANGE_IN_TASK_PRIORITY, taskManager);
        taskManager.addTask((int) taskPriority, this);
    }
예제 #6
0
파일: DummyTask.cs 프로젝트: nolith/tasque
 public DummyTask(DummyBackend backend, int id, string taskName)
 {
     this.backend = backend;
     this.id = id;
     this.name = taskName;
     this.dueDate = DateTime.MinValue; // No due date specified
     this.completionDate = DateTime.MinValue; // No due date specified
     this.priority = TaskPriority.None;
     this.state = TaskState.Active;
 }
예제 #7
0
        public static TaskPriority DtoToEntity(TaskPriorityDto dto)
        {
            var entity = new TaskPriority
            {
                Id    = dto.Id,
                Name  = dto.Name,
                Order = dto.Order
            };

            return(entity);
        }
예제 #8
0
 private void ParseImportance()
 {
     if (_options.Contains("-hp"))
     {
         _importance = TaskPriority.High;
     }
     else if (_options.Contains("-lp"))
     {
         _importance = TaskPriority.Low;
     }
 }
예제 #9
0
        private void PostTask(string iDocument, int iLine, string iMessage, TaskPriority iPriority)
        {
            Task task = new Task();
              task.Document = iDocument;
              task.Line     = iLine;
              task.Text     = iMessage;
              task.Priority = iPriority;
              task.Navigate += new EventHandler(this.NavigateTo);

              mErrorListProvider.Tasks.Add(task);
        }
예제 #10
0
 public static string ToFriendlyString(this TaskPriority taskPriority)
 {
     return(taskPriority switch
     {
         TaskPriority.LowPriority => "Niski",
         TaskPriority.NormalPriority => "Normalny",
         TaskPriority.HighPriority => "Wysoki",
         TaskPriority.VeryHighPriority => "Powyżej wysokiego",
         TaskPriority.PeopleAreDyingPriority => "Ludzie tutaj umierają",
         _ => "",
     });
        public async Task <TodoTask> CreateAsync(string title, string description, TaskPriority priority)
        {
            var obj = new
            {
                Title       = title,
                Description = description,
                Priority    = priority
            };

            return(await _httpService.Client.PostAndReturnJsonAsync <object, TodoTask>("Todo/Create", obj));
        }
예제 #12
0
    // defaults to a real-time task -- now what happens when both this and Global are first put in queue ??
    public GridNavigationTask(State t_startState, State t_goalState, float t_inflationFactor, ref List<State> t_path,
		float t_tunnelDistanceThreshold, float t_tunnelTimeThreshold, ref List<State> t_spaceTimePath, GridTimeDomain t_gridTimeDomain,
		TaskPriority t_taskPriority, TaskManager taskManager)
        : base(taskManager, t_taskPriority)
    {
        taskType = TaskType.GridNavigationTask;

        startState = t_startState;
        goalState = t_goalState;

        // EVENT : startState will trigger GridNavigationTask that STATE_CHANGED
        startState.registerObserver(Event.STATE_POSITION_CHANGED, this);

        // EVENT : goalState will trigger GridNavigationTask that STATE_CHANGED
        goalState.registerObserver(Event.STATE_POSITION_CHANGED, this);

        // EVENT : goalState will trigger GridNavigationTask that it is GOAL_INVALID or VALID
        goalState.registerObserver(Event.GOAL_INVALID, this);
        goalState.registerObserver(Event.GOAL_VALID, this);

        inflationFactor = t_inflationFactor;

        //planner = t_planner;
        outputPlan = new Dictionary<DefaultState, ARAstarNode>();
        path = t_path;

        // TODO : deprecate these lists
        List<PlanningDomainBase> domainList = new List<PlanningDomainBase>();
        ARAstarDomain araStarDomain = new ARAstarDomain ();
        araStarDomain.setPlanningTask(this);
        domainList.Add(araStarDomain);

        gridPlanner = new ARAstarPlanner();
        gridPlanner.init(ref domainList, 100);

        initialized = true;

        obstacleChanged = false;
        obstacleChangedData = new List<object> ();

        // tunnel planner variables
        tunnelDistanceThreshold = t_tunnelDistanceThreshold;
        tunnelTimeThreshold = t_tunnelTimeThreshold;
        gridTimeDomain = t_gridTimeDomain;
        spaceTimePath = t_spaceTimePath;

        spaceTimePathStatus = false;

        dynamicChange = false;

        currentlyExecutingTask = false;

        gridPathStatus = PathStatus.NoPath;
    }
예제 #13
0
		public Task (FilePath file, string description, int column, int line, TaskSeverity severity, TaskPriority priority, IWorkspaceObject parent, object owner)
		{
			this.file = file;
			this.description = description;
			this.column = column;
			this.line = line;
			this.severity = severity;
			this.priority = priority;
			this.owner = owner;
			this.parentObject = parent;
		}
예제 #14
0
파일: Task.cs 프로젝트: SymphonyX/VAST
    public void setTaskPriority( TaskPriority newTaskPriority )
    {
        // allowing task to be put in the same priority list from which it was popped out of.
        //if ( this.taskPriority == newTaskPriority )
        //	return;

        // the data we would send is old and new task priority
        notifyObservers ( Event.CHANGE_IN_TASK_PRIORITY, new TaskPriorityChange(this,newTaskPriority) );

        taskPriority = newTaskPriority;
    }
예제 #15
0
        public TaskEntry(string titel, string description, TaskPriority priority, DateTime startDate,
                         DateTime deadlineDate)
        {
            Titel        = titel;
            Description  = description;
            Priority     = priority.ToString();
            StartDate    = startDate;
            DeadlineDate = deadlineDate;

            CreatedDate = DateTime.Now;
        }
예제 #16
0
        int PrioirtySortFunc(TreeModel model, TreeIter iter1, TreeIter iter2)
        {
            TaskPriority prio1 = (TaskPriority)Enum.Parse(typeof(TaskPriority), (string)model.GetValue(iter1, (int)Columns.Priority));
            TaskPriority prio2 = (TaskPriority)Enum.Parse(typeof(TaskPriority), (string)model.GetValue(iter2, (int)Columns.Priority));

            if (prio1 == prio2)
            {
                return(0);
            }
            return(prio1 < prio2 ? 1 : -1);
        }
예제 #17
0
 /// <summary>
 /// Enqueues another action without considering the cancellation token.
 /// </summary>
 /// <param name="loop">The loop to extend.</param>
 /// <param name="action">The action to enqueue.</param>
 /// <param name="priority">The priority of the item.</param>
 public static void Enqueue(this IEventLoop loop, Action action, TaskPriority priority = TaskPriority.Normal)
 {
     if (loop != null)
     {
         loop.Enqueue(c => action.Invoke(), priority);
     }
     else
     {
         action.Invoke();
     }
 }
예제 #18
0
 public Task(FilePath file, string description, int column, int line, TaskSeverity severity, TaskPriority priority, IWorkspaceObject parent, object owner)
 {
     this.file         = file;
     this.description  = description;
     this.column       = column;
     this.line         = line;
     this.severity     = severity;
     this.priority     = priority;
     this.owner        = owner;
     this.parentObject = parent;
 }
예제 #19
0
 /// <summary>
 /// Draws the editable version.
 /// </summary>
 public void DrawEditable()
 {
     EditorGUILayout.LabelField("Summary");
     summary = EditorGUILayout.TextField(summary);
     EditorGUILayout.LabelField("Task");
     task = EditorGUILayout.TextArea(task, GUILayout.Height(40));
     EditorGUILayout.LabelField("Time Estimate");
     timeEstimate = EditorGUILayout.TextField(timeEstimate);
     //ValidateTimeEstimate();
     EditorGUILayout.LabelField("Priority");
     priority = (TaskPriority)GUILayout.Toolbar(((int)priority), new string[] { "Low", "Medium", "High" });
 }
예제 #20
0
 public Task(string title, TaskType type, TaskPriority priority = TaskPriority.Normal,
             DateTime?dueDate = null, string summary = null)
 {
     Title    = title;
     Summary  = summary;
     DueDate  = dueDate;
     Priority = priority;
     Type     = type;
     History  = new List <Event> {
         new CreatedEvent()
     };
 }
예제 #21
0
		public TaskData (string uri)
		{
			this.uri = uri;
			this.details = string.Empty;

			create_date = DateTime.MinValue;
			last_change_date = DateTime.MinValue;
			due_date = DateTime.MinValue;
			completion_date = DateTime.MinValue;
			priority = TaskPriority.Undefined;
			origin_note_uri = string.Empty;
		}
예제 #22
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,AddedDate,ModifiedDate,Name")] TaskPriority taskPriority)
        {
            if (ModelState.IsValid)
            {
                taskPriority.ModifiedDate    = DateTime.Now;
                db.Entry(taskPriority).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(taskPriority));
        }
예제 #23
0
		Gdk.Color GetColorByPriority (TaskPriority prio)
		{
			switch (prio)
			{
				case TaskPriority.High:
					return highPrioColor;
				case TaskPriority.Normal:
					return normalPrioColor;
				default:
					return lowPrioColor;
			}
		}
예제 #24
0
        public TaskData(string uri)
        {
            this.uri     = uri;
            this.details = string.Empty;

            create_date      = DateTime.MinValue;
            last_change_date = DateTime.MinValue;
            due_date         = DateTime.MinValue;
            completion_date  = DateTime.MinValue;
            priority         = TaskPriority.Undefined;
            origin_note_uri  = string.Empty;
        }
예제 #25
0
        private void PostTask(string iDocument, int iLine, string iMessage, TaskPriority iPriority)
        {
            Task task = new Task();

            task.Document  = iDocument;
            task.Line      = iLine;
            task.Text      = iMessage;
            task.Priority  = iPriority;
            task.Navigate += new EventHandler(this.NavigateTo);

            mErrorListProvider.Tasks.Add(task);
        }
예제 #26
0
        /// <summary>
        /// Выводит приоритет задачи в лог.
        /// </summary>
        /// <param name="aTaskPriority">
        /// Приоритет задачи.
        /// </param>
        /// <param name="aColor">
        /// Цвет сообщения.
        /// </param>
        private void LogPriority(TaskPriority aTaskPriority, ConsoleColor aColor)
        {
            if (PriorityLog == null)
            {
                return;
            }

            string lPriority = aTaskPriority == TaskPriority.High
                                   ? "H"
                                   : aTaskPriority == TaskPriority.Normal ? "N" : "L";

            PriorityLog.WriteMessage(lPriority, aColor);
        }
예제 #27
0
        public int put_Priority(VSTASKPRIORITY tpPriority)
        {
            switch (tpPriority)
            {
            case VSTASKPRIORITY.TP_LOW: priority = TaskPriority.Low; break;

            case VSTASKPRIORITY.TP_NORMAL: priority = TaskPriority.Normal; break;

            case VSTASKPRIORITY.TP_HIGH: priority = TaskPriority.High; break;
                // don't do anything in another case
            }
            return(0);
        }
예제 #28
0
 public string IconFor(TaskPriority priority)
 {
     return(priority switch
     {
         TaskPriority.VeryLow => "fa-angle-double-down",
         TaskPriority.Low => "fa-angle-down",
         TaskPriority.Medium => "fa-grip-lines",
         TaskPriority.High => "fa-angle-up",
         TaskPriority.VeryHigh => "fa-angle-double-up",
         TaskPriority.Urgent => "fa-exclamation",
         TaskPriority.Critical => "fa-exclamation-circle",
         _ => throw new ArgumentOutOfRangeException(nameof(priority))
     });
예제 #29
0
 public static void AddWarning(
     string message,
     string file,
     int line,
     int endLine,
     int column,
     int endColumn,
     IVsHierarchy hierarchy,
     TaskCategory category = TaskCategory.BuildCompile,
     TaskPriority priority = TaskPriority.High)
 {
     AddTask(message, file, line, endLine, column, endColumn, hierarchy, category, TaskErrorCategory.Warning, priority);
 }
예제 #30
0
        public IActionResult GetByTaskPriorityID(int TaskPriorityID)
        {
            TaskPriority taskPriority = db.TaskPriorities.Where(temp => temp.TaskPriorityID == TaskPriorityID).FirstOrDefault();

            if (taskPriority != null)
            {
                return(Ok(taskPriority));
            }
            else
            {
                return(NoContent());
            }
        }
예제 #31
0
 public static void AddMessage(
     string message,
     string file,
     int line,
     int endLine,
     int column,
     int endColumn,
     Microsoft.VisualStudio.Shell.Interop.IVsHierarchy hierarchy,
     TaskCategory category = TaskCategory.BuildCompile,
     TaskPriority priority = TaskPriority.High)
 {
     AddTask(message, file, line, endLine, column, endColumn, hierarchy, category, TaskErrorCategory.Message, priority);
 }
예제 #32
0
        TaskPriority ITaskRepository.UpdatePriority(ITaskCore task,
                                                    TaskPriority priority)
        {
            var command = "UPDATE Tasks SET Priority=@priority WHERE ID=@id;";

            using (var cmd = new SqliteCommand(database.Connection)) {
                cmd.CommandText = command;
                cmd.Parameters.AddWithValue("@priority", (int)priority);
                cmd.Parameters.AddIdParameter(task);
                cmd.ExecuteNonQuery();
            }
            return(priority);
        }
예제 #33
0
파일: Task.cs 프로젝트: hesam/SketchSharp
 /// <include file='doc\Task.uex' path='docs/doc[@for="Task.Task"]/*' />
 public Task() {
     priority = TaskPriority.Normal;
     subCategoryIndex = -1;
     // Initializing the imageIndex to -1 tells VS to not expect to get
     // an imageList from us either, and instead use the default images.
     // This fixes bug 172354.
     imageIndex = -1;
     line = -1;
     column = -1;
     text = string.Empty;
     helpKeyword = string.Empty;
     document = string.Empty;
 }
예제 #34
0
 internal TaskViewModel(ITaskRuntimeInfo taskInfo)
 {
     this.taskId          = taskInfo.TaskId;
     this.taskType        = taskInfo.TaskType;
     this.priority        = taskInfo.Priority;
     this.submittedUtc    = taskInfo.SubmittedUtc;
     this.status          = taskInfo.Status.ToString();
     this.startedUtc      = taskInfo.StartedUtc;
     this.canceledUtc     = taskInfo.CanceledUtc;
     this.completedUtc    = taskInfo.CompletedUtc;
     this.taskProcessorId = taskInfo.TaskProcessorId;
     this.pollingQueue    = taskInfo.PollingQueue;
     this.error           = taskInfo.Error;
 }
예제 #35
0
        TaskPriority ITaskRepository.UpdatePriority(ITaskCore task,
                                                    TaskPriority priority)
        {
            var    taskList = task.TaskListContainers.First();
            string taskSeriesId, taskId;

            backend.DecodeTaskId(task, out taskSeriesId, out taskId);
            var list = backend.Rtm.TasksSetPriority(backend.Timeline,
                                                    taskList.Id, taskSeriesId, taskId, task.GetPriorityString());
            var last = list.TaskSeriesCollection [0].TaskCollection.Length - 1;

            return(list.TaskSeriesCollection [0]
                   .TaskCollection [last].GetTaskPriority());
        }
예제 #36
0
        void ChoicePriority(TaskPriority priority)
        {
            TaskFile tf = new TaskFile();

            if (this.listView1.SelectedItems.Count > 0)
            {
                int b = listView1.SelectedItems.Count;
                for (int i = 0; i < b; i++)
                {
                    tf.UpdatePriority(listView1.SelectedItems[i].SubItems[11].Text, priority);
                }
                Listview(TaskFile.Tasks);
            }
        }
예제 #37
0
        public async Task <ActionResult> Create([Bind(Include = "Id,AddedDate,ModifiedDate,Name")] TaskPriority taskPriority)
        {
            if (ModelState.IsValid)
            {
                taskPriority.AddedDate    = DateTime.Now;
                taskPriority.ModifiedDate = null;
                db.TaskPriorities.Add(taskPriority);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(taskPriority));
        }
예제 #38
0
 /// <include file='doc\Task.uex' path='docs/doc[@for="Task.Task"]/*' />
 public Task()
 {
     priority         = TaskPriority.Normal;
     subCategoryIndex = -1;
     // Initializing the imageIndex to -1 tells VS to not expect to get
     // an imageList from us either, and instead use the default images.
     // This fixes bug 172354.
     imageIndex  = -1;
     line        = -1;
     column      = -1;
     text        = string.Empty;
     helpKeyword = string.Empty;
     document    = string.Empty;
 }
예제 #39
0
        // GET: TaskPriority/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TaskPriority taskPriority = await db.TaskPriorities.FindAsync(id);

            if (taskPriority == null)
            {
                return(HttpNotFound());
            }
            return(View(taskPriority));
        }
예제 #40
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TaskPriority taskprioritymaster = db.TaskPrioritys.Find(id);

            if (taskprioritymaster == null)
            {
                return(HttpNotFound());
            }
            return(View(taskprioritymaster));
        }
예제 #41
0
        private static void PrioritySample()
        {
            var priority    = taskfly.GetTaskPriority();
            var newPriority = new TaskPriority()
            {
                Description = "Priority Inserted"
            };
            int newId = taskfly.AddPriority(newPriority);

            newPriority.Id          = newId;
            newPriority.Description = "Priority Changed";
            taskfly.ChangePriority(newPriority);
            taskfly.DeletePriority(newId);
        }
예제 #42
0
 public bool QueueTask(Action task, TaskPriority priority)
 {
     lock (this.TaskQueueLock)
     {
         if (this.IsStopped || this.QueueingDisabled)
         {
             return(false);
         }
         this.TaskQueue.AddLast(new Task(task, priority));
         //pulse because tasks count changed
         Monitor.PulseAll(this.TaskQueueLock);
         return(true);
     }
 }
예제 #43
0
        public bool Enqueue(ITask task, TaskPriority priority)
        {
            lock (_dispatcherLock)
            {
                if (_stopped)
                {
                    return(false);
                }

                _queue.Enqueue(task, priority);
                Monitor.PulseAll(_dispatcherLock);
                return(true);
            }
        }
예제 #44
0
 public WalkRandomTask(LivingObject _TaskOwner, TaskPriority _Priority)
     : base(_TaskOwner, _Priority)
 {
     this.finishedWalking = false;
     targetPosition = new Vector2(Utility.Random.GenerateGoodRandomNumber((int)(this.TaskOwner.Position.X - Chunk.chunkSizeX * Block.BlockSize / 2), (int)(this.TaskOwner.Position.X + Chunk.chunkSizeX * Block.BlockSize / 2)), Utility.Random.GenerateGoodRandomNumber((int)(this.TaskOwner.Position.X - Chunk.chunkSizeX * Block.BlockSize / 2), (int)(this.TaskOwner.Position.X + Chunk.chunkSizeX * Block.BlockSize / 2)));
     this.TaskOwner.Path = createPath(new Vector2(this.TaskOwner.Position.X, this.TaskOwner.Position.Y), new Vector2(this.targetPosition.X, this.targetPosition.Y));
     int counter = 1;
     while (!isPathPossible() && counter >= 0)
     {
         targetPosition = new Vector2(Utility.Random.GenerateGoodRandomNumber((int)(this.TaskOwner.Position.X - Chunk.chunkSizeX * Block.BlockSize / 2), (int)(this.TaskOwner.Position.X + Chunk.chunkSizeX * Block.BlockSize / 2)), Utility.Random.GenerateGoodRandomNumber((int)(this.TaskOwner.Position.X - Chunk.chunkSizeX * Block.BlockSize / 2), (int)(this.TaskOwner.Position.X + Chunk.chunkSizeX * Block.BlockSize / 2)));
         this.TaskOwner.Path = createPath(new Vector2(this.TaskOwner.Position.X, this.TaskOwner.Position.Y), new Vector2(this.targetPosition.X, this.targetPosition.Y));
         counter--;
     }
 }
예제 #45
0
    // defaults to a real-time task unless the priority is explicitly set
    public GlobalNavigationtask(State t_startState, State t_goalState, int t_passableMask, 
		TaskPriority t_taskPriority, TaskManager taskManager)
        : base(taskManager, t_taskPriority)
    {
        taskType = TaskType.GlobalNavigationTask;

        startState = t_startState;
        goalState = t_goalState;

        // EVENT: globalNavigationTask is triggered by the goalState when STATE_CHANGED
        goalState.registerObserver(Event.STATE_POSITION_CHANGED, this);

        // NOTE: this does not replan when the start state changes

        passableMask = t_passableMask;
    }
    // defaults to a real-time task unless the priority is explicitly set
    public GridTimeTunnelNavigationTask_DEPRECATED(State t_startState, State t_goalState, List<State> t_tunnel, float t_tunnelDistanceThreshold, float t_tunnelTimeThreshold, 
		ref GridTimeDomain t_gridTimeDomain, ref List<State> t_spaceTimePath,
		TaskPriority t_taskPriority, TaskManager taskManager)
        : base(taskManager, t_taskPriority)
    {
        startState = t_startState;
        goalState = t_goalState;

        taskType = TaskType.GridTimeTunnelNavigationTask_DEPRECATED;

        // this IS a reference -- we never actually assign it again -- it just refers the path of the grid task
        tunnel = t_tunnel;

        tunnelDistanceThreshold = t_tunnelDistanceThreshold;
        tunnelTimeThreshold = t_tunnelTimeThreshold;
        gridTimeDomain = t_gridTimeDomain;

        spaceTimePath = t_spaceTimePath;
    }
예제 #47
0
        public TaskWrapper UpdateProjectTask(
            int taskid,
            string description,
            ApiDateTime deadline,
            ApiDateTime startDate,
            TaskPriority? priority,
            string title,
            int milestoneid,
            IEnumerable<Guid> responsibles,
            int? projectID,
            bool notify,
            TaskStatus? status,
            int? progress)
        {
            var taskEngine = EngineFactory.GetTaskEngine();
            var task = taskEngine.GetByID(taskid).NotFoundIfNull();

            if (string.IsNullOrEmpty(title)) throw new ArgumentException(@"title can't be empty", "title");

            if (!EngineFactory.GetMilestoneEngine().IsExists(milestoneid) && milestoneid > 0)
            {
                throw new ItemNotFoundException("Milestone not found");
            }

            task.Responsibles = new List<Guid>(responsibles.Distinct());

            task.Deadline = Update.IfNotEquals(task.Deadline, deadline);
            task.Description = Update.IfNotEquals(task.Description, description);

            if (priority.HasValue)
            {
                task.Priority = Update.IfNotEquals(task.Priority, priority.Value);
            }

            task.Title = Update.IfNotEmptyAndNotEquals(task.Title, title);
            task.Milestone = Update.IfNotEquals(task.Milestone, milestoneid);
            task.StartDate = Update.IfNotEquals(task.StartDate, startDate);

            if (projectID.HasValue)
            {
                var project = EngineFactory.GetProjectEngine().GetByID((int)projectID).NotFoundIfNull();
                task.Project = project;
            }

            if (progress.HasValue)
            {
                task.Progress = progress.Value;
            }

            task = taskEngine.SaveOrUpdate(task, null, notify);

            if (status.HasValue)
            {
                taskEngine.ChangeStatus(task, status.Value);
            }

            MessageService.Send(Request, MessageAction.TaskUpdated, task.Project.Title, task.Title);

            return GetTask(task.ID);
        }
예제 #48
0
        public TaskWrapper AddProjectTask(int projectid, Guid responsible, string description, ApiDateTime deadline, TaskPriority priority, string title, int milestoneid, IEnumerable<Guid> responsibles, bool notify)
        {
            if (string.IsNullOrEmpty(title)) throw new ArgumentException(@"title can't be empty", "title");

            ProjectSecurity.DemandCreateTask(EngineFactory.GetProjectEngine().GetByID(projectid).NotFoundIfNull());
            if (!EngineFactory.GetMilestoneEngine().IsExists(milestoneid) && milestoneid>0)
            {
                throw new ItemNotFoundException("Milestone not found");
            }
            var task = new Task
            {
                CreateBy = CurrentUserId,
                CreateOn = Core.Tenants.TenantUtil.DateTimeNow(),
                Deadline = deadline,
                Description = description ?? "",
                Responsible = responsible,
                Priority = priority,
                Status = TaskStatus.Open,
                Title = title,
                Project = EngineFactory.GetProjectEngine().GetByID(projectid),
                Milestone = milestoneid,
                Responsibles = new HashSet<Guid>(responsibles) { responsible }
            };
            EngineFactory.GetTaskEngine().SaveOrUpdate(task, null, notify);
            return GetTask(task.ID);
        }
예제 #49
0
        public TaskWrapper UpdateProjectTask(int taskid, Guid responsible, string description, ApiDateTime deadline, TaskPriority priority, string title, int milestoneid, IEnumerable<Guid> responsibles, int? projectID, bool notify)
        {
            var task = EngineFactory.GetTaskEngine().GetByID(taskid).NotFoundIfNull();

            if (string.IsNullOrEmpty(title)) throw new ArgumentException(@"title can't be empty", "title");

            var canWork = ProjectSecurity.CanWork(task);
            ProjectSecurity.DemandWork(task);

            if (!EngineFactory.GetMilestoneEngine().IsExists(milestoneid) && milestoneid > 0)
            {
                throw new ItemNotFoundException("Milestone not found");
            }

            task.Responsible = responsible;
            task.Responsibles = new HashSet<Guid>(responsibles){responsible};

            if (canWork > 1)
            {
                task.Deadline = Update.IfNotEquals(task.Deadline, deadline);
                task.Description = Update.IfNotEquals(task.Description, description);
                task.Priority = Update.IfNotEquals(task.Priority, priority);
                task.Title = Update.IfNotEmptyAndNotEquals(task.Title, title);
                task.Milestone = Update.IfNotEquals(task.Milestone, milestoneid);

                if (projectID.HasValue)
                {
                    var project = EngineFactory.GetProjectEngine().GetByID((int) projectID).NotFoundIfNull();
                    task.Project = project;
                }
            }

            EngineFactory.GetTaskEngine().SaveOrUpdate(task, null, notify);
            return GetTask(taskid);
        }
예제 #50
0
		public TaskListEntry (FilePath file, string description, int column, int line, TaskSeverity severity, TaskPriority priority, WorkspaceObject parent, object owner)
			: this (file, description, column, line, severity, priority, parent, owner, null)
		{
		}
예제 #51
0
        private TaskEventLoopEntry Dequeue(TaskPriority priority)
        {
            if (_queues.ContainsKey(priority) && _queues[priority].Count != 0)
            {
                return _queues[priority].Dequeue();
            }

            return null;
        }
예제 #52
0
        public TaskPriority UpdatePriority(
			ITaskCore task, TaskPriority priority)
        {
            var dummyTask = backend.GetTaskBy (task.Id);
            dummyTask.Priority = (int)priority;
            return priority;
        }
예제 #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;
        }
예제 #54
0
		public Task (FilePath file, string description, int column, int line, TaskSeverity severity, TaskPriority priority, IWorkspaceObject parent)
			: this (file, description, column, line, severity, priority, parent, null)
		{
		}
예제 #55
0
        TaskPriority ITaskRepository.UpdatePriority(ITaskCore task,
		                                             TaskPriority priority)
        {
            var command = "UPDATE Tasks SET Priority=@priority WHERE ID=@id;";
            using (var cmd = new SqliteCommand (database.Connection)) {
                cmd.CommandText = command;
                cmd.Parameters.AddWithValue ("@priority", (int)priority);
                cmd.Parameters.AddIdParameter (task);
                cmd.ExecuteNonQuery ();
            }
            return priority;
        }
 public IEventLoopEntry Enqueue(Action<CancellationToken> action, TaskPriority priority)
 {
     return null;
 }
예제 #57
0
		Gdk.Color GetColorByPriority (TaskPriority prio)
		{
			switch (prio)
			{
				case TaskPriority.High:
					return highPrioColor;
				case TaskPriority.Normal:
					return normalPrioColor;
				default:
					return lowPrioColor;
			}
		}
예제 #58
0
		public TaskListEntry (BuildError error, object owner)
		{
			parentObject = error.SourceTarget as WorkspaceObject;
			file = error.FileName;
			this.owner = owner;
			description = error.ErrorText;
			column = error.Column;
			line = error.Line;
			if (!string.IsNullOrEmpty (error.ErrorNumber))
				description += " (" + error.ErrorNumber + ")";
			if (error.IsWarning)
				severity = error.ErrorNumber == "COMMENT" ? TaskSeverity.Information : TaskSeverity.Warning;
			else
				severity = TaskSeverity.Error;
			priority = TaskPriority.Normal;
			code = error.ErrorNumber;
			category = error.Subcategory;
			helpKeyword = error.HelpKeyword;
		}
예제 #59
0
		public TaskListEntry (FilePath file, string description, int column, int line, TaskSeverity severity, TaskPriority priority)
			: this (file, description, column, line, severity, priority, null, null)
		{
		}
예제 #60
0
 public AttackRandomTask(LivingObject _TaskOwner, TaskPriority _Priority)
     : base(_TaskOwner, _Priority)
 {
     target = null;
 }