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


C# ModelBase类代码示例

本文整理汇总了C#中ModelBase的典型用法代码示例。如果您正苦于以下问题:C# ModelBase类的具体用法?C# ModelBase怎么用?C# ModelBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ModelBase类属于命名空间,在下文中一共展示了ModelBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AbstractModelLoader

        public AbstractModelLoader(string modelFileName)
        {
            m_Model = new ModelBase(modelFileName);

            m_ModelFileName = modelFileName;
            m_ModelPath = Path.GetDirectoryName(m_ModelFileName);
        }
开发者ID:RicoPlays,项目名称:sm64dse,代码行数:7,代码来源:AbstractModelLoader.cs

示例2: SerializeModel

		/// <summary>
		///   Serializes the <paramref name="model" />.
		/// </summary>
		private unsafe void SerializeModel(BinaryWriter writer, ModelBase model, Formula[] formulas)
		{
			// Collect all objects contained in the model
			var objectTable = CreateObjectTable(model, formulas);

			// Prepare the serialization of the model's initial state
			lock (_syncObject)
			{
				_stateVector = SerializationRegistry.Default.GetStateVectorLayout(model, objectTable, SerializationMode.Full);
				_deserializer = null;
			}

			var stateVectorSize = _stateVector.SizeInBytes;
			var serializer = _stateVector.CreateSerializer(objectTable);

			// Serialize the object table
			SerializeObjectTable(objectTable, writer);

			// Serialize the object identifier of the model itself and the formulas
			writer.Write(objectTable.GetObjectIdentifier(model));
			writer.Write(formulas.Length);
			foreach (var formula in formulas)
				writer.Write(objectTable.GetObjectIdentifier(formula));

			// Serialize the initial state
			var serializedState = stackalloc byte[stateVectorSize];
			serializer(serializedState);

			// Copy the serialized state to the stream
			writer.Write(stateVectorSize);
			for (var i = 0; i < stateVectorSize; ++i)
				writer.Write(serializedState[i]);
		}
开发者ID:isse-augsburg,项目名称:ssharp,代码行数:36,代码来源:RuntimeModelSerializer.cs

示例3: configure

 public void configure(int controllerID, ControllerBase controller, ModelBase model, ViewBase view)
 {
     addControllerRoute(new RouteBase(controllerID, controller));
     controller.configure(view, model);
     model.configure();
     view.configure(model);
 }
开发者ID:akiken,项目名称:TetrisV0,代码行数:7,代码来源:MVC.cs

示例4: AbstractModelWriter

        public AbstractModelWriter(ModelBase model, string modelFileName)
        {
            m_Model = model;

            m_ModelFileName = modelFileName;
            m_ModelPath = Path.GetDirectoryName(m_ModelFileName);
        }
开发者ID:RicoPlays,项目名称:sm64dse,代码行数:7,代码来源:AbstractModelWriter.cs

示例5: Populate

        public override void Populate(ModelBase obj)
        {
            CodigoIso newProps = obj as CodigoIso;

            Codigo = newProps.Codigo;
            Nome = newProps.Nome;
        }
开发者ID:pedrostc,项目名称:ContainerControl,代码行数:7,代码来源:CodigoIso.cs

示例6: DynamoNodeButton

 public DynamoNodeButton(ModelBase model, string eventName)
     : this()
 {
     this.model = model;
     this.eventName = eventName;
     Click += OnDynamoNodeButtonClick;
 }
开发者ID:sh4nnongoh,项目名称:Dynamo,代码行数:7,代码来源:DynamoNodeButton.cs

示例7: SerializedRuntimeModel

		/// <param name="model">A copy of the original model the runtime model was generated from.</param>
		/// <param name="buffer">The buffer the model was deserialized from.</param>
		/// <param name="objectTable">The table of objects referenced by the model.</param>
		/// <param name="formulas">The formulas that are checked on the model.</param>
		internal SerializedRuntimeModel(ModelBase model, byte[] buffer, ObjectTable objectTable, Formula[] formulas)
		{
			Model = model;
			Buffer = buffer;
			ObjectTable = objectTable;
			Formulas = formulas;
		}
开发者ID:isse-augsburg,项目名称:ssharp,代码行数:11,代码来源:SerializedRuntimeModel.cs

示例8: Save

		/// <summary>
		///   Returns the serialized <paramref name="model" /> and the <paramref name="formulas" />.
		/// </summary>
		/// <param name="model">The model that should be serialized.</param>
		/// <param name="formulas">The formulas that should be serialized.</param>
		public static byte[] Save(ModelBase model, params Formula[] formulas)
		{
			var serializer = new RuntimeModelSerializer();
			serializer.Serialize(model, formulas);

			lock (serializer._syncObject)
				return serializer._serializedModel;
		}
开发者ID:isse-augsburg,项目名称:ssharp,代码行数:13,代码来源:RuntimeModelSerializer.cs

