Exemple #1
0
 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();
 }
Exemple #2
0
 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;
 }
Exemple #3
0
    /** 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);
 }
Exemple #5
0
 /// <summary>
 /// Removes the block from the Display panel.
 /// </summary>
 /// <param name="block"></param>
 public void Remove(IDisplayable block)
 {
     panel.Controls.Remove(block.Control);
 }
Exemple #6
0
 /// <summary>
 /// adds the block to the panel.
 /// </summary>
 /// <param name="block"></param>
 private void AddToPanel(IDisplayable block)
 {
     panel.Controls.Add(block.Control);
 }
Exemple #7
0
 internal TError ApplyTo <TError>(IDisplayable <TError> target)
 {
     return(_setter.SetDisplay(target));
 }
Exemple #8
0
 public Int32 CompareTo(IDisplayable displayable)
 {
     return displayable is TablixRow
                ? String.Compare(Name, displayable.Name, StringComparison.Ordinal)
                : -1;
 }
Exemple #9
0
 /// <summary>
 /// Loads the image given to display it onto this ImageBox.
 /// </summary>
 public void Load(IDisplayable image)
 {
     Display = image;
     this.Invalidate();
 }
Exemple #10
0
 static void DisplayYourself(IDisplayable myObject)
 {
     //Any objected passed into this method must have a Display() method implemented.
     myObject.Display();
 }
Exemple #11
0
 public IAuditContextManager SetObject(IDisplayable displayable)
 {
     CurrentContextData.Displayable = displayable;
     return(this);
 }
Exemple #12
0
 /// <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";
Exemple #13
0
 public TError SetDisplay <TError>(IDisplayable <TError> target)
 {
     return(target.ApplyEcoreWindow(_windowHandle));
 }
Exemple #14
0
 public TError SetDisplay <TError>(IDisplayable <TError> target)
 {
     return(target.ApplyEvasDisplay(_type, _target));
 }
Exemple #15
0
        public void Core_UpdateDisplay(IDisplayable display)
        {
            OAM_ImageBox.Load(display);

            Tileset_ImageBox.Load(Tiles.ToImage(32, 8, Colors.ToBytes(false)));
        }
Exemple #16
0
 /// <summary>
 /// Resets the dispay of this ImageBox (show the default gray rectangle)
 /// </summary>
 public void Reset()
 {
     Display = null;
     this.Invalidate();
 }
Exemple #17
0
 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;
 }
Exemple #20
0
 /// <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);
 }
Exemple #21
0
 /// <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;
 }
Exemple #23
0
 /// <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 };
 }
Exemple #24
0
 protected Duck(IDisplayable displayable, ISwimable swimable)
 {
     this.displayable = displayable;
     this.swimable    = swimable;
 }
Exemple #25
0
 /// <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;
     }
 }
Exemple #26
0
 static void DisplayObject(IDisplayable data)
 {
     Console.WriteLine(data.GetDisplayText());
 }
Exemple #27
0
 public void Display(IDisplayable displayable)
 {
     Console.WriteLine($"Drawing {displayable.GetDisplayableType()}, {displayable.GetName()}, in low resolution");
 }
 public virtual void Execute(IDisplayable entity)
 {
 }
Exemple #29
0
 public static bool CollidesWith(this IDisplayable element1, IDisplayable element2)
 {
     return(!(element1.Position.DistanceTo(element2.Position) > element1.Size));
 }
Exemple #30
0
 public virtual void SetVisible(IDisplayable value)
 {
     gameObject.SetActive(value != null);
 }
Exemple #31
0
 public void AddItem(IDisplayable item)
 {
     Items.Add(item);
     PerformLayout();
 }
Exemple #32
0
 public virtual void UpdateUI(IDisplayable value)
 {
     SetVisible(value);
 }
Exemple #33
0
        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());
            }
        }
Exemple #34
0
 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);
 }
Exemple #36
0
        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++;
        }
Exemple #37
0
        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;
        }
Exemple #38
0
 public virtual Int32 CompareTo(IDisplayable displayable)
 {
     return displayable is TextBox
                ? String.Compare(Name, displayable.Name, StringComparison.Ordinal)
                : -1;
 }
Exemple #39
0
 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()));
 }