Exemplo n.º 1
0
 private void Donebtn_Click(object sender, EventArgs e)
 {
     if (validate())
     {
         label6.Visible = false;
         Material material = new Material();
         material.Name     = textBox1.Text;
         material.Lectures = selectedlectures;
         material.Sections = selectedsections;
         material.Books    = selectedbooks;
         material.ID       = this.material.ID;
         foreach (var item in Connector.connections)
         {
             if (item.CheckMaterials(material))
             {
                 if (MessageBox.Show("You Have Already Add this Material.", "Already Exist", MessageBoxButtons.OK, MessageBoxIcon.Warning) == DialogResult.OK)
                 {
                     return;
                 }
                 else
                 {
                     return;
                 }
             }
             else
             {
                 item.UpdateMaterial(material);
             }
         }
         update.Update();
         ParentChanged -= EditMaterial_ParentChanged;
         this.Dispose(true);
     }
 }
Exemplo n.º 2
0
 private void Donebtn_Click(object sender, EventArgs e)
 {
     if (validate())
     {
         label4.Visible = false;
         label6.Visible = false;
         Section section = new Section();
         section.Name      = textBox1.Text;
         section.PageCount = int.Parse(textBox4.Text);
         section.Location  = textBox5.Text;
         section.Date      = DateTime.Today.ToShortDateString();
         section.Id        = this.section.Id;
         foreach (var item in Connector.connections)
         {
             if (item.CheckSections(section))
             {
                 if (MessageBox.Show("You Have Already Add this Section.", "Already Exist", MessageBoxButtons.OK, MessageBoxIcon.Warning) == DialogResult.OK)
                 {
                     return;
                 }
                 else
                 {
                     return;
                 }
             }
             else
             {
                 item.UpdateSection(section);
             }
         }
         callin.Update();
         ParentChanged -= EditSections_ParentChanged;
         this.Dispose(true);
     }
 }
Exemplo n.º 3
0
 private void Donebtn_Click(object sender, EventArgs e)
 {
     if (validate())
     {
         errorinstructornamelb.Visible = false;
         errormaterialnamelb.Visible   = false;
         errorpricelb.Visible          = false;
         errordaylb.Visible            = false;
         errorformatlb.Visible         = false;
         errorinstructornamelb.Visible = false;
         errorplacelb.Visible          = false;
         Course course = new Course();
         course.Name       = textBox1.Text;
         course.Instructor = comboBox2.SelectedItem as Instructor;
         course.Material   = comboBox3.SelectedItem as Material;
         course.Place      = (textBox5.Text == "") ? "Unkown Place" : textBox5.Text;
         course.Price      = int.Parse(textBox4.Text);
         course.period     = new Period((int)periodhrdropdown.Value, (int)periodmindropdown.Value, (int)periodsecdropdown.Value);
         course.time       = new Time((int)timehrdropdown.Value, (int)timemindropdown.Value, (int)timesecdropdown.Value, Convert.ToTimeFormat(comboBox1.SelectedItem.ToString()));
         course.Day        = Convert.ToDays(weekdayslist.SelectedItem.ToString());
         course.ID         = this.course.ID;
         foreach (var item in Connector.connections)
         {
             if (item.CheckCourses(course))
             {
                 if (MessageBox.Show("You Have Already Add this Course.", "Already Exist", MessageBoxButtons.OK, MessageBoxIcon.Warning) == DialogResult.OK)
                 {
                     return;
                 }
                 else
                 {
                     return;
                 }
             }
             else
             {
                 if (!item.CheckInstructors(course.Instructor))
                 {
                     course.Instructor = item.CreateInstructor(course.Instructor);
                 }
                 if (!item.CheckMaterials(course.Material))
                 {
                     course.Material = item.CreateMaterials(course.Material);
                 }
                 item.UpdateCourse(course);
             }
         }
         calling.Update();
         ParentChanged -= this.EditCourse_ParentChanged;
         this.Dispose();
     }
 }
Exemplo n.º 4
0
 public void Update()
 {
     foreach (Object obj in updates)
     {
         IObjectEvent objectEvent;
         if (!objectEvents.TryGetValue(obj.GetType(), out objectEvent))
         {
             continue;
         }
         IUpdate iUpdate = objectEvent as IUpdate;
         if (iUpdate == null)
         {
             continue;
         }
         objectEvent.SetValue(obj);
         try
         {
             iUpdate.Update();
         }
         catch (Exception e)
         {
             Log.Error(e.ToString());
         }
     }
 }