示例9: Simulator

		/// <summary>
		///   Initializes a new instance.
		/// </summary>
		/// <param name="model">The model that should be simulated.</param>
		/// <param name="formulas">The formulas that can be evaluated on the model.</param>
		public Simulator(ModelBase model, params Formula[] formulas)
		{
			Requires.NotNull(model, nameof(model));
			Requires.NotNull(formulas, nameof(formulas));

			_runtimeModel = RuntimeModel.Create(model, formulas);
			Reset();
		}
开发者ID:isse-augsburg,项目名称:ssharp,代码行数:13,代码来源:Simulator.cs

示例10: InitializeModel

		/// <summary>
		///   Initizializes the model that should be analyzed.
		/// </summary>
		/// <param name="configuration">The configuration that should be used for the analyses.</param>
		/// <param name="model">The model that should be analyzed.</param>
		/// <param name="hazard">The hazard that should be analyzed.</param>
		internal void InitializeModel(AnalysisConfiguration configuration, ModelBase model, Formula hazard)
		{
			Model = model;
			ForcedFaults = new FaultSet(Model.Faults.Where(fault => fault.Activation == Activation.Forced));
			SuppressedFaults = new FaultSet(Model.Faults.Where(fault => fault.Activation == Activation.Suppressed));

			InitializeModel(configuration, hazard);
		}
开发者ID:isse-augsburg,项目名称:ssharp,代码行数:14,代码来源:AnalysisBackend.cs

示例11: MaximalSafeSetHeuristic

		/// <summary>
		///   Initializes a new instance.
		/// </summary>
		/// <param name="model">The model the heuristic is created for.</param>
		/// <param name="cardinalityLevel">The cardinality level where the first suggestions should be made.</param>
		public MaximalSafeSetHeuristic(ModelBase model, uint cardinalityLevel = 3)
		{
			Requires.NotNull(model, nameof(model));

			_model = model;
			_cardinalityLevel = cardinalityLevel;
			_allFaults = new FaultSet(model.Faults.Where(fault => fault.Activation != Activation.Suppressed).ToArray());
		}
开发者ID:isse-augsburg,项目名称:ssharp,代码行数:13,代码来源:MaximalSafeSetHeuristic.cs

示例12: BookingView

        public BookingView(BookingViews type, ModelBase model = null, bool IsDuplicate = false)
        {
            InitializeComponent();
            if (model != null)
                this.Header = "Edit Booking";
            DataContext = ViewModel = new BookingViewModel(type, model,IsDuplicate);

            Owner = Application.Current.MainWindow;
        }
开发者ID:syatin003,项目名称:Wpf,代码行数:9,代码来源:BookingView.xaml.cs

示例13: SetModel

		public void SetModel(ModelBase model, params Formula[] formulas)
		{
			_formulas = formulas;
			_model = model;

			foreach (var fault in _model.Faults)
				fault.Activation = Activation.Suppressed;

			SetSimulator(new Simulator(_model, formulas));
		}
开发者ID:isse-augsburg,项目名称:ssharp,代码行数:10,代码来源:SimulationControls.xaml.cs

示例14: ExportTextureToPNG

 protected static void ExportTextureToPNG(string destDir, ModelBase.TextureDefBase texture)
 {
     try
     {
         ExportTextureToPNG(destDir, texture.m_ID, texture.GetBitmap());
     }
     catch (IOException)
     {
         Console.Write("Cannot write image for texture: " + texture.m_ID);
     }
 }
开发者ID:RicoPlays,项目名称:sm64dse,代码行数:11,代码来源:AbstractModelWriter.cs

示例15: SafetyAnalysisResults

		/// <summary>
		///   Initializes a new instance.
		/// </summary>
		/// <param name="model">The <see cref="Model" /> instance the safety analysis was conducted for.</param>
		/// <param name="hazard">The hazard the analysis was conducated for.</param>
		/// <param name="suppressedFaults">The faults whose activations have been completely suppressed during analysis.</param>
		/// <param name="forcedFaults">The faults whose activations have been forced during analysis.</param>
		/// <param name="heuristics">The heuristics that are used during the analysis.</param>
		/// <param name="activationBehavior">The fault acitvation behavior used during the analysis.</param>
		internal SafetyAnalysisResults(ModelBase model, Formula hazard, IEnumerable<Fault> suppressedFaults,
									  IEnumerable<Fault> forcedFaults, IEnumerable<IFaultSetHeuristic> heuristics,
									  FaultActivationBehavior activationBehavior)
		{
			Model = model;
			Hazard = hazard;
			SuppressedFaults = suppressedFaults;
			ForcedFaults = forcedFaults;
			Heuristics = heuristics.ToArray(); // make a copy so that later changes to the heuristics don't affect the results
			FaultActivationBehavior = activationBehavior;
		}
开发者ID:isse-augsburg,项目名称:ssharp,代码行数:20,代码来源:SafetyAnalysisResults.cs


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