コード例 #1
0
 static void Document_DocumentAdded(object sender, SubjectEventArgs <Document> e)
 {
     if (isForcingNewVersion)
     {
         LockDocument(e.Subject as Document);
     }
 }
コード例 #2
0
 void Document_DocumentRemoved(object sender, SubjectEventArgs <Document> e)
 {
     Document.DocumentRemoved -= Document_DocumentRemoved;
     WriteBlock.AppendTask(() =>
     {
         Document.Open(mFilePath, null);
     });
 }
コード例 #3
0
        void Document_DocumentRemoved(object sender, SubjectEventArgs <Document> e)
        {
            Document.DocumentRemoved -= Document_DocumentRemoved;
            WriteBlock.AppendTask(() =>
            {
                var windows = Document.Open(mFilePath, null);

                Window.ActiveWindow = windows.First();
            });
        }
コード例 #4
0
ファイル: AddCourses.ascx.cs プロジェクト: skrishnau/LMS
 void undo_RemoveClicked(object sender, SubjectEventArgs e)
 {
     try
     {
         var list = (List <Academic.ViewModel.Subject.Subject>)ViewState["SavedCourses"];
         if (list != null)
         {
             var found = list.Find(x => x.Id == e.Id);
             if (found != null)
             {
                 found.Checked = false;
             }
         }
     }
     catch { }
 }
コード例 #5
0
ファイル: AddCourses.ascx.cs プロジェクト: skrishnau/LMS
        void uc_CourseChecked(object sender, SubjectEventArgs e)
        {
            //not need now ; working code
            //if (e.Checked)
            //{
            //    EachSelectedCourseUC each = (EachSelectedCourseUC)
            //        Page.LoadControl("~/Views/Structure/All/UserControls/CourseLinkage/EachSelectedCourseUC.ascx");
            //    each.SetName(e.Id, e.Name);
            //    each.RemoveClicked += each_RemoveClicked;
            //    pnlSelectedCourses.Controls.Add(each);
            //}

            AddCheckedCoursesToList(new Academic.ViewModel.Subject.Subject()
            {
                Id = e.Id, Name = e.Name, Checked = e.Checked
            });
        }
コード例 #6
0
ファイル: AddCourses.ascx.cs プロジェクト: skrishnau/LMS
        //selected list
        void each_RemoveClicked(object sender, SubjectEventArgs e)
        {
            try
            {
                var list = (List <Academic.ViewModel.Subject.Subject>)ViewState["SelectedCourses"];
                if (list != null)
                {
                    //sub.Checked = true;
                    var found   = list.Find(x => x.Id == e.Id);
                    var removed = list.Remove(found);
                    if (removed)
                    {
                        var cntrlToRemove = sender as EachSelectedCourseUC;
                        if (cntrlToRemove != null)
                        {
                            pnlSelectedCourses.Controls.Remove(cntrlToRemove);
                        }

                        //works

                        //var name = "courseListing" + e.Id + e.Name.Replace(" ", "_");
                        //var ffff = pnlCourseList.FindControl("courseListing" + e.Id + e.Name.Replace(" ", "_"));
                        //var pme = pnlCourseList.FindControl("courseListing3one");
                        //change checked state
                        var chkboxPanel = pnlCourseList.FindControl(
                            "courseListing" + e.Id + e.Name.Replace(" ", "_"));
                        var cbPanel = pnlCourseList.FindControl(
                            "chkbox" + e.Id + e.Name.Replace(" ", "_"));
                        var controlList = pnlCourseList.Controls;

                        //pnlCourseList.

                        if (chkboxPanel != null)
                        {
                            var ckbox = chkboxPanel.FindControl("chkbox" + e.Id + e.Name.Replace(" ", "_"));
                            if (ckbox != null)
                            {
                                var chkbox = (ckbox as CheckBox);//.Checked = false;
                                if (chkbox != null)
                                {
                                    chkbox.Checked = false;
                                }
                            }
                        }

                        //not used
                        //var checkedCourse = pnlCourseList.FindControl("chkbox" + e.Id + e.Name);
                        //if (checkedCourse != null)
                        //{
                        //    var chkbox = (checkedCourse as CheckBox);//.Checked = false;
                        //    if (chkbox != null)
                        //    {
                        //        chkbox.Checked = false;
                        //    }
                        //}
                    }
                }
            }
            catch
            {
            }
        }
コード例 #7
0
 private void BehaviorDescriptor_EventOccured(object sender, SubjectEventArgs e)
 {
     // Chain events that occur within the behaviordescriptor up
     this.OnEvent(e.EventName, e.Args);
 }