本文整理汇总了C#中ModelBase类的典型用法代码示例。如果您正苦于以下问题:C# ModelBase类的具体用法?C# ModelBase怎么用?C# ModelBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModelBase类属于命名空间,在下文中一共展示了ModelBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: ZoomValue
public ZoomValue(ListCollectionView view, ModelBase item)
{
_view = view;
_item = item;
InitializeComponent();
this.DataContext = item;
this.Loaded += OnEditTaskItemLoaded;
this.Closed += new EventHandler(ZoomValue_Closed);
}
开发者ID:axs221,项目名称:TaskDash,代码行数:12,代码来源:ZoomValue.xaml.cs
示例17: BMDWriter
public BMDWriter(ModelBase model, ref NitroFile modelFile, BMDImporter.BMDExtraImportOptions extraOptions)
: base(model, modelFile.m_Name)
{
m_ModelFile = modelFile;
m_ConvertToTriangleStrips = extraOptions.m_ConvertToTriangleStrips;
m_KeepVertexOrderDuringStripping = extraOptions.m_KeepVertexOrderDuringStripping;
m_AlwaysWriteFullVertexCmd23h = extraOptions.m_AlwaysWriteFullVertexCmd23h;
if (m_ConvertToTriangleStrips)
{
Stripify();
}
}
开发者ID:RicoPlays,项目名称:sm64dse,代码行数:13,代码来源:BMDWriter.cs
示例18: AddScriptBrick
public void AddScriptBrick(ModelBase scriptBrick, int firstViewIndex, int lastViewIndex)
{
//if (this.Count == lastViewIndex + 1 && GetAtIndex(lastViewIndex) is Script && )
//{
// lastViewIndex++;
//}
if (scriptBrick is Brick) // Add brick at last visible end of a Script
{
var brick = scriptBrick as Brick;
var scriptEndIndex = -1;
Script lastFullScript = null;
foreach (var script in Scripts)
{
var scriptBeginIndex = scriptEndIndex + 1;
scriptEndIndex += script.Bricks.Count + 1;
// what does that do?
//if (scriptEndIndex > lastViewIndex && scriptBeginIndex >= firstViewIndex)
//{
// break;
//}
lastFullScript = script;
}
if (lastFullScript == null)
{
var startScript = new StartScript();
Scripts.Add(startScript);
lastFullScript = startScript;
OnScriptAdded(startScript, IndexOf(startScript));
}
lastFullScript.Bricks.Add(brick);
//OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); // TODO: make faster and use method below instead
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, scriptBrick, IndexOf(scriptBrick)));
}
else if (scriptBrick is Script) // Add Script at end of all
{
var script = scriptBrick as Script;
Scripts.Add(script);
//OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); // TODO: make faster and use method below instead
OnScriptAdded((Script) scriptBrick, IndexOf(scriptBrick));
}
}
开发者ID:Catrobat,项目名称:CatrobatForWindows,代码行数:50,代码来源:ActionsCollection.cs
示例19: TriangleStripper
public TriangleStripper(ModelBase.FaceListDef faceList)
{
if (faceList.m_Type != ModelBase.PolyListType.Triangles)
{
bool tris = true;
for (int i = 0; i < faceList.m_Faces.Count; i++)
{
tris = (faceList.m_Faces[i].m_NumVertices == 3);
if (!tris)
throw new ArgumentException("The provided FaceListDef must be triangulated.");
}
faceList.m_Type = ModelBase.PolyListType.Triangles;
}
m_Vertices = new List<VertexLinked>();
m_Triangles = new List<TriangleLinked>();
m_TrianglesToProcess = new List<TriangleLinked>();
for (int i = 0; i < faceList.m_Faces.Count; i++)
{
if (IsDegenerateFace(faceList.m_Faces[i]))
{
faceList.m_Faces.RemoveAt(i);
}
}
for (int i = 0; i < faceList.m_Faces.Count; i++)
{
m_Triangles.Add(new TriangleLinked(faceList.m_Faces[i]));
}
for (int i = 0; i < m_Triangles.Count; i++)
{
ModelBase.FaceDef triangle = m_Triangles[i].m_Triangle;
for (int j = 0; j < triangle.m_NumVertices; j++)
{
VertexLinked vertex = new VertexLinked(triangle.m_Vertices[j]);
int index = m_Vertices.IndexOf(vertex);
if (index == -1)
{
m_Vertices.Add(vertex);
index = m_Vertices.Count - 1;
}
m_Vertices[index].m_LinkedTriangles.Add(i);
}
}
}
开发者ID:RicoPlays,项目名称:sm64dse,代码行数:50,代码来源:TriangleStripper.cs
示例20: AddTexture
protected void AddTexture(ModelBase.TextureDefBase texture, ModelBase.MaterialDef matDef)
{
matDef.m_TextureDefID = texture.m_ID;
IEnumerable<ModelBase.TextureDefBase> matchingHash = m_Model.m_Textures.Values.Where(
tex0 => tex0.m_ImgHash.Equals(texture.m_ImgHash));
if (matchingHash.Count() > 0)
{
matDef.m_TextureDefID = matchingHash.ElementAt(0).m_ID;
return;
}
m_Model.m_Textures.Add(texture.m_ID, texture);
}
开发者ID:RicoPlays,项目名称:sm64dse,代码行数:14,代码来源:AbstractModelLoader.cs
注:本文中的ModelBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论