예제 #1
0
 public static IEnumerable<Person> personsOfDiscussion(Discussion d)
 {
     var q = from p in DbCtx.Get().Person
             where p.Topic.Any(t0 => t0.Discussion.Id == d.Id)
             select p;
     return q;
 }
예제 #2
0
 public ReportParameters(List<int> requiredUsers, Session session, Topic topic, Discussion discussion)
 {
     this.requiredUsers = requiredUsers;
     this.sessionTopicUsers = topic.Person.Select(pers => pers.Id).Intersect(requiredUsers);
     this.session = session;
     this.topic = topic;
     this.discussion = discussion;
 }
예제 #3
0
파일: Ctors.cs 프로젝트: gdlprj/duscusys
 public static GeneralSide NewGenSide(Person p, Discussion d, int side)
 {
     var res = new GeneralSide();
     res.Person = p;
     res.Discussion = d;
     res.Side = side;
     return res;
 }
예제 #4
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public DiscussionInfoZoom(Discussion d)
        {
            InitializeComponent();

            // Add handlers for window availability events
            AddWindowAvailabilityHandlers();

            DataContext = d;
            bg.ToViewMode();
            bg.SetCanReorderItems(false);
        }
예제 #5
0
        public TopicSelectionDlg(Discussion d)
        {
            InitializeComponent();

            AddWindowAvailabilityHandlers();

            this.WindowState = WindowState.Normal;

            lstTopics.ItemsSource = d.Topic;

            lstFormat.Items.Add("Export to HTML");
            lstFormat.Items.Add("Export to PDF");
            lstFormat.SelectedIndex = 0;
        }
예제 #6
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public ResultViewer(Discussion discussion, Main.OnDiscFrmClosing closing)
        {
            InitializeComponent();

            // Add handlers for window availability events
            AddWindowAvailabilityHandlers();

            _closing = closing;
            this.discussion = discussion;
            this.DataContext = discussion;

            List<ArgPoint> agreed = new List<ArgPoint>();
            List<ArgPoint> disagreed = new List<ArgPoint>();
            List<ArgPoint> unsolved = new List<ArgPoint>();

            lstBxAgreement.ItemsSource = agreed;
            lstBxDisagreement.ItemsSource = disagreed;
            lstBxUnsolved.ItemsSource = unsolved;
        }
예제 #7
0
        public PersonDiscConfigWnd(Discussion d, Person p)
        {
            InitializeComponent();

            this.WindowState = WindowState.Normal;
            this.Width = 336;

            personSelector.onSelected += onPersonSelected;

            _d = d;
            person = p;
            lblDiscussion.Content = "Discussion: " + d.Subject;

            int currentSide = DaoUtils.GetGeneralSide(p, d);
            if (currentSide != -1)
                selector1.SelectedSide = currentSide;
            else
                selector1.SelectedSide = (int) SideCode.Neutral;

            personSelector.Set(PublicBoardCtx.Get().Person, "Name");
        }
예제 #8
0
        public HtmlEditWnd(Discussion d, Action close)
        {
            InitializeComponent();

            _close += close;

            _d = d;

            if (d.HtmlBackground == null)
            {
                var htmlTemplatePathName = System.IO.Path.Combine(
                    System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
                    "DiscussionHTMLPage.html");

                plainHtml.Text = System.IO.File.ReadAllText(htmlTemplatePathName);
            }
            else
            {
                plainHtml.Text = d.HtmlBackground;
            }

            UpdateWebView();
        }
예제 #9
0
파일: Model.cs 프로젝트: gdlprj/duscusys
 /// <summary>
 /// Create a new Discussion object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="subject">Initial value of the Subject property.</param>
 public static Discussion CreateDiscussion(global::System.Int32 id, global::System.String subject)
 {
     Discussion discussion = new Discussion();
     discussion.Id = id;
     discussion.Subject = subject;
     return discussion;
 }
예제 #10
0
 private void DiscussionChanged(object selected)
 {
     _discussion = selected as Discussion;
 }
예제 #11
0
 public static string getDiscussionBackgroundUrl(Discussion d)
 {
     return string.Format("http://{0}/discsvc/bgpage?id={1}", ConfigManager.ServiceServer, d.Id);
 }
예제 #12
0
        private static string SessionStr(Session s, Discussion d)
        {
            var tsConv = new TimeslotConverter();

            return s.Name + " (" +
                   s.EstimatedDateTime.ToString("D") + " " +
                   (string) tsConv.Convert(s.EstimatedTimeSlot, null, null, null) + "), " + d.Subject;
        }
