internal static IDisposable GetEditableWrapper(ContentItem item, bool isEditable, string propertyName, IDisplayable displayable, TextWriter writer) { var viewEditable = displayable as IViewEditable; if (isEditable && (viewEditable == null || viewEditable.IsViewEditable) && item != null && displayable != null) return TagWrapper.Begin("div", writer, htmlAttributes: new RouteValueDictionary { { "data-id", item.ID }, { "data-path", item.Path }, { "data-property", propertyName }, { "data-displayable", displayable.GetType().Name }, { "class", "editable " + displayable.GetType().Name + " Editable" + propertyName } }); else return new EmptyDisposable(); }
public bool ShowBait(IDisplayable d) { if (!(registery.Values.Any(x => x.Position.Column == d.Position.Column && x.Position.Row == d.Position.Row))) { bait = d; DisplayPanel.Show(d); return true; } return false; }
/** FormateCoolDown, private static string * @Params : IDisplayable * We try to check if we are handling a IStatusDisplayable If it is, we Formate the type of Displayable. **/ private static string FormateStatusType(IDisplayable status) { string statusType = status is IBuff ? "Empowerment" : "Curse"; return("<b><size=12><color=lightblue>" + statusType + "</color></size></b> \n"); }
public void ConvertValue(IDisplayable val) { this._ouputValue.Invoke(val.Name); }
/// <summary> /// Removes the block from the Display panel. /// </summary> /// <param name="block"></param> public void Remove(IDisplayable block) { panel.Controls.Remove(block.Control); }
/// <summary> /// adds the block to the panel. /// </summary> /// <param name="block"></param> private void AddToPanel(IDisplayable block) { panel.Controls.Add(block.Control); }
internal TError ApplyTo <TError>(IDisplayable <TError> target) { return(_setter.SetDisplay(target)); }
public Int32 CompareTo(IDisplayable displayable) { return displayable is TablixRow ? String.Compare(Name, displayable.Name, StringComparison.Ordinal) : -1; }
/// <summary> /// Loads the image given to display it onto this ImageBox. /// </summary> public void Load(IDisplayable image) { Display = image; this.Invalidate(); }
static void DisplayYourself(IDisplayable myObject) { //Any objected passed into this method must have a Display() method implemented. myObject.Display(); }
public IAuditContextManager SetObject(IDisplayable displayable) { CurrentContextData.Displayable = displayable; return(this); }
/// <summary> /// A safe display string that can be used for logging and returns "null" when the /// underlying object is null. /// </summary> /// <param name="displayable">The <see cref="IDisplayable"/> object.</param> /// <returns>A display string.</returns> public static string ToSafeDisplayString(this IDisplayable displayable) => displayable?.ToDisplayString() ?? "null";
public TError SetDisplay <TError>(IDisplayable <TError> target) { return(target.ApplyEcoreWindow(_windowHandle)); }
public TError SetDisplay <TError>(IDisplayable <TError> target) { return(target.ApplyEvasDisplay(_type, _target)); }
public void Core_UpdateDisplay(IDisplayable display) { OAM_ImageBox.Load(display); Tileset_ImageBox.Load(Tiles.ToImage(32, 8, Colors.ToBytes(false))); }
/// <summary> /// Resets the dispay of this ImageBox (show the default gray rectangle) /// </summary> public void Reset() { Display = null; this.Invalidate(); }
public static MvcHtmlString ActionLink(this HtmlHelper helper, IDisplayable item, [AspMvcAction] string actionName, [AspMvcController] string controllerName) { return(System.Web.Mvc.Html.LinkExtensions.ActionLink(helper, item.Name, actionName, controllerName, new { Id = item.Id }, null)); }
public ForecastPlatform(IDisplayable displayable) { _displayMethod = displayable; }
private void InitializeGuaranteedProperties() { XAxis = new Vector(CSEntity.XAxis); YAxis = new Vector(CSEntity.YAxis); ZAxis = new Vector(CSEntity.ZAxis); Display = CSEntity.Display; }
/// <summary> /// Orients this object to look at the specified subject /// </summary> /// <param name="subject">The IDisplayable to face towards</param> public void FaceTowards(IDisplayable subject) { FaceTowards(subject.Rectangle.Center.X, subject.Rectangle.Center.Y); }
/// <summary> /// Updates the position of the block. /// </summary> /// <param name="block"></param> public void UpdatePosition(IDisplayable block) { block.UpdatePosition(ConvertBlockToPixel(block)); }
public DisplayableSet(IDisplayable sprite) { Sprite = sprite; }
/// <summary> /// Converts rows and columns to x and y in pixel. /// </summary> /// <param name="block"></param> /// <returns></returns> private AbsolutePosition ConvertBlockToPixel(IDisplayable block) { var position = block.Position; int top = this.BorderWidth + (block.Height + this.BorderWidth) * position.Row; int left = this.BorderWidth + (block.Width + this.BorderWidth) * position.Column; return new AbsolutePosition() { Left = left, Top = top }; }
protected Duck(IDisplayable displayable, ISwimable swimable) { this.displayable = displayable; this.swimable = swimable; }
/// <summary> /// puts the block in the display panel. /// </summary> /// <param name="block"></param> public void Show(IDisplayable block) { UpdatePosition(block); AddToPanel(block); if (!headadded) { block.Control.BackColor = Color.Pink; headadded = true; } }
static void DisplayObject(IDisplayable data) { Console.WriteLine(data.GetDisplayText()); }
public void Display(IDisplayable displayable) { Console.WriteLine($"Drawing {displayable.GetDisplayableType()}, {displayable.GetName()}, in low resolution"); }
public virtual void Execute(IDisplayable entity) { }
public static bool CollidesWith(this IDisplayable element1, IDisplayable element2) { return(!(element1.Position.DistanceTo(element2.Position) > element1.Size)); }
public virtual void SetVisible(IDisplayable value) { gameObject.SetActive(value != null); }
public void AddItem(IDisplayable item) { Items.Add(item); PerformLayout(); }
public virtual void UpdateUI(IDisplayable value) { SetVisible(value); }
internal static IDisposable GetEditableWrapper(ContentItem item, bool isEditable, string propertyName, IDisplayable displayable, TextWriter writer) { var viewEditable = displayable as IViewEditable; if (isEditable && (viewEditable == null || viewEditable.IsViewEditable) && item != null && displayable != null) { return(TagWrapper.Begin("div", writer, htmlAttributes: new RouteValueDictionary { { "data-id", item.ID }, { "data-path", item.Path }, { "data-property", propertyName }, { "data-displayable", displayable.GetType().Name }, { "data-versionIndex", item.VersionIndex }, { "data-versionKey", item.GetVersionKey() }, { "class", "editable " + displayable.GetType().Name + " Editable" + propertyName }, { "title", (displayable is IEditable) ? (displayable as IEditable).Title : displayable.Name } })); } else { return(new EmptyDisposable()); } }
private Vector2 GetScreenPoint(IDisplayable displayable) { return(displayable.Position.UpperLeft.Translate(-1 * ScreenBounds.Position.UpperLeft.Scale(CurrentLayer.ScrollingCoefficient))); }
/// <summary> /// Setup a REST handler that returns the values from a ParameterSet. /// </summary> /// <param name="urlBase">base of the url for this parameter set</param> /// <param name="parms">the parameter set to read and write</param> /// <param name="writable">if 'true', it allows POST operations to change the parameter set</param> public RestHandler(string urlBase, IDisplayable displayable) { m_baseUrl = urlBase; m_displayable = displayable; m_processGet = ProcessGetParam; m_prefix = APINAME + urlBase; RestManager.Instance.RegisterListener(this); m_log.Log(LogLevel.DRESTDETAIL, "Register GET/POST displayable handler for {0}", m_prefix); }
public void DrawSprite(IDisplayable displayable, TextureInfo texture, int cell) { var drawInfo = displayable.DrawInfo; if (displayable == null || texture == null || !drawInfo.Visible) { return; } Texture2D xnaTec = GetTexture(texture.ID); XNAColor color = XNAColor.White; int drawIndex = 0; var topLeft = GetScreenPoint(displayable); XNARec src = GetTextureCell(texture, cell); XNARec dest = new XNARec((int)topLeft.X, (int)topLeft.Y, src.Width, src.Height); Rectangle dest1 = new Rectangle(topLeft.X, topLeft.Y, displayable.Position.Width, displayable.Position.Height); Rectangle dest2 = new Rectangle(0, 0, src.Width, src.Height); switch (texture.AnchorOrigin) { case AnchorOrigin.BottomCenter: dest2.BottomCenter = dest1.BottomCenter; break; case AnchorOrigin.Center: dest2.Center = dest1.Center; break; default: throw new NotImplementedException(); } if (texture.CellAnchorOffset != null) { dest2.Translate(texture.CellAnchorOffset.Value.Flip(drawInfo.FlipX, drawInfo.FlipY)); } var dest3 = new XNARec((int)dest2.Left, (int)dest2.Top, (int)dest2.Width, (int)dest2.Height); SpriteEffects flip = SpriteEffects.None; if (!drawInfo.FlipOffsetsOnly) { if (drawInfo.FlipX) { flip = flip | SpriteEffects.FlipHorizontally; } if (drawInfo.FlipY) { flip = flip | SpriteEffects.FlipVertically; } } spriteBatch.Draw(xnaTec, dest3, src, color, 0, Vector2.Zero, flip, 0); drawIndex++; }
private ViewUserControl CreateContainer(IDisplayable displayable) { var viewData = new ViewDataDictionary(CurrentItem); var container = new ViewUserControl { Page = (Html.ViewContext.View is Control) ? ((Control)Html.ViewContext.View).Page : null, ViewData = viewData, }; displayable.AddTo(CurrentItem, propertyName, container); return container; }
public virtual Int32 CompareTo(IDisplayable displayable) { return displayable is TextBox ? String.Compare(Name, displayable.Name, StringComparison.Ordinal) : -1; }
public override Int32 CompareTo(IDisplayable displayable) { return displayable is PageHeader ? String.Compare(Name, displayable.Name, StringComparison.Ordinal) : -1; }
private float NormalizeValue(IDisplayable value) { return(Mathf.InverseLerp(0, value.GetMaxValue(), value.GetCurrentValue())); }