public bool CanPlace(System.Collections.Generic.ICollection<DesignItem> childItems, PlacementType type, PlacementAlignment position) { return type == PlacementType.Resize && (position == PlacementAlignment.Right || position == PlacementAlignment.BottomRight || position == PlacementAlignment.Bottom); }
public static PlacementSettings[] GetPlacement(this ContentTypeDefinition contentTypeDefinition, PlacementType placementType) { var currentSettings = contentTypeDefinition.Settings; string placement; var serializer = new JavaScriptSerializer(); currentSettings.TryGetValue("ContentTypeSettings.Placement." + placementType, out placement); return String.IsNullOrEmpty(placement) ? new PlacementSettings[0] : serializer.Deserialize<PlacementSettings[]>(placement); }
/// <summary> /// Removes any custom placement for a specific shape /// </summary> public static ContentTypeDefinitionBuilder ResetPlacement(this ContentTypeDefinitionBuilder builder, PlacementType placementType, string shapeType, string differentiator) { var serializer = new JavaScriptSerializer(); var placementSettings = GetPlacement(builder.Build(), placementType).ToList(); placementSettings = placementSettings.Where(x => x.ShapeType != shapeType && x.Differentiator != differentiator).ToList(); var placement = serializer.Serialize(placementSettings.ToArray()); return builder.WithSetting("ContentTypeSettings.Placement." + placementType, placement); }
private static string AddPlacement(ContentTypeDefinition builder, PlacementType placementType, string shapeType, string differentiator, string zone, string position) { var serializer = new JavaScriptSerializer(); var placementSettings = GetPlacement(builder, placementType).ToList(); placementSettings = placementSettings.Where(x => !x.IsSameAs(new PlacementSettings { ShapeType = shapeType, Differentiator = differentiator })).ToList(); placementSettings.Add(new PlacementSettings { ShapeType = shapeType, Differentiator = differentiator, Zone = zone, Position = position }); var placement = serializer.Serialize(placementSettings.ToArray()); return placement; }
public RoomTemplate(PlacementType type, RoomTile[,] template, RoomTile[,] accessories) { PlacementType = type; Template = template; Accessories = accessories; CanRotate = true; Probability = 1.0f; Rotation = 0.0f; }
public virtual bool CanPlace(IEnumerable<DesignItem> childItems, PlacementType type, PlacementAlignment position) { return true; }
/// <summary> /// Adds a placement the string representation of a placement /// </summary> public static ContentTypeDefinition ResetPlacement(this ContentTypeDefinition builder, PlacementType placementType) { builder.Settings["ContentTypeSettings.Placement." + placementType] = String.Empty; return builder; }
/// <summary> /// Removes any custom placement /// </summary> public static ContentTypeDefinitionBuilder ResetPlacement(this ContentTypeDefinitionBuilder builder, PlacementType placementType) { return builder.WithSetting("ContentTypeSettings.Placement." + placementType, String.Empty); }
public void SetPlacementType(PlacementType pacementType) { string placementTypeString = null; switch (placementType) { case PlacementType.Inline: placementTypeString = Const.PlacementTypeInline; break; case PlacementType.Interstitial: placementTypeString = Const.PlacementTypeInterstitial; break; } string js = string.Format("mraid.setPlacementType(\"{0}\");", placementTypeString); EvalJS(js); }
public virtual bool CanPlace(ICollection<DesignItem> childItems, PlacementType type, PlacementAlignment position) { return true; }
/// <summary> /// Adds a placement the string representation of a placement /// </summary> public static ContentTypeDefinition Placement(this ContentTypeDefinition builder, PlacementType placementType, string shapeType, string differentiator, string zone, string position) { var placement = AddPlacement(builder, placementType, shapeType, differentiator, zone, position); builder.Settings["ContentTypeSettings.Placement." + placementType] = placement; return builder; }
/// <summary> /// Defines a custom placement /// </summary> public static ContentTypeDefinitionBuilder Placement(this ContentTypeDefinitionBuilder builder, PlacementType placementType, string shapeType, string differentiator, string zone, string position) { var placement = AddPlacement(builder.Build(), placementType, shapeType, differentiator, zone, position); return builder.WithSetting("ContentTypeSettings.Placement." + placementType, placement); }
public Gene(GeneType _type, int _count, PlacementType _palcement, int _compAbilityStat) { initGene(_type, _count, _palcement, _compAbilityStat); }
private void initGene(GeneType _type, int _count, PlacementType _palcement, int _compAbilityStat) { type = _type; count = _count; placement = _palcement; compAbilityStat = _compAbilityStat; IncrementGeneCounter(); }
public bool CanPlace(IEnumerable<DesignItem> childItems, PlacementType type, PlacementAlignment position) { return type == PlacementType.Resize && (position == PlacementAlignment.Right || position == PlacementAlignment.BottomRight || position == PlacementAlignment.Bottom); }