Exemplo n.º 5
0
        public void Start()
        {
            this.Load();

            foreach (Component <World> component in this.GetComponents())
            {
                IUpdate update = component as IUpdate;
                if (update != null)
                {
                    this.iUpdates.Add(update);
                }

                IStart start = component as IStart;
                if (start != null)
                {
                    start.Start();
                }
            }

            // loop
            while (!this.isStop)
            {
                Thread.Sleep(1);
                foreach (IUpdate update in this.iUpdates)
                {
                    update.Update();
                }
            }
        }
Exemplo n.º 6
0
        public async void UpdateTask()
        {
            if (Singleton.GetTaskId() != 0)
            {
                var updatedItem = new TaskClass(
                    Singleton.GetTaskId(),
                    Tvm.SelectedItem.TaskName     = Singleton.GetTaskName(),
                    Tvm.SelectedItem.TaskSchedule = Singleton.GetTaskSchedule(),
                    null,
                    Tvm.SelectedItem.TaskType = Singleton.GetTaskType(),
                    Dc.ConvertToDate(_updateVm.DueDate),
                    null,
                    null,
                    Tvm.SelectedItem.DoneVar     = Singleton.GetDoneVar(),
                    Tvm.SelectedItem.EquipmentId = Singleton.GetEquipmentId()
                    );

                await _update.Update(updatedItem, "Tasks", Singleton.GetTaskId());

                GoTask();

                var msg = new MessageDialog("Task updated");
                await msg.ShowAsync();
            }
            else
            {
                var msg = new MessageDialog("Please select item");
                await msg.ShowAsync();
            }
        }
Exemplo n.º 7
0
        private void button1_Click(object sender, EventArgs e)
        {
            //TcpServer.SocketListener server = new TcpServer.SocketListener();
            //server.serverResponse += new TcpServer.ServerResponseDelegate(server_serverResponse);
            IInvoiceModle mode = new invoice();

            mode.InvoiceNo   = 220;
            mode.InvoiceDate = new DateTime();

            ISave core = (invoice)mode;

            IUpdate update = (invoice)mode;

            update.Update();



            t1 = new Thread(new ThreadStart(core.Save));
            label4.Invoke((MethodInvoker)(() => label4.Text = t1.ThreadState.ToString()));
            t1.Start();
            // t1.Join();
            // server.StartServer();
            //MessageBox.Show("Next Customer Please","System");

            //
            //ProcessOne one = new ProcessOne();
            //one.count += new GetCount(one_count);

            //Thread t1 = new Thread(new ThreadStart(one.Calculation));
            //t1.Start();

            //ProcessOne two = new ProcessOne();
            //two.count += new GetCount(two_count);
            //Thread t2 = new Thread(new ThreadStart(two.Calculation));
        }
Exemplo n.º 8
0
 private void checkUpdate(IUpdate up)
 {
     if (!up.HasUpdated())
     {
         up.Update();
     }
 }
Exemplo n.º 9
0
        private void DoRescheduleTask(int periodicity)
        {
            var nextTuesdayDate = GetNextDate(periodicity);
            var newReSchedule   = CreateReScheduledTask(nextTuesdayDate, "N");

            _updateTaskClass.Update(newReSchedule, "Tasks", TaskVm.SelectedItem.TaskId);
        }
Exemplo n.º 10
0
        public void Update()
        {
            while (this.updates.Count > 0)
            {
                Disposer disposer = this.updates.Dequeue();
                if (disposer.Id == 0)
                {
                    continue;
                }
                if (!this.disposerEvents.TryGetValue(disposer.GetType(), out IObjectEvent objectEvent))
                {
                    continue;
                }

                this.updates2.Enqueue(disposer);

                IUpdate iUpdate = objectEvent as IUpdate;
                if (iUpdate == null)
                {
                    continue;
                }
                objectEvent.Set(disposer);
                try
                {
                    iUpdate.Update();
                }
                catch (Exception e)
                {
                    Log.Error(e.ToString());
                }
            }

            ObjectHelper.Swap(ref this.updates, ref this.updates2);
        }
Exemplo n.º 11
0
 public void Update(int?id, Component component)
 {
     if (read.GetById(id) == null)
     {
         throw new NotFoundComponentException();
     }
     update.Update(component);
 }
Exemplo n.º 12
0
 public void UpdateDefault(CCTVInfoType type)
 {
     if (_syncParams.ContainsKey(type))
     {
         IUpdate pd = _syncParams[type] as IUpdate;
         pd.Update();
     }
 }
