当前位置: 首页>>代码示例>>C#>>正文


C# ComponentModel.Model类代码示例

本文整理汇总了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;
 }
开发者ID:guillermogrillo,项目名称:mondongo,代码行数:7,代码来源:NuevoRol.cs

示例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;
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:38,代码来源:LoadGroupTypes.cs

示例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;
        }
开发者ID:pkdevbox,项目名称:Rock,代码行数:39,代码来源:FilterActiveLocations.cs

示例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 );
        }
开发者ID:Ganon11,项目名称:Rock,代码行数:37,代码来源:Sms.cs

示例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));
            }
        }
开发者ID:hh22333,项目名称:Ext.NET.Community,代码行数:29,代码来源:ModelFieldAttribute.cs

示例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;
        }
开发者ID:jondhinkle,项目名称:Rock,代码行数:40,代码来源:RemoveEmptyLocations.cs

示例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);
            }
        }
开发者ID:shana0440,项目名称:easy-control-myo-sharp,代码行数:34,代码来源:PresentationModel.cs

示例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;
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:40,代码来源:FilterGroupsByAbilityLevel.cs

示例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);
 }
开发者ID:chrisforbes,项目名称:aliengame,代码行数:7,代码来源:GuardSpawner.cs

示例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;
        }
开发者ID:tica,项目名称:DataFlow,代码行数:29,代码来源:FilterGraphViewModel.cs

示例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);
		}
开发者ID:zzilla,项目名称:ONVIF-Device-Manager,代码行数:33,代码来源:VideoPlayerView.xaml.cs

示例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);
 }
开发者ID:LooWooTech,项目名称:LEDFlow,代码行数:7,代码来源:LEDScreenTab.cs

示例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()));
        }
开发者ID:Ranaakamarth,项目名称:SkyrimSpeechCommander,代码行数:28,代码来源:VoicePausingViewModel.cs

示例14: PinViewModel

        protected PinViewModel(FilterViewModel parent, Model.Pin pin)
        {
            Parent = parent;
            _pin = pin;

            parent.PropertyChanged += parent_PropertyChanged;
        }
开发者ID:tica,项目名称:DataFlow,代码行数:7,代码来源:PinViewModel.cs

示例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();
            }
        }
开发者ID:sal1n,项目名称:lcog-client,代码行数:35,代码来源:OtherObject.cs


注:本文中的System.ComponentModel.Model类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。