Example #1
0
 public virtual bool Update(CDriver.Progress progress)
 {
     this.InvalidateChildren();
     this.MedSmsFolder.CacheControl(2);
     if (this.MedSmsFolder != null)
     {
         IOperation operation = this.MedSmsFolder.Cache() as IOperation;
         if (!CDriver.OperationToProgress(operation, progress, 0, 500))
         {
             return(false);
         }
         int streamCount = this.MedSmsFolder.StreamCount;
         for (int i = 1; i <= streamCount; i++)
         {
             ISMS iSMS = this.MedSmsFolder.GetStream(i) as ISMS;
             if (iSMS.Empty == 0 && iSMS.Type != 5)
             {
                 base.AddLast(new CSmsItem(this, iSMS));
             }
             if (!progress(1000 * i / streamCount / 2 + 500))
             {
                 return(false);
             }
         }
     }
     return(progress(1000));
 }
Example #2
0
        public virtual bool Push(CDriver.Progress progress)
        {
            for (int i = 0; i < this.EmptyListsToPush.Length; i++)
            {
                for (int j = 0; j < this.MedOrganizers[i].StreamCount; j++)
                {
                    IOrganizerItem organizerItem = this.MedOrganizers[i].GetStream(j + 1) as IOrganizerItem;
                    organizerItem.GetType();
                }
                foreach (IOrganizerItem current in this.EmptyListsToPush[i])
                {
                    current.Commit();
                }
            }
            if (this.Events != null)
            {
                foreach (COrganizerEntry cOrganizerEntry in this.Events)
                {
                    cOrganizerEntry.Commit();
                }
            }
            if (this.Notes != null)
            {
                foreach (COrganizerEntry cOrganizerEntry2 in this.Notes)
                {
                    cOrganizerEntry2.Commit();
                }
            }
            if (this.Tasks != null)
            {
                foreach (COrganizerEntry cOrganizerEntry3 in this.Tasks)
                {
                    cOrganizerEntry3.Commit();
                }
            }
            int min = 0;
            int max = 1000 / ((this.MedOrganizers.Length > 0) ? this.MedOrganizers.Length : 1);

            for (int k = 0; k < this.MedOrganizers.Length; k++)
            {
                IOrganizer organizer = this.MedOrganizers[k];
                for (int l = 0; l < organizer.StreamCount; l++)
                {
                    IOrganizerItem organizerItem2 = organizer.GetStream(l + 1) as IOrganizerItem;
                    organizerItem2.GetType();
                }
                IOperation operation = organizer.Flush() as IOperation;
                if (!CDriver.OperationToProgress(operation, progress, min, max))
                {
                    return(false);
                }
            }
            return(progress(1000));
        }
Example #3
0
 public void InstallConnector(CDriver.Progress progress)
 {
     if (this.IsConnectorRequired)
     {
         IOperation operation = this.MobilePhone.InstallConnector() as IOperation;
         if (operation != null && !CDriver.OperationToProgress(operation, progress, 0, 500))
         {
             throw new Exception("Installation of the connector failed");
         }
     }
 }
Example #4
0
        public virtual bool Push(CDriver.Progress progress)
        {
            foreach (IPhonebookItem current in this.EmptyListToPush)
            {
                current.Save();
            }
            foreach (CPhonebookEntry cPhonebookEntry in this)
            {
                cPhonebookEntry.Commit();
            }
            IOperation operation = this.MedPhonebook.Flush() as IOperation;

            return(CDriver.OperationToProgress(operation, progress, 0, 1000));
        }
Example #5
0
        public virtual bool Activate(string key, string user, string company, string oem, CDriver.Progress progress)
        {
            IOperation operation;

            try
            {
                operation = (IOperation)this.MedLicense.Activate(key, user, company, oem);
            }
            catch (Exception ex)
            {
                throw new Exception(this.ToString() + " : Activation failed [ " + ex.Message + " ]", ex);
            }
            if (!CDriver.OperationToProgress(operation, progress, 0, 1000))
            {
                return(false);
            }
            if (operation.Status != 1)
            {
                throw new Exception(this.ToString() + " : Activation failed with error " + operation.Error.ToString());
            }
            return(true);
        }
