本文整理汇总了C#中UW.ClassroomPresenter.Model.PresenterModel类的典型用法代码示例。如果您正苦于以下问题:C# PresenterModel类的具体用法?C# PresenterModel怎么用?C# PresenterModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PresenterModel类属于UW.ClassroomPresenter.Model命名空间,在下文中一共展示了PresenterModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FileMenu
public FileMenu(ControlEventQueue dispatcher, PresenterModel model, DeckMarshalService marshal, CloseFormDelegate cfd) {
this.Text = Strings.File;
open_deck_ = new OpenDeckMenuItem(model, marshal);
this.MenuItems.Add(open_deck_);
this.MenuItems.Add(new CloseDeckMenuItem(dispatcher, model, marshal));
this.MenuItems.Add(new MenuItem("-"));// Text of "-" signifies a separator bar.
this.MenuItems.Add(new SaveDeckMenuItem(model, marshal));
this.MenuItems.Add(new SaveDeckAsMenuItem(model, marshal));
this.MenuItems.Add(new SaveAllDecksMenuItem(model, marshal));
this.MenuItems.Add(new SaveAllDecksAsMenuItem(model, marshal));
this.MenuItems.Add(new MenuItem("-")); // Text of "-" signifies a separator bar.
this.MenuItems.Add(new ExportDeckAsImageItem(model));
this.MenuItems.Add(new ExportDeckAsHTMLItem(model));
this.MenuItems.Add(new ExportInkMenuItem(model));
this.MenuItems.Add(new MenuItem("-"));
this.MenuItems.Add(new PageSetupMenuItem(this, model));
this.MenuItems.Add(new PrintPreviewMenuItem(this, model));
this.MenuItems.Add(new PrintMenuItem(this, model));
this.MenuItems.Add(new MenuItem( "-" ));
this.MenuItems.Add(new ExitMenuItem(cfd));
presenter_model_ = model;
presenter_model_.Workspace.CurrentPresentation.ListenAndInitialize(dispatcher, new Property<PresentationModel>.EventHandler(this.HandlePresentationChanged));
presenter_model_.Workspace.CurrentDeckTraversal.ListenAndInitialize(dispatcher, new Property<DeckTraversalModel>.EventHandler(this.HandleDeckChanged));
}
示例2: SaveAllDecksMenuItem
public SaveAllDecksMenuItem(PresenterModel model, DeckMarshalService marshal)
{
this.m_Model = model;
this.m_SaveDeckDialog = new SaveDeckDialog(model, marshal);
this.Text = Strings.SaveAllDecks;
}
示例3: ConnectTCPRadioButton
public ConnectTCPRadioButton(ControlEventQueue dispatcher, PresenterModel model, ManualConnectionPanel manual, Point location, int width)
{
this.m_EventQueue = dispatcher;
this.m_Model = model;
this.m_Manual = manual;
this.m_Connected = false;
this.FlatStyle = FlatStyle.System;
this.Font = Model.Viewer.ViewerStateModel.StringFont1;
this.Text = Strings.ConnectToTCPServer;
this.Location = location;
this.Size = new Size(width, this.Font.Height + 5);
this.m_ClassroomManager = null;
//Watch for Role changes and disable if role is Instructor.
this.m_RoleChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleRoleChanged));
this.m_Model.Participant.Changed["Role"].Add(this.m_RoleChangedDispatcher.Dispatcher);
using (Synchronizer.Lock(this.m_Model.Participant.SyncRoot)) {
if (this.m_Model.Participant.Role is InstructorModel)
this.Enabled = false;
else
this.Enabled = true;
}
//should probably make this a listener
//Do persistence in a more intelligent way - this doesn't make the popup pop up.
/*using (Synchronizer.Lock(this.m_Model.ViewerState.SyncRoot)) {
if (this.Text == this.m_Model.ViewerState.ManualConnectionButtonName) {
this.Checked = true;
}
}*/
this.CheckedChanged += new EventHandler(OnClick);
this.m_ProtocolCollectionHelper = new ProtocolCollectionHelper(this, this.m_Model.Network);
}
示例4: DeckMatcherForm
/// <summary>
/// Construct the dialog box
/// </summary>
/// <param name="model"></param>
public DeckMatcherForm( PresenterModel model )
{
this.m_Model = model;
// Setup the form UI
this.SuspendLayout();
this.ClientSize = new Size( 400, 500 );
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "DeckMatcherForm";
this.Text = "Deck Matcher";
// Add the controls
this.Controls.Add( new DeckMatcherDoneButton( new Point(313, 470), 0 ) );
this.m_UnmatchedControls = new UnmatchedGroupBox( this, new Point(10, 10), new Size(380,260), 1 );
this.Controls.Add( this.m_UnmatchedControls );
this.m_MatchedControls = new MatchedGroupBox( this, new Point(10, 280), new Size(380,180), 2 );
this.Controls.Add( this.m_MatchedControls );
this.ResumeLayout();
// Populate the form...
this.RefreshLists();
}
示例5: MainToolBar
/// <summary>
/// Constructor
/// </summary>
/// <param name="model">The model that this component modifies</param>
public MainToolBar(PresenterModel model, ControlEventQueue dispatcher)
{
// Initialize private variables
this.m_EventQueue = dispatcher;
this.m_Model = model;
// Setup the object UI description
this.SuspendLayout();
this.Name = "MainToolBar";
this.GripStyle = ToolStripGripStyle.Hidden;
// Create the primary image list for this object
this.ImageList = new ImageList();
this.ImageList.ImageSize = new Size(40, 40);
this.ImageList.ColorDepth = ColorDepth.Depth32Bit;
// Set the default button size
this.ImageScalingSize = new Size( 40, 40 );
this.AutoSize = true;
// Assign a custom renderer to this object so that rendering appears
// in the old style
this.Renderer = new CustomRenderer();
this.ResumeLayout();
}
示例6: EditMenu
public EditMenu(ControlEventQueue dispatcher, PresenterModel model)
{
this.Text = Strings.Edit;
this.MenuItems.Add(new UndoMenuItem(dispatcher, model));
this.MenuItems.Add(new RedoMenuItem(dispatcher, model));
}
示例7: RedoMenuItem
public RedoMenuItem(ControlEventQueue dispatcher, PresenterModel model)
: base(dispatcher, model)
{
this.Text = Strings.Redo;
this.Shortcut = Shortcut.CtrlY;
this.ShowShortcut = true;
}
示例8: StartEmptyPresentation
public static void StartEmptyPresentation( PresenterModel model )
{
// Make sure we have a suitable RoleModel for broadcasting a presentation.
InstructorModel instructor;
using(Synchronizer.Lock(model.Participant.SyncRoot)) {
instructor = model.Participant.Role as InstructorModel;
if(instructor == null) {
// Make the participant representing this user an Instructor,
// which tells the ConnectionManager to broadcast the presentation
// once it's added to the classroom.
instructor = new InstructorModel(Guid.NewGuid());
model.Participant.Role = instructor;
}
}
// Create the presentation.
// TODO: Find something useful to use as the Presentation's HumanName.
PresentationModel pres = new PresentationModel(Guid.NewGuid(), model.Participant, "Untitled Presentation",true);
using(Synchronizer.Lock(model.Network.SyncRoot)) {
// Associate the participant with itself. This removes any existing association
// (since an Instructor should not be processing broadcasts from other clients),
// and also causes the NetworkAssociationService to copy anything we do to the
// InstructorModel to the WorkspaceModel.
model.Network.Association = model.Participant;
}
// Here's the kicker, which triggers the viewer to hide the classroom browser
// and start displaying the presentation. The NetworkAssociationService copies
// the presentation to the WorkspaceModel, which causes it to be displayed by the UI.
using(Synchronizer.Lock(instructor.SyncRoot)) {
instructor.CurrentPresentation = pres;
}
}
示例9: StartJoinButton2
public StartJoinButton2(PresenterModel model, StartupForm stup, bool compact)
{
this.m_Model = model;
this.m_Startup = stup;
this.Text = text1;
this.AutoSize = false;
this.FlatStyle = FlatStyle.System;
this.Font = Model.Viewer.ViewerStateModel.StringFont1;
this.clicked = false;
//Calculate the largest size for this button
SizeF size1, size2;
using (Graphics g = this.CreateGraphics()) {
size1 = g.MeasureString(text1, this.Font);
size2 = g.MeasureString(text2, this.Font);
size1.Width += 15;
size2.Width += 10;
if (compact) {
size1.Height += 5;
size2.Height += 5;
}
else {
size1.Height += 10;
size2.Height += 15;
}
}
this.Size = new Size(Math.Max((int)size1.Width, (int)size2.Width), Math.Max((int)size1.Height, (int)size2.Height));
this.DialogResult = DialogResult.OK;
this.m_RoleChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Startup.m_EventQueue, new PropertyEventHandler(this.TextOnRoleChange));
this.m_Model.ViewerState.Changed["iRole"].Add(this.m_RoleChangedDispatcher.Dispatcher);
this.m_RoleChangedDispatcher.Dispatcher(null, null);
}
示例10: TCPMessageReceiver
public TCPMessageReceiver(ITCPReceiver receiver, PresenterModel model, ClassroomModel classroom)
{
this.m_Model = model;
this.m_Classroom = classroom;
this.m_Receiver = receiver;
this.m_Assembler = new ChunkAssembler();
#if RTP_BUILD
//If we are in the public role and the receiver enabled the client-side bridge, start the bridge.
bool isPublicRole = false;
using (Synchronizer.Lock(m_Model.SyncRoot)) {
using (Synchronizer.Lock(m_Model.Participant.SyncRoot)) {
if (m_Model.Participant.Role is PublicModel) {
isPublicRole = true;
}
}
}
if ((isPublicRole) && (receiver is TCPClient) && ((TCPClient)receiver).BridgeEnabled) {
m_U2MBridge = new ClientUnicastToMulticastBridge(m_Model);
}
#endif
this.m_Queue = new MessageProcessingQueue(this);
Thread thread = new Thread(new ThreadStart(this.ReceiveThread));
thread.Name = "TCPMessageReceiver";
thread.Start();
}
示例11: StudentSubmissionNetworkService
/// <summary>
/// Constructor
/// </summary>
/// <param name="sender">The network queue to send messages on</param>
/// <param name="model">The presenter model</param>
public StudentSubmissionNetworkService(SendingQueue sender, PresenterModel model)
{
this.m_Sender = sender;
this.m_Model = model;
this.m_SendingLock = false;
this.m_SendingLockTimer = new System.Timers.Timer();
if (model.ViewerState != null)
{
using (Synchronizer.Lock(this.m_Model.ViewerState.SyncRoot))
{
this.m_SendingLockTimer.Interval = this.m_Model.ViewerState.StudentSubmissionInterval*1000;
}
}
this.m_SendingLockTimer.Elapsed += new System.Timers.ElapsedEventHandler(SendingLockTimer_Elapsed);
this.m_SendingLockTimer.Enabled = false;
// Setup the event listener for this
this.m_SendChangeDispatcher = new EventQueue.PropertyEventDispatcher( this.m_Sender, new PropertyEventHandler(this.HandleSendSubmission) );
//FV: Not locking here resolves a lock order warning.
//using( Synchronizer.Lock( this.m_Model.ViewerState.SyncRoot ) ) {
this.m_Model.ViewerState.Changed["StudentSubmissionSignal"].Add( this.m_SendChangeDispatcher.Dispatcher );
//}
this.m_SubmissionIntervalDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleSubmissionIntervalChanged));
this.m_Model.ViewerState.Changed["StudentSubmissionInterval"].Add(this.m_SubmissionIntervalDispatcher.Dispatcher);
}
示例12: LinkedDeckTraversalModel
public LinkedDeckTraversalModel(EventQueue dispatcher, Guid id, PresenterModel model, DeckTraversalModel linked)
: base(id, linked.Deck)
{
this.m_EventQueue = dispatcher;
this.m_Model = model;
this.m_Linked = linked;
// TODO: Evaluate whether we need to support other types of DeckTraversalModels.
this.m_Unlinked = new SlideDeckTraversalModel(Guid.NewGuid(), linked.Deck);
this.m_CurrentChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleCurrentChanged));
this.m_NextChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleNextChanged));
this.m_PreviousChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandlePreviousChanged));
this.m_AbsoluteCurrentSlideIndexChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleAbsoluteCurrentSlideIndexChanged));
// Set this.m_Active and register event listeners via UpdateMode.
this.m_Mode = DeckTraversalSelector.Linked;
this.UpdateMode(DeckTraversalSelector.Linked);
// Since UpdateMode doesn't initialize the event listeners like the Mode setter does, we must do this.
this.m_CurrentChangedDispatcher.Dispatcher(this, null);
this.m_NextChangedDispatcher.Dispatcher(this, null);
this.m_PreviousChangedDispatcher.Dispatcher(this, null);
this.m_AbsoluteCurrentSlideIndexChangedDispatcher.Dispatcher(this, null);
// Watch for changes to the current network association.
// When we're associated with an Instructor, we must obey its ForcingStudentNavigationLock policy.
this.m_NetworkAssociationChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleNetworkAssociationChanged));
this.m_NetworkAssociationRoleChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleNetworkAssociationRoleChanged));
this.m_ForcingStudentNavigationLockChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.HandleForcingStudentNavigationLockChanged));
this.m_Model.Network.Changed["Association"].Add(this.m_NetworkAssociationChangedDispatcher.Dispatcher);
this.m_NetworkAssociationChangedDispatcher.Dispatcher(this, null);
}
示例13: PresenterNetworkService
public PresenterNetworkService(SendingQueue sender, PresenterModel model)
{
this.m_Sender = sender;
this.m_Model = model;
this.m_ParticipantNetworkService = new ParticipantNetworkService(this.m_Sender, this.m_Model, this.m_Model.Participant);
this.m_VersionExchangeNetworkService = new VersionExchangeNetworkService(m_Sender);
}
示例14: DiagnosticsMenuItem
/// <summary>
/// Default Constructor
/// </summary>
/// <param name="model">The PresenterModel to operate on</param>
public DiagnosticsMenuItem( PresenterModel model )
{
localModel = model;
this.Text = "Diagnostics";
this.MenuItems.Add( new SaveLogMenuItem( model ) );
this.MenuItems.Add( new MenuItem( "-" ) );
this.MenuItems.Add( new StartPingMenuItem( model ) );
}
示例15: FilmStripAlignmentMenu
public FilmStripAlignmentMenu(ControlEventQueue dispatcher, PresenterModel model)
: base(Strings.FilmStripAlignment)
{
this.MenuItems.Add(new DockMenuItem(dispatcher, model, DockStyle.Left, Strings.Left));
this.MenuItems.Add(new DockMenuItem(dispatcher, model, DockStyle.Right, Strings.Right));
this.MenuItems.Add(new DockMenuItem(dispatcher, model, DockStyle.Top, Strings.Top));
this.MenuItems.Add(new DockMenuItem(dispatcher, model, DockStyle.Bottom, Strings.Bottom));
}