-
Notifications
You must be signed in to change notification settings - Fork 8
Adding support for reading and modifying tasks #3
base: main
Are you sure you want to change the base?
Conversation
I agree with your statements and believe that you are on the right track.
The reason for this is that I find the Secondly, I had to spend lots of time reading the Microsoft documentation (linked in the README.md) which I think only had C++ examples which is not a language I use or have studied. I would like to save others from having to do this with this crate. /background As you mention, I think it is a good idea to use the This PR has started to make me think that let ts: TaskScheduler = TaskScheduler::new();
let s: Schedule = ts.Get("SomeId");
s.Author = "Name"; // or s.Author("")
ts.Save(s);
let sb: ScheduleBuilder = ts.Create();
let new_sched: Schedule = sb.etc.etc...
ts,Register(new_sched); What are your thoughts on this? |
Just a note here, target branch |
Well, what if there's a base Like creating a task can look like this: let ts: TaskScheduler = TaskScheduler::new();
let new_sch: Schedule = ts.Create();
new_sch
.create_time()
.author("Test dummy")?
.description("Test Time Trigger")?
...
.register()? And modifying a task can be: let existing_sch = ts.Get();
println!("{}", existing_sch.GetAuthor());
existing_sch
.author("Test dummy")?
.save()? The reason Well, either that or make a new |
Yes, I think we are saying the same thing (almost). I'm ok with the The let com = ComRuntime::new()?;
let builder: ScheduleBuilder<Base> = ScheduleBuilder::new(&com).unwrap(); This could all be handled by pub struct TaskScheduler {
com: ComRuntime
.. stuff ..
}
impl TaskScheduler {
new() -> Self {
Self.com = ComRuntime::new().unwrap();
.. stuff ..
}
create() -> ScheduleBuilder<Base> {
.. stuff ..
ScheduleBuilder::new(self.com.clone()).unwrap()
}
} Note that the |
So yeah, I've moved this to another branch (I'll sync up the changes once #2 is resolved) but the goal of the
ScheduleGetter
struct is to be able to:Right now it just exposes
IRegisteredTask
so yeah it doesn't really fit in. Maybe I could take that returned value and somehow structure aSchedule
from it?And then provide avenues for "saving" this
Schedule
as opposed to "registering" it, or maybe registration can just delete any previous tasks with the same name.What would you envision the design to be like ideally?