Exemplo n.º 13
0
 private void Donebtn_Click(object sender, EventArgs e)
 {
     if (validate())
     {
         label3.Visible = false;
         label4.Visible = false;
         label6.Visible = false;
         Book book = new Book();
         book.Name         = textBox1.Text;
         book.Publisher    = textBox2.Text;
         book.ChapterCount = int.Parse(textBox3.Text);
         book.PageCount    = int.Parse(textBox4.Text);
         book.Location     = textBox5.Text;
         if (selectedauthors.Count == 0)
         {
             selectedauthors.Add("Unkown Author");
         }
         book.Authors = selectedauthors;
         book.Date    = DateTime.Today.ToShortDateString();
         book.Id      = this.book.Id;
         foreach (var item in Connector.connections)
         {
             if (item.CheckBooks(book))
             {
                 if (MessageBox.Show("You Have Already Add this Book.", "Already Exist", MessageBoxButtons.OK, MessageBoxIcon.Warning) == DialogResult.OK)
                 {
                     return;
                 }
                 else
                 {
                     return;
                 }
             }
             else
             {
                 item.UpdateBook(book);
             }
         }
         calling.Update();
         ParentChanged -= this.EditBooks_ParentChanged;
         this.Dispose(true);
     }
 }
Exemplo n.º 14
0
        public void Update(float deltaTime)
        {
            this.Start();

            while (this.updates.Count > 0)
            {
                ECS_Disposer disposer = this.updates.Dequeue();
                if (disposer.Id == 0)
                {
                    continue;
                }

                IObjectEvent objectEvent;
                if (!this.disposerEvents.TryGetValue(disposer.GetType(), out objectEvent))
                {
                    continue;
                }

                this.updates2.Enqueue(disposer);

                IUpdate iUpdate = objectEvent as IUpdate;
                if (iUpdate == null)
                {
                    continue;
                }
                objectEvent.Set(disposer);

#if UNITY_EDITOR
                iUpdate.Update(deltaTime);
#else
                try
                {
                    iUpdate.Update(deltaTime);
                }
                catch (Exception e)
                {
                    Logger.LogError(e.ToString());
                }
#endif
            }

            ObjectHelper.Swap(ref this.updates, ref this.updates2);
        }
Exemplo n.º 15
0
 public void SendChanges(double temperature, double pressure, double humidity)
 {
     foreach (Form f in MdiChildren)
     {
         IUpdate upd = f as IUpdate;
         if (upd != null)
         {
             upd.Update(temperature, pressure, humidity);
         }
     }
 }
Exemplo n.º 16
0
 public void SendUpdates(Temperature t, Pressure p, Humidity h)
 {
     foreach (Form f in this.MdiChildren)
     {
         IUpdate update = f as IUpdate;
         if (update != null)
         {
             update.Update(t, p, h);
         }
     }
 }
Exemplo n.º 17
0
        public void Update(GameTime gameTime)
        {
            var elapsedTimeSincePrevious = gameTime.Elapsed.Subtract(_previousInterval);

            if (elapsedTimeSincePrevious >= _interval)
            {
                //Every Interval
                _updaterToCall.Update(gameTime);
            }

            _previousInterval = gameTime.Elapsed;
        }
Exemplo n.º 18
0
        private void Donebtn_Click(object sender, EventArgs e)
        {
            RadioButton checkedbutton = new RadioButton();

            if (validate())
            {
                label3.Visible = false;
                label4.Visible = false;
                label5.Visible = false;
                Instructor instructor = new Instructor();
                instructor.FirstName = textBox1.Text;
                instructor.LastName  = textBox2.Text;
                instructor.Phone     = (textBox4.Text == "")?"Unkown Phone":textBox4.Text;
                instructor.Email     = (textBox3.Text == "")?"Unkown Email":textBox3.Text;
                instructor.type      = Convert.ToType(getchecked(checkedbutton));
                instructor.ID        = this.instructor.ID;
                foreach (var item in Connector.connections)
                {
                    if (item.CheckInstructors(instructor))
                    {
                        if (MessageBox.Show("You Have Already Add this Instructor.", "Already Exist", MessageBoxButtons.OK, MessageBoxIcon.Warning) == DialogResult.OK)
                        {
                            return;
                        }
                        else
                        {
                            return;
                        }
                    }
                    else
                    {
                        item.UpdateInstructor(instructor);
                    }
                }
                Instructorpanel.Update();
                ParentChanged -= this.EditInstructor_ParentChanged;
                this.Dispose();
            }
        }
Exemplo n.º 19
0
 void Update()
 {
     if (this.RenderOptions.Billboard == BillboardType.Screen)
     {
         this.UpdatePosition();
     }
     if (!_isBuilt)
     {
         this.Invalidate();
     }
     if (_iupdate != null)
     {
         _iupdate.Update(Time.deltaTime);
     }
 }
