示例#1
0
 private void OnObjectsModified(object o, Evolution.ObjectsModifiedArgs args)
 {
     foreach (CalComponent cc in CalUtil.ICalToCalComponentArray(args.Objects.Handle, this.cal_view.Client))
     {
         AddCalComponent(cc);
     }
 }
示例#2
0
        private void ConnectToEDS()
        {
            try {
                // FIXME: This is a total hack.  We call into a
                // method inside libevolutionglue so that we can
                // possibly catch a DllNotFoundException if it
                // fails to load.
                CalUtil.datetime_to_icaltimetype(new DateTime());                   // This is a no-op

                // This is the first code which tries to open the
                // evolution-data-server APIs.  Try to catch
                // DllNotFoundException and bail out if things go
                // badly.
                new SourcesHandler("/apps/evolution/addressbook/sources", typeof(BookContainer), this, Driver.Fingerprint);
                new SourcesHandler("/apps/evolution/calendar/sources", typeof(CalContainer), this, Driver.Fingerprint, CalSourceType.Event);
                new SourcesHandler("/apps/evolution/tasks/sources", typeof(CalContainer), this, Driver.Fingerprint, CalSourceType.Todo);
                new SourcesHandler("/apps/evolution/memos/sources", typeof(CalContainer), this, Driver.Fingerprint, CalSourceType.Journal);
            } catch (DllNotFoundException ex) {
                Logger.Log.Error(ex, "Unable to start EvolutionDataServer backend: Unable to find or open libraries:");
                return;
            } catch (EntryPointNotFoundException ex) {
                Logger.Log.Error(ex, "Unable to start EvolutionDataServer backend: Unable to find or open libraries:");
                return;
            }
        }
示例#3
0
        public void TasksModified(object o, Evolution.ObjectsModifiedArgs args)
        {
            Logger.Debug("Tasks Modified ");
            Gtk.TreeIter iter;
            EDSTask      edsTask;
            EDSCategory  edsCategory;

            CalComponent[] modifiedTasks = CalUtil.ICalToCalComponentArray(args.Objects.Handle, ((CalView)o).Client);

            foreach (CalComponent task in modifiedTasks)
            {
                Logger.Debug("Modified : " + task.Summary);
                if (taskIters.ContainsKey(task.Uid))
                {
                    edsCategory = new EDSCategory(task.Source);
                    edsTask     = new EDSTask(task, edsCategory);
                    iter        = taskIters[edsTask.Id];
                    taskStore.SetValue(iter, 0, edsTask);
                }
            }
        }
示例#4
0
 public void TasksAdded(object o, Evolution.ObjectsAddedArgs args)
 {
     Logger.Debug("Tasks Added ");
     CalComponent[] addedTasks = CalUtil.ICalToCalComponentArray(args.Objects.Handle, ((CalView)o).Client);
     lock (taskLock) {
         Gtk.TreeIter taskIter;
         EDSTask      edsTask;
         EDSCategory  edsCategory;
         foreach (CalComponent task in addedTasks)
         {
             if (!taskIters.ContainsKey(task.Uid))
             {
                 edsCategory = new EDSCategory(task.Source);
                 edsTask     = new EDSTask(task, edsCategory);
                 taskIter    = taskStore.AppendNode();
                 taskStore.SetValue(taskIter, 0, edsTask);
                 taskIters [edsTask.Id] = taskIter;
             }
         }
     }
 }