예제 #13
0
        public PublicCenter(UISharedRTClient sharedClient,
                            Main.OnDiscFrmClosing closing,
                            int screenshotTopicId, 
                            int screenshotDiscussionId)
        {
            this._discussion = SessionInfo.Get().discussion;
            _sharedClient = sharedClient;
            _closing = closing;
            _topicId = screenshotTopicId;
            _discussionId = screenshotDiscussionId;

            InitializeComponent();

            if (CurrentTopic != null)
                ExplanationModeMediator.Inst.CurrentTopicId = CurrentTopic.Id;
            else
                ExplanationModeMediator.Inst.CurrentTopicId = null;

            topicNavPanel.topicChanged += topicSelectionChanged;
            topicNavPanel.discussion = SessionInfo.Get().discussion;
            topicNavPanel.topicAnimate += TopicAnimate;

            btnExplanationMode.DataContext = ExplanationModeMediator.Inst;
            btnLaserPointer.DataContext = ExplanationModeMediator.Inst;
         

            localAccount.DataContext = SessionInfo.Get().person;

            _botsViewModel = new BotsViewModel(this);
            //btnEnlargeOpenCommentClose.DataContext = _botsViewModel;
            //btnEnlargeOpenAttachmentClose.DataContext = _botsViewModel;
            //btnSuperBotEnabled.DataContext = _botsViewModel;
            //btnEnlargeOpenSourceClose.DataContext = _botsViewModel;
            btnDEditorBotEnabled.DataContext = _botsViewModel;

            avaBar.Init(_sharedClient);
            avaBar.paletteOwnerChanged += PaletteOwnerChanged;

            SetListeners(_sharedClient, true);

            _zoomSeries = new ZoomSeriesAnalyser(OnSeriesEnd);

            TouchVisualizer.SetShowsVisualizations(laserScene, false);

            if (SessionInfo.Get().person.Name.StartsWith(DaoUtils.MODER_SUBNAME))
            {
                startStopWatch();
            }

            //  scene.Height = 0.6 * System.Windows.SystemParameters.PrimaryScreenHeight;
            //  inkCanv.Height = scene.Height;

            //var scaleTr = Matrix.Identity;
            //scaleTr.Translate(0, -scene.Height / 2);
            //scaleTr.ScaleAt(2,2, 
            //                0.5, 
            //                0.5);
            //SetWorkingAreaTransform(scaleTr, false, false, false, false);  
        }
예제 #14
0
 private void ForgetDBDiscussionState()
 {
     //forget cached state
     PublicBoardCtx.DropContext();
     _discussion = SessionInfo.Get().discussion;
     DataContext = this;
 }
예제 #15
0
        private void ParticipantChanged(object selected)
        {
            _discussion = null;
            _person = selected as Person;

            //enum all discussions of the person
            DiscCtx ctx = PublicBoardCtx.Get();
            IQueryable<Discussion> lookup =
                (from t in ctx.Topic
                 where t.Person.Any(p0 => p0.Id == _person.Id)
                 select t.Discussion).Distinct();

            discSelector.Set(lookup, "Subject");
            discSelector.IsEnabled = true;
        }
예제 #16
0
파일: Model.cs 프로젝트: gdlprj/duscusys
 /// <summary>
 /// Deprecated Method for adding a new object to the Discussion EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToDiscussion(Discussion discussion)
 {
     base.AddObject("Discussion", discussion);
 }
예제 #17
0
파일: Ctors.cs 프로젝트: gdlprj/duscusys
 public static bool DiscussionExists(Discussion disc)
 {
     return PublicBoardCtx.Get().Discussion.FirstOrDefault(d => d.Id == disc.Id) != null;
 }
예제 #18
0
파일: Helpers.cs 프로젝트: gdlprj/duscusys
 public static IEnumerable<ArgPoint> ArgPointsOf(Person pers, Discussion d, Topic t)
 {
     return pers.ArgPoint.Where(ap => ap.Topic != null && ap.Topic.Id == t.Id);
 }
예제 #19
0
        private void UpdateTopicsOfDiscussion(Discussion d)
        {
            TopicsOfDiscussion.Clear();

            if (d == null)
                return;

            int selfId = SessionInfo.Get().person.Id;
            var topicsOfDiscussion = d.Topic;

            foreach (Topic t in topicsOfDiscussion)
            {
                if (t.Person.Any(p0 => p0.Id == selfId))
                    TopicsOfDiscussion.Add(t);
            }

            if (TopicsOfDiscussion.Count > 0)
                lstTopics.SelectedIndex = 0;
        }
예제 #20
0
 private void btnAddDiscussion_Click(object sender, RoutedEventArgs e)
 {
     var newDisc = new Discussion();
     newDisc.Subject = txtBxDiscussion.Text;
     newDisc.Background = new RichText();
     newDisc.Background.Text = "";
     EditedDiscussion = newDisc;
     PublicBoardCtx.Get().AddToDiscussion(EditedDiscussion);
     PublicBoardCtx.Get().SaveChanges();
     discussionSelector.Set(PublicBoardCtx.Get().Discussion, "Subject");
     discussionSelector.Select(EditedDiscussion);
 }