本文整理汇总了C#中System.ComponentModel.Model类的典型用法代码示例。如果您正苦于以下问题:C# Model类的具体用法?C# Model怎么用?C# Model使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Model类属于System.ComponentModel命名空间,在下文中一共展示了Model类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NuevoRol
public NuevoRol(Model.RolModel _rol)
{
InitializeComponent();
controller = new Controller.RolController();
rol = _rol;
cbEstados.Enabled = false;
}
示例2: Execute
/// <summary>
/// Executes the specified workflow.
/// </summary>
/// <param name="rockContext">The rock context.</param>
/// <param name="action">The workflow action.</param>
/// <param name="entity">The entity.</param>
/// <param name="errorMessages">The error messages.</param>
/// <returns></returns>
/// <exception cref="System.NotImplementedException"></exception>
public override bool Execute( RockContext rockContext, Model.WorkflowAction action, Object entity, out List<string> errorMessages )
{
var checkInState = GetCheckInState( entity, out errorMessages );
if ( checkInState != null )
{
foreach ( var family in checkInState.CheckIn.GetFamilies( true ) )
{
foreach ( var person in family.People )
{
foreach ( var kioskGroupType in checkInState.Kiosk.ActiveGroupTypes( checkInState.ConfiguredGroupTypes ) )
{
if ( kioskGroupType.KioskGroups.SelectMany( g => g.KioskLocations ).Any( l => l.IsCheckInActive && l.IsActiveAndNotFull ) )
{
if ( !person.GroupTypes.Any( g => g.GroupType.Id == kioskGroupType.GroupType.Id ) )
{
var checkinGroupType = new CheckInGroupType();
checkinGroupType.GroupType = kioskGroupType.GroupType;
person.GroupTypes.Add( checkinGroupType );
}
}
}
}
}
return true;
}
return false;
}
示例3: Execute
/// <summary>
/// Executes the specified workflow.
/// </summary>
/// <param name="action">The workflow action.</param>
/// <param name="entity">The entity.</param>
/// <param name="errorMessages">The error messages.</param>
/// <returns></returns>
/// <exception cref="System.NotImplementedException"></exception>
public override bool Execute( Model.WorkflowAction action, Object entity, out List<string> errorMessages )
{
var checkInState = GetCheckInState( entity, out errorMessages );
if ( checkInState != null )
{
var family = checkInState.CheckIn.Families.Where( f => f.Selected ).FirstOrDefault();
if ( family != null )
{
foreach ( var person in family.People.Where( p => p.Selected ) )
{
foreach ( var groupType in person.GroupTypes.Where( g => g.Selected ) )
{
foreach ( var group in groupType.Groups )
{
foreach ( var location in group.Locations.ToList() )
{
if ( !location.Location.IsActive )
{
group.Locations.Remove( location );
}
}
}
}
}
}
return true;
}
return false;
}
示例4: GetHtmlPreview
/// <summary>
/// Gets the HTML preview.
/// </summary>
/// <param name="communication">The communication.</param>
/// <param name="person">The person.</param>
/// <returns></returns>
public override string GetHtmlPreview( Model.Communication communication, Person person )
{
var rockContext = new RockContext();
// Requery the Communication object
communication = new CommunicationService( rockContext ).Get( communication.Id );
var globalAttributes = Rock.Web.Cache.GlobalAttributesCache.Read();
var mergeValues = Rock.Web.Cache.GlobalAttributesCache.GetMergeFields( null );
if ( person != null )
{
mergeValues.Add( "Person", person );
var recipient = communication.Recipients.Where( r => r.PersonId == person.Id ).FirstOrDefault();
if ( recipient != null )
{
// Add any additional merge fields created through a report
foreach ( var mergeField in recipient.AdditionalMergeValues )
{
if ( !mergeValues.ContainsKey( mergeField.Key ) )
{
mergeValues.Add( mergeField.Key, mergeField.Value );
}
}
}
}
string message = communication.GetChannelDataValue( "Message" );
return message.ResolveMergeFields( mergeValues );
}
示例5: CopyTo
public void CopyTo(ModelField field, Model model)
{
field.Apply(this);
if (this.IDProperty)
{
model.IDProperty = field.Name;
}
if (this.CustomSortHandler != null)
{
field.CustomSortType.Fn = this.CustomSortHandler;
}
if (this.SerializeHandler != null)
{
field.Serialize.Fn = this.SerializeHandler;
}
if (this.ConvertHandler != null)
{
field.Convert.Fn = this.ConvertHandler;
}
if (this.DefaultValue != null)
{
field.DefaultValue = TokenUtils.RawWrap(JSON.Serialize(this.DefaultValue));
}
}
示例6: Execute
/// <summary>
/// Executes the specified workflow.
/// </summary>
/// <param name="rockContext">The rock context.</param>
/// <param name="action">The workflow action.</param>
/// <param name="entity">The entity.</param>
/// <param name="errorMessages">The error messages.</param>
/// <returns></returns>
/// <exception cref="System.NotImplementedException"></exception>
public override bool Execute( RockContext rockContext, Model.WorkflowAction action, Object entity, out List<string> errorMessages )
{
var checkInState = GetCheckInState( entity, out errorMessages );
if ( checkInState != null )
{
foreach ( var family in checkInState.CheckIn.Families.ToList() )
{
foreach ( var person in family.People.ToList() )
{
foreach ( var groupType in person.GroupTypes.ToList() )
{
foreach ( var group in groupType.Groups.ToList() )
{
foreach ( var location in group.Locations.ToList() )
{
if ( location.Schedules.Count == 0 )
{
group.Locations.Remove( location );
}
}
}
}
}
}
return true;
}
return false;
}
示例7: PresentationModel
public PresentationModel(Model model)
{
InitializePoseKeyDictionary();
_model = model;
List<Tuple<string, string>> imageList = new List<Tuple<string, string>>
{
new Tuple<string, string>("fingersSpread", "Image/fingersSpread.png"),
new Tuple<string, string>("waveOut", "Image/waveOut.png"),
new Tuple<string, string>("waveIn", "Image/waveIn.png"),
new Tuple<string, string>("fist", "Image/fist.png"),
new Tuple<string, string>("keyboard", "Image/keyboard.png"),
};
foreach (Tuple<string, string> item in imageList)
{
AddImage(item.Item1, Image.FromFile(item.Item2));
}
Bitmap source = new Bitmap("Image/arm-device.png");
List<Tuple<string, Rectangle>> sectionList = new List<Tuple<string, Rectangle>>
{
new Tuple<string, Rectangle>("rollDown", new Rectangle(0, 0, 230, 230)),
new Tuple<string, Rectangle>("rollUp", new Rectangle(182, 0, 230, 230)),
new Tuple<string, Rectangle>("pitchDown", new Rectangle(0, 182, 230, 230)),
new Tuple<string, Rectangle>("pitchUp", new Rectangle(180, 180, 230, 230)),
new Tuple<string, Rectangle>("yawUp", new Rectangle(0, 360, 230, 230)),
new Tuple<string, Rectangle>("yawDown", new Rectangle(182, 360, 230, 230)),
};
foreach (Tuple<string, Rectangle> item in sectionList)
{
CutImage(item.Item1, source, item.Item2);
}
}
示例8: Execute
/// <summary>
/// Executes the specified workflow.
/// </summary>
/// <param name="rockContext">The rock context.</param>
/// <param name="action">The workflow action.</param>
/// <param name="entity">The entity.</param>
/// <param name="errorMessages">The error messages.</param>
/// <returns></returns>
/// <exception cref="System.NotImplementedException"></exception>
public override bool Execute( RockContext rockContext, Model.WorkflowAction action, Object entity, out List<string> errorMessages )
{
var checkInState = GetCheckInState( entity, out errorMessages );
if ( checkInState == null )
{
return false;
}
var family = checkInState.CheckIn.CurrentFamily;
if ( family != null )
{
var remove = GetAttributeValue( action, "Remove" ).AsBoolean();
if ( checkInState.CheckInType.TypeOfCheckin == TypeOfCheckin.Family )
{
var currentPerson = checkInState.CheckIn.CurrentPerson;
if ( currentPerson != null )
{
FilterGroups( currentPerson, rockContext, remove );
}
}
else
{
foreach ( var person in family.People )
{
FilterGroups( person, rockContext, remove );
}
}
}
return true;
}
示例9: GuardSpawner
public GuardSpawner(Model m, XmlElement e)
: base(m, e)
{
NumGuards = e.GetAttributeInt("numguards", 2);
MaxGuards = e.GetAttributeInt("maxguards", 2);
RespawnRate = e.GetAttributeFloat("respawnrate", 0);
}
示例10: FilterGraphViewModel
public FilterGraphViewModel(Model.FilterGraph graph)
{
_filterGraph = graph;
var filterViewModels = graph.Filters.ToDictionary(i => i, i => new ViewModel.FilterViewModel(i, this));
var connections = new List<ConnectionViewModel>();
foreach (var f in filterViewModels)
{
foreach (var outputPin in f.Key.OutputPins)
{
var outputPinViewModel = f.Value.FindOutput(outputPin.PinDesc.Name);
foreach (var inputPin in outputPin.ConnectedPins)
{
var otherFilter = inputPin.FilterInstance;
var inputPinViewModel = filterViewModels[otherFilter].FindInput(inputPin.PinDesc.Name);
connections.Add(new ConnectionViewModel(outputPinViewModel, inputPinViewModel));
}
}
}
FilterLookup = filterViewModels.ToDictionary(kvp => kvp.Key.Guid, kvp => kvp.Value);
Connections = connections;
graph.RunStateChanged += graph_RunStateChanged;
}
示例11: Init
public void Init(Model model) {
OnCompleted += () => {
try {
disposables.Dispose();
} catch (Exception err) {
dbg.Error(err);
}
};
VerifyAccess();
disposables.Add(renderSubscription);
isPaused = false;
InitializeComponent();
captionNoSignal.CreateBinding(TextBlock.TextProperty, Strings, s => s.noSignal);
noSignalPanel.Visibility = System.Windows.Visibility.Hidden;
btnPause.Click += new RoutedEventHandler(btnPause_Click);
btnResume.Click += new RoutedEventHandler(btnPause_Click);
btnPause.CreateBinding(Button.VisibilityProperty, this, x => { return x.isPaused ? Visibility.Collapsed : Visibility.Visible; });
btnResume.CreateBinding(Button.VisibilityProperty, this, x => { return !x.isPaused ? Visibility.Collapsed : Visibility.Visible; });
playbackStatistics.Visibility = AppDefaults.visualSettings.ShowVideoPlaybackStatistics ? Visibility.Visible : Visibility.Collapsed;
if (model.isUriEnabled) {
uriString.Visibility = System.Windows.Visibility.Visible;
uriString.Text = model.mediaUri.uri;
} else {
uriString.Visibility = System.Windows.Visibility.Collapsed;
}
VideoStartup(model);
}
示例12: AddControl
private void AddControl(Model.LEDScreen data)
{
var control = new LEDScreenControl();
control.BindData(data);
control.Margin = new System.Windows.Forms.Padding(10);
flowLayoutPanel1.Controls.Add(control);
}
示例13: VoicePausingViewModel
public VoicePausingViewModel(Model.Profile profile)
{
this.Profile = profile;
this.AddPausePhraseCommand = new ActionCommand(this.AddPausePhrase,
() => this.PausePhraseName != null &&
this.PausePhraseName.Trim().Length > 0 &&
!this.Profile.PauseRecognitionPhrases.Any(phr => phr == this.PausePhraseName.Trim()));
this.RemovePausePhraseCommand = new ActionCommand(this.RemovePausePhrase,
() => this.CurrentPausePhrase != null);
this.RenamePausePhraseCommand = new ActionCommand(this.RenamePausePhrase,
() => this.CurrentPausePhrase != null &&
this.PausePhraseName != null &&
this.PausePhraseName.Trim().Length > 0 &&
!this.Profile.PauseRecognitionPhrases.Any(phr => phr == this.PausePhraseName.Trim()));
this.AddUnpausePhraseCommand = new ActionCommand(this.AddUnpausePhrase,
() => this.UnpausePhraseName != null &&
this.UnpausePhraseName.Trim().Length > 0 &&
!this.Profile.UnpauseRecognitionPhrases.Any(phr => phr == this.UnpausePhraseName.Trim()));
this.RemoveUnpausePhraseCommand = new ActionCommand(this.RemoveUnpausePhrase,
() => this.CurrentUnpausePhrase != null);
this.RenameUnpausePhraseCommand = new ActionCommand(this.RenameUnpausePhrase,
() => this.CurrentUnpausePhrase != null &&
this.UnpausePhraseName != null &&
this.UnpausePhraseName.Trim().Length > 0 &&
!this.Profile.UnpauseRecognitionPhrases.Any(phr => phr == this.UnpausePhraseName.Trim()));
}
示例14: PinViewModel
protected PinViewModel(FilterViewModel parent, Model.Pin pin)
{
Parent = parent;
_pin = pin;
parent.PropertyChanged += parent_PropertyChanged;
}
示例15: OtherObject
/// <summary>
/// Constructor.
/// </summary>
/// <param name="obj">Map object to display</param>
public OtherObject(Model.MapObject obj)
{
InitializeComponent();
this.InitialiseEventHandlers();
this.MapObject = obj;
this.pictureBox.Image = obj.Image;
this.labelObjectName.Text = obj.Name + " [" + obj.ID.ToString() + "]";
if (obj.Faction != null)
{
this.labelFactionName.Text = obj.Faction.Name;
}
else
{
this.labelFactionName.Text = "Unclaimed";
}
if (obj.GetType() == typeof(Planet))
{
Planet p = (Planet)obj;
this.labelMassOrEnergy.Text = p.Energy.ToString();
}
else
{
Ship s = (Ship)obj;
this.labelMassOrEnergy.Text = s.Mass.ToString();
}
}