Example #6
0
        public virtual bool Update(CDriver.Progress progress)
        {
            this.InvalidateChildren();
            IOperation operation = this.MedPhonebook.Cache() as IOperation;

            if (!CDriver.OperationToProgress(operation, progress, 0, 500))
            {
                return(false);
            }
            int num = 0;

            try
            {
                num = this.MedPhonebook.StreamCount;
            }
            catch (Exception ex)
            {
                Console.WriteLine(this.ToString() + "Unable to query StreamCount property [ " + ex.Message + " ]");
                return(true);
            }
            for (int i = 1; i <= num; i++)
            {
                IPhonebookItem phonebookItem = (IPhonebookItem)this.MedPhonebook.GetStream(i);
                if (phonebookItem.Empty == 0)
                {
                    base.AddLast(new CPhonebookEntry(this, phonebookItem));
                }
                else
                {
                    this.EmptyList.AddFirst(phonebookItem);
                }
                if (!progress(1000 * i / num / 2 + 500))
                {
                    return(false);
                }
            }
            return(progress(1000));
        }
Example #7
0
        public bool Update(CDriver.Progress progress)
        {
            if (this.Events != null)
            {
                this.Events.Invalidate();
            }
            if (this.Tasks != null)
            {
                this.Tasks.Invalidate();
            }
            if (this.Notes != null)
            {
                this.Notes.Invalidate();
            }
            for (int i = 0; i < this.EmptyListsToPush.Length; i++)
            {
                this.EmptyListsToPush[i].Clear();
                this.EmptyLists[i].Clear();
            }
            int num  = 0;
            int num2 = 1000 / ((this.MedOrganizers.Length > 0) ? this.MedOrganizers.Length : 1);

            for (int j = 0; j < this.MedOrganizers.Length; j++)
            {
                IOrganizer organizer = this.MedOrganizers[j];
                IOperation operation = organizer.Cache() as IOperation;
                if (!CDriver.OperationToProgress(operation, progress, num, num + num2 / 2))
                {
                    return(false);
                }
                int num3;
                try
                {
                    num3 = organizer.StreamCount;
                }
                catch (Exception ex)
                {
                    Console.WriteLine(this.ToString() + "Unable to query StreamCount property [ " + ex.Message + " ]");
                    num3 = 0;
                }
                for (int k = 1; k <= num3; k++)
                {
                    IOrganizerItem organizerItem = (IOrganizerItem)organizer.GetStream(k);
                    if (organizerItem.Type == 1)
                    {
                        this.Events.AddLast(new COrganizerEntry(this.Events, organizerItem, this.Events.EntryDescriptor));
                    }
                    else
                    {
                        if (organizerItem.Type == 3)
                        {
                            this.Notes.AddLast(new COrganizerEntry(this.Notes, organizerItem, this.Notes.EntryDescriptor));
                        }
                        else
                        {
                            if (organizerItem.Type == 2)
                            {
                                this.Tasks.AddLast(new COrganizerEntry(this.Tasks, organizerItem, this.Tasks.EntryDescriptor));
                            }
                            else
                            {
                                this.EmptyLists[j].AddLast(organizerItem);
                            }
                        }
                    }
                    if (!progress(num + num2 * k / num3 / 2 + num2 / 2))
                    {
                        return(false);
                    }
                }
                num += num2;
            }
            return(progress(1000));
        }
Example #8
0
        public virtual bool Push(CDriver.Progress progress)
        {
            IOperation operation = this.MedSmsFolder.Flush() as IOperation;

            return(CDriver.OperationToProgress(operation, progress, 0, 1000));
        }