Exemplo n.º 20
0
        private void UpdateAxisGrid(DependencyObject host)
        {
            IUpdate multiAxisGrid = host as IUpdate;

            if (multiAxisGrid != null)
            {
                multiAxisGrid.Update();
            }
            if (host != null)
            {
                for (int i = 0; i < VisualTreeHelper.GetChildrenCount(host); ++i)
                {
                    DependencyObject item = VisualTreeHelper.GetChild(host, i);
                    UpdateAxisGrid(item);
                }
            }
        }
Exemplo n.º 21
0
        public void UpdatePersistancyTest()
        {
            Update.Update(UpdateTask, "Tasks", 233);

            string myValue   = "updated name";
            string realValue = null;

            foreach (var item in CollectionsClass.LoadToDo())
            {
                if (item.TaskName == "updated name")
                {
                    realValue = item.TaskName;
                }
            }

            Assert.AreEqual(myValue, realValue);    //passed
        }
Exemplo n.º 22
0
        public void Update()
        {
            this.Start();

            unique.Clear();
            while (this.updates.Count > 0)
            {
                ObjectDisposer disposer = this.updates.Dequeue();
                if (disposer.IsDispose)
                {
                    continue;
                }

                if (!this.unique.Add(disposer))
                {
                    continue;
                }

                IObjectEventFacade objectEvent;

                if (!this.disposerEvents.TryGetValue(disposer.GetType(), out objectEvent))
                {
                    continue;
                }

                this.updates2.Enqueue(disposer);

                IUpdate iUpdate = objectEvent as IUpdate;
                if (iUpdate == null)
                {
                    continue;
                }
                objectEvent.Set(disposer);
                try
                {
                    iUpdate.Update();
                }
                catch (Exception e)
                {
                    Logger.LogError(e.ToString());
                }
            }

            ObjectHelper.Swap(ref this.updates, ref this.updates2);
        }
Exemplo n.º 23
0
        public void Update()
        {
            this.Start();

            // 交换update
            List <long> tmpUpdate = updates;

            updates    = newUpdates;
            newUpdates = tmpUpdate;
            newUpdates.Clear();
            foreach (long id in updates)
            {
                Object obj;
                if (!objects.TryGetValue(id, out obj))
                {
                    continue;
                }
                IObjectEvent objectEvent;
                if (!objectEvents.TryGetValue(obj.GetType(), out objectEvent))
                {
                    continue;
                }
                IUpdate iUpdate = objectEvent as IUpdate;
                if (iUpdate == null)
                {
                    continue;
                }
                newUpdates.Add(id);
                objectEvent.SetValue(obj);
                try
                {
                    iUpdate.Update();
                }
                catch (Exception e)
                {
                    Log.Error(e.ToString());
                }
            }
        }
Exemplo n.º 24
0
        public void Update()
        {
            int count = Behaviours.Count;

            FinishedList.Clear();
            for (int i = 0; i < count; ++i)
            {
                IUpdate sb = Behaviours[i];
                sb.Update(Time.deltaTime);
                if (!sb.IsPlaying)
                {
                    FinishedList.Add(i);
                }
            }
            count = FinishedList.Count;
            if (count > 0)
            {
                for (int i = count - 1; i >= 0; --i)
                {
                    Behaviours.RemoveAt(i);
                }
            }
        }
Exemplo n.º 25
0
    public static void EditorUpdate()
    {
        // stop editor updates if compiling and disconnect
        if (EditorApplication.isCompiling)
        {
            StopEditorUpdates();
            UnloadPrefabAnimations();
            ChromaConnectionManager.Instance.Disconnect();
        }
        else
        {
            // Connection Manager updates aren't needed in PlayMode,
            // if the ConnectionManager is in the Scene
            if (!Application.isPlaying)
            {
                // keep updates happening in edit mode
                ChromaConnectionManager.Instance.Update();
            }

            // Update the targets being inspected
            int i = 0;
            while (i < _sTargets.Count)
            {
                IUpdate updater = _sTargets[i];
                if (null != updater)
                {
                    updater.Update();
                    ++i;
                }
                else
                {
                    _sTargets.RemoveAt(i);
                }
            }
        }
    }
Exemplo n.º 26
0
 public void Update(Order order)
 {
     update.Update(order);
 }
Exemplo n.º 27
0
 void Update()
 {
     _controller.Update();
     LoopInScreen();
 }
Exemplo n.º 28
0
 private void close_Click(object sender, EventArgs e)
 {
     update.Update();
     ParentChanged -= this.LecturesPanel_ParentChanged;
     this.Dispose(true);
 }
Exemplo n.º 29
0
 public void Update(int key, T obj)
 {
     _update.Update(key, obj);
 }
Exemplo n.º 30
0
 public static async Task Update()
 {
     _Updater?.Update();
 }