本文整理汇总了C#中Partition类的典型用法代码示例。如果您正苦于以下问题:C# Partition类的具体用法?C# Partition怎么用?C# Partition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Partition类属于命名空间,在下文中一共展示了Partition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Cell
internal Partition part; // the partition containing this cell
#endregion Fields
#region Constructors
/// <summary>
/// Load a cell from disk into memory.
/// </summary>
/// <param name="part">The partition where this cell belongs</param>
/// <param name="fileName">The name of the file holding the persisted cell</param>
/// <exception cref="FileFormatException">The cell file is malformed</exception>
/// <exception cref="EndOfStreamException">The cell file is too short</exception>
internal Cell(Partition part, string fileName, bool partial)
{
this.part = part;
this.fileName = fileName;
var fileLength = new FileInfo(fileName).Length;
using (var br = new BinaryReader(new BufferedStream(new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read)))) {
this.baseUID = br.ReadInt64();
this.epoch = br.ReadInt32();
this.numUrls = br.ReadInt64();
this.supraUID = this.baseUID + this.numUrls;
this.urlCell = new UrlCell(this, br);
this.linkCell = new LinkCell[2];
this.linkCell[0] = new LinkCell(this, br);
this.linkCell[1] = new LinkCell(this, br);
long numHdrBytes = br.BaseStream.Position;
this.urlCell.startPos = numHdrBytes;
this.linkCell[0].startPos = this.urlCell.startPos + this.urlCell.numBytes;
this.linkCell[1].startPos = this.linkCell[0].startPos + this.linkCell[0].numBytes;
var expectedSize = numHdrBytes + this.urlCell.numBytes +
(partial ? 0L : this.linkCell[0].numBytes + this.linkCell[1].numBytes);
if (fileLength != expectedSize) {
throw new FileFormatException(fileName + " is wrong size");
}
}
}
示例2: CheckTerrain
void CheckTerrain(string id, int res)
{
instance = GetComponent<BC2Instance>().instance;
string terrainLocation = Util.GetField("TerrainAsset", instance).reference;
if (terrainLocation == "" || terrainLocation == null)
{
Util.Log("TerrainAsset is missing from " + instance.guid);
} else
{
string guid = Util.GetGuid(terrainLocation);
terrainLocation = Util.ClearGUIDString(terrainLocation);
terrainLoc = terrainLocation;
partition = Util.LoadPartition(terrainLocation);
int terrainRes;
if (res == 0)
{
terrainRes = TerrainRes(terrainLocation, guid);
fullres = terrainRes;
} else
{
terrainRes = res;
}
int terrainHeight = TerrainHeight(terrainLocation);
LoadTerrain(terrainLocation, terrainRes, terrainHeight, id);
}
}
示例3: DiagramsModel
/// <summary>
/// Constructor
/// </summary>
/// <param name="partition">Partition where new element is to be created.</param>
/// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
public DiagramsModel(Partition partition, params PropertyAssignment[] propertyAssignments)
: base(partition, propertyAssignments)
{
// listen to events
this.Store.EventManagerDirectory.ElementAdded.Add(new EventHandler<ElementAddedEventArgs>(OnElementAdded));
this.Store.EventManagerDirectory.ElementDeleted.Add(new EventHandler<ElementDeletedEventArgs>(OnElementDeleted));
}
示例4: CreateNewProcessOverview
public static void CreateNewProcessOverview(string ProcessName, ProjectItem processFile, ProjectItem diagramFile)
{
var store = new Store(typeof(CloudCoreArchitectProcessOverviewDomainModel));
var partition = new Partition(store);
var result = new SerializationResult();
using (Transaction t = store.TransactionManager.BeginTransaction("create new process overview model"))
{
try
{
var processOverviewSerializationHelper = CloudCoreArchitectProcessOverviewSerializationHelper.Instance;
Architect.ProcessOverview.Process process = processOverviewSerializationHelper.CreateModelHelper(partition);
SetProcessOverviewProperties(ProcessName, process);
var diagram = processOverviewSerializationHelper.CreateDiagramHelper(partition, process);
processOverviewSerializationHelper.SaveModelAndDiagram(result, process, processFile.FileNames[0], diagram, diagramFile.FileNames[0]);
AddAssemblyReference(ProcessName, process);
t.Commit();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
示例5: DeleteCommand
public DeleteCommand(Cluster cluster, WritePolicy policy, Key key)
{
this.cluster = cluster;
this.policy = policy;
this.key = key;
this.partition = new Partition(key);
}
示例6: Init
public void Init()
{
this.ListUIChildren = new List<UIComponent>();
Ribbon.HEIGHT = (int)(0.2f * Render.ScreenHeight);
Rec = new Rectangle(0, 0, (int)Render.ScreenWidth, Ribbon.HEIGHT);
RecMenuBar = new Rectangle(Ribbon.MARGE + 100, 0, Rec.Width - 100 - Ribbon.MARGE * 2, 30);
recBackground = new Rectangle(Rec.X, Rec.Y, Rec.Width, (int)((float)Rec.Height * 1.2f));
vecTime = new Vector2(RecMenuBar.Left + MARGE * 4, RecMenuBar.Top + RecMenuBar.Height / 2 - Render.FontTextSmall.MeasureString("0").Y / 2);
BPMMeter BPMMeter = new BPMMeter(this, this.UI, GetNewTimeSpan());
BPMMeter.Init();
this.ListUIChildren.Add(BPMMeter);
Partition = new Partition(this, this.UI, GetNewTimeSpan());
Partition.Init();
this.ListUIChildren.Add(Partition);
imgPlay = new ClickableImage(UI, this, GetNewTimeSpan(), "Play", Render.texPlay, Render.texPlay, new Vector2(BPMMeter.Rec.Right + MARGE * 2, Partition.Rec.Y + RecMenuBar.Height / 2 - Render.texPlay.Height / 2));
imgPause = new ClickableImage(UI, this, GetNewTimeSpan(), "Pause", Render.texPause, Render.texPause, new Vector2(BPMMeter.Rec.Right + MARGE * 2, Partition.Rec.Y + RecMenuBar.Height / 2 - Render.texPause.Height / 2));
imgPause.Visible = false;
imgStop = new ClickableImage(UI, this, GetNewTimeSpan(), "Stop", Render.texStop, Render.texStop, new Vector2(BPMMeter.Rec.Right + MARGE * 3 + Render.texPlay.Width, Partition.Rec.Y + RecMenuBar.Height / 2 - Render.texStop.Height / 2));
imgPlay.ClickImage += new ClickableImage.ClickImageHandler(imgPlay_ClickImage);
imgPause.ClickImage += new ClickableImage.ClickImageHandler(imgPause_ClickImage);
imgStop.ClickImage += new ClickableImage.ClickImageHandler(imgStop_ClickImage);
this.ListUIChildren.Add(imgPlay);
this.ListUIChildren.Add(imgPause);
this.ListUIChildren.Add(imgStop);
}
示例7: Partition
/// <summary>
/// Copy information from another partition.
/// </summary>
/// <param name="other">Partition to copy.</param>
public Partition(Partition other)
{
this.partitionNumber = other.partitionNumber;
this.size = other.size;
this.replicas = new List<UNCPathname>();
this.replicas.AddRange(other.replicas);
}
示例8: NodeShape
public NodeShape(Partition partition, params PropertyAssignment[] propertyAssignments)
: base(partition, propertyAssignments)
{
bool bHandledSize = false;
bool bHandledLocation = false;
bool bHandledAbsoluteLocation = false;
if (propertyAssignments != null)
foreach (PropertyAssignment propertyAssignment in propertyAssignments)
{
if (propertyAssignment.PropertyId == NodeShape.SizeDomainPropertyId)
bHandledSize = true;
else if (propertyAssignment.PropertyId == NodeShape.LocationDomainPropertyId)
bHandledLocation = true;
else if (propertyAssignment.PropertyId == NodeShape.AbsoluteLocationDomainPropertyId)
bHandledAbsoluteLocation = true;
}
if (!bHandledSize)
this.Size = this.DefaultSize;
if (!bHandledLocation)
this.Location = PointD.Empty;
if (!bHandledAbsoluteLocation)
this.AbsoluteLocation = PointD.Empty;
}
示例9: CreateModelElementForEFObjectType
private static ModelElement CreateModelElementForEFObjectType(EFObject obj, Partition partition)
{
ModelElement modelElement = null;
var t = obj.GetType();
if (t == typeof(ConceptualEntityModel))
{
modelElement = new EntityDesignerViewModel(partition);
}
else if (t == typeof(ConceptualEntityType))
{
modelElement = new EntityType(partition);
}
else if (t == typeof(ConceptualProperty))
{
modelElement = new ScalarProperty(partition);
}
else if (t == typeof(ComplexConceptualProperty))
{
modelElement = new ComplexProperty(partition);
}
else if (t == typeof(Association))
{
modelElement = new ViewModel.Association(partition);
}
else if (t == typeof(EntityTypeBaseType))
{
modelElement = new Inheritance(partition);
}
else if (t == typeof(NavigationProperty))
{
modelElement = new ViewModel.NavigationProperty(partition);
}
return modelElement;
}
示例10: WallCatalogResource
public WallCatalogResource(int APIversion,
uint version,
uint unknown2,
Common common,
Wall wallType,
Partition partitionType,
PartitionFlagsType partitionFlags,
VerticalSpan verticalSpanType,
PartitionsBlockedFlagsType partitionsBlockedFlags,
PartitionsBlockedFlagsType adjacentPartitionsBlockedFlags,
PartitionTool partitionToolMode,
ToolUsageFlagsType toolUsageFlags,
uint defaultPatternIndex,
WallThickness wallThicknessType,
TGIBlockList ltgib)
: base(APIversion, version, common, ltgib)
{
this.unknown2 = unknown2;
this.wallType = wallType;
this.partitionType = partitionType;
this.partitionFlags = partitionFlags;
this.verticalSpanType = verticalSpanType;
this.partitionsBlockedFlags = partitionsBlockedFlags;
this.adjacentPartitionsBlockedFlags = adjacentPartitionsBlockedFlags;
this.partitionToolMode = partitionToolMode;
this.toolUsageFlags = toolUsageFlags;
this.defaultPatternIndex = defaultPatternIndex;
this.wallThicknessType = wallThicknessType;
}
示例11: OnInspectorGUI
public override void OnInspectorGUI()
{
DrawDefaultInspector();
MapLoad mapLoad = (MapLoad)target;
if(GUILayout.Button("Save as " + mapLoad.saveAs))
{
mapLoad.Save();
}
string path = "Levels/"+mapLoad.mapName;
string minimapPath;
if (lastMapName != mapLoad.mapName) {
if(Util.FileExist("Resources/"+path+".xml")) {
partition = Util.LoadPartition (path);
foreach (Field field in Util.GetComplex ("LevelDescription", partition.instance [0]).field) {
if (field.name == "MinimapTexture") {
minimapPath = Util.ClearGUIDString (field.reference);
minimapPath += ".itexture";
texture = Util.LoadiTexture (minimapPath);
}
}
}
lastMapName = mapLoad.mapName;
}
if (texture != null && !Application.isPlaying) {
GUILayout.Label (texture, GUILayout.Width(EditorGUIUtility.currentViewWidth - 40), GUILayout.Height(EditorGUIUtility.currentViewWidth - 40));
}
}
示例12: DeletePartition
public bool DeletePartition(Partition entity)
{
if (entity == null) return false;
_unitOfWork.PartitionRepository.Delete(entity);
_unitOfWork.Save();
return true;
}
示例13: CreateDiagramHelper
internal override EntityDesignerDiagram CreateDiagramHelper(Partition diagramPartition, ModelElement modelRoot)
{
var evm = modelRoot as EntityDesignerViewModel;
var diagram = new EntityDesignerDiagram(diagramPartition);
diagram.ModelElement = evm;
return diagram;
}
示例14: SetUp
public void SetUp()
{
table = Storage.SetUp();
partition = new Partition(table, "test");
virtual1 = new Partition(table, "test|123");
virtual2 = new Partition(table, "test|456");
}
示例15: AsyncExists
public AsyncExists(AsyncCluster cluster, Policy policy, Key key, ExistsListener listener)
: base(cluster)
{
this.policy = policy;
this.listener = listener;
this.key = key;
this.partition = new Partition(key);
}