Last active
January 21, 2016 05:19
-
-
Save jesulink2514/69c0c4743748cd69d8cf to your computer and use it in GitHub Desktop.
struct Size para el frameworkBootstrap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace RefactorView.Infraestructure.Html | |
{ | |
public struct Size | |
{ | |
public Size(byte lg,byte md,byte sm,byte xs) | |
{ | |
this.Lg = lg; | |
this.Md = md; | |
this.Sm = sm; | |
this.Xs = xs; | |
} | |
public byte Lg { get; set; } | |
public byte Md { get; set; } | |
public byte Sm { get; set; } | |
public byte Xs { get; set; } | |
public override string ToString() | |
{ | |
return $"col-lg-{Lg} col-md-{Md} col-sm-{Sm} col-xs-{Xs}"; | |
} | |
private byte CalcComplement(byte val) | |
{ | |
if (val == 12) return 12; | |
return (byte)(12 - val); | |
} | |
public Size GetComplement() | |
{ | |
return new Size(CalcComplement(Lg), CalcComplement(Md), CalcComplement(Sm), CalcComplement(Xs)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment