2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,6 +6,6 @@
|
|||||||
Dotfuscated/*
|
Dotfuscated/*
|
||||||
Published/*
|
Published/*
|
||||||
|
|
||||||
VAR.Focus.Web/priv/*.json
|
VAR.Focus.WebApp/priv/*.json
|
||||||
.vs
|
.vs
|
||||||
packages/*
|
packages/*
|
||||||
|
|||||||
@@ -1,109 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Web;
|
|
||||||
using VAR.Focus.BusinessLogic;
|
|
||||||
using VAR.Focus.BusinessLogic.Entities;
|
|
||||||
|
|
||||||
namespace VAR.Focus.Web.Code
|
|
||||||
{
|
|
||||||
public class WebSessions
|
|
||||||
{
|
|
||||||
#region Declarations
|
|
||||||
|
|
||||||
private static WebSessions _currentInstance = null;
|
|
||||||
|
|
||||||
private string _cookieName = "FocusSID";
|
|
||||||
private int _cookieExpirationDays = 30;
|
|
||||||
|
|
||||||
#endregion Declarations
|
|
||||||
|
|
||||||
#region Properties
|
|
||||||
|
|
||||||
public static WebSessions Current
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_currentInstance == null)
|
|
||||||
{
|
|
||||||
_currentInstance = new WebSessions();
|
|
||||||
}
|
|
||||||
return _currentInstance;
|
|
||||||
}
|
|
||||||
set { _currentInstance = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public string CookieName
|
|
||||||
{
|
|
||||||
get { return _cookieName; }
|
|
||||||
set { _cookieName = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int CookieExpirationDays
|
|
||||||
{
|
|
||||||
get { return _cookieExpirationDays; }
|
|
||||||
set { _cookieExpirationDays = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Properties
|
|
||||||
|
|
||||||
#region Public methods
|
|
||||||
|
|
||||||
public void Session_SetCookie(HttpContext context, Session session)
|
|
||||||
{
|
|
||||||
HttpCookie cookie = new HttpCookie(_cookieName, session.SessionToken);
|
|
||||||
cookie.Expires = DateTime.Now.AddDays(_cookieExpirationDays);
|
|
||||||
context.Response.Cookies.Add(cookie);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Session_Init(HttpContext context, string userName)
|
|
||||||
{
|
|
||||||
Session session = Sessions.Current.Session_Create(userName);
|
|
||||||
Session_SetCookie(context, session);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Session Session_GetCurrent(HttpContext context)
|
|
||||||
{
|
|
||||||
HttpCookie cookie = context.Request.Cookies[_cookieName];
|
|
||||||
if (cookie == null) { return null; }
|
|
||||||
|
|
||||||
string sessionToken = cookie.Value;
|
|
||||||
if (string.IsNullOrEmpty(sessionToken)) { return null; }
|
|
||||||
|
|
||||||
Session session = Sessions.Current.Session_GetByToken(sessionToken);
|
|
||||||
return session;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Session_FinalizeCurrent(HttpContext context)
|
|
||||||
{
|
|
||||||
Session session = Session_GetCurrent(context);
|
|
||||||
if (Sessions.Current.Session_Delete(session) == false) { return false; }
|
|
||||||
|
|
||||||
HttpCookie cookie = new HttpCookie(_cookieName);
|
|
||||||
cookie.Expires = DateTime.Now.AddDays(-1d);
|
|
||||||
context.Response.Cookies.Add(cookie);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Session_IsUserAuthenticated(HttpContext context)
|
|
||||||
{
|
|
||||||
Session session = Session_GetCurrent(context);
|
|
||||||
if (session == null) { return false; }
|
|
||||||
User user = Users.Current.User_GetByName(session.UserName);
|
|
||||||
if (user == null) { return false; }
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public User Session_GetCurrentUser(HttpContext context)
|
|
||||||
{
|
|
||||||
Session session = Session_GetCurrent(context);
|
|
||||||
if (session == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
User user = Users.Current.User_GetByName(session.UserName);
|
|
||||||
return user;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Public methods
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,169 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.Web.UI;
|
|
||||||
using System.Web.UI.WebControls;
|
|
||||||
using VAR.Focus.Web.Pages;
|
|
||||||
using VAR.Json;
|
|
||||||
using VAR.WebForms.Common.Code;
|
|
||||||
|
|
||||||
namespace VAR.Focus.Web.Controls
|
|
||||||
{
|
|
||||||
public class CtrCardBoard : Control, INamingContainer
|
|
||||||
{
|
|
||||||
#region Declarations
|
|
||||||
|
|
||||||
private string _serviceUrl = nameof(HndCardBoard);
|
|
||||||
|
|
||||||
private int _idBoard = 0;
|
|
||||||
|
|
||||||
private string _userName = string.Empty;
|
|
||||||
|
|
||||||
private int _timePoolData = 10000;
|
|
||||||
|
|
||||||
private int _timeRefresh = 20;
|
|
||||||
|
|
||||||
private int _timeRefreshDisconnected = 5000;
|
|
||||||
|
|
||||||
private int _timeMoveAnimation = 500;
|
|
||||||
|
|
||||||
private int _defaultCardWidth = 200;
|
|
||||||
|
|
||||||
private int _defaultCardHeight = 150;
|
|
||||||
|
|
||||||
private int _defaultRegionWidth = 300;
|
|
||||||
|
|
||||||
private int _defaultRegionHeight = 500;
|
|
||||||
|
|
||||||
#endregion Declarations
|
|
||||||
|
|
||||||
#region Properties
|
|
||||||
|
|
||||||
public string ServiceUrl
|
|
||||||
{
|
|
||||||
get { return _serviceUrl; }
|
|
||||||
set { _serviceUrl = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int IDBoard
|
|
||||||
{
|
|
||||||
get { return _idBoard; }
|
|
||||||
set { _idBoard = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public string UserName
|
|
||||||
{
|
|
||||||
get { return _userName; }
|
|
||||||
set { _userName = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int TimePoolData
|
|
||||||
{
|
|
||||||
get { return _timePoolData; }
|
|
||||||
set { _timePoolData = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int TimeRefresh
|
|
||||||
{
|
|
||||||
get { return _timeRefresh; }
|
|
||||||
set { _timeRefresh = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int TimeRefreshDisconnected
|
|
||||||
{
|
|
||||||
get { return _timeRefreshDisconnected; }
|
|
||||||
set { _timeRefreshDisconnected = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int TimeMoveAnimation
|
|
||||||
{
|
|
||||||
get { return _timeMoveAnimation; }
|
|
||||||
set { _timeMoveAnimation = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private int DefaultCardWidth
|
|
||||||
{
|
|
||||||
get { return _defaultCardWidth; }
|
|
||||||
set { _defaultCardWidth = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private int DefaultCardHeight
|
|
||||||
{
|
|
||||||
get { return _defaultCardHeight; }
|
|
||||||
set { _defaultCardHeight = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private int DefaultRegionWidth
|
|
||||||
{
|
|
||||||
get { return _defaultRegionWidth; }
|
|
||||||
set { _defaultRegionWidth = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private int DefaultRegionHeight
|
|
||||||
{
|
|
||||||
get { return _defaultRegionHeight; }
|
|
||||||
set { _defaultRegionHeight = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Properties
|
|
||||||
|
|
||||||
#region Control Life cycle
|
|
||||||
|
|
||||||
public CtrCardBoard()
|
|
||||||
{
|
|
||||||
Init += ChatControl_Init;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ChatControl_Init(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
InitializeControls();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Control Life cycle
|
|
||||||
|
|
||||||
#region Private methods
|
|
||||||
|
|
||||||
private void InitializeControls()
|
|
||||||
{
|
|
||||||
Panel divBoard = new Panel { ID = "divBoard", CssClass = "divBoard" };
|
|
||||||
Controls.Add(divBoard);
|
|
||||||
|
|
||||||
string strCfgName = string.Format("{0}_cfg", ClientID);
|
|
||||||
Dictionary<string, object> cfg = new Dictionary<string, object>
|
|
||||||
{
|
|
||||||
{"divBoard", divBoard.ClientID},
|
|
||||||
{"IDBoard", _idBoard},
|
|
||||||
{"UserName", _userName},
|
|
||||||
{"EditBoardUrl", FrmBoardEdit.GetUrl(_idBoard)},
|
|
||||||
{"IDCardEvent", string.Empty},
|
|
||||||
{"ServiceUrl", _serviceUrl},
|
|
||||||
{"TimePoolData", _timePoolData},
|
|
||||||
{"TimeRefresh", _timeRefresh},
|
|
||||||
{"TimeRefreshDisconnected", _timeRefreshDisconnected},
|
|
||||||
{"TimeMoveAnimation", _timeMoveAnimation},
|
|
||||||
{"DefaultCardWidth", _defaultCardWidth},
|
|
||||||
{"DefaultCardHeight", _defaultCardHeight},
|
|
||||||
{"DefaultRegionWidth", _defaultRegionWidth},
|
|
||||||
{"DefaultRegionHeight", _defaultRegionHeight},
|
|
||||||
{"Texts", new Dictionary<string, object> {
|
|
||||||
{"Toolbox", MultiLang.GetLiteral( "Toolbox")},
|
|
||||||
{"AddCard", MultiLang.GetLiteral("AddCard")},
|
|
||||||
{"AddRegion", MultiLang.GetLiteral("AddRegion")},
|
|
||||||
{"EditBoard", MultiLang.GetLiteral("Config")},
|
|
||||||
{"Accept", MultiLang.GetLiteral("Accept")},
|
|
||||||
{"Cancel", MultiLang.GetLiteral("Cancel")},
|
|
||||||
{"ConfirmDelete", MultiLang.GetLiteral("ConfirmDelete")},
|
|
||||||
} },
|
|
||||||
};
|
|
||||||
StringBuilder sbCfg = new StringBuilder();
|
|
||||||
sbCfg.AppendFormat("<script>\n");
|
|
||||||
sbCfg.AppendFormat("var {0} = {1};\n", strCfgName, JsonWriter.WriteObject(cfg));
|
|
||||||
sbCfg.AppendFormat("RunCardBoard({0});\n", strCfgName);
|
|
||||||
sbCfg.AppendFormat("</script>\n");
|
|
||||||
LiteralControl liScript = new LiteralControl(sbCfg.ToString());
|
|
||||||
Controls.Add(liScript);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Private methods
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,171 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.Web.UI;
|
|
||||||
using System.Web.UI.WebControls;
|
|
||||||
using VAR.Json;
|
|
||||||
using VAR.WebForms.Common.Code;
|
|
||||||
using VAR.WebForms.Common.Controls;
|
|
||||||
|
|
||||||
namespace VAR.Focus.Web.Controls
|
|
||||||
{
|
|
||||||
public class CtrChat : Control, INamingContainer
|
|
||||||
{
|
|
||||||
#region Declarations
|
|
||||||
|
|
||||||
private string _serviceUrl = nameof(HndChat);
|
|
||||||
|
|
||||||
private string _idMessageBoard = null;
|
|
||||||
|
|
||||||
private string _userName = string.Empty;
|
|
||||||
|
|
||||||
private int _timePoolData = 10000;
|
|
||||||
|
|
||||||
private Unit _width = new Unit(500, UnitType.Pixel);
|
|
||||||
private Unit _height = new Unit(300, UnitType.Pixel);
|
|
||||||
|
|
||||||
private Panel _divChatWindow = null;
|
|
||||||
private Panel _divChatContainer = null;
|
|
||||||
private Panel _divChatTitleBar = null;
|
|
||||||
|
|
||||||
#endregion Declarations
|
|
||||||
|
|
||||||
#region Properties
|
|
||||||
|
|
||||||
public string ServiceUrl
|
|
||||||
{
|
|
||||||
get { return _serviceUrl; }
|
|
||||||
set { _serviceUrl = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public string IDMessageBoard
|
|
||||||
{
|
|
||||||
get { return _idMessageBoard; }
|
|
||||||
set { _idMessageBoard = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public string UserName
|
|
||||||
{
|
|
||||||
get { return _userName; }
|
|
||||||
set { _userName = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int TimePoolData
|
|
||||||
{
|
|
||||||
get { return _timePoolData; }
|
|
||||||
set { _timePoolData = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public Unit Width
|
|
||||||
{
|
|
||||||
get { return _width; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_width = value;
|
|
||||||
if (_divChatContainer != null)
|
|
||||||
{
|
|
||||||
_divChatContainer.Width = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Unit Height
|
|
||||||
{
|
|
||||||
get { return _height; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_height = value;
|
|
||||||
if (_divChatContainer != null)
|
|
||||||
{
|
|
||||||
_divChatContainer.Height = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Properties
|
|
||||||
|
|
||||||
#region Control Life cycle
|
|
||||||
|
|
||||||
public CtrChat()
|
|
||||||
{
|
|
||||||
Init += ChatControl_Init;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ChatControl_Init(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
InitializeControls();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Control Life cycle
|
|
||||||
|
|
||||||
#region Private methods
|
|
||||||
|
|
||||||
private void InitializeControls()
|
|
||||||
{
|
|
||||||
string strCfgName = string.Format("{0}_cfg", ClientID);
|
|
||||||
|
|
||||||
_divChatWindow = new Panel { ID = "divChatWindow", CssClass = "divChatWindow" };
|
|
||||||
Controls.Add(_divChatWindow);
|
|
||||||
|
|
||||||
_divChatTitleBar = new Panel { ID = "divChatTitleBar", CssClass = "divChatTitleBar" };
|
|
||||||
_divChatWindow.Controls.Add(_divChatTitleBar);
|
|
||||||
|
|
||||||
CLabel lblTitle = new CLabel();
|
|
||||||
lblTitle.ID = "lblTitle";
|
|
||||||
_divChatTitleBar.Controls.Add(lblTitle);
|
|
||||||
|
|
||||||
_divChatContainer = new Panel { ID = "divChatContainer", CssClass = "divChatContainer" };
|
|
||||||
_divChatWindow.Controls.Add(_divChatContainer);
|
|
||||||
_divChatContainer.Width = 0;
|
|
||||||
_divChatContainer.Height = 0;
|
|
||||||
|
|
||||||
var divChat = new Panel { ID = "divChat", CssClass = "divChat" };
|
|
||||||
_divChatContainer.Controls.Add(divChat);
|
|
||||||
|
|
||||||
var divChatControls = new Panel { ID = "divChatControls", CssClass = "divChatControls" };
|
|
||||||
_divChatContainer.Controls.Add(divChatControls);
|
|
||||||
|
|
||||||
var txtText = new TextBox { ID = "txtText", CssClass = "chatTextBox" };
|
|
||||||
txtText.Attributes.Add("autocomplete", "off");
|
|
||||||
txtText.Attributes.Add("onkeydown", string.Format("if(event.keyCode==13){{SendChat({0}); return false;}}", strCfgName));
|
|
||||||
divChatControls.Controls.Add(txtText);
|
|
||||||
|
|
||||||
var btnSend = new Button { ID = "btnSend", Text = MultiLang.GetLiteral("ChatSend"), CssClass = "chatButton" };
|
|
||||||
divChatControls.Controls.Add(btnSend);
|
|
||||||
btnSend.Attributes.Add("onclick", string.Format("SendChat({0}); return false;", strCfgName));
|
|
||||||
|
|
||||||
Dictionary<string, object> cfg = new Dictionary<string, object>
|
|
||||||
{
|
|
||||||
{"divChatWindow", _divChatWindow.ClientID},
|
|
||||||
{"divChatTitleBar", _divChatTitleBar.ClientID},
|
|
||||||
{"lblTitle", lblTitle.ClientID},
|
|
||||||
{"divChatContainer", _divChatContainer.ClientID},
|
|
||||||
{"divChatContainerWidth", _width.ToString()},
|
|
||||||
{"divChatContainerHeight", _height.ToString()},
|
|
||||||
{"divChat", divChat.ClientID},
|
|
||||||
{"txtText", txtText.ClientID},
|
|
||||||
{"btnSend", btnSend.ClientID},
|
|
||||||
{"IDMessageBoard", _idMessageBoard},
|
|
||||||
{"UserName", _userName},
|
|
||||||
{"IDMessage", 0},
|
|
||||||
{"ServiceUrl", _serviceUrl},
|
|
||||||
{"TimePoolData", _timePoolData},
|
|
||||||
{"Texts", new Dictionary<string, object> {
|
|
||||||
{"Chat", MultiLang.GetLiteral("Chat")},
|
|
||||||
{"Close", MultiLang.GetLiteral("ChatClose")},
|
|
||||||
{"NewMessages", MultiLang.GetLiteral("ChatNewMessages")},
|
|
||||||
{"Disconnected", MultiLang.GetLiteral("Disconnected")},
|
|
||||||
} },
|
|
||||||
};
|
|
||||||
StringBuilder sbCfg = new StringBuilder();
|
|
||||||
sbCfg.AppendFormat("<script>\n");
|
|
||||||
sbCfg.AppendFormat("var {0} = {1};\n", strCfgName, JsonWriter.WriteObject(cfg));
|
|
||||||
sbCfg.AppendFormat("RunChat({0});\n", strCfgName);
|
|
||||||
sbCfg.AppendFormat("</script>\n");
|
|
||||||
LiteralControl liScript = new LiteralControl(sbCfg.ToString());
|
|
||||||
Controls.Add(liScript);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Private methods
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,273 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Web;
|
|
||||||
using VAR.Focus.BusinessLogic;
|
|
||||||
using VAR.Focus.BusinessLogic.Entities;
|
|
||||||
using VAR.Focus.BusinessLogic.Persistence;
|
|
||||||
using VAR.Focus.Web.Code;
|
|
||||||
using VAR.WebForms.Common.Code;
|
|
||||||
|
|
||||||
namespace VAR.Focus.Web.Controls
|
|
||||||
{
|
|
||||||
public class HndCardBoard : IHttpHandler
|
|
||||||
{
|
|
||||||
#region Declarations
|
|
||||||
|
|
||||||
private const int MaxWaitLoops = 5;
|
|
||||||
|
|
||||||
private static object _monitor = new object();
|
|
||||||
private static Dictionary<int, CardBoard> _cardBoards = new Dictionary<int, CardBoard>();
|
|
||||||
|
|
||||||
#endregion Declarations
|
|
||||||
|
|
||||||
#region IHttpHandler
|
|
||||||
|
|
||||||
public bool IsReusable
|
|
||||||
{
|
|
||||||
get { return false; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ProcessRequest(HttpContext context)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (context.Request.RequestType == "GET")
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(context.GetRequestParm("IDCardEvent")))
|
|
||||||
{
|
|
||||||
ProcessInitializationReciver(context);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ProcessEventReciver(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (context.Request.RequestType == "POST")
|
|
||||||
{
|
|
||||||
ProcessEventSender(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
context.ResponseObject(new OperationStatus { IsOK = false, Message = ex.Message, });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion IHttpHandler
|
|
||||||
|
|
||||||
#region Private methods
|
|
||||||
|
|
||||||
private void ProcessInitializationReciver(HttpContext context)
|
|
||||||
{
|
|
||||||
int idBoard = Convert.ToInt32(context.GetRequestParm("IDBoard"));
|
|
||||||
CardBoard cardBoard;
|
|
||||||
if (_cardBoards.ContainsKey(idBoard) == false)
|
|
||||||
{
|
|
||||||
lock (_cardBoards)
|
|
||||||
{
|
|
||||||
if (_cardBoards.ContainsKey(idBoard) == false)
|
|
||||||
{
|
|
||||||
cardBoard = new CardBoard(idBoard, new JsonFilePersistence());
|
|
||||||
_cardBoards[idBoard] = cardBoard;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_cardBoards.ContainsKey(idBoard))
|
|
||||||
{
|
|
||||||
cardBoard = _cardBoards[idBoard];
|
|
||||||
List<Card> listCards = cardBoard.Cards_Status();
|
|
||||||
List<Region> listRegions = cardBoard.Regions_Status();
|
|
||||||
List<IBoardEvent> listEvents = new List<IBoardEvent>();
|
|
||||||
int lastIDCardEvent = cardBoard.GetLastIDCardEvent();
|
|
||||||
int lastIDCard = cardBoard.GetLastIDCard();
|
|
||||||
listEvents = new List<IBoardEvent>();
|
|
||||||
if (listRegions.Count > 0)
|
|
||||||
{
|
|
||||||
listEvents.AddRange(CardBoard.ConvertRegionsToEvents(listRegions, lastIDCardEvent));
|
|
||||||
}
|
|
||||||
if (listCards.Count > 0)
|
|
||||||
{
|
|
||||||
listEvents.AddRange(CardBoard.ConvertCardsToEvents(listCards, lastIDCardEvent));
|
|
||||||
}
|
|
||||||
context.ResponseObject(listEvents);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private CardBoard GetCardBoard(int idBoard)
|
|
||||||
{
|
|
||||||
CardBoard cardBoard = null;
|
|
||||||
if (_cardBoards.ContainsKey(idBoard) == false)
|
|
||||||
{
|
|
||||||
lock (_cardBoards)
|
|
||||||
{
|
|
||||||
if (_cardBoards.ContainsKey(idBoard) == false)
|
|
||||||
{
|
|
||||||
cardBoard = new CardBoard(idBoard, new JsonFilePersistence());
|
|
||||||
_cardBoards[idBoard] = cardBoard;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cardBoard = _cardBoards[idBoard];
|
|
||||||
return cardBoard;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ProcessEventReciver(HttpContext context)
|
|
||||||
{
|
|
||||||
int idBoard = Convert.ToInt32(context.GetRequestParm("IDBoard"));
|
|
||||||
int idCardEvent = Convert.ToInt32(context.GetRequestParm("IDCardEvent"));
|
|
||||||
string strTimePoolData = context.GetRequestParm("TimePoolData");
|
|
||||||
int timePoolData = Convert.ToInt32(string.IsNullOrEmpty(strTimePoolData) ? "0" : strTimePoolData);
|
|
||||||
|
|
||||||
CardBoard cardBoard = GetCardBoard(idBoard);
|
|
||||||
int waitCount = (timePoolData > 0) ? MaxWaitLoops : 0;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
List<IBoardEvent> listMessages = cardBoard.Cards_GetEventList(idCardEvent);
|
|
||||||
if (listMessages.Count > 0)
|
|
||||||
{
|
|
||||||
waitCount = 0;
|
|
||||||
context.ResponseObject(listMessages);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (waitCount > 0)
|
|
||||||
{
|
|
||||||
lock (_monitor) { Monitor.Wait(_monitor, timePoolData); }
|
|
||||||
waitCount--;
|
|
||||||
}
|
|
||||||
} while (waitCount > 0);
|
|
||||||
context.ResponseObject(new List<Message>());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ProcessEventSender(HttpContext context)
|
|
||||||
{
|
|
||||||
Session session = WebSessions.Current.Session_GetCurrent(context);
|
|
||||||
string currentUserName = session.UserName;
|
|
||||||
string strIDBoard = context.GetRequestParm("IDBoard");
|
|
||||||
int idBoard = Convert.ToInt32(string.IsNullOrEmpty(strIDBoard) ? "0" : strIDBoard);
|
|
||||||
string command = context.GetRequestParm("Command");
|
|
||||||
int idCard = 0;
|
|
||||||
int idRegion = 0;
|
|
||||||
bool done = false;
|
|
||||||
CardBoard cardBoard = GetCardBoard(idBoard);
|
|
||||||
lock (cardBoard)
|
|
||||||
{
|
|
||||||
if (command == "CardCreate")
|
|
||||||
{
|
|
||||||
string title = context.GetRequestParm("Title");
|
|
||||||
string body = context.GetRequestParm("Body");
|
|
||||||
int x = Convert.ToInt32(context.GetRequestParm("X"));
|
|
||||||
int y = Convert.ToInt32(context.GetRequestParm("Y"));
|
|
||||||
int width = Convert.ToInt32(context.GetRequestParm("Width"));
|
|
||||||
int height = Convert.ToInt32(context.GetRequestParm("Height"));
|
|
||||||
int locked = Convert.ToInt32(context.GetRequestParm("Locked"));
|
|
||||||
idCard = cardBoard.Card_Create(title, body, x, y, width, height, locked != 0, currentUserName);
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
if (command == "CardMove")
|
|
||||||
{
|
|
||||||
idCard = Convert.ToInt32(context.GetRequestParm("IDCard"));
|
|
||||||
int x = Convert.ToInt32(context.GetRequestParm("X"));
|
|
||||||
int y = Convert.ToInt32(context.GetRequestParm("Y"));
|
|
||||||
cardBoard.Card_Move(idCard, x, y, currentUserName);
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
if (command == "CardResize")
|
|
||||||
{
|
|
||||||
idCard = Convert.ToInt32(context.GetRequestParm("IDCard"));
|
|
||||||
int width = Convert.ToInt32(context.GetRequestParm("Width"));
|
|
||||||
int height = Convert.ToInt32(context.GetRequestParm("Height"));
|
|
||||||
cardBoard.Card_Resize(idCard, width, height, currentUserName);
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
if (command == "CardEdit")
|
|
||||||
{
|
|
||||||
idCard = Convert.ToInt32(context.GetRequestParm("IDCard"));
|
|
||||||
string title = context.GetRequestParm("Title");
|
|
||||||
string body = context.GetRequestParm("Body");
|
|
||||||
cardBoard.Card_Edit(idCard, title, body, currentUserName);
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
if (command == "CardLock")
|
|
||||||
{
|
|
||||||
idCard = Convert.ToInt32(context.GetRequestParm("IDCard"));
|
|
||||||
int locked = Convert.ToInt32(context.GetRequestParm("Locked"));
|
|
||||||
cardBoard.Card_Lock(idCard, locked != 0, currentUserName);
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
if (command == "CardDelete")
|
|
||||||
{
|
|
||||||
idCard = Convert.ToInt32(context.GetRequestParm("IDCard"));
|
|
||||||
cardBoard.Card_Delete(idCard, currentUserName);
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
if (command == "RegionCreate")
|
|
||||||
{
|
|
||||||
string title = context.GetRequestParm("Title");
|
|
||||||
int x = Convert.ToInt32(context.GetRequestParm("X"));
|
|
||||||
int y = Convert.ToInt32(context.GetRequestParm("Y"));
|
|
||||||
int width = Convert.ToInt32(context.GetRequestParm("Width"));
|
|
||||||
int height = Convert.ToInt32(context.GetRequestParm("Height"));
|
|
||||||
int locked = Convert.ToInt32(context.GetRequestParm("Locked"));
|
|
||||||
idRegion = cardBoard.Region_Create(title, x, y, width, height, locked != 0, currentUserName);
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
if (command == "RegionMove")
|
|
||||||
{
|
|
||||||
idRegion = Convert.ToInt32(context.GetRequestParm("IDRegion"));
|
|
||||||
int x = Convert.ToInt32(context.GetRequestParm("X"));
|
|
||||||
int y = Convert.ToInt32(context.GetRequestParm("Y"));
|
|
||||||
cardBoard.Region_Move(idRegion, x, y, currentUserName);
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
if (command == "RegionResize")
|
|
||||||
{
|
|
||||||
idRegion = Convert.ToInt32(context.GetRequestParm("IDRegion"));
|
|
||||||
int width = Convert.ToInt32(context.GetRequestParm("Width"));
|
|
||||||
int height = Convert.ToInt32(context.GetRequestParm("Height"));
|
|
||||||
cardBoard.Region_Resize(idRegion, width, height, currentUserName);
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
if (command == "RegionEdit")
|
|
||||||
{
|
|
||||||
idRegion = Convert.ToInt32(context.GetRequestParm("IDRegion"));
|
|
||||||
string title = context.GetRequestParm("Title");
|
|
||||||
cardBoard.Region_Edit(idRegion, title, currentUserName);
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
if (command == "RegionLock")
|
|
||||||
{
|
|
||||||
idRegion = Convert.ToInt32(context.GetRequestParm("IDRegion"));
|
|
||||||
int locked = Convert.ToInt32(context.GetRequestParm("Locked"));
|
|
||||||
cardBoard.Region_Lock(idRegion, locked != 0, currentUserName);
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
if (command == "RegionDelete")
|
|
||||||
{
|
|
||||||
idRegion = Convert.ToInt32(context.GetRequestParm("IDRegion"));
|
|
||||||
cardBoard.Region_Delete(idRegion, currentUserName);
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (done)
|
|
||||||
{
|
|
||||||
NotifyAll();
|
|
||||||
context.ResponseObject(new OperationStatus
|
|
||||||
{
|
|
||||||
IsOK = true,
|
|
||||||
Message = "Update successfully",
|
|
||||||
ReturnValue = Convert.ToString(idCard)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void NotifyAll()
|
|
||||||
{
|
|
||||||
lock (_monitor) { Monitor.PulseAll(_monitor); }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Private methods
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Web;
|
|
||||||
using VAR.Focus.BusinessLogic;
|
|
||||||
using VAR.Focus.BusinessLogic.Entities;
|
|
||||||
using VAR.Focus.BusinessLogic.Persistence;
|
|
||||||
using VAR.Focus.Web.Code;
|
|
||||||
using VAR.WebForms.Common.Code;
|
|
||||||
|
|
||||||
namespace VAR.Focus.Web.Controls
|
|
||||||
{
|
|
||||||
public class HndChat : IHttpHandler
|
|
||||||
{
|
|
||||||
#region Declarations
|
|
||||||
|
|
||||||
private const int MaxWaitLoops = 5;
|
|
||||||
|
|
||||||
private static object _monitor = new object();
|
|
||||||
private static Dictionary<string, MessageBoard> _chatBoards = new Dictionary<string, MessageBoard>();
|
|
||||||
|
|
||||||
#endregion Declarations
|
|
||||||
|
|
||||||
#region IHttpHandler
|
|
||||||
|
|
||||||
public bool IsReusable
|
|
||||||
{
|
|
||||||
get { return false; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ProcessRequest(HttpContext context)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (context.Request.RequestType == "GET")
|
|
||||||
{
|
|
||||||
ProcessReciver(context);
|
|
||||||
}
|
|
||||||
if (context.Request.RequestType == "POST")
|
|
||||||
{
|
|
||||||
ProcessSender(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
context.ResponseObject(new OperationStatus { IsOK = false, Message = ex.Message, });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion IHttpHandler
|
|
||||||
|
|
||||||
#region Private methods
|
|
||||||
|
|
||||||
private void ProcessReciver(HttpContext context)
|
|
||||||
{
|
|
||||||
string idMessageBoard = context.GetRequestParm("IDMessageBoard");
|
|
||||||
int idMessage = Convert.ToInt32(context.GetRequestParm("IDMessage"));
|
|
||||||
string strTimePoolData = context.GetRequestParm("TimePoolData");
|
|
||||||
int timePoolData = Convert.ToInt32(string.IsNullOrEmpty(strTimePoolData) ? "0" : strTimePoolData);
|
|
||||||
|
|
||||||
MessageBoard messageBoard;
|
|
||||||
int waitCount = (timePoolData > 0) ? MaxWaitLoops : 0;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (_chatBoards.ContainsKey(idMessageBoard) == false)
|
|
||||||
{
|
|
||||||
lock (_chatBoards)
|
|
||||||
{
|
|
||||||
if (_chatBoards.ContainsKey(idMessageBoard) == false)
|
|
||||||
{
|
|
||||||
messageBoard = new MessageBoard(idMessageBoard, new JsonFilePersistence());
|
|
||||||
_chatBoards[idMessageBoard] = messageBoard;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_chatBoards.ContainsKey(idMessageBoard))
|
|
||||||
{
|
|
||||||
messageBoard = _chatBoards[idMessageBoard];
|
|
||||||
List<Message> listMessages = messageBoard.Messages_GetList(idMessage);
|
|
||||||
if (listMessages.Count > 0)
|
|
||||||
{
|
|
||||||
waitCount = 0;
|
|
||||||
context.ResponseObject(listMessages);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (waitCount > 0)
|
|
||||||
{
|
|
||||||
lock (_monitor) { Monitor.Wait(_monitor, timePoolData); }
|
|
||||||
waitCount--;
|
|
||||||
}
|
|
||||||
} while (waitCount > 0);
|
|
||||||
context.ResponseObject(new List<Message>());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ProcessSender(HttpContext context)
|
|
||||||
{
|
|
||||||
string text = Convert.ToString(context.GetRequestParm("Text"));
|
|
||||||
string idMessageBoard = context.GetRequestParm("IDMessageBoard");
|
|
||||||
if (string.IsNullOrEmpty(idMessageBoard)) { idMessageBoard = "root"; }
|
|
||||||
string userName = Convert.ToString(context.GetRequestParm("UserName"));
|
|
||||||
Session session = WebSessions.Current.Session_GetCurrent(context);
|
|
||||||
if (session.UserName.ToLower() != userName.ToLower())
|
|
||||||
{
|
|
||||||
context.ResponseObject(new OperationStatus { IsOK = false, Message = "User mismatch" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
lock (_chatBoards)
|
|
||||||
{
|
|
||||||
MessageBoard messageBoard;
|
|
||||||
if (_chatBoards.ContainsKey(idMessageBoard))
|
|
||||||
{
|
|
||||||
messageBoard = _chatBoards[idMessageBoard];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
messageBoard = new MessageBoard(idMessageBoard, new JsonFilePersistence());
|
|
||||||
_chatBoards[idMessageBoard] = messageBoard;
|
|
||||||
}
|
|
||||||
messageBoard.Message_Add(userName, text);
|
|
||||||
lock (_monitor) { Monitor.PulseAll(_monitor); }
|
|
||||||
}
|
|
||||||
context.ResponseObject(new OperationStatus { IsOK = true, Message = "Message sent" });
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Private methods
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Web;
|
|
||||||
using VAR.Focus.Web.Code;
|
|
||||||
using VAR.Focus.Web.Pages;
|
|
||||||
using VAR.WebForms.Common.Code;
|
|
||||||
|
|
||||||
namespace VAR.Focus.Web
|
|
||||||
{
|
|
||||||
public class FocusGlobalConfig : IGlobalConfig
|
|
||||||
{
|
|
||||||
public string Title { get; } = "Focus";
|
|
||||||
public string TitleSeparator { get; } = " :: ";
|
|
||||||
public string Author { get; } = "Valeriano Alfonso Rodriguez";
|
|
||||||
public string Copyright { get; } = "Copyright (c) 2015-2020 by Valeriano Alfonso, All Right Reserved";
|
|
||||||
public string DefaultHandler { get; } = nameof(FrmBoard);
|
|
||||||
public string LoginHandler { get; } = nameof(FrmLogin);
|
|
||||||
public List<string> AllowedExtensions { get; } = new List<string> { ".png", ".jpg", ".jpeg", ".gif", ".ico", ".wav", ".mp3", ".ogg", ".mp4", ".webm", ".webp", ".mkv", ".avi" };
|
|
||||||
|
|
||||||
public bool IsUserAuthenticated(HttpContext context)
|
|
||||||
{
|
|
||||||
return WebSessions.Current.Session_IsUserAuthenticated(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UserUnauthenticate(HttpContext context)
|
|
||||||
{
|
|
||||||
WebSessions.Current.Session_FinalizeCurrent(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 458 KiB |
@@ -1,213 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Web;
|
|
||||||
using System.Web.UI.WebControls;
|
|
||||||
using VAR.Focus.BusinessLogic;
|
|
||||||
using VAR.Focus.BusinessLogic.Entities;
|
|
||||||
using VAR.Focus.Web.Code;
|
|
||||||
using VAR.Focus.Web.Controls;
|
|
||||||
using VAR.WebForms.Common.Code;
|
|
||||||
using VAR.WebForms.Common.Controls;
|
|
||||||
using VAR.WebForms.Common.Pages;
|
|
||||||
|
|
||||||
namespace VAR.Focus.Web.Pages
|
|
||||||
{
|
|
||||||
public class FrmBoard : PageCommon
|
|
||||||
{
|
|
||||||
#region Declarations
|
|
||||||
|
|
||||||
private int _idBoard = 0;
|
|
||||||
|
|
||||||
private CTextBox _txtTitle = new CTextBox { ID = "txtTitle", CssClassExtra = "width100pc", AllowEmpty = false, };
|
|
||||||
private CTextBox _txtDescription = new CTextBox { ID = "txtDescription", CssClassExtra = "width100pc", TextMode = TextBoxMode.MultiLine, KeepSize = true, };
|
|
||||||
|
|
||||||
#endregion Declarations
|
|
||||||
|
|
||||||
#region Life cycle
|
|
||||||
|
|
||||||
public FrmBoard()
|
|
||||||
{
|
|
||||||
Init += FrmBoard_Init;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void FrmBoard_Init(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string strIDBoard = Context.GetRequestParm("idBoard");
|
|
||||||
if (string.IsNullOrEmpty(strIDBoard) == false)
|
|
||||||
{
|
|
||||||
_idBoard = Convert.ToInt32(strIDBoard);
|
|
||||||
}
|
|
||||||
if (_idBoard == 0)
|
|
||||||
{
|
|
||||||
FrmBoard_InitIndex();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FrmBoard_InitBoard();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Life cycle
|
|
||||||
|
|
||||||
#region UI Events
|
|
||||||
|
|
||||||
private void btnAddBoard_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (FormUtils.Controls_AreValid(Controls) == false) { return; }
|
|
||||||
|
|
||||||
User user = WebSessions.Current.Session_GetCurrentUser(Context);
|
|
||||||
Board board = Boards.Current.Boards_SetBoard(0, _txtTitle.Text, _txtDescription.Text, null, user.Name);
|
|
||||||
_idBoard = board.IDBoard;
|
|
||||||
|
|
||||||
Response.Redirect(GetUrl(_idBoard));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BtnView_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
CButton btnView = (CButton)sender;
|
|
||||||
int idBoard = Convert.ToInt32(btnView.CommandArgument);
|
|
||||||
Response.Redirect(GetUrl(idBoard));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BtnEdit_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
CButton btnEdit = (CButton)sender;
|
|
||||||
int idBoard = Convert.ToInt32(btnEdit.CommandArgument);
|
|
||||||
Response.Redirect(FrmBoardEdit.GetUrl(idBoard, nameof(FrmBoard)));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BtnDelete_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
CButton btnEdit = (CButton)sender;
|
|
||||||
int idBoard = Convert.ToInt32(btnEdit.CommandArgument);
|
|
||||||
|
|
||||||
User user = WebSessions.Current.Session_GetCurrentUser(Context);
|
|
||||||
if (Boards.Current.Boards_DelBoard(idBoard, user.Name))
|
|
||||||
{
|
|
||||||
Controls.Clear();
|
|
||||||
FrmBoard_InitIndex();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion UI Events
|
|
||||||
|
|
||||||
#region Private methods
|
|
||||||
|
|
||||||
private Panel BoardSelector_Create(Board board)
|
|
||||||
{
|
|
||||||
var pnlBoardSelector = new Panel { CssClass = "boardBanner" };
|
|
||||||
|
|
||||||
var lnkTitle = new HyperLink
|
|
||||||
{
|
|
||||||
NavigateUrl = GetUrl(board.IDBoard),
|
|
||||||
};
|
|
||||||
var lblTitle = new CLabel
|
|
||||||
{
|
|
||||||
Text = board.Title,
|
|
||||||
CssClass = "title",
|
|
||||||
};
|
|
||||||
lnkTitle.Controls.Add(lblTitle);
|
|
||||||
pnlBoardSelector.Controls.Add(lnkTitle);
|
|
||||||
|
|
||||||
var lblDescription = new CLabel
|
|
||||||
{
|
|
||||||
Text = board.Description.Replace(" ", " ").Replace("\n", "<br>"),
|
|
||||||
CssClass = "description",
|
|
||||||
};
|
|
||||||
pnlBoardSelector.Controls.Add(FormUtils.CreatePanel("", lblDescription));
|
|
||||||
|
|
||||||
Panel pnlButtons = (Panel)FormUtils.CreatePanel("formRow");
|
|
||||||
var btnView = new CButton
|
|
||||||
{
|
|
||||||
ID = string.Format("btnView{0}", board.IDBoard),
|
|
||||||
Text = MultiLang.GetLiteral("View"),
|
|
||||||
};
|
|
||||||
btnView.CommandArgument = Convert.ToString(board.IDBoard);
|
|
||||||
btnView.Click += BtnView_Click;
|
|
||||||
pnlButtons.Controls.Add(btnView);
|
|
||||||
var btnEdit = new CButton
|
|
||||||
{
|
|
||||||
ID = string.Format("btnEdit{0}", board.IDBoard),
|
|
||||||
Text = MultiLang.GetLiteral("Edit"),
|
|
||||||
};
|
|
||||||
btnEdit.CommandArgument = Convert.ToString(board.IDBoard);
|
|
||||||
btnEdit.Click += BtnEdit_Click;
|
|
||||||
pnlButtons.Controls.Add(btnEdit);
|
|
||||||
var btnDelete = new CButton
|
|
||||||
{
|
|
||||||
ID = string.Format("btnDelete{0}", board.IDBoard),
|
|
||||||
Text = MultiLang.GetLiteral("Delete"),
|
|
||||||
};
|
|
||||||
btnDelete.CommandArgument = Convert.ToString(board.IDBoard);
|
|
||||||
btnDelete.Click += BtnDelete_Click;
|
|
||||||
btnDelete.Attributes.Add("onclick", string.Format("return confirm('{0}');", MultiLang.GetLiteral("ConfirmDelete")));
|
|
||||||
pnlButtons.Controls.Add(btnDelete);
|
|
||||||
pnlBoardSelector.Controls.Add(pnlButtons);
|
|
||||||
|
|
||||||
return pnlBoardSelector;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void FrmBoard_InitIndex()
|
|
||||||
{
|
|
||||||
Title = "Boards";
|
|
||||||
|
|
||||||
User user = WebSessions.Current.Session_GetCurrentUser(Context);
|
|
||||||
List<Board> boards = Boards.Current.Boards_GetListForUser(user?.Name);
|
|
||||||
foreach (Board board in boards)
|
|
||||||
{
|
|
||||||
Panel pnlBoardSelector = BoardSelector_Create(board);
|
|
||||||
Controls.Add(pnlBoardSelector);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Board creator
|
|
||||||
var pnlBoardAdd = new Panel { CssClass = "boardBanner" };
|
|
||||||
var btnAddBoard = new CButton { ID = "btnAddBoard", Text = MultiLang.GetLiteral("AddBoard") };
|
|
||||||
btnAddBoard.Click += btnAddBoard_Click;
|
|
||||||
pnlBoardAdd.Controls.Add(FormUtils.CreatePanel("formRow", _txtTitle));
|
|
||||||
_txtTitle.PlaceHolder = MultiLang.GetLiteral("Title");
|
|
||||||
pnlBoardAdd.Controls.Add(FormUtils.CreatePanel("formRow", _txtDescription));
|
|
||||||
_txtDescription.PlaceHolder = MultiLang.GetLiteral("Description");
|
|
||||||
pnlBoardAdd.Controls.Add(FormUtils.CreatePanel("formRow", btnAddBoard));
|
|
||||||
Controls.Add(pnlBoardAdd);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void FrmBoard_InitBoard()
|
|
||||||
{
|
|
||||||
User user = WebSessions.Current.Session_GetCurrentUser(Context);
|
|
||||||
Board board = Boards.Current.Board_GetByIDBoard(_idBoard);
|
|
||||||
|
|
||||||
Title = board.Title;
|
|
||||||
|
|
||||||
CtrCardBoard cardBoardControl = new CtrCardBoard
|
|
||||||
{
|
|
||||||
ID = "ctrCardBoard",
|
|
||||||
IDBoard = board.IDBoard,
|
|
||||||
UserName = user.Name,
|
|
||||||
};
|
|
||||||
Controls.Add(cardBoardControl);
|
|
||||||
|
|
||||||
CtrChat chatControl = new CtrChat
|
|
||||||
{
|
|
||||||
ID = "ctrChat",
|
|
||||||
IDMessageBoard = string.Format("CardBoard_{0}", board.IDBoard),
|
|
||||||
UserName = user.Name,
|
|
||||||
};
|
|
||||||
Controls.Add(chatControl);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Private methods
|
|
||||||
|
|
||||||
#region Public methods
|
|
||||||
|
|
||||||
public static string GetUrl(int idBoard, string returnUrl = null)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(returnUrl))
|
|
||||||
{
|
|
||||||
return string.Format("{0}?idBoard={1}", nameof(FrmBoard), idBoard);
|
|
||||||
}
|
|
||||||
return string.Format("{0}?idBoard={1}&returnUrl={2}", nameof(FrmBoard), idBoard, HttpUtility.UrlEncode(returnUrl));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Public methods
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,141 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Web;
|
|
||||||
using System.Web.UI.WebControls;
|
|
||||||
using VAR.Focus.BusinessLogic;
|
|
||||||
using VAR.Focus.BusinessLogic.Entities;
|
|
||||||
using VAR.Focus.Web.Code;
|
|
||||||
using VAR.WebForms.Common.Code;
|
|
||||||
using VAR.WebForms.Common.Controls;
|
|
||||||
using VAR.WebForms.Common.Pages;
|
|
||||||
|
|
||||||
namespace VAR.Focus.Web.Pages
|
|
||||||
{
|
|
||||||
public class FrmBoardEdit : PageCommon
|
|
||||||
{
|
|
||||||
#region Declarations
|
|
||||||
|
|
||||||
private int _idBoard = 0;
|
|
||||||
|
|
||||||
private CTextBox _txtTitle = new CTextBox { ID = "txtTitle", CssClassExtra = "width100pc", AllowEmpty = false };
|
|
||||||
private CTextBox _txtDescription = new CTextBox { ID = "txtDescription", CssClassExtra = "width100pc", TextMode = TextBoxMode.MultiLine, KeepSize = true, };
|
|
||||||
private CButton _btnSave = new CButton { ID = "btnSave" };
|
|
||||||
private CButton _btnExit = new CButton { ID = "btnExit" };
|
|
||||||
|
|
||||||
#endregion Declarations
|
|
||||||
|
|
||||||
#region Page life cycle
|
|
||||||
|
|
||||||
public FrmBoardEdit()
|
|
||||||
{
|
|
||||||
Init += FrmBoardEdit_Init;
|
|
||||||
Load += FrmBoardEdit_Load;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void FrmBoardEdit_Load(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (IsPostBack == false)
|
|
||||||
{
|
|
||||||
LoadData();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void FrmBoardEdit_Init(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string strIDBoard = Context.GetRequestParm("idBoard");
|
|
||||||
if (string.IsNullOrEmpty(strIDBoard) == false)
|
|
||||||
{
|
|
||||||
_idBoard = Convert.ToInt32(strIDBoard);
|
|
||||||
}
|
|
||||||
if (_idBoard == 0)
|
|
||||||
{
|
|
||||||
Response.Redirect(nameof(FrmBoard));
|
|
||||||
}
|
|
||||||
InitializeComponents();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Page life cycle
|
|
||||||
|
|
||||||
#region UI Events
|
|
||||||
|
|
||||||
private void btnSave_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (FormUtils.Controls_AreValid(Controls) == false) { return; }
|
|
||||||
|
|
||||||
User user = WebSessions.Current.Session_GetCurrentUser(Context);
|
|
||||||
Board board = Boards.Current.Boards_SetBoard(
|
|
||||||
_idBoard,
|
|
||||||
_txtTitle.Text,
|
|
||||||
_txtDescription.Text,
|
|
||||||
_txtDescription.GetClientsideHeight(),
|
|
||||||
user.Name);
|
|
||||||
|
|
||||||
// FIXME: Notify User of "Save Succesfully"
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnExit_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string returnUrl = Context.GetRequestParm("returnUrl");
|
|
||||||
if (string.IsNullOrEmpty(returnUrl))
|
|
||||||
{
|
|
||||||
Response.Redirect(FrmBoard.GetUrl(_idBoard));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Response.Redirect(returnUrl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion UI Events
|
|
||||||
|
|
||||||
#region Private methods
|
|
||||||
|
|
||||||
private void InitializeComponents()
|
|
||||||
{
|
|
||||||
Title = MultiLang.GetLiteral("EditBoard");
|
|
||||||
var lblTitle = new CLabel { Text = Title, Tag = "h2" };
|
|
||||||
Controls.Add(lblTitle);
|
|
||||||
|
|
||||||
Controls.Add(FormUtils.CreateField(MultiLang.GetLiteral("Title"), _txtTitle));
|
|
||||||
_txtTitle.NextFocusOnEnter = _txtTitle;
|
|
||||||
_txtTitle.PlaceHolder = MultiLang.GetLiteral("Title");
|
|
||||||
|
|
||||||
Controls.Add(FormUtils.CreateField(MultiLang.GetLiteral("Description"), _txtDescription));
|
|
||||||
_txtDescription.PlaceHolder = MultiLang.GetLiteral("Description");
|
|
||||||
|
|
||||||
_btnSave.Text = MultiLang.GetLiteral("Save");
|
|
||||||
_btnSave.Click += btnSave_Click;
|
|
||||||
|
|
||||||
_btnExit.Text = MultiLang.GetLiteral("Exit");
|
|
||||||
_btnExit.Click += btnExit_Click;
|
|
||||||
|
|
||||||
Panel pnlButtons = new Panel();
|
|
||||||
pnlButtons.Controls.Add(_btnSave);
|
|
||||||
pnlButtons.Controls.Add(_btnExit);
|
|
||||||
Controls.Add(FormUtils.CreateField(string.Empty, pnlButtons));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LoadData()
|
|
||||||
{
|
|
||||||
Board board = Boards.Current.Board_GetByIDBoard(_idBoard);
|
|
||||||
|
|
||||||
_txtTitle.Text = board.Title;
|
|
||||||
_txtDescription.Text = board.Description;
|
|
||||||
_txtDescription.SetClientsideHeight(board.DescriptionHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Private methods
|
|
||||||
|
|
||||||
#region Public methods
|
|
||||||
|
|
||||||
public static string GetUrl(int idBoard, string returnUrl = null)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(returnUrl))
|
|
||||||
{
|
|
||||||
return string.Format("{0}?idBoard={1}", nameof(FrmBoardEdit), idBoard);
|
|
||||||
}
|
|
||||||
return string.Format("{0}?idBoard={1}&returnUrl={2}", nameof(FrmBoardEdit), idBoard, HttpUtility.UrlEncode(returnUrl));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Public methods
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Web.UI.WebControls;
|
|
||||||
using VAR.Focus.BusinessLogic;
|
|
||||||
using VAR.Focus.Web.Code;
|
|
||||||
using VAR.WebForms.Common.Code;
|
|
||||||
using VAR.WebForms.Common.Controls;
|
|
||||||
using VAR.WebForms.Common.Pages;
|
|
||||||
|
|
||||||
namespace VAR.Focus.Web.Pages
|
|
||||||
{
|
|
||||||
public class FrmLogin : PageCommon
|
|
||||||
{
|
|
||||||
#region Declarations
|
|
||||||
|
|
||||||
private CTextBox _txtNameEmail = new CTextBox { ID = "txtNameEmail", CssClassExtra = "width150px", AllowEmpty = false };
|
|
||||||
private CTextBox _txtPassword = new CTextBox { ID = "txtPassword", CssClassExtra = "width150px", AllowEmpty = false, TextMode = TextBoxMode.Password };
|
|
||||||
private CButton _btnLogin = new CButton { ID = "btnLogin" };
|
|
||||||
|
|
||||||
#endregion Declarations
|
|
||||||
|
|
||||||
#region Page life cycle
|
|
||||||
|
|
||||||
public FrmLogin()
|
|
||||||
{
|
|
||||||
MustBeAutenticated = false;
|
|
||||||
Init += FrmLogin_Init;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void FrmLogin_Init(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
InitializeControls();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Page life cycle
|
|
||||||
|
|
||||||
#region UI Events
|
|
||||||
|
|
||||||
private void btnLogin_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (FormUtils.Controls_AreValid(Controls) == false) { return; }
|
|
||||||
|
|
||||||
if (Users.Current.User_Authenticate(_txtNameEmail.Text, _txtPassword.Text) == false)
|
|
||||||
{
|
|
||||||
_txtPassword.Text = string.Empty;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
WebSessions.Current.Session_Init(Context, _txtNameEmail.Text);
|
|
||||||
Response.Redirect(GlobalConfig.Get().DefaultHandler);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion UI Events
|
|
||||||
|
|
||||||
#region Private methods
|
|
||||||
|
|
||||||
private void InitializeControls()
|
|
||||||
{
|
|
||||||
Title = MultiLang.GetLiteral("Login");
|
|
||||||
var lblTitle = new CLabel { Text = Title, Tag = "h2" };
|
|
||||||
Controls.Add(lblTitle);
|
|
||||||
|
|
||||||
Controls.Add(FormUtils.CreateField(MultiLang.GetLiteral("NameOrMail"), _txtNameEmail));
|
|
||||||
_txtNameEmail.NextFocusOnEnter = _txtPassword;
|
|
||||||
_txtNameEmail.PlaceHolder = MultiLang.GetLiteral("NameOrMail");
|
|
||||||
|
|
||||||
Controls.Add(FormUtils.CreateField(MultiLang.GetLiteral("Password"), _txtPassword));
|
|
||||||
_txtPassword.NextFocusOnEnter = _btnLogin;
|
|
||||||
_txtPassword.PlaceHolder = MultiLang.GetLiteral("Password");
|
|
||||||
|
|
||||||
Controls.Add(FormUtils.CreateField(string.Empty, _btnLogin));
|
|
||||||
_btnLogin.Text = MultiLang.GetLiteral("Login");
|
|
||||||
_btnLogin.Click += btnLogin_Click;
|
|
||||||
|
|
||||||
Controls.Add(FormUtils.CreateField(string.Empty, new HyperLink { Text = MultiLang.GetLiteral("RegisterUser"), NavigateUrl = "FrmRegister" }));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Private methods
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,124 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Web.UI.WebControls;
|
|
||||||
using VAR.Focus.BusinessLogic;
|
|
||||||
using VAR.Focus.BusinessLogic.Entities;
|
|
||||||
using VAR.WebForms.Common.Code;
|
|
||||||
using VAR.WebForms.Common.Controls;
|
|
||||||
using VAR.WebForms.Common.Pages;
|
|
||||||
|
|
||||||
namespace VAR.Focus.Web.Pages
|
|
||||||
{
|
|
||||||
public class FrmRegister : PageCommon
|
|
||||||
{
|
|
||||||
#region Declarations
|
|
||||||
|
|
||||||
private Panel _pnlRegister = new Panel { ID = "pnlRegister" };
|
|
||||||
private CTextBox _txtName = new CTextBox { ID = "txtName", CssClassExtra = "width150px", AllowEmpty = false };
|
|
||||||
private CTextBox _txtEmail = new CTextBox { ID = "txtEmail", CssClassExtra = "width150px", AllowEmpty = false };
|
|
||||||
private CTextBox _txtPassword1 = new CTextBox { ID = "txtPassword1", CssClassExtra = "width150px", AllowEmpty = false, TextMode = TextBoxMode.Password };
|
|
||||||
private CTextBox _txtPassword2 = new CTextBox { ID = "txtPassword2", CssClassExtra = "width150px", AllowEmpty = false, TextMode = TextBoxMode.Password };
|
|
||||||
private CButton _btnRegister = new CButton { ID = "btnRegister" };
|
|
||||||
private CButton _btnExit = new CButton { ID = "btnExit" };
|
|
||||||
private Panel _pnlSuccess = new Panel { ID = "pnlSuccess" };
|
|
||||||
private CLabel _lblSuccess = new CLabel { ID = "lblSuccess" };
|
|
||||||
private CButton _btnExitSuccess = new CButton { ID = "btnExitSuccess" };
|
|
||||||
|
|
||||||
#endregion Declarations
|
|
||||||
|
|
||||||
#region Page life cycle
|
|
||||||
|
|
||||||
public FrmRegister()
|
|
||||||
{
|
|
||||||
MustBeAutenticated = false;
|
|
||||||
Init += FrmRegister_Init;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void FrmRegister_Init(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
InitializeComponents();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Page life cycle
|
|
||||||
|
|
||||||
#region UI Events
|
|
||||||
|
|
||||||
private void btnRegister_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (FormUtils.Controls_AreValid(Controls) == false) { return; }
|
|
||||||
|
|
||||||
// FIXME: Check Email
|
|
||||||
|
|
||||||
// Check password
|
|
||||||
if (_txtPassword1.Text != _txtPassword2.Text)
|
|
||||||
{
|
|
||||||
_txtPassword1.MarkedInvalid = true;
|
|
||||||
_txtPassword2.MarkedInvalid = true;
|
|
||||||
_txtPassword1.Text = string.Empty;
|
|
||||||
_txtPassword2.Text = string.Empty;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
User user = Users.Current.User_Set(_txtName.Text, _txtEmail.Text, _txtPassword1.Text);
|
|
||||||
|
|
||||||
_pnlRegister.Visible = false;
|
|
||||||
_pnlSuccess.Visible = true;
|
|
||||||
_lblSuccess.Text = string.Format("User {0} created sucessfully", user.Name);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnExit_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Response.Redirect(GlobalConfig.Get().DefaultHandler);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion UI Events
|
|
||||||
|
|
||||||
#region Private methods
|
|
||||||
|
|
||||||
private void InitializeComponents()
|
|
||||||
{
|
|
||||||
Title = MultiLang.GetLiteral("RegisterUser");
|
|
||||||
var lblTitle = new CLabel { Text = Title, Tag = "h2" };
|
|
||||||
Controls.Add(lblTitle);
|
|
||||||
|
|
||||||
Controls.Add(_pnlRegister);
|
|
||||||
|
|
||||||
_pnlRegister.Controls.Add(FormUtils.CreateField(MultiLang.GetLiteral("Name"), _txtName));
|
|
||||||
_txtName.NextFocusOnEnter = _txtEmail;
|
|
||||||
_txtName.PlaceHolder = MultiLang.GetLiteral("Name");
|
|
||||||
|
|
||||||
_pnlRegister.Controls.Add(FormUtils.CreateField(MultiLang.GetLiteral("Email"), _txtEmail));
|
|
||||||
_txtEmail.NextFocusOnEnter = _txtPassword1;
|
|
||||||
_txtEmail.PlaceHolder = MultiLang.GetLiteral("Email");
|
|
||||||
|
|
||||||
_pnlRegister.Controls.Add(FormUtils.CreateField(MultiLang.GetLiteral("Password"), _txtPassword1));
|
|
||||||
_txtPassword1.NextFocusOnEnter = _txtPassword2;
|
|
||||||
_txtPassword1.PlaceHolder = MultiLang.GetLiteral("Password");
|
|
||||||
|
|
||||||
_pnlRegister.Controls.Add(FormUtils.CreateField(string.Empty, _txtPassword2));
|
|
||||||
_txtPassword2.NextFocusOnEnter = _btnRegister;
|
|
||||||
_txtPassword2.PlaceHolder = MultiLang.GetLiteral("Password");
|
|
||||||
|
|
||||||
_btnRegister.Text = MultiLang.GetLiteral("Register");
|
|
||||||
_btnRegister.Click += btnRegister_Click;
|
|
||||||
|
|
||||||
_btnExit.Text = MultiLang.GetLiteral("Exit");
|
|
||||||
_btnExit.Click += btnExit_Click;
|
|
||||||
|
|
||||||
Panel pnlButtons = new Panel();
|
|
||||||
pnlButtons.Controls.Add(_btnRegister);
|
|
||||||
pnlButtons.Controls.Add(_btnExit);
|
|
||||||
_pnlRegister.Controls.Add(FormUtils.CreateField(string.Empty, pnlButtons));
|
|
||||||
|
|
||||||
Controls.Add(_pnlSuccess);
|
|
||||||
_pnlSuccess.Visible = false;
|
|
||||||
|
|
||||||
_pnlSuccess.Controls.Add(_lblSuccess);
|
|
||||||
|
|
||||||
_btnExitSuccess.Text = MultiLang.GetLiteral("Exit");
|
|
||||||
_btnExitSuccess.Click += btnExit_Click;
|
|
||||||
_pnlSuccess.Controls.Add(FormUtils.CreateField(string.Empty, _btnExitSuccess));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Private methods
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
[assembly: AssemblyTitle("VAR.Focus")]
|
|
||||||
[assembly: AssemblyDescription("")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("VAR")]
|
|
||||||
[assembly: AssemblyProduct("VAR.Focus")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright © VAR 2015-2020")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
[assembly: Guid("4cd25e9d-237f-4a9f-89ac-35e537cf265e")]
|
|
||||||
[assembly: AssemblyVersion("1.0.0")]
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
|
||||||
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
|
||||||
-->
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
|
||||||
<PublishProvider>FileSystem</PublishProvider>
|
|
||||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
|
||||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
|
||||||
<SiteUrlToLaunchAfterPublish />
|
|
||||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
|
||||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
|
||||||
<publishUrl>Z:\www\VAR.Focus</publishUrl>
|
|
||||||
<DeleteExistingFiles>False</DeleteExistingFiles>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
"AddBoard": "Add board",
|
|
||||||
"EditBoard": "Edit board",
|
|
||||||
"Title": "Title",
|
|
||||||
"Description": "Description",
|
|
||||||
"Save": "Save",
|
|
||||||
"Exit": "Exit",
|
|
||||||
"Toolbox": "Toolbox",
|
|
||||||
"AddCard": "+ Card",
|
|
||||||
"AddRegion": "+ Region",
|
|
||||||
"Accept": "Accept",
|
|
||||||
"Cancel": "Cancel",
|
|
||||||
"ConfirmDelete": "Are you sure to delete?",
|
|
||||||
"ConfirmExit": "Are you sure to exit?",
|
|
||||||
"Config": "Config",
|
|
||||||
"Login": "Login",
|
|
||||||
"Logout": "Logout",
|
|
||||||
"NameOrMail": "Name/Mail",
|
|
||||||
"Password": "Password",
|
|
||||||
"RegisterUser": "RegisterUser",
|
|
||||||
"Name": "Name",
|
|
||||||
"Email": "Email",
|
|
||||||
"Register": "Register",
|
|
||||||
"View": "View",
|
|
||||||
"Edit": "Edit",
|
|
||||||
"Delete": "Delete",
|
|
||||||
"Chat": "Chat",
|
|
||||||
"ChatClose": "Close X",
|
|
||||||
"ChatNewMessages": "New messages",
|
|
||||||
"ChatDisconnected": "Disconnected",
|
|
||||||
"ChatSend": "Send"
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
"AddBoard": "Añadir panel",
|
|
||||||
"EditBoard": "Editar panel",
|
|
||||||
"Title": "Titulo",
|
|
||||||
"Description": "Descripción",
|
|
||||||
"Save": "Guardar",
|
|
||||||
"Exit": "Salir",
|
|
||||||
"Toolbox": "Herramientas",
|
|
||||||
"AddCard": "+ Tarejeta",
|
|
||||||
"AddRegion": "+ Region",
|
|
||||||
"Accept": "Aceptar",
|
|
||||||
"Cancel": "Cancelar",
|
|
||||||
"ConfirmDelete": "¿Estas seguro de eliminar?",
|
|
||||||
"ConfirmExit": "¿Estas seguro de salir?",
|
|
||||||
"Config": "Config.",
|
|
||||||
"Login": "Login",
|
|
||||||
"Logout": "Cerrar sesion",
|
|
||||||
"NameOrMail": "Nombre/Mail",
|
|
||||||
"Password": "Password",
|
|
||||||
"RegisterUser": "Registrar usuario",
|
|
||||||
"Name": "Nombre",
|
|
||||||
"Email": "Email",
|
|
||||||
"Register": "Registrar",
|
|
||||||
"View": "Ver",
|
|
||||||
"Edit": "Editar",
|
|
||||||
"Delete": "Eliminar",
|
|
||||||
"Chat": "Chat",
|
|
||||||
"ChatClose": "Cerrar X",
|
|
||||||
"ChatNewMessages": "Nuevos mensages",
|
|
||||||
"ChatDisconnected": "Desconectado",
|
|
||||||
"ChatSend": "Envia"
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,184 +0,0 @@
|
|||||||
function RunChat(cfg) {
|
|
||||||
cfg.divChat = GetElement(cfg.divChat);
|
|
||||||
cfg.divChatContainer = GetElement(cfg.divChatContainer);
|
|
||||||
cfg.lblTitle = GetElement(cfg.lblTitle);
|
|
||||||
cfg.txtText = GetElement(cfg.txtText);
|
|
||||||
cfg.btnSend = GetElement(cfg.btnSend);
|
|
||||||
|
|
||||||
cfg.LastUser = null;
|
|
||||||
|
|
||||||
cfg.lblTitle.innerHTML = cfg.Texts.Chat;
|
|
||||||
cfg.lblTitle.className = "titleChatNormal";
|
|
||||||
cfg.divChatContainer.style.width = 0;
|
|
||||||
cfg.divChatContainer.style.height = 0;
|
|
||||||
cfg.divChatContainer.style.opacity = 0;
|
|
||||||
|
|
||||||
cfg.Minimized = true;
|
|
||||||
cfg.Connected = null;
|
|
||||||
cfg.FirstMessages = true;
|
|
||||||
cfg.ScrollOnRestore = true;
|
|
||||||
cfg.ScrollPosition = 0;
|
|
||||||
|
|
||||||
cfg.lblTitle.onclick = function () {
|
|
||||||
if (cfg.Minimized) {
|
|
||||||
cfg.divChatContainer.style.width = cfg.divChatContainerWidth;
|
|
||||||
cfg.divChatContainer.style.height = cfg.divChatContainerHeight;
|
|
||||||
cfg.divChatContainer.style.opacity = 1;
|
|
||||||
if (cfg.Connected) {
|
|
||||||
cfg.lblTitle.innerHTML = cfg.Texts.Close;
|
|
||||||
cfg.lblTitle.className = "titleChatNormal";
|
|
||||||
}
|
|
||||||
if (cfg.ScrollOnRestore) {
|
|
||||||
cfg.divChat.scrollTop = cfg.divChat.scrollHeight;
|
|
||||||
} else {
|
|
||||||
cfg.divChat.scrollTop = cfg.ScrollPosition;
|
|
||||||
}
|
|
||||||
cfg.Minimized = false;
|
|
||||||
} else {
|
|
||||||
cfg.ScrollPosition = cfg.divChat.scrollTop;
|
|
||||||
var scrollVisible = cfg.divChat.scrollHeight - cfg.divChat.offsetHeight;
|
|
||||||
cfg.ScrollOnRestore = cfg.divChat.scrollTop > scrollVisible;
|
|
||||||
cfg.divChatContainer.style.width = 0;
|
|
||||||
cfg.divChatContainer.style.height = 0;
|
|
||||||
cfg.divChatContainer.style.opacity = 0;
|
|
||||||
if (cfg.Connected) {
|
|
||||||
cfg.lblTitle.innerHTML = cfg.Texts.Chat;
|
|
||||||
cfg.lblTitle.className = "titleChatNormal";
|
|
||||||
}
|
|
||||||
cfg.Minimized = true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var CreateMessageDOM = function (message, selfMessage, showUserName) {
|
|
||||||
var divMessageRow = document.createElement("DIV");
|
|
||||||
if (selfMessage) {
|
|
||||||
divMessageRow.className = "selfMessageRow";
|
|
||||||
} else {
|
|
||||||
divMessageRow.className = "messageRow";
|
|
||||||
}
|
|
||||||
|
|
||||||
var divMessage = document.createElement("DIV");
|
|
||||||
divMessage.className = "message";
|
|
||||||
divMessageRow.appendChild(divMessage);
|
|
||||||
|
|
||||||
if (showUserName) {
|
|
||||||
var divUser = document.createElement("DIV");
|
|
||||||
divUser.className = "user";
|
|
||||||
divUser.innerHTML = escapeHTML(message.UserName);
|
|
||||||
divMessage.appendChild(divUser);
|
|
||||||
}
|
|
||||||
|
|
||||||
var text = message.Text;
|
|
||||||
|
|
||||||
var divText = document.createElement("DIV");
|
|
||||||
divText.className = "text";
|
|
||||||
divText.innerHTML = escapeHTML(text);
|
|
||||||
divMessage.appendChild(divText);
|
|
||||||
|
|
||||||
divMessage.title = new Date(message.Date);
|
|
||||||
|
|
||||||
return divMessageRow;
|
|
||||||
};
|
|
||||||
|
|
||||||
var RequestChatData = function () {
|
|
||||||
var ReciveChatData = function (responseText) {
|
|
||||||
// Mark as connected
|
|
||||||
if (cfg.Connected === false) {
|
|
||||||
if (cfg.Minimized) {
|
|
||||||
cfg.lblTitle.innerHTML = cfg.Texts.Chat;
|
|
||||||
} else {
|
|
||||||
cfg.lblTitle.innerHTML = cfg.Texts.Close;
|
|
||||||
}
|
|
||||||
cfg.lblTitle.className = "titleChatNormal";
|
|
||||||
cfg.txtText.disabled = false;
|
|
||||||
cfg.btnSend.disabled = false;
|
|
||||||
}
|
|
||||||
cfg.Connected = true;
|
|
||||||
|
|
||||||
recvMsgs = JSON.parse(responseText);
|
|
||||||
if (recvMsgs) {
|
|
||||||
var msgCount = 0;
|
|
||||||
var scrollChat = false;
|
|
||||||
var scrollVisible = cfg.divChat.scrollHeight - cfg.divChat.offsetHeight;
|
|
||||||
if (cfg.Minimized === false && cfg.divChat.scrollTop > scrollVisible) {
|
|
||||||
scrollChat = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var frag = document.createDocumentFragment();
|
|
||||||
for (var i = 0, n = recvMsgs.length; i < n; i++) {
|
|
||||||
var msg = recvMsgs[i];
|
|
||||||
if (cfg.IDMessage < msg.IDMessage) {
|
|
||||||
cfg.IDMessage = msg.IDMessage;
|
|
||||||
var elemMessage = CreateMessageDOM(msg,
|
|
||||||
msg.UserName === cfg.UserName,
|
|
||||||
cfg.LastUser !== msg.UserName);
|
|
||||||
cfg.LastUser = msg.UserName;
|
|
||||||
frag.appendChild(elemMessage);
|
|
||||||
msgCount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cfg.divChat.appendChild(frag);
|
|
||||||
if (scrollChat) {
|
|
||||||
cfg.divChat.scrollTop = cfg.divChat.scrollHeight;
|
|
||||||
}
|
|
||||||
if (cfg.Minimized && cfg.FirstMessages === false && msgCount > 0) {
|
|
||||||
cfg.lblTitle.innerHTML = cfg.Texts.NewMessages;
|
|
||||||
cfg.lblTitle.className = "titleChatAlert";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cfg.FirstMessages = false;
|
|
||||||
|
|
||||||
// Reset pool
|
|
||||||
window.setTimeout(function () {
|
|
||||||
RequestChatData();
|
|
||||||
}, 20);
|
|
||||||
};
|
|
||||||
var ErrorChatData = function () {
|
|
||||||
// Mark as disconnected
|
|
||||||
cfg.lblTitle.innerHTML = cfg.Texts.Disconnected;
|
|
||||||
cfg.lblTitle.className = "titleChatDisconnected";
|
|
||||||
cfg.txtText.disabled = true;
|
|
||||||
cfg.btnSend.disabled = true;
|
|
||||||
cfg.Connected = false;
|
|
||||||
|
|
||||||
cfg.FirstMessages = false;
|
|
||||||
|
|
||||||
// Retry
|
|
||||||
window.setTimeout(function () {
|
|
||||||
RequestChatData();
|
|
||||||
}, 5000);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Pool data
|
|
||||||
var isImmediate = cfg.FirstMessages || cfg.Connected === false;
|
|
||||||
var data = {
|
|
||||||
"IDMessageBoard": cfg.IDMessageBoard,
|
|
||||||
"IDMessage": cfg.IDMessage,
|
|
||||||
"TimePoolData": isImmediate ? "0" : String(cfg.TimePoolData),
|
|
||||||
"TimeStamp": new Date().getTime()
|
|
||||||
};
|
|
||||||
SendRequest(cfg.ServiceUrl, data, ReciveChatData, ErrorChatData);
|
|
||||||
};
|
|
||||||
RequestChatData();
|
|
||||||
}
|
|
||||||
|
|
||||||
function SendChat(cfg) {
|
|
||||||
cfg.txtText = GetElement(cfg.txtText);
|
|
||||||
|
|
||||||
if (cfg.txtText.value.trim() === "") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send data
|
|
||||||
var data = {
|
|
||||||
"Text": cfg.txtText.value,
|
|
||||||
"IDMessageBoard": cfg.IDMessageBoard,
|
|
||||||
"UserName": cfg.UserName,
|
|
||||||
"TimeStamp": new Date().getTime()
|
|
||||||
};
|
|
||||||
SendData(cfg.ServiceUrl, data, null, null);
|
|
||||||
|
|
||||||
cfg.txtText.value = "";
|
|
||||||
cfg.txtText.focus();
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
.boardBanner {
|
|
||||||
border: solid 1px rgb(32, 32, 32);
|
|
||||||
border-radius: 5px;
|
|
||||||
display: inline-block;
|
|
||||||
width: 300px;
|
|
||||||
margin: 15px;
|
|
||||||
padding: 10px;
|
|
||||||
vertical-align: top;
|
|
||||||
background-color: rgb(250,250,200);
|
|
||||||
box-shadow: 0 3px 10px rgba(0,0,0,0.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.boardBanner a {
|
|
||||||
text-decoration: none;
|
|
||||||
color: black;
|
|
||||||
display: block;
|
|
||||||
height: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.boardBanner .title {
|
|
||||||
font-size: 20px;
|
|
||||||
padding-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.boardBanner .description {
|
|
||||||
font-size: 14px;
|
|
||||||
display: block;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.boardBanner .formRow {
|
|
||||||
margin: 0;
|
|
||||||
margin-top: 10px;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.boardBanner .formRow:first-child {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
@@ -1,348 +0,0 @@
|
|||||||
.divBoard {
|
|
||||||
position: relative;
|
|
||||||
height: 100%;
|
|
||||||
background-image: url(Images/BGCork.png);
|
|
||||||
box-shadow: 0 0 10px black inset;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divToolbox {
|
|
||||||
position: absolute;
|
|
||||||
background-color: rgb(127,127,255);
|
|
||||||
box-shadow: 0 5px 15px rgba(0,0,0,0.5);
|
|
||||||
width: 200px;
|
|
||||||
padding: 5px;
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divToolbox .divTitle {
|
|
||||||
font-family: "Segoe UI",Tahoma,Geneva,Verdana,sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: center;
|
|
||||||
display: block;
|
|
||||||
height: 20px;
|
|
||||||
line-height: 20px;
|
|
||||||
background-color: rgb(0,0,128);
|
|
||||||
color: rgb(128,128,255);
|
|
||||||
border-radius: 3px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divToolbox .divOverlay {
|
|
||||||
opacity: 0;
|
|
||||||
background-color: rgb(127,127,255);
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
height: 30px;
|
|
||||||
-ms-touch-action: none;
|
|
||||||
touch-action: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divToolbox .btnToolbox {
|
|
||||||
margin-top: 5px;
|
|
||||||
margin-right: 5px;
|
|
||||||
border: none;
|
|
||||||
border-radius: 3px;
|
|
||||||
box-shadow: 0 -2px 4px rgba(0,0,0,0.4) inset, 0 2px 3px rgba(255,255,255,1) inset;
|
|
||||||
color: rgb(0,0,128);
|
|
||||||
background-color: transparent;
|
|
||||||
font-family: "Segoe UI",Tahoma,Geneva,Verdana,sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
cursor: pointer;
|
|
||||||
padding-bottom: 2px;
|
|
||||||
padding-top: 2px;
|
|
||||||
padding-left: 10px;
|
|
||||||
padding-right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divToolbox .btnToolbox:hover {
|
|
||||||
color: rgb(127,127,255);
|
|
||||||
background-color: rgb(0,0,128);
|
|
||||||
}
|
|
||||||
|
|
||||||
.divToolbox .btnToolbox:active {
|
|
||||||
box-shadow: 0 2px 4px rgba(0,0,0,0.4) inset, 0 -2px 3px rgba(255,255,255,1) inset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divCard {
|
|
||||||
position: absolute;
|
|
||||||
background-color: rgb(255,255,127);
|
|
||||||
box-shadow: 0 3px 10px rgba(0,0,0,0.5);
|
|
||||||
padding: 5px;
|
|
||||||
border-radius: 2px;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divCard .divTitle {
|
|
||||||
padding-bottom: 5px;
|
|
||||||
padding-right: 17px;
|
|
||||||
font-family: "Segoe UI",Tahoma,Geneva,Verdana,sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: center;
|
|
||||||
height: 17px;
|
|
||||||
box-sizing: content-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divCard .txtTitle {
|
|
||||||
width: 100%;
|
|
||||||
font-family: "Segoe UI",Tahoma,Geneva,Verdana,sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
background-color: transparent;
|
|
||||||
border: none;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divCard .divBody {
|
|
||||||
font-family: "Segoe UI",Tahoma,Geneva,Verdana,sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
height: calc(100% - 17px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.divCard .txtBody {
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
font-family: "Segoe UI",Tahoma,Geneva,Verdana,sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
background-color: transparent;
|
|
||||||
border: none;
|
|
||||||
resize: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divCard .divOverlay {
|
|
||||||
opacity: 0;
|
|
||||||
background-color: rgb(255,255,0);
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
-ms-touch-action: none;
|
|
||||||
touch-action: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divCard .divOverlayTouchable {
|
|
||||||
opacity: 0;
|
|
||||||
background-color: rgb(255,255,0);
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divCard .divResize {
|
|
||||||
opacity: 0;
|
|
||||||
background-color: rgb(255,0,255);
|
|
||||||
position: absolute;
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
-ms-touch-action: none;
|
|
||||||
touch-action: none;
|
|
||||||
cursor: se-resize;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divCard .btnCard {
|
|
||||||
padding: 0;
|
|
||||||
border: none;
|
|
||||||
border-radius: 3px;
|
|
||||||
box-shadow: 0 -2px 4px rgba(0,0,0,0.4) inset, 0 2px 3px rgba(255,255,255,1) inset;
|
|
||||||
color: black;
|
|
||||||
background-color: transparent;
|
|
||||||
font-family: "Segoe UI",Tahoma,Geneva,Verdana,sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divCard .btnCard:hover {
|
|
||||||
color: yellow;
|
|
||||||
background-color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divCard .btnCard:active {
|
|
||||||
box-shadow: 0 2px 4px rgba(0,0,0,0.4) inset, 0 -2px 3px rgba(255,255,255,1) inset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divCard .btnEdit {
|
|
||||||
margin: 0;
|
|
||||||
top: 4px;
|
|
||||||
position: absolute;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
right: 24px;
|
|
||||||
line-height: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divCard .btnDelete {
|
|
||||||
margin: 0;
|
|
||||||
top: 4px;
|
|
||||||
position: absolute;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
right: 4px;
|
|
||||||
line-height: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divCard .btnLock {
|
|
||||||
margin: 0;
|
|
||||||
top: 4px;
|
|
||||||
position: absolute;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
right: 44px;
|
|
||||||
line-height: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divCard .btnUnlock {
|
|
||||||
margin: 0;
|
|
||||||
top: 4px;
|
|
||||||
position: absolute;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
right: 4px;
|
|
||||||
line-height: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divRegion {
|
|
||||||
position: absolute;
|
|
||||||
background-color: rgba(0,0,0,0.5);
|
|
||||||
box-shadow: 0 0 0 5px rgba(0,0,0,0.5);
|
|
||||||
padding: 5px;
|
|
||||||
border-radius: 10px;
|
|
||||||
border: dashed 5px rgba(255, 255, 255, 0.5);
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divRegion .divTitle {
|
|
||||||
padding-bottom: 5px;
|
|
||||||
padding-right: 17px;
|
|
||||||
font-family: "Segoe UI",Tahoma,Geneva,Verdana,sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: center;
|
|
||||||
height: 17px;
|
|
||||||
box-sizing: content-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divRegion .txtTitle {
|
|
||||||
width: 100%;
|
|
||||||
font-family: "Segoe UI",Tahoma,Geneva,Verdana,sans-serif;
|
|
||||||
font-size: 30px;
|
|
||||||
color: rgba(255, 255, 255, 0.5);
|
|
||||||
background-color: transparent;
|
|
||||||
border: none;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divRegion .divOverlay {
|
|
||||||
opacity: 0;
|
|
||||||
background-color: rgb(255,255,0);
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
-ms-touch-action: none;
|
|
||||||
touch-action: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divRegion .divOverlayTouchable {
|
|
||||||
opacity: 0;
|
|
||||||
background-color: rgb(255,255,0);
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divRegion .divResize {
|
|
||||||
opacity: 0;
|
|
||||||
background-color: rgb(255,0,255);
|
|
||||||
position: absolute;
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
-ms-touch-action: none;
|
|
||||||
touch-action: none;
|
|
||||||
cursor: se-resize;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divRegion .btnRegion {
|
|
||||||
padding: 0;
|
|
||||||
border: none;
|
|
||||||
border-radius: 3px;
|
|
||||||
box-shadow: 0 -2px 4px rgba(0,0,0,0.4) inset, 0 2px 3px rgba(255,255,255,1) inset;
|
|
||||||
color: black;
|
|
||||||
background-color: transparent;
|
|
||||||
font-family: "Segoe UI",Tahoma,Geneva,Verdana,sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divRegion .btnRegion:hover {
|
|
||||||
color: yellow;
|
|
||||||
background-color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divRegion .btnRegion:active {
|
|
||||||
box-shadow: 0 2px 4px rgba(0,0,0,0.4) inset, 0 -2px 3px rgba(255,255,255,1) inset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divRegion .btnEdit {
|
|
||||||
margin: 0;
|
|
||||||
top: 4px;
|
|
||||||
position: absolute;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
right: 24px;
|
|
||||||
line-height: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divRegion .btnDelete {
|
|
||||||
margin: 0;
|
|
||||||
top: 4px;
|
|
||||||
position: absolute;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
right: 4px;
|
|
||||||
line-height: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divRegion .btnLock {
|
|
||||||
margin: 0;
|
|
||||||
top: 4px;
|
|
||||||
position: absolute;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
right: 44px;
|
|
||||||
line-height: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divRegion .btnUnlock {
|
|
||||||
margin: 0;
|
|
||||||
top: 4px;
|
|
||||||
position: absolute;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
right: 4px;
|
|
||||||
line-height: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divEditBackground {
|
|
||||||
display: block;
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
background-color: rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
||||||
@@ -1,188 +0,0 @@
|
|||||||
.divChatWindow {
|
|
||||||
box-sizing: border-box;
|
|
||||||
overflow: hidden;
|
|
||||||
border: solid 1px rgba(0,0,0,0.5);
|
|
||||||
padding: 5px;
|
|
||||||
border-radius: 5px;
|
|
||||||
background-color: rgb(64,64,64);
|
|
||||||
box-shadow: 0 2px 10px rgba(0,0,0,0.5);
|
|
||||||
position: fixed;
|
|
||||||
bottom: 15px;
|
|
||||||
right: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divChatTitleBar {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.titleChatNormal {
|
|
||||||
color: white;
|
|
||||||
background-color: rgb(64,64,64);
|
|
||||||
cursor: pointer;
|
|
||||||
display: inline-block;
|
|
||||||
border-radius: 5px;
|
|
||||||
padding-top: 2px;
|
|
||||||
padding-bottom: 2px;
|
|
||||||
padding-left: 5px;
|
|
||||||
padding-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes alert {
|
|
||||||
0% {
|
|
||||||
background-color: red;
|
|
||||||
}
|
|
||||||
|
|
||||||
50% {
|
|
||||||
background-color: rgb(64,64,64);
|
|
||||||
}
|
|
||||||
|
|
||||||
100% {
|
|
||||||
background-color: red;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.titleChatAlert {
|
|
||||||
color: white;
|
|
||||||
background-color: red;
|
|
||||||
animation-name: alert;
|
|
||||||
animation-duration: 1s;
|
|
||||||
animation-iteration-count: infinite;
|
|
||||||
cursor: pointer;
|
|
||||||
display: inline-block;
|
|
||||||
border-radius: 5px;
|
|
||||||
padding-top: 2px;
|
|
||||||
padding-bottom: 2px;
|
|
||||||
padding-left: 5px;
|
|
||||||
padding-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.titleChatDisconnected {
|
|
||||||
color: rgb(192,192,192);
|
|
||||||
background-color: rgb(64,64,64);
|
|
||||||
cursor: pointer;
|
|
||||||
display: inline-block;
|
|
||||||
border-radius: 5px;
|
|
||||||
padding-top: 2px;
|
|
||||||
padding-bottom: 2px;
|
|
||||||
padding-left: 5px;
|
|
||||||
padding-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divChatContainer {
|
|
||||||
transition-property: width, height, opacity;
|
|
||||||
transition-duration: 0.3s;
|
|
||||||
overflow: hidden;
|
|
||||||
max-width: calc(100vw - 30px);
|
|
||||||
max-height: calc(100vh - 55px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.divChat {
|
|
||||||
box-sizing: border-box;
|
|
||||||
overflow: auto;
|
|
||||||
height: calc(100% - 29px);
|
|
||||||
margin-bottom: 5px;
|
|
||||||
border-radius: 5px;
|
|
||||||
border: solid 1px rgba(0,0,0,0.5);
|
|
||||||
box-shadow: inset 0 1px 5px rgba(0,0,0,0.5);
|
|
||||||
background-color: rgb(128,128,128);
|
|
||||||
}
|
|
||||||
|
|
||||||
.messageRow,
|
|
||||||
.selfMessageRow {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.messageRow {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.selfMessageRow {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.message {
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: top;
|
|
||||||
border: solid 1px rgba(32, 32, 32, 0.5);
|
|
||||||
background-color: rgb(220,220,220);
|
|
||||||
border-radius: 5px;
|
|
||||||
box-shadow: 0 1px 5px rgba(0,0,0,0.3), inset 0 2px 5px rgba(255,255,255,0.5), inset 0 -2px 5px rgba(128,128,128,0.5);
|
|
||||||
margin: 2px;
|
|
||||||
padding: 5px;
|
|
||||||
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
.messageRow .message {
|
|
||||||
background-color: rgb(220,255,220);
|
|
||||||
}
|
|
||||||
|
|
||||||
.selfMessageRow .message {
|
|
||||||
background-color: rgb(255,255,220);
|
|
||||||
}
|
|
||||||
|
|
||||||
.message .user {
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: rgb(64,64,64);
|
|
||||||
text-shadow: 0 0 1px rgba(0,0,0,0.3);
|
|
||||||
font-size: 10px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.message .text {
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: rgb(32,32,32);
|
|
||||||
text-shadow: 0 0 1px rgba(0,0,0,0.3);
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divChatControls {
|
|
||||||
font-size: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chatTextBox {
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding-top: 2px;
|
|
||||||
padding-left: 5px;
|
|
||||||
padding-bottom: 2px;
|
|
||||||
padding-right: 5px;
|
|
||||||
box-shadow: inset 0 1px 5px rgba(0,0,0,0.5);
|
|
||||||
width: calc(100% - 52px);
|
|
||||||
border-radius: 5px;
|
|
||||||
border: solid 1px rgba(0,0,0,0.5);
|
|
||||||
margin: 0 2px 0 0;
|
|
||||||
vertical-align: top;
|
|
||||||
height: 24px;
|
|
||||||
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chatButton {
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding-top: 2px;
|
|
||||||
padding-left: 5px;
|
|
||||||
padding-bottom: 2px;
|
|
||||||
padding-right: 5px;
|
|
||||||
box-shadow: 0 2px 10px rgba(0,0,0,0.5), inset 0 0px 6px rgba(0,0,0,0.5), inset 0 5px 10px rgba(255,255,255,0.4);
|
|
||||||
width: 50px;
|
|
||||||
vertical-align: top;
|
|
||||||
border-radius: 5px;
|
|
||||||
border: solid 1px rgba(0,0,0,0.5);
|
|
||||||
height: 24px;
|
|
||||||
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
|
|
||||||
font-size: 12px;
|
|
||||||
text-align: center;
|
|
||||||
cursor: pointer;
|
|
||||||
background-color: rgb(64,64,64);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chatButton:hover {
|
|
||||||
background-color: rgb(92,92,92);
|
|
||||||
}
|
|
||||||
|
|
||||||
.chatButton:active {
|
|
||||||
background-color: rgb(64,64,64);
|
|
||||||
box-shadow: inset 0 0px 6px rgba(0,0,0,0.9), inset 0 5px 10px rgba(255,255,255,0.2);
|
|
||||||
}
|
|
||||||
@@ -1,143 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProductVersion>
|
|
||||||
</ProductVersion>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectGuid>{7596FD6B-DAF0-4B22-B356-5CF4629F0436}</ProjectGuid>
|
|
||||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>VAR.Focus.Web</RootNamespace>
|
|
||||||
<AssemblyName>VAR.Focus.Web</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
|
||||||
<UseIISExpress>true</UseIISExpress>
|
|
||||||
<IISExpressSSLPort />
|
|
||||||
<IISExpressAnonymousAuthentication />
|
|
||||||
<IISExpressWindowsAuthentication />
|
|
||||||
<IISExpressUseClassicPipelineMode />
|
|
||||||
<TargetFrameworkProfile />
|
|
||||||
<UseGlobalApplicationHostFile />
|
|
||||||
<Use64BitIISExpress />
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Web" />
|
|
||||||
<Reference Include="VAR.Json, Version=1.2.2.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\VAR.Json.1.2.2\lib\netstandard2.0\VAR.Json.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="Images\BGCork.png" />
|
|
||||||
<Content Include="priv\keep.txt" />
|
|
||||||
<None Include="packages.config" />
|
|
||||||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
|
|
||||||
<Content Include="Resources\Literals.en.json" />
|
|
||||||
<Content Include="Resources\Literals.es.json" />
|
|
||||||
<None Include="web.Debug.config">
|
|
||||||
<DependentUpon>web.config</DependentUpon>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</None>
|
|
||||||
<None Include="web.Release.config">
|
|
||||||
<DependentUpon>web.config</DependentUpon>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="Scripts\05. Cards.js" />
|
|
||||||
<Content Include="Scripts\10. Chat.js" />
|
|
||||||
<Content Include="Styles\02. Boards.css" />
|
|
||||||
<Content Include="Styles\05. Cards.css" />
|
|
||||||
<Content Include="Styles\10. Chat.css" />
|
|
||||||
<Content Include="web.config">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Content>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="Code\WebSessions.cs" />
|
|
||||||
<Compile Include="Controls\CtrCardBoard.cs" />
|
|
||||||
<Compile Include="Controls\HndCardBoard.cs" />
|
|
||||||
<Compile Include="Controls\CtrChat.cs" />
|
|
||||||
<Compile Include="Controls\HndChat.cs" />
|
|
||||||
<Compile Include="Pages\FrmBoard.cs">
|
|
||||||
<SubType>ASPXCodeBehind</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Pages\FrmBoardEdit.cs">
|
|
||||||
<SubType>ASPXCodeBehind</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Pages\FrmLogin.cs">
|
|
||||||
<SubType>ASPXCodeBehind</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Pages\FrmRegister.cs">
|
|
||||||
<SubType>ASPXCodeBehind</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="FocusGlobalConfig.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\VAR.Focus.BusinessLogic\VAR.Focus.BusinessLogic.csproj">
|
|
||||||
<Project>{d88af21d-1c60-4b27-abff-a133d6afc51c}</Project>
|
|
||||||
<Name>VAR.Focus.BusinessLogic</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\VAR.WebForms.Common\VAR.WebForms.Common.csproj">
|
|
||||||
<Project>{328bb4e2-58f2-4beb-a619-ce3fa842ef43}</Project>
|
|
||||||
<Name>VAR.WebForms.Common</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
|
|
||||||
<ProjectExtensions>
|
|
||||||
<VisualStudio>
|
|
||||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
|
||||||
<WebProjectProperties>
|
|
||||||
<UseIIS>True</UseIIS>
|
|
||||||
<AutoAssignPort>True</AutoAssignPort>
|
|
||||||
<DevelopmentServerPort>31337</DevelopmentServerPort>
|
|
||||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
|
||||||
<IISUrl>http://localhost:31337/VAR.Focus/</IISUrl>
|
|
||||||
<OverrideIISAppRootUrl>True</OverrideIISAppRootUrl>
|
|
||||||
<IISAppRootUrl>http://localhost:31337/</IISAppRootUrl>
|
|
||||||
<NTLMAuthentication>False</NTLMAuthentication>
|
|
||||||
<UseCustomServer>False</UseCustomServer>
|
|
||||||
<CustomServerUrl>
|
|
||||||
</CustomServerUrl>
|
|
||||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
|
||||||
</WebProjectProperties>
|
|
||||||
</FlavorProperties>
|
|
||||||
</VisualStudio>
|
|
||||||
</ProjectExtensions>
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="VAR.Json" version="1.2.2" targetFramework="net461" />
|
|
||||||
</packages>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
|
||||||
<system.web>
|
|
||||||
</system.web>
|
|
||||||
</configuration>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
|
||||||
<system.web>
|
|
||||||
<compilation xdt:Transform="RemoveAttributes(debug)" />
|
|
||||||
</system.web>
|
|
||||||
</configuration>
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<configuration>
|
|
||||||
<system.web>
|
|
||||||
<compilation debug="true" targetFramework="4.6.1" />
|
|
||||||
<httpModules>
|
|
||||||
<remove name="GlobalModule" />
|
|
||||||
<add name="GlobalModule" type="VAR.WebForms.Common.GlobalModule" />
|
|
||||||
</httpModules>
|
|
||||||
<httpHandlers>
|
|
||||||
<clear />
|
|
||||||
<add path="*" verb="*" type="VAR.WebForms.Common.GlobalRouter" />
|
|
||||||
</httpHandlers>
|
|
||||||
<pages clientIDMode="AutoID" enableViewState="false" enableSessionState="false" enableViewStateMac="false" />
|
|
||||||
<httpRuntime enableVersionHeader="false" />
|
|
||||||
</system.web>
|
|
||||||
<system.webServer>
|
|
||||||
<modules>
|
|
||||||
<remove name="GlobalModule" />
|
|
||||||
<add name="GlobalModule" type="VAR.WebForms.Common.GlobalModule" />
|
|
||||||
</modules>
|
|
||||||
<handlers>
|
|
||||||
<clear />
|
|
||||||
<add name="GlobalRouter" path="*" verb="*" type="VAR.WebForms.Common.GlobalRouter" />
|
|
||||||
</handlers>
|
|
||||||
<validation validateIntegratedModeConfiguration="false" />
|
|
||||||
<httpProtocol>
|
|
||||||
<customHeaders>
|
|
||||||
<remove name="X-Powered-By" />
|
|
||||||
</customHeaders>
|
|
||||||
</httpProtocol>
|
|
||||||
</system.webServer>
|
|
||||||
</configuration>
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Web;
|
|
||||||
using VAR.Json;
|
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Code
|
|
||||||
{
|
|
||||||
public static class ExtensionMethods
|
|
||||||
{
|
|
||||||
#region HttpContext
|
|
||||||
|
|
||||||
public static string GetRequestParm(this HttpContext context, string parm)
|
|
||||||
{
|
|
||||||
foreach (string key in context.Request.Params.AllKeys)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(key) == false && key.EndsWith(parm))
|
|
||||||
{
|
|
||||||
return context.Request.Params[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void ResponseObject(this HttpContext context, object obj)
|
|
||||||
{
|
|
||||||
context.Response.ContentType = "text/json";
|
|
||||||
string strObject = JsonWriter.WriteObject(obj);
|
|
||||||
context.Response.Write(strObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void PrepareCacheableResponse(this HttpResponse response)
|
|
||||||
{
|
|
||||||
const int secondsInDay = 86400;
|
|
||||||
response.ExpiresAbsolute = DateTime.Now.AddSeconds(secondsInDay);
|
|
||||||
response.Expires = secondsInDay;
|
|
||||||
response.Cache.SetCacheability(HttpCacheability.Public);
|
|
||||||
response.Cache.SetMaxAge(new TimeSpan(0, 0, secondsInDay));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void PrepareUncacheableResponse(this HttpResponse response)
|
|
||||||
{
|
|
||||||
response.ExpiresAbsolute = DateTime.Now.AddDays(-2d);
|
|
||||||
response.Expires = -1500;
|
|
||||||
response.AddHeader("Cache-Control", "max-age=0, no-cache, no-store");
|
|
||||||
response.BufferOutput = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion HttpContext
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Web;
|
|
||||||
using VAR.Json;
|
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Code
|
|
||||||
{
|
|
||||||
public class MultiLang
|
|
||||||
{
|
|
||||||
private static string GetLocalPath(string path)
|
|
||||||
{
|
|
||||||
string currentDir = Path.GetDirectoryName((new System.Uri(Assembly.GetExecutingAssembly().CodeBase)).AbsolutePath);
|
|
||||||
return string.Format("{0}/{1}", Directory.GetParent(currentDir), path);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Dictionary<string, Dictionary<string, object>> _literals = null;
|
|
||||||
|
|
||||||
private static void InitializeLiterals()
|
|
||||||
{
|
|
||||||
_literals = new Dictionary<string, Dictionary<string, object>>();
|
|
||||||
|
|
||||||
JsonParser jsonParser = new JsonParser();
|
|
||||||
foreach (string lang in new string[] { "en", "es" })
|
|
||||||
{
|
|
||||||
string filePath = GetLocalPath(string.Format("Resources/Literals.{0}.json", lang));
|
|
||||||
if (File.Exists(filePath) == false) { continue; }
|
|
||||||
|
|
||||||
string strJsonLiteralsLanguage = File.ReadAllText(filePath);
|
|
||||||
object result = jsonParser.Parse(strJsonLiteralsLanguage);
|
|
||||||
_literals.Add(lang, result as Dictionary<string, object>);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private const string _defaultLanguage = "en";
|
|
||||||
|
|
||||||
private static string GetUserLanguage()
|
|
||||||
{
|
|
||||||
HttpContext ctx = HttpContext.Current;
|
|
||||||
if (ctx != null)
|
|
||||||
{
|
|
||||||
if (ctx.Items["UserLang"] != null)
|
|
||||||
{
|
|
||||||
return (string)ctx.Items["UserLang"];
|
|
||||||
}
|
|
||||||
|
|
||||||
IEnumerable<string> userLanguages = ctx.Request.UserLanguages
|
|
||||||
.Select(lang =>
|
|
||||||
{
|
|
||||||
if (lang.Contains(";"))
|
|
||||||
{
|
|
||||||
lang = lang.Split(';')[0];
|
|
||||||
}
|
|
||||||
if (lang.Contains("-"))
|
|
||||||
{
|
|
||||||
lang = lang.Split('-')[0];
|
|
||||||
}
|
|
||||||
return lang.ToLower();
|
|
||||||
})
|
|
||||||
.Where(lang => _literals.ContainsKey(lang));
|
|
||||||
string userLang = userLanguages.FirstOrDefault() ?? _defaultLanguage;
|
|
||||||
|
|
||||||
ctx.Items["UserLang"] = userLang;
|
|
||||||
return userLang;
|
|
||||||
}
|
|
||||||
return _defaultLanguage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetLiteral(string resource, string culture = null)
|
|
||||||
{
|
|
||||||
if (_literals == null) { InitializeLiterals(); }
|
|
||||||
if (culture == null) { culture = GetUserLanguage(); }
|
|
||||||
|
|
||||||
if (_literals == null || _literals.ContainsKey(culture) == false) { return resource; }
|
|
||||||
Dictionary<string, object> _literalCurrentCulture = _literals[culture];
|
|
||||||
|
|
||||||
if (_literalCurrentCulture == null || _literalCurrentCulture.ContainsKey(resource) == false) { return resource; }
|
|
||||||
return (_literalCurrentCulture[resource] as string) ?? resource;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using System.Web.UI.WebControls;
|
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Controls
|
|
||||||
{
|
|
||||||
public class CButton : Button
|
|
||||||
{
|
|
||||||
public CButton()
|
|
||||||
{
|
|
||||||
CssClass = "button";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
using System.Web.UI;
|
|
||||||
using System.Web.UI.WebControls;
|
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Controls
|
|
||||||
{
|
|
||||||
public class CLabel : Label
|
|
||||||
{
|
|
||||||
#region Declarations
|
|
||||||
|
|
||||||
private string _tagName = "span";
|
|
||||||
|
|
||||||
#endregion Declarations
|
|
||||||
|
|
||||||
#region Properties
|
|
||||||
|
|
||||||
public string Tag
|
|
||||||
{
|
|
||||||
get { return _tagName; }
|
|
||||||
set { _tagName = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Properties
|
|
||||||
|
|
||||||
#region Life cycle
|
|
||||||
|
|
||||||
public override void RenderBeginTag(HtmlTextWriter writer)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(_tagName) == false)
|
|
||||||
{
|
|
||||||
this.AddAttributesToRender(writer);
|
|
||||||
writer.RenderBeginTag(_tagName);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
base.RenderBeginTag(writer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Life cycle
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace VAR.WebForms.Common
|
|
||||||
{
|
|
||||||
public class GlobalModule : IHttpModule
|
|
||||||
{
|
|
||||||
public void Dispose() { }
|
|
||||||
|
|
||||||
public void Init(HttpApplication context)
|
|
||||||
{
|
|
||||||
context.PreSendRequestHeaders += Context_PreSendRequestHeaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Context_PreSendRequestHeaders(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
HttpContext ctx = HttpContext.Current;
|
|
||||||
if (ctx == null) { return; }
|
|
||||||
|
|
||||||
ctx.Response.Headers.Remove("Server");
|
|
||||||
ctx.Response.Headers.Remove("X-Powered-By");
|
|
||||||
ctx.Response.Headers.Add("X-Content-Type-Options", "nosniff");
|
|
||||||
ctx.Response.Headers.Add("X-Frame-Options", "SAMEORIGIN");
|
|
||||||
ctx.Response.Headers.Add("X-XSS-Protection", "1; mode=block");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using System.Web;
|
|
||||||
using VAR.Json;
|
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Pages
|
|
||||||
{
|
|
||||||
public class FrmEcho : IHttpHandler
|
|
||||||
{
|
|
||||||
#region IHttpHandler
|
|
||||||
|
|
||||||
public bool IsReusable
|
|
||||||
{
|
|
||||||
get { return false; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ProcessRequest(HttpContext context)
|
|
||||||
{
|
|
||||||
context.Response.Write("<pre><code>");
|
|
||||||
context.Response.Write(JsonWriter.WriteObject(context.Request, indent: true));
|
|
||||||
context.Response.Write("</code></pre>");
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion IHttpHandler
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
[assembly: AssemblyTitle("VAR.WebForms.Common")]
|
|
||||||
[assembly: AssemblyDescription("")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("")]
|
|
||||||
[assembly: AssemblyProduct("VAR.WebForms.Common")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright © VAR 2015-2020")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
[assembly: Guid("328bb4e2-58f2-4beb-a619-ce3fa842ef43")]
|
|
||||||
[assembly: AssemblyVersion("1.0.0")]
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{328BB4E2-58F2-4BEB-A619-CE3FA842EF43}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>VAR.WebForms.Common</RootNamespace>
|
|
||||||
<AssemblyName>VAR.WebForms.Common</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<Deterministic>true</Deterministic>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Web" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
<Reference Include="VAR.Json, Version=1.2.2.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\VAR.Json.1.2.2\lib\netstandard2.0\VAR.Json.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="Code\Bundler.cs" />
|
|
||||||
<Compile Include="Code\ExtensionMethods.cs" />
|
|
||||||
<Compile Include="Code\GlobalErrorHandler.cs" />
|
|
||||||
<Compile Include="Code\IGlobalConfig.cs" />
|
|
||||||
<Compile Include="Code\MultiLang.cs" />
|
|
||||||
<Compile Include="Code\ObjectActivator.cs" />
|
|
||||||
<Compile Include="Code\ScriptsBundler.cs" />
|
|
||||||
<Compile Include="Code\StaticFileHelper.cs" />
|
|
||||||
<Compile Include="Code\StylesBundler.cs" />
|
|
||||||
<Compile Include="Controls\CButton.cs" />
|
|
||||||
<Compile Include="Controls\CLabel.cs" />
|
|
||||||
<Compile Include="Controls\CTextBox.cs" />
|
|
||||||
<Compile Include="Controls\IValidableControl.cs" />
|
|
||||||
<Compile Include="Code\GlobalConfig.cs" />
|
|
||||||
<Compile Include="GlobalModule.cs" />
|
|
||||||
<Compile Include="GlobalRouter.cs" />
|
|
||||||
<Compile Include="Pages\FormUtils.cs" />
|
|
||||||
<Compile Include="Pages\FrmEcho.cs" />
|
|
||||||
<Compile Include="Pages\FrmError.cs">
|
|
||||||
<SubType>ASPXCodeBehind</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Pages\PageCommon.cs">
|
|
||||||
<SubType>ASPXCodeBehind</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Scripts\01. Base.js" />
|
|
||||||
<EmbeddedResource Include="Scripts\02. Ajax.js" />
|
|
||||||
<EmbeddedResource Include="Scripts\03. Controls.js" />
|
|
||||||
<EmbeddedResource Include="Styles\00. Reset.css" />
|
|
||||||
<EmbeddedResource Include="Styles\01. base.css" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="packages.config" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
</Project>
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="VAR.Json" version="1.2.2" targetFramework="net461" />
|
|
||||||
</packages>
|
|
||||||
@@ -3,9 +3,9 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Web;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Code
|
namespace VAR.WebFormsCore.Code
|
||||||
{
|
{
|
||||||
public class Bundler
|
public class Bundler
|
||||||
{
|
{
|
||||||
@@ -70,34 +70,27 @@ namespace VAR.WebForms.Common.Code
|
|||||||
|
|
||||||
#region Public methods
|
#region Public methods
|
||||||
|
|
||||||
public void WriteResponse(HttpResponse response, string contentType)
|
private static Encoding _utf8Econding = new UTF8Encoding();
|
||||||
|
|
||||||
|
public async void WriteResponse(HttpResponse response, string contentType)
|
||||||
{
|
{
|
||||||
|
StringWriter textWriter = new StringWriter();
|
||||||
response.ContentType = contentType;
|
response.ContentType = contentType;
|
||||||
foreach (string fileName in AssemblyFiles)
|
foreach (string fileName in AssemblyFiles)
|
||||||
{
|
{
|
||||||
Stream resourceStream = _assembly.GetManifestResourceStream(fileName);
|
Stream resourceStream = _assembly.GetManifestResourceStream(fileName);
|
||||||
string fileContent = new StreamReader(resourceStream).ReadToEnd();
|
string fileContent = new StreamReader(resourceStream).ReadToEnd();
|
||||||
byte[] byteArray = Encoding.UTF8.GetBytes(fileContent);
|
textWriter.Write(fileContent);
|
||||||
if (byteArray.Length > 0)
|
textWriter.Write("\n\n");
|
||||||
{
|
|
||||||
response.OutputStream.Write(byteArray, 0, byteArray.Length);
|
|
||||||
|
|
||||||
byteArray = Encoding.UTF8.GetBytes("\n\n");
|
|
||||||
response.OutputStream.Write(byteArray, 0, byteArray.Length);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
foreach (string fileName in AbsoluteFiles)
|
foreach (string fileName in AbsoluteFiles)
|
||||||
{
|
{
|
||||||
string fileContent = File.ReadAllText(fileName);
|
string fileContent = File.ReadAllText(fileName);
|
||||||
byte[] byteArray = Encoding.UTF8.GetBytes(fileContent);
|
textWriter.Write(fileContent);
|
||||||
if (byteArray.Length > 0)
|
textWriter.Write("\n\n");
|
||||||
{
|
|
||||||
response.OutputStream.Write(byteArray, 0, byteArray.Length);
|
|
||||||
|
|
||||||
byteArray = Encoding.UTF8.GetBytes("\n\n");
|
|
||||||
response.OutputStream.Write(byteArray, 0, byteArray.Length);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
byte[] byteObject = _utf8Econding.GetBytes(textWriter.ToString());
|
||||||
|
await response.Body.WriteAsync(byteObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public methods
|
#endregion Public methods
|
||||||
61
VAR.WebFormsCore/Code/ExtensionMethods.cs
Normal file
61
VAR.WebFormsCore/Code/ExtensionMethods.cs
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
using System;
|
||||||
|
using System.Text;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using VAR.Json;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Code
|
||||||
|
{
|
||||||
|
public static class ExtensionMethods
|
||||||
|
{
|
||||||
|
#region HttpContext
|
||||||
|
|
||||||
|
public static string GetRequestParm(this HttpContext context, string parm)
|
||||||
|
{
|
||||||
|
if (context.Request.Method == "POST")
|
||||||
|
{
|
||||||
|
foreach (string key in context.Request.Form.Keys)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(key) == false && key == parm)
|
||||||
|
{
|
||||||
|
return context.Request.Form[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (string key in context.Request.Query.Keys)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(key) == false && key == parm)
|
||||||
|
{
|
||||||
|
return context.Request.Query[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Encoding _utf8Econding = new UTF8Encoding();
|
||||||
|
|
||||||
|
public static void ResponseObject(this HttpContext context, object obj)
|
||||||
|
{
|
||||||
|
context.Response.ContentType = "text/json";
|
||||||
|
string strObject = JsonWriter.WriteObject(obj);
|
||||||
|
byte[] byteObject = _utf8Econding.GetBytes(strObject);
|
||||||
|
context.Response.Body.WriteAsync(byteObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void PrepareCacheableResponse(this HttpResponse response)
|
||||||
|
{
|
||||||
|
const int secondsInDay = 86400;
|
||||||
|
response.Headers.Add("Cache-Control", string.Format("public, max-age={0}", secondsInDay));
|
||||||
|
string ExpireDate = DateTime.UtcNow.AddSeconds(secondsInDay).ToString("ddd, dd MMM yyyy HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
|
||||||
|
response.Headers.Add("Expires", ExpireDate + " GMT");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void PrepareUncacheableResponse(this HttpResponse response)
|
||||||
|
{
|
||||||
|
response.Headers.Add("Cache-Control", "max-age=0, no-cache, no-store");
|
||||||
|
string ExpireDate = DateTime.UtcNow.AddSeconds(-1500).ToString("ddd, dd MMM yyyy HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
|
||||||
|
response.Headers.Add("Expires", ExpireDate + " GMT");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion HttpContext
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Code
|
namespace VAR.WebFormsCore.Code
|
||||||
{
|
{
|
||||||
public static class GlobalConfig
|
public static class GlobalConfig
|
||||||
{
|
{
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Web;
|
using Microsoft.AspNetCore.Http;
|
||||||
using VAR.WebForms.Common.Pages;
|
using VAR.WebFormsCore.Pages;
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Code
|
namespace VAR.WebFormsCore.Code
|
||||||
{
|
{
|
||||||
public static class GlobalErrorHandler
|
public static class GlobalErrorHandler
|
||||||
{
|
{
|
||||||
@@ -12,12 +12,12 @@ namespace VAR.WebForms.Common.Code
|
|||||||
private static void ShowInternalError(HttpContext context, Exception ex)
|
private static void ShowInternalError(HttpContext context, Exception ex)
|
||||||
{
|
{
|
||||||
context.Response.StatusCode = 500;
|
context.Response.StatusCode = 500;
|
||||||
context.Response.Clear();
|
//context.Response.Clear();
|
||||||
|
|
||||||
StringBuilder sbOutput = new StringBuilder();
|
StringBuilder sbOutput = new StringBuilder();
|
||||||
sbOutput.Append("<h2>Internal error</h2>");
|
sbOutput.Append("<h2>Internal error</h2>");
|
||||||
Exception exAux = ex;
|
Exception exAux = ex;
|
||||||
if (exAux is HttpUnhandledException && exAux.InnerException != null) { exAux = exAux.InnerException; }
|
//if (exAux is HttpUnhandledException && exAux.InnerException != null) { exAux = exAux.InnerException; }
|
||||||
while (exAux != null)
|
while (exAux != null)
|
||||||
{
|
{
|
||||||
sbOutput.AppendFormat("<p><b>Message:</b> {0}</p>", exAux.Message);
|
sbOutput.AppendFormat("<p><b>Message:</b> {0}</p>", exAux.Message);
|
||||||
@@ -37,7 +37,7 @@ namespace VAR.WebForms.Common.Code
|
|||||||
sbOutput.Append("-->");
|
sbOutput.Append("-->");
|
||||||
}
|
}
|
||||||
|
|
||||||
context.Response.Write(sbOutput.ToString());
|
context.Response.WriteAsync(sbOutput.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Private methods
|
#endregion Private methods
|
||||||
@@ -49,8 +49,8 @@ namespace VAR.WebForms.Common.Code
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
IHttpHandler frmError = new FrmError(ex);
|
IHttpHandler frmError = new FrmError(ex);
|
||||||
context.Response.Clear();
|
//context.Response.Clear();
|
||||||
context.Handler = frmError;
|
//context.Handler = frmError;
|
||||||
frmError.ProcessRequest(context);
|
frmError.ProcessRequest(context);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
@@ -3,14 +3,88 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Web;
|
using System.Threading.Tasks;
|
||||||
using VAR.WebForms.Common.Code;
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace VAR.WebForms.Common
|
namespace VAR.WebFormsCore.Code
|
||||||
{
|
{
|
||||||
public class GlobalRouter : IHttpHandler
|
public class GlobalRouterMiddleware
|
||||||
{
|
{
|
||||||
#region Handlers
|
private readonly RequestDelegate _next;
|
||||||
|
private readonly IWebHostEnvironment _env;
|
||||||
|
|
||||||
|
public GlobalRouterMiddleware(RequestDelegate next, IWebHostEnvironment env)
|
||||||
|
{
|
||||||
|
_next = next;
|
||||||
|
_env = env;
|
||||||
|
ServerHelpers.SetContentRoot(env.ContentRootPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task Invoke(HttpContext httpContext)
|
||||||
|
{
|
||||||
|
httpContext.Response.Headers.Remove("Server");
|
||||||
|
httpContext.Response.Headers.Remove("X-Powered-By");
|
||||||
|
httpContext.Response.Headers.Add("X-Content-Type-Options", "nosniff");
|
||||||
|
httpContext.Response.Headers.Add("X-Frame-Options", "SAMEORIGIN");
|
||||||
|
httpContext.Response.Headers.Add("X-XSS-Protection", "1; mode=block");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
RouteRequest(httpContext);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (IsIgnoreException(ex) == false)
|
||||||
|
{
|
||||||
|
GlobalErrorHandler.HandleError(httpContext, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await httpContext.Response.Body.FlushAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool IsIgnoreException(Exception ex)
|
||||||
|
{
|
||||||
|
if (ex is ThreadAbortException)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RouteRequest(HttpContext context)
|
||||||
|
{
|
||||||
|
string path = context.Request.Path;
|
||||||
|
string file = Path.GetFileName(path);
|
||||||
|
if (string.IsNullOrEmpty(file))
|
||||||
|
{
|
||||||
|
file = GlobalConfig.Get().DefaultHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pass allowed extensions requests
|
||||||
|
string extension = Path.GetExtension(path).ToLower();
|
||||||
|
if (GlobalConfig.Get().AllowedExtensions.Contains(extension))
|
||||||
|
{
|
||||||
|
string filePath = ServerHelpers.MapContentPath(path);
|
||||||
|
if (File.Exists(filePath))
|
||||||
|
{
|
||||||
|
StaticFileHelper.ResponseStaticFile(context, filePath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IHttpHandler handler = GetHandler(file);
|
||||||
|
if (handler == null)
|
||||||
|
{
|
||||||
|
// TODO: FrmNotFound
|
||||||
|
throw new Exception("NotFound");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use handler
|
||||||
|
handler.ProcessRequest(context);
|
||||||
|
}
|
||||||
|
|
||||||
private static Dictionary<string, Type> _handlers = new Dictionary<string, Type>();
|
private static Dictionary<string, Type> _handlers = new Dictionary<string, Type>();
|
||||||
|
|
||||||
@@ -77,68 +151,13 @@ namespace VAR.WebForms.Common
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Handlers
|
|
||||||
|
|
||||||
#region IHttpHandler
|
|
||||||
|
|
||||||
public bool IsReusable
|
|
||||||
{
|
|
||||||
get { return false; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ProcessRequest(HttpContext context)
|
public static class GlobalRouterMiddlewareExtensions
|
||||||
{
|
{
|
||||||
try
|
public static IApplicationBuilder UseGlobalRouterMiddleware(this IApplicationBuilder builder, IWebHostEnvironment env)
|
||||||
{
|
{
|
||||||
RouteRequest(context);
|
return builder.UseMiddleware<GlobalRouterMiddleware>(env);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
if (ex is ThreadAbortException)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
GlobalErrorHandler.HandleError(context, ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion IHttpHandler
|
|
||||||
|
|
||||||
#region Private methods
|
|
||||||
|
|
||||||
private void RouteRequest(HttpContext context)
|
|
||||||
{
|
|
||||||
string file = Path.GetFileName(context.Request.FilePath);
|
|
||||||
if (string.IsNullOrEmpty(file))
|
|
||||||
{
|
|
||||||
file = GlobalConfig.Get().DefaultHandler;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pass allowed extensions requests
|
|
||||||
string extension = Path.GetExtension(context.Request.FilePath).ToLower();
|
|
||||||
if (GlobalConfig.Get().AllowedExtensions.Contains(extension))
|
|
||||||
{
|
|
||||||
string filePath = context.Request.PhysicalPath;
|
|
||||||
if (File.Exists(filePath))
|
|
||||||
{
|
|
||||||
StaticFileHelper.ResponseStaticFile(context, filePath);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IHttpHandler handler = GetHandler(file);
|
|
||||||
if (handler == null)
|
|
||||||
{
|
|
||||||
// TODO: FrmNotFound
|
|
||||||
throw new Exception("NotFound");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use handler
|
|
||||||
context.Response.Clear();
|
|
||||||
context.Handler = handler;
|
|
||||||
handler.ProcessRequest(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Private methods
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Web;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Code
|
namespace VAR.WebFormsCore.Code
|
||||||
{
|
{
|
||||||
public interface IGlobalConfig
|
public interface IGlobalConfig
|
||||||
{
|
{
|
||||||
9
VAR.WebFormsCore/Code/IHttpHandler.cs
Normal file
9
VAR.WebFormsCore/Code/IHttpHandler.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Code
|
||||||
|
{
|
||||||
|
public interface IHttpHandler
|
||||||
|
{
|
||||||
|
void ProcessRequest(HttpContext context);
|
||||||
|
}
|
||||||
|
}
|
||||||
89
VAR.WebFormsCore/Code/MultiLang.cs
Normal file
89
VAR.WebFormsCore/Code/MultiLang.cs
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
|
using VAR.Json;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Code
|
||||||
|
{
|
||||||
|
public class MultiLang
|
||||||
|
{
|
||||||
|
private static string GetPrivatePath(string baseDir, string fileName)
|
||||||
|
{
|
||||||
|
string currentDir = Path.GetDirectoryName(new System.Uri(Assembly.GetExecutingAssembly().Location).AbsolutePath);
|
||||||
|
string privatePath = Path.Combine(currentDir, baseDir);
|
||||||
|
while (Directory.Exists(privatePath) == false)
|
||||||
|
{
|
||||||
|
DirectoryInfo dirInfo = Directory.GetParent(currentDir);
|
||||||
|
if (dirInfo == null) { break; }
|
||||||
|
currentDir = dirInfo.FullName;
|
||||||
|
privatePath = Path.Combine(currentDir, baseDir);
|
||||||
|
}
|
||||||
|
return Path.Combine(privatePath, fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Dictionary<string, Dictionary<string, object>> _literals = null;
|
||||||
|
|
||||||
|
private static void InitializeLiterals()
|
||||||
|
{
|
||||||
|
_literals = new Dictionary<string, Dictionary<string, object>>();
|
||||||
|
|
||||||
|
JsonParser jsonParser = new JsonParser();
|
||||||
|
foreach (string lang in new string[] { "en", "es" })
|
||||||
|
{
|
||||||
|
string filePath = GetPrivatePath("Resources", string.Format("Literals.{0}.json", lang));
|
||||||
|
if (File.Exists(filePath) == false) { continue; }
|
||||||
|
|
||||||
|
string strJsonLiteralsLanguage = File.ReadAllText(filePath);
|
||||||
|
object result = jsonParser.Parse(strJsonLiteralsLanguage);
|
||||||
|
_literals.Add(lang, result as Dictionary<string, object>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private const string _defaultLanguage = "en";
|
||||||
|
|
||||||
|
private static string GetUserLanguage()
|
||||||
|
{
|
||||||
|
// TODO: Needs replacement for ctx.Request.UserLanguages
|
||||||
|
//HttpContext ctx = HttpContext.Current;
|
||||||
|
//if (ctx != null)
|
||||||
|
//{
|
||||||
|
// if (ctx.Items["UserLang"] != null)
|
||||||
|
// {
|
||||||
|
// return (string)ctx.Items["UserLang"];
|
||||||
|
// }
|
||||||
|
|
||||||
|
// IEnumerable<string> userLanguages = ctx.Request.UserLanguages
|
||||||
|
// .Select(lang =>
|
||||||
|
// {
|
||||||
|
// if (lang.Contains(";"))
|
||||||
|
// {
|
||||||
|
// lang = lang.Split(';')[0];
|
||||||
|
// }
|
||||||
|
// if (lang.Contains("-"))
|
||||||
|
// {
|
||||||
|
// lang = lang.Split('-')[0];
|
||||||
|
// }
|
||||||
|
// return lang.ToLower();
|
||||||
|
// })
|
||||||
|
// .Where(lang => _literals.ContainsKey(lang));
|
||||||
|
// string userLang = userLanguages.FirstOrDefault() ?? _defaultLanguage;
|
||||||
|
|
||||||
|
// ctx.Items["UserLang"] = userLang;
|
||||||
|
// return userLang;
|
||||||
|
//}
|
||||||
|
return _defaultLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetLiteral(string resource, string culture = null)
|
||||||
|
{
|
||||||
|
if (_literals == null) { InitializeLiterals(); }
|
||||||
|
if (culture == null) { culture = GetUserLanguage(); }
|
||||||
|
|
||||||
|
if (_literals == null || _literals.ContainsKey(culture) == false) { return resource; }
|
||||||
|
Dictionary<string, object> _literalCurrentCulture = _literals[culture];
|
||||||
|
|
||||||
|
if (_literalCurrentCulture == null || _literalCurrentCulture.ContainsKey(resource) == false) { return resource; }
|
||||||
|
return (_literalCurrentCulture[resource] as string) ?? resource;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Code
|
namespace VAR.WebFormsCore.Code
|
||||||
{
|
{
|
||||||
public class ObjectActivator
|
public class ObjectActivator
|
||||||
{
|
{
|
||||||
9
VAR.WebFormsCore/Code/Program.cs
Normal file
9
VAR.WebFormsCore/Code/Program.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace VAR.WebFormsCore.Code
|
||||||
|
{
|
||||||
|
public class Program
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,20 +1,18 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Web;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Code
|
namespace VAR.WebFormsCore.Code
|
||||||
{
|
{
|
||||||
public class ScriptsBundler : IHttpHandler
|
public class ScriptsBundler : IHttpHandler
|
||||||
{
|
{
|
||||||
#region IHttpHandler
|
#region IHttpHandler
|
||||||
|
|
||||||
public bool IsReusable { get { return false; } }
|
|
||||||
|
|
||||||
public void ProcessRequest(HttpContext context)
|
public void ProcessRequest(HttpContext context)
|
||||||
{
|
{
|
||||||
Bundler bundler = new Bundler(
|
Bundler bundler = new Bundler(
|
||||||
assembly: Assembly.GetExecutingAssembly(),
|
assembly: Assembly.GetExecutingAssembly(),
|
||||||
assemblyNamespace: "Scripts",
|
assemblyNamespace: "Scripts",
|
||||||
absolutePath: context.Server.MapPath("~/Scripts/"));
|
absolutePath: ServerHelpers.MapContentPath("Scripts"));
|
||||||
context.Response.PrepareCacheableResponse();
|
context.Response.PrepareCacheableResponse();
|
||||||
bundler.WriteResponse(context.Response, "text/javascript");
|
bundler.WriteResponse(context.Response, "text/javascript");
|
||||||
}
|
}
|
||||||
113
VAR.WebFormsCore/Code/ServerHelpers.cs
Normal file
113
VAR.WebFormsCore/Code/ServerHelpers.cs
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
using System.Globalization;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Code
|
||||||
|
{
|
||||||
|
public class ServerHelpers
|
||||||
|
{
|
||||||
|
private static string _contentRoot = null;
|
||||||
|
public static void SetContentRoot(string contentRoot)
|
||||||
|
{
|
||||||
|
_contentRoot = contentRoot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string MapContentPath(string path)
|
||||||
|
{
|
||||||
|
string mappedPath = string.Concat(_contentRoot, "/", path);
|
||||||
|
return mappedPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string HtmlEncode(string text)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(text)) { return text; }
|
||||||
|
|
||||||
|
StringBuilder sbResult = new();
|
||||||
|
|
||||||
|
for (int i = 0; i < text.Length; i++)
|
||||||
|
{
|
||||||
|
char ch = text[i];
|
||||||
|
|
||||||
|
if (ch == '<')
|
||||||
|
{
|
||||||
|
sbResult.Append("<");
|
||||||
|
}
|
||||||
|
else if (ch == '>')
|
||||||
|
{
|
||||||
|
sbResult.Append(">");
|
||||||
|
}
|
||||||
|
else if (ch == '"')
|
||||||
|
{
|
||||||
|
sbResult.Append(""");
|
||||||
|
}
|
||||||
|
else if (ch == '\'')
|
||||||
|
{
|
||||||
|
sbResult.Append("'");
|
||||||
|
}
|
||||||
|
else if (ch == '&')
|
||||||
|
{
|
||||||
|
sbResult.Append("&");
|
||||||
|
}
|
||||||
|
else if (ch > 127)
|
||||||
|
{
|
||||||
|
sbResult.Append("&#");
|
||||||
|
sbResult.Append(((int)ch).ToString(NumberFormatInfo.InvariantInfo));
|
||||||
|
sbResult.Append(';');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sbResult.Append(ch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sbResult.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string UrlEncode(string text)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(text)) { return text; }
|
||||||
|
|
||||||
|
StringBuilder sbResult = new();
|
||||||
|
|
||||||
|
for (int i = 0; i < text.Length; i++)
|
||||||
|
{
|
||||||
|
char ch = text[i];
|
||||||
|
|
||||||
|
if (ch == ' ')
|
||||||
|
{
|
||||||
|
sbResult.Append('+');
|
||||||
|
}
|
||||||
|
else if (IsUrlSafe(ch) == false)
|
||||||
|
{
|
||||||
|
sbResult.AppendFormat("%{0:X02}", ch);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sbResult.Append(ch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sbResult.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsUrlSafe(char ch)
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
(ch >= 'a' && ch <= 'z') ||
|
||||||
|
(ch >= 'A' && ch <= 'Z') ||
|
||||||
|
(ch >= '0' && ch <= '9') ||
|
||||||
|
ch == '-' ||
|
||||||
|
ch == '_' ||
|
||||||
|
ch == '.' ||
|
||||||
|
ch == '!' ||
|
||||||
|
ch == '*' ||
|
||||||
|
ch == '(' ||
|
||||||
|
ch == ')' ||
|
||||||
|
false)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Web;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Code
|
namespace VAR.WebFormsCore.Code
|
||||||
{
|
{
|
||||||
public class StaticFileHelper
|
public class StaticFileHelper
|
||||||
{
|
{
|
||||||
@@ -66,7 +66,7 @@ namespace VAR.WebForms.Common.Code
|
|||||||
{".7z", "application/x-7z-compressed"},
|
{".7z", "application/x-7z-compressed"},
|
||||||
};
|
};
|
||||||
|
|
||||||
public static void ResponseStaticFile(HttpContext context, string filePath)
|
public static async void ResponseStaticFile(HttpContext context, string filePath)
|
||||||
{
|
{
|
||||||
string extension = Path.GetExtension(filePath).ToLower();
|
string extension = Path.GetExtension(filePath).ToLower();
|
||||||
string contentType = null;
|
string contentType = null;
|
||||||
@@ -75,19 +75,14 @@ namespace VAR.WebForms.Common.Code
|
|||||||
contentType = _mimeTypeByExtension[extension];
|
contentType = _mimeTypeByExtension[extension];
|
||||||
}
|
}
|
||||||
|
|
||||||
context.Response.Clear();
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(contentType) == false)
|
if (string.IsNullOrEmpty(contentType) == false)
|
||||||
{
|
{
|
||||||
context.Response.ContentType = contentType;
|
context.Response.ContentType = contentType;
|
||||||
}
|
}
|
||||||
context.Response.PrepareCacheableResponse();
|
context.Response.PrepareCacheableResponse();
|
||||||
|
|
||||||
context.Response.Buffer = true;
|
byte[] fileData = File.ReadAllBytes(filePath);
|
||||||
context.Response.WriteFile(filePath);
|
await context.Response.Body.WriteAsync(fileData);
|
||||||
context.Response.Flush();
|
|
||||||
context.Response.Close();
|
|
||||||
context.Response.End();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,20 +1,18 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Web;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Code
|
namespace VAR.WebFormsCore.Code
|
||||||
{
|
{
|
||||||
public class StylesBundler : IHttpHandler
|
public class StylesBundler : IHttpHandler
|
||||||
{
|
{
|
||||||
#region IHttpHandler
|
#region IHttpHandler
|
||||||
|
|
||||||
public bool IsReusable { get { return false; } }
|
|
||||||
|
|
||||||
public void ProcessRequest(HttpContext context)
|
public void ProcessRequest(HttpContext context)
|
||||||
{
|
{
|
||||||
Bundler bundler = new Bundler(
|
Bundler bundler = new Bundler(
|
||||||
assembly: Assembly.GetExecutingAssembly(),
|
assembly: Assembly.GetExecutingAssembly(),
|
||||||
assemblyNamespace: "Styles",
|
assemblyNamespace: "Styles",
|
||||||
absolutePath: context.Server.MapPath("~/Styles/"));
|
absolutePath: ServerHelpers.MapContentPath("Styles"));
|
||||||
context.Response.PrepareCacheableResponse();
|
context.Response.PrepareCacheableResponse();
|
||||||
bundler.WriteResponse(context.Response, "text/css");
|
bundler.WriteResponse(context.Response, "text/css");
|
||||||
}
|
}
|
||||||
35
VAR.WebFormsCore/Code/Unit.cs
Normal file
35
VAR.WebFormsCore/Code/Unit.cs
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
namespace VAR.WebFormsCore.Code
|
||||||
|
{
|
||||||
|
public class Unit
|
||||||
|
{
|
||||||
|
private int _value;
|
||||||
|
private UnitType _unitType;
|
||||||
|
|
||||||
|
public Unit(int value, UnitType type)
|
||||||
|
{
|
||||||
|
_value = value;
|
||||||
|
_unitType = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
if (_unitType == UnitType.Pixel)
|
||||||
|
{
|
||||||
|
return string.Format("{0}px", _value);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_unitType == UnitType.Percentaje)
|
||||||
|
{
|
||||||
|
return string.Format("{0}%", _value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum UnitType
|
||||||
|
{
|
||||||
|
Pixel,
|
||||||
|
Percentaje,
|
||||||
|
}
|
||||||
|
}
|
||||||
40
VAR.WebFormsCore/Controls/Button.cs
Normal file
40
VAR.WebFormsCore/Controls/Button.cs
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public class Button : Control, IReceivePostbackEvent
|
||||||
|
{
|
||||||
|
public Button()
|
||||||
|
{
|
||||||
|
CssClass = "button";
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _text = string.Empty;
|
||||||
|
|
||||||
|
public string Text { get { return _text; } set { _text = value; } }
|
||||||
|
|
||||||
|
private string _commandArgument = string.Empty;
|
||||||
|
|
||||||
|
public string CommandArgument { get { return _commandArgument; } set { _commandArgument = value; } }
|
||||||
|
|
||||||
|
public event EventHandler Click;
|
||||||
|
|
||||||
|
public override void Render(TextWriter textWriter)
|
||||||
|
{
|
||||||
|
textWriter.Write("<input type=\"submit\" ");
|
||||||
|
RenderAttributes(textWriter);
|
||||||
|
RenderAttribute(textWriter, "value", _text);
|
||||||
|
textWriter.Write(">");
|
||||||
|
|
||||||
|
base.Render(textWriter);
|
||||||
|
|
||||||
|
textWriter.Write("</input>");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReceivePostBack()
|
||||||
|
{
|
||||||
|
Click?.Invoke(this, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Web.UI;
|
|
||||||
using System.Web.UI.WebControls;
|
|
||||||
using VAR.Json;
|
using VAR.Json;
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Controls
|
namespace VAR.WebFormsCore.Controls
|
||||||
{
|
{
|
||||||
public class CTextBox : Control, INamingContainer, IValidableControl
|
public class CTextBox : Control, INamingContainer, IValidableControl
|
||||||
{
|
{
|
||||||
@@ -143,12 +141,6 @@ namespace VAR.WebForms.Common.Controls
|
|||||||
"if(event.keyCode==13){{document.getElementById('{0}').focus(); return false;}}",
|
"if(event.keyCode==13){{document.getElementById('{0}').focus(); return false;}}",
|
||||||
_nextFocusOnEnter.ClientID));
|
_nextFocusOnEnter.ClientID));
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIX: The framework deletes textbox values on password mode
|
|
||||||
if (_txtContent.TextMode == TextBoxMode.Password)
|
|
||||||
{
|
|
||||||
_txtContent.Attributes["value"] = _txtContent.Text;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Control life cycle
|
#endregion Control life cycle
|
||||||
222
VAR.WebFormsCore/Controls/Control.cs
Normal file
222
VAR.WebFormsCore/Controls/Control.cs
Normal file
@@ -0,0 +1,222 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using VAR.WebFormsCore.Code;
|
||||||
|
using VAR.WebFormsCore.Pages;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public class Control
|
||||||
|
{
|
||||||
|
public event EventHandler PreInit;
|
||||||
|
|
||||||
|
protected void OnPreInit()
|
||||||
|
{
|
||||||
|
PreInit?.Invoke(this, null);
|
||||||
|
foreach (Control control in Controls)
|
||||||
|
{
|
||||||
|
control.OnPreInit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public event EventHandler Init;
|
||||||
|
|
||||||
|
protected void OnInit()
|
||||||
|
{
|
||||||
|
Init?.Invoke(this, null);
|
||||||
|
foreach (Control control in Controls)
|
||||||
|
{
|
||||||
|
control.OnInit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public event EventHandler Load;
|
||||||
|
|
||||||
|
protected virtual void Process() { }
|
||||||
|
|
||||||
|
protected void OnLoad()
|
||||||
|
{
|
||||||
|
Process();
|
||||||
|
Load?.Invoke(this, null);
|
||||||
|
foreach (Control control in Controls)
|
||||||
|
{
|
||||||
|
control.OnLoad();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public event EventHandler PreRender;
|
||||||
|
|
||||||
|
protected void OnPreRender()
|
||||||
|
{
|
||||||
|
PreRender?.Invoke(this, null);
|
||||||
|
foreach (Control control in Controls)
|
||||||
|
{
|
||||||
|
control.OnPreRender();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _id = null;
|
||||||
|
|
||||||
|
public string ID { get { return _id; } set { _id = value; _clientID = null; } }
|
||||||
|
|
||||||
|
private string _clientID = null;
|
||||||
|
|
||||||
|
public string ClientID
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_clientID == null)
|
||||||
|
{
|
||||||
|
_clientID = GenerateClientID();
|
||||||
|
}
|
||||||
|
return _clientID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Control _parent = null;
|
||||||
|
|
||||||
|
public Control Parent { get { return _parent; } set { _parent = value; _clientID = null; } }
|
||||||
|
|
||||||
|
private ControlCollection _controls = null;
|
||||||
|
|
||||||
|
private string _cssClass = null;
|
||||||
|
|
||||||
|
public string CssClass { get { return _cssClass; } set { _cssClass = value; } }
|
||||||
|
|
||||||
|
public ControlCollection Controls
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_controls == null)
|
||||||
|
{
|
||||||
|
_controls = new ControlCollection(this);
|
||||||
|
}
|
||||||
|
return _controls;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Page _page = null;
|
||||||
|
|
||||||
|
public Page Page
|
||||||
|
{
|
||||||
|
get { return _page; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_page = value;
|
||||||
|
foreach (Control control in Controls)
|
||||||
|
{
|
||||||
|
control.Page = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool _visible = true;
|
||||||
|
|
||||||
|
public bool Visible { get { return _visible; } set { _visible = value; } }
|
||||||
|
|
||||||
|
private string GenerateClientID()
|
||||||
|
{
|
||||||
|
StringBuilder sbClientID = new();
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(_id) == false)
|
||||||
|
{
|
||||||
|
sbClientID.Insert(0, _id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string currentID = string.Format("ctl{0:00}", Index);
|
||||||
|
sbClientID.Insert(0, currentID);
|
||||||
|
}
|
||||||
|
|
||||||
|
Control parent = Parent;
|
||||||
|
while (parent != null)
|
||||||
|
{
|
||||||
|
if (parent is INamingContainer)
|
||||||
|
{
|
||||||
|
sbClientID.Insert(0, "_");
|
||||||
|
if (string.IsNullOrEmpty(parent.ID) == false)
|
||||||
|
{
|
||||||
|
sbClientID.Insert(0, parent.ID);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string parentID = string.Format("ctl{0:00}", parent.Index);
|
||||||
|
sbClientID.Insert(0, parentID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parent = parent.Parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
return sbClientID.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Dictionary<string, string> Style { get; } = new Dictionary<string, string>();
|
||||||
|
|
||||||
|
public Dictionary<string, string> Attributes { get; } = new Dictionary<string, string>();
|
||||||
|
|
||||||
|
private int _index = 0;
|
||||||
|
|
||||||
|
public int Index { get { return _index; } set { _index = value; } }
|
||||||
|
|
||||||
|
public virtual void Render(TextWriter textWriter)
|
||||||
|
{
|
||||||
|
foreach (Control control in Controls)
|
||||||
|
{
|
||||||
|
if (control.Visible == false) { continue; }
|
||||||
|
control.Render(textWriter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RenderAttribute(TextWriter textWriter, string key, string value)
|
||||||
|
{
|
||||||
|
textWriter.Write(" {0}=\"{1}\"", key, ServerHelpers.HtmlEncode(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void RenderAttributes(TextWriter textWriter, bool forceId = false)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(_id) == false || forceId)
|
||||||
|
{
|
||||||
|
RenderAttribute(textWriter, "id", ClientID);
|
||||||
|
RenderAttribute(textWriter, "name", ClientID);
|
||||||
|
}
|
||||||
|
if (string.IsNullOrEmpty(_cssClass) == false)
|
||||||
|
{
|
||||||
|
RenderAttribute(textWriter, "class", _cssClass);
|
||||||
|
}
|
||||||
|
foreach (KeyValuePair<string, string> attributePair in Attributes)
|
||||||
|
{
|
||||||
|
RenderAttribute(textWriter, attributePair.Key, attributePair.Value);
|
||||||
|
}
|
||||||
|
if (Style.Count > 0)
|
||||||
|
{
|
||||||
|
StringBuilder sbStyle = new();
|
||||||
|
foreach (KeyValuePair<string, string> stylePair in Style)
|
||||||
|
{
|
||||||
|
sbStyle.AppendFormat("{0}: {1};", stylePair.Key, stylePair.Value);
|
||||||
|
}
|
||||||
|
RenderAttribute(textWriter, "style", sbStyle.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Control> ChildsOfType<T>(List<Control> controls = null)
|
||||||
|
{
|
||||||
|
if (controls == null)
|
||||||
|
{
|
||||||
|
controls = new List<Control>();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this is T) { controls.Add(this); }
|
||||||
|
|
||||||
|
foreach (Control child in _controls)
|
||||||
|
{
|
||||||
|
child.ChildsOfType<T>(controls);
|
||||||
|
}
|
||||||
|
return controls;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
24
VAR.WebFormsCore/Controls/ControlCollection.cs
Normal file
24
VAR.WebFormsCore/Controls/ControlCollection.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public class ControlCollection : List<Control>
|
||||||
|
{
|
||||||
|
private Control _parent = null;
|
||||||
|
private int _index = 0;
|
||||||
|
|
||||||
|
public ControlCollection(Control parent)
|
||||||
|
{
|
||||||
|
_parent = parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public new void Add(Control control)
|
||||||
|
{
|
||||||
|
control.Page = _parent.Page;
|
||||||
|
control.Parent = _parent;
|
||||||
|
control.Index = _index;
|
||||||
|
_index++;
|
||||||
|
base.Add(control);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
31
VAR.WebFormsCore/Controls/HiddenField.cs
Normal file
31
VAR.WebFormsCore/Controls/HiddenField.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public class HiddenField : Control
|
||||||
|
{
|
||||||
|
private string _value = string.Empty;
|
||||||
|
|
||||||
|
public string Value { get { return _value; } set { _value = value; } }
|
||||||
|
|
||||||
|
protected override void Process()
|
||||||
|
{
|
||||||
|
if (Page.IsPostBack && Page.Context.Request.Form.ContainsKey(ClientID))
|
||||||
|
{
|
||||||
|
Value = Page.Context.Request.Form[ClientID];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Render(TextWriter textWriter)
|
||||||
|
{
|
||||||
|
textWriter.Write("<input type=\"hidden\" ");
|
||||||
|
RenderAttributes(textWriter, forceId: true);
|
||||||
|
if (string.IsNullOrEmpty(Value) == false)
|
||||||
|
{
|
||||||
|
RenderAttribute(textWriter, "value", _value);
|
||||||
|
}
|
||||||
|
textWriter.Write(">");
|
||||||
|
textWriter.Write("</input>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
VAR.WebFormsCore/Controls/HtmlBody.cs
Normal file
7
VAR.WebFormsCore/Controls/HtmlBody.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public class HtmlBody : HtmlGenericControl
|
||||||
|
{
|
||||||
|
public HtmlBody() : base("body") { }
|
||||||
|
}
|
||||||
|
}
|
||||||
45
VAR.WebFormsCore/Controls/HtmlForm.cs
Normal file
45
VAR.WebFormsCore/Controls/HtmlForm.cs
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using Microsoft.Extensions.Primitives;
|
||||||
|
using VAR.WebFormsCore.Code;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public class HtmlForm : Control
|
||||||
|
{
|
||||||
|
private string _method = "post";
|
||||||
|
|
||||||
|
public HtmlForm() { }
|
||||||
|
|
||||||
|
public override void Render(TextWriter textWriter)
|
||||||
|
{
|
||||||
|
textWriter.Write("<form ");
|
||||||
|
RenderAttributes(textWriter);
|
||||||
|
RenderAttribute(textWriter, "method", _method);
|
||||||
|
RenderAttribute(textWriter, "action", GetAction());
|
||||||
|
textWriter.Write(">");
|
||||||
|
|
||||||
|
base.Render(textWriter);
|
||||||
|
|
||||||
|
textWriter.Write("</form>");
|
||||||
|
}
|
||||||
|
private string GetAction()
|
||||||
|
{
|
||||||
|
StringBuilder sbAction = new();
|
||||||
|
sbAction.Append(Page.GetType().Name);
|
||||||
|
|
||||||
|
if (Page.Context.Request.Query.Count > 0)
|
||||||
|
{
|
||||||
|
sbAction.Append('?');
|
||||||
|
|
||||||
|
foreach (KeyValuePair<string, StringValues> queryParam in Page.Context.Request.Query)
|
||||||
|
{
|
||||||
|
sbAction.AppendFormat("&{0}={1}", ServerHelpers.UrlEncode(queryParam.Key), ServerHelpers.UrlEncode(queryParam.Value[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sbAction.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
25
VAR.WebFormsCore/Controls/HtmlGenericControl.cs
Normal file
25
VAR.WebFormsCore/Controls/HtmlGenericControl.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public class HtmlGenericControl : Control
|
||||||
|
{
|
||||||
|
private string _tagName;
|
||||||
|
|
||||||
|
public HtmlGenericControl(string tag)
|
||||||
|
{
|
||||||
|
_tagName = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Render(TextWriter textWriter)
|
||||||
|
{
|
||||||
|
textWriter.Write("<{0} ", _tagName);
|
||||||
|
RenderAttributes(textWriter);
|
||||||
|
textWriter.Write(">");
|
||||||
|
|
||||||
|
base.Render(textWriter);
|
||||||
|
|
||||||
|
textWriter.Write("</{0}>", _tagName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
25
VAR.WebFormsCore/Controls/HtmlHead.cs
Normal file
25
VAR.WebFormsCore/Controls/HtmlHead.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public class HtmlHead : Control
|
||||||
|
{
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
public override void Render(TextWriter textWriter)
|
||||||
|
{
|
||||||
|
textWriter.Write("<head ");
|
||||||
|
RenderAttributes(textWriter);
|
||||||
|
textWriter.Write(">");
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(Title) == false)
|
||||||
|
{
|
||||||
|
textWriter.Write("<title>{0}</title>", Title);
|
||||||
|
}
|
||||||
|
|
||||||
|
base.Render(textWriter);
|
||||||
|
|
||||||
|
textWriter.Write("</head>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
29
VAR.WebFormsCore/Controls/HtmlMeta.cs
Normal file
29
VAR.WebFormsCore/Controls/HtmlMeta.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public class HtmlMeta : Control
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string Content { get; set; }
|
||||||
|
public string HttpEquiv { get; internal set; }
|
||||||
|
public override void Render(TextWriter textWriter)
|
||||||
|
{
|
||||||
|
textWriter.Write("<meta ");
|
||||||
|
RenderAttributes(textWriter);
|
||||||
|
if (string.IsNullOrEmpty(Name) == false)
|
||||||
|
{
|
||||||
|
textWriter.Write(" name=\"{0}\"", Name);
|
||||||
|
}
|
||||||
|
if (string.IsNullOrEmpty(Content) == false)
|
||||||
|
{
|
||||||
|
textWriter.Write(" content=\"{0}\"", Content);
|
||||||
|
}
|
||||||
|
if (string.IsNullOrEmpty(HttpEquiv) == false)
|
||||||
|
{
|
||||||
|
textWriter.Write(" http-equiv=\"{0}\"", HttpEquiv);
|
||||||
|
}
|
||||||
|
textWriter.Write(" />");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
32
VAR.WebFormsCore/Controls/HyperLink.cs
Normal file
32
VAR.WebFormsCore/Controls/HyperLink.cs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public class HyperLink : Control
|
||||||
|
{
|
||||||
|
|
||||||
|
public string NavigateUrl { get; set; }
|
||||||
|
public string Text { get; set; }
|
||||||
|
|
||||||
|
public override void Render(TextWriter textWriter)
|
||||||
|
{
|
||||||
|
textWriter.Write("<a ");
|
||||||
|
RenderAttributes(textWriter);
|
||||||
|
if (string.IsNullOrEmpty(NavigateUrl) == false)
|
||||||
|
{
|
||||||
|
textWriter.Write(" href=\"{0}\"", NavigateUrl);
|
||||||
|
}
|
||||||
|
textWriter.Write(">");
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(Text) == false)
|
||||||
|
{
|
||||||
|
textWriter.Write(Text);
|
||||||
|
}
|
||||||
|
|
||||||
|
base.Render(textWriter);
|
||||||
|
|
||||||
|
textWriter.Write("</a>");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
6
VAR.WebFormsCore/Controls/INamingContainer.cs
Normal file
6
VAR.WebFormsCore/Controls/INamingContainer.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public interface INamingContainer
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
7
VAR.WebFormsCore/Controls/IReceivePostbackEvent.cs
Normal file
7
VAR.WebFormsCore/Controls/IReceivePostbackEvent.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public interface IReceivePostbackEvent
|
||||||
|
{
|
||||||
|
void ReceivePostBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace VAR.WebForms.Common.Controls
|
namespace VAR.WebFormsCore.Controls
|
||||||
{
|
{
|
||||||
public interface IValidableControl
|
public interface IValidableControl
|
||||||
{
|
{
|
||||||
41
VAR.WebFormsCore/Controls/Label.cs
Normal file
41
VAR.WebFormsCore/Controls/Label.cs
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
using System.IO;
|
||||||
|
using VAR.WebFormsCore.Code;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public class Label : Control
|
||||||
|
{
|
||||||
|
#region Properties
|
||||||
|
|
||||||
|
private string _tagName = "span";
|
||||||
|
|
||||||
|
public string Tag
|
||||||
|
{
|
||||||
|
get { return _tagName; }
|
||||||
|
set { _tagName = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _text = string.Empty;
|
||||||
|
|
||||||
|
public string Text { get { return _text; } set { _text = value; } }
|
||||||
|
|
||||||
|
#endregion Properties
|
||||||
|
|
||||||
|
#region Life cycle
|
||||||
|
|
||||||
|
public override void Render(TextWriter textWriter)
|
||||||
|
{
|
||||||
|
textWriter.Write("<{0} ", _tagName);
|
||||||
|
RenderAttributes(textWriter);
|
||||||
|
textWriter.Write(">");
|
||||||
|
|
||||||
|
textWriter.Write(ServerHelpers.HtmlEncode(_text));
|
||||||
|
|
||||||
|
base.Render(textWriter);
|
||||||
|
|
||||||
|
textWriter.Write("</{0}>", _tagName);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Life cycle
|
||||||
|
}
|
||||||
|
}
|
||||||
18
VAR.WebFormsCore/Controls/LiteralControl.cs
Normal file
18
VAR.WebFormsCore/Controls/LiteralControl.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public class LiteralControl : Control
|
||||||
|
{
|
||||||
|
public string Content { get; set; }
|
||||||
|
|
||||||
|
public LiteralControl() { }
|
||||||
|
public LiteralControl(string content) { Content = content; }
|
||||||
|
|
||||||
|
public override void Render(TextWriter textWriter)
|
||||||
|
{
|
||||||
|
textWriter.Write(Content);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
7
VAR.WebFormsCore/Controls/Panel.cs
Normal file
7
VAR.WebFormsCore/Controls/Panel.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public class Panel : HtmlGenericControl, INamingContainer
|
||||||
|
{
|
||||||
|
public Panel() : base("div") { }
|
||||||
|
}
|
||||||
|
}
|
||||||
63
VAR.WebFormsCore/Controls/TextBox.cs
Normal file
63
VAR.WebFormsCore/Controls/TextBox.cs
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
using System.IO;
|
||||||
|
using VAR.WebFormsCore.Code;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Controls
|
||||||
|
{
|
||||||
|
public class TextBox : Control
|
||||||
|
{
|
||||||
|
private string _text = string.Empty;
|
||||||
|
|
||||||
|
public string Text { get { return _text; } set { _text = value; } }
|
||||||
|
|
||||||
|
public TextBoxMode TextMode { get; set; } = TextBoxMode.Normal;
|
||||||
|
|
||||||
|
protected override void Process()
|
||||||
|
{
|
||||||
|
if (Page.IsPostBack && Page.Context.Request.Form.ContainsKey(ClientID))
|
||||||
|
{
|
||||||
|
_text = Page.Context.Request.Form[ClientID];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Render(TextWriter textWriter)
|
||||||
|
{
|
||||||
|
if (TextMode == TextBoxMode.MultiLine)
|
||||||
|
{
|
||||||
|
textWriter.Write("<textarea ");
|
||||||
|
RenderAttributes(textWriter, forceId: true);
|
||||||
|
textWriter.Write(">");
|
||||||
|
textWriter.Write(ServerHelpers.HtmlEncode(_text));
|
||||||
|
textWriter.Write("</textarea>");
|
||||||
|
}
|
||||||
|
else if (TextMode == TextBoxMode.Normal)
|
||||||
|
{
|
||||||
|
textWriter.Write("<input type=\"text\" ");
|
||||||
|
RenderAttributes(textWriter, forceId: true);
|
||||||
|
if (string.IsNullOrEmpty(Text) == false)
|
||||||
|
{
|
||||||
|
RenderAttribute(textWriter, "value", _text);
|
||||||
|
}
|
||||||
|
textWriter.Write(">");
|
||||||
|
textWriter.Write("</input>");
|
||||||
|
}
|
||||||
|
else if (TextMode == TextBoxMode.Password)
|
||||||
|
{
|
||||||
|
textWriter.Write("<input type=\"password\" ");
|
||||||
|
RenderAttributes(textWriter, forceId: true);
|
||||||
|
if (string.IsNullOrEmpty(Text) == false)
|
||||||
|
{
|
||||||
|
RenderAttribute(textWriter, "value", _text);
|
||||||
|
}
|
||||||
|
textWriter.Write(">");
|
||||||
|
textWriter.Write("</input>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum TextBoxMode
|
||||||
|
{
|
||||||
|
Normal,
|
||||||
|
Password,
|
||||||
|
MultiLine,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
using System.Web.UI;
|
using VAR.WebFormsCore.Controls;
|
||||||
using System.Web.UI.WebControls;
|
|
||||||
using VAR.WebForms.Common.Controls;
|
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Pages
|
namespace VAR.WebFormsCore.Pages
|
||||||
{
|
{
|
||||||
public class FormUtils
|
public class FormUtils
|
||||||
{
|
{
|
||||||
@@ -36,7 +34,7 @@ namespace VAR.WebForms.Common.Pages
|
|||||||
|
|
||||||
if (string.IsNullOrEmpty(label) == false)
|
if (string.IsNullOrEmpty(label) == false)
|
||||||
{
|
{
|
||||||
CLabel lblField = new CLabel();
|
Label lblField = new Label();
|
||||||
lblField.Text = label;
|
lblField.Text = label;
|
||||||
pnlLabelContainer.Controls.Add(lblField);
|
pnlLabelContainer.Controls.Add(lblField);
|
||||||
}
|
}
|
||||||
20
VAR.WebFormsCore/Pages/FrmEcho.cs
Normal file
20
VAR.WebFormsCore/Pages/FrmEcho.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using VAR.Json;
|
||||||
|
using VAR.WebFormsCore.Code;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Pages
|
||||||
|
{
|
||||||
|
public class FrmEcho : IHttpHandler
|
||||||
|
{
|
||||||
|
#region IHttpHandler
|
||||||
|
|
||||||
|
public void ProcessRequest(HttpContext context)
|
||||||
|
{
|
||||||
|
context.Response.WriteAsync("<pre><code>");
|
||||||
|
context.Response.WriteAsync(JsonWriter.WriteObject(context.Request, indent: true));
|
||||||
|
context.Response.WriteAsync("</code></pre>");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion IHttpHandler
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.UI;
|
using VAR.WebFormsCore.Controls;
|
||||||
using System.Web.UI.WebControls;
|
|
||||||
using VAR.WebForms.Common.Controls;
|
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Pages
|
namespace VAR.WebFormsCore.Pages
|
||||||
{
|
{
|
||||||
public class FrmError : PageCommon
|
public class FrmError : PageCommon
|
||||||
{
|
{
|
||||||
@@ -18,6 +16,7 @@ namespace VAR.WebForms.Common.Pages
|
|||||||
|
|
||||||
public FrmError(Exception ex)
|
public FrmError(Exception ex)
|
||||||
{
|
{
|
||||||
|
MustBeAutenticated = false;
|
||||||
_ex = ex;
|
_ex = ex;
|
||||||
Init += FrmError_Init;
|
Init += FrmError_Init;
|
||||||
}
|
}
|
||||||
@@ -35,18 +34,18 @@ namespace VAR.WebForms.Common.Pages
|
|||||||
{
|
{
|
||||||
Title = "Application Error";
|
Title = "Application Error";
|
||||||
|
|
||||||
CLabel lblErrorTitle = new CLabel { Text = Title, Tag = "h2" };
|
Label lblErrorTitle = new Label { Text = Title, Tag = "h2" };
|
||||||
Controls.Add(lblErrorTitle);
|
Controls.Add(lblErrorTitle);
|
||||||
|
|
||||||
Exception exAux = _ex;
|
Exception exAux = _ex;
|
||||||
if (exAux is HttpUnhandledException && exAux.InnerException != null) { exAux = exAux.InnerException; }
|
//if (exAux is HttpUnhandledException && exAux.InnerException != null) { exAux = exAux.InnerException; }
|
||||||
while (exAux != null)
|
while (exAux != null)
|
||||||
{
|
{
|
||||||
CLabel lblMessage = new CLabel { Tag = "P" };
|
Label lblMessage = new Label { Tag = "P" };
|
||||||
lblMessage.Text = string.Format("<b>{0}:</b> {1}", "Message", HttpUtility.HtmlEncode(exAux.Message));
|
lblMessage.Text = string.Format("<b>{0}:</b> {1}", "Message", HttpUtility.HtmlEncode(exAux.Message));
|
||||||
Controls.Add(lblMessage);
|
Controls.Add(lblMessage);
|
||||||
|
|
||||||
CLabel lblStacktraceTitle = new CLabel { Tag = "p" };
|
Label lblStacktraceTitle = new Label { Tag = "p" };
|
||||||
lblStacktraceTitle.Text = string.Format("<b>{0}:</b>", "Stacktrace");
|
lblStacktraceTitle.Text = string.Format("<b>{0}:</b>", "Stacktrace");
|
||||||
Controls.Add(lblStacktraceTitle);
|
Controls.Add(lblStacktraceTitle);
|
||||||
Panel pnlStacktrace = new Panel();
|
Panel pnlStacktrace = new Panel();
|
||||||
68
VAR.WebFormsCore/Pages/Page.cs
Normal file
68
VAR.WebFormsCore/Pages/Page.cs
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using VAR.WebFormsCore.Code;
|
||||||
|
using VAR.WebFormsCore.Controls;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.Pages
|
||||||
|
{
|
||||||
|
public class Page : Control, IHttpHandler
|
||||||
|
{
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
public HttpContext Context { get; set; }
|
||||||
|
|
||||||
|
private static Encoding _utf8Econding = new UTF8Encoding();
|
||||||
|
|
||||||
|
public async void ProcessRequest(HttpContext context)
|
||||||
|
{
|
||||||
|
StringWriter stringWriter = new();
|
||||||
|
|
||||||
|
Context = context;
|
||||||
|
Page = this;
|
||||||
|
|
||||||
|
if (context.Request.Method == "POST")
|
||||||
|
{
|
||||||
|
_isPostBack = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
OnPreInit();
|
||||||
|
if (context.Response.HasStarted) { return; }
|
||||||
|
|
||||||
|
OnInit();
|
||||||
|
if (context.Response.HasStarted) { return; }
|
||||||
|
|
||||||
|
OnLoad();
|
||||||
|
if (context.Response.HasStarted) { return; }
|
||||||
|
|
||||||
|
if (_isPostBack)
|
||||||
|
{
|
||||||
|
List<Control> controls = ChildsOfType<IReceivePostbackEvent>();
|
||||||
|
foreach (Control control in controls)
|
||||||
|
{
|
||||||
|
string clientID = control.ClientID;
|
||||||
|
if (context.Request.Form.ContainsKey(clientID))
|
||||||
|
{
|
||||||
|
(control as IReceivePostbackEvent).ReceivePostBack();
|
||||||
|
if (context.Response.HasStarted) { return; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OnPreRender();
|
||||||
|
if (context.Response.HasStarted) { return; }
|
||||||
|
|
||||||
|
Render(stringWriter);
|
||||||
|
if (context.Response.HasStarted) { return; }
|
||||||
|
|
||||||
|
context.Response.Headers.Add("Content-Type", "text/html");
|
||||||
|
byte[] byteObject = _utf8Econding.GetBytes(stringWriter.ToString());
|
||||||
|
await context.Response.Body.WriteAsync(byteObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool _isPostBack = false;
|
||||||
|
|
||||||
|
public bool IsPostBack { get { return _isPostBack; } }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,24 +1,20 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using VAR.WebFormsCore.Code;
|
||||||
using System.Web.UI;
|
using VAR.WebFormsCore.Controls;
|
||||||
using System.Web.UI.HtmlControls;
|
|
||||||
using System.Web.UI.WebControls;
|
|
||||||
using VAR.WebForms.Common.Code;
|
|
||||||
using VAR.WebForms.Common.Controls;
|
|
||||||
|
|
||||||
namespace VAR.WebForms.Common.Pages
|
namespace VAR.WebFormsCore.Pages
|
||||||
{
|
{
|
||||||
public class PageCommon : Page
|
public class PageCommon : Page
|
||||||
{
|
{
|
||||||
#region Declarations
|
#region Declarations
|
||||||
|
|
||||||
private HtmlHead _head;
|
private HtmlHead _head;
|
||||||
private HtmlGenericControl _body;
|
private HtmlBody _body;
|
||||||
private HtmlForm _form;
|
private HtmlForm _form;
|
||||||
private Panel _pnlContainer = new Panel();
|
private Panel _pnlContainer = new Panel();
|
||||||
private CButton _btnPostback = new CButton();
|
private Button _btnPostback = new Button();
|
||||||
private CButton _btnLogout = new CButton();
|
private Button _btnLogout = new Button();
|
||||||
|
|
||||||
private bool _mustBeAutenticated = true;
|
private bool _mustBeAutenticated = true;
|
||||||
private bool _isAuthenticated = false;
|
private bool _isAuthenticated = false;
|
||||||
@@ -56,7 +52,7 @@ namespace VAR.WebForms.Common.Pages
|
|||||||
_isAuthenticated = GlobalConfig.Get().IsUserAuthenticated(Context);
|
_isAuthenticated = GlobalConfig.Get().IsUserAuthenticated(Context);
|
||||||
if (_mustBeAutenticated && _isAuthenticated == false)
|
if (_mustBeAutenticated && _isAuthenticated == false)
|
||||||
{
|
{
|
||||||
Response.Redirect(GlobalConfig.Get().LoginHandler);
|
Context.Response.Redirect(GlobalConfig.Get().LoginHandler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +76,7 @@ namespace VAR.WebForms.Common.Pages
|
|||||||
GlobalConfig.Get().UserUnauthenticate(Context);
|
GlobalConfig.Get().UserUnauthenticate(Context);
|
||||||
if (_mustBeAutenticated)
|
if (_mustBeAutenticated)
|
||||||
{
|
{
|
||||||
Response.Redirect(GlobalConfig.Get().LoginHandler);
|
Context.Response.Redirect(GlobalConfig.Get().LoginHandler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,7 +86,7 @@ namespace VAR.WebForms.Common.Pages
|
|||||||
|
|
||||||
private void CreateControls()
|
private void CreateControls()
|
||||||
{
|
{
|
||||||
Context.Response.Charset = Encoding.UTF8.WebName;
|
//Context.Response.Charset = Encoding.UTF8.WebName;
|
||||||
|
|
||||||
var doctype = new LiteralControl("<!DOCTYPE html>\n");
|
var doctype = new LiteralControl("<!DOCTYPE html>\n");
|
||||||
base.Controls.Add(doctype);
|
base.Controls.Add(doctype);
|
||||||
@@ -111,7 +107,7 @@ namespace VAR.WebForms.Common.Pages
|
|||||||
_head.Controls.Add(new LiteralControl(string.Format("<script type=\"text/javascript\" src=\"ScriptsBundler?v={0}\"></script>\n", version)));
|
_head.Controls.Add(new LiteralControl(string.Format("<script type=\"text/javascript\" src=\"ScriptsBundler?v={0}\"></script>\n", version)));
|
||||||
_head.Controls.Add(new LiteralControl(string.Format("<link href=\"StylesBundler?v={0}\" type=\"text/css\" rel=\"stylesheet\"/>\n", version)));
|
_head.Controls.Add(new LiteralControl(string.Format("<link href=\"StylesBundler?v={0}\" type=\"text/css\" rel=\"stylesheet\"/>\n", version)));
|
||||||
|
|
||||||
_body = new HtmlGenericControl("body");
|
_body = new HtmlBody();
|
||||||
html.Controls.Add(_body);
|
html.Controls.Add(_body);
|
||||||
_form = new HtmlForm { ID = "formMain" };
|
_form = new HtmlForm { ID = "formMain" };
|
||||||
_body.Controls.Add(_form);
|
_body.Controls.Add(_form);
|
||||||
@@ -123,7 +119,7 @@ namespace VAR.WebForms.Common.Pages
|
|||||||
lnkTitle.NavigateUrl = ".";
|
lnkTitle.NavigateUrl = ".";
|
||||||
pnlHeader.Controls.Add(lnkTitle);
|
pnlHeader.Controls.Add(lnkTitle);
|
||||||
|
|
||||||
var lblTitle = new CLabel { Text = GlobalConfig.Get().Title, Tag = "h1" };
|
var lblTitle = new Label { Text = GlobalConfig.Get().Title, Tag = "h1" };
|
||||||
lnkTitle.Controls.Add(lblTitle);
|
lnkTitle.Controls.Add(lblTitle);
|
||||||
|
|
||||||
_btnPostback.ID = "btnPostback";
|
_btnPostback.ID = "btnPostback";
|
||||||
27
VAR.WebFormsCore/Properties/launchSettings.json
Normal file
27
VAR.WebFormsCore/Properties/launchSettings.json
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"iisSettings": {
|
||||||
|
"windowsAuthentication": false,
|
||||||
|
"anonymousAuthentication": true,
|
||||||
|
"iisExpress": {
|
||||||
|
"applicationUrl": "http://localhost:58454/",
|
||||||
|
"sslPort": 44386
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"profiles": {
|
||||||
|
"IIS Express": {
|
||||||
|
"commandName": "IISExpress",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"VAR.WebFormsCore": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
},
|
||||||
|
"applicationUrl": "https://localhost:5001;http://localhost:5000"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
28
VAR.WebFormsCore/VAR.WebFormsCore.csproj
Normal file
28
VAR.WebFormsCore/VAR.WebFormsCore.csproj
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="Scripts\01. Base.js" />
|
||||||
|
<None Remove="Scripts\02. Ajax.js" />
|
||||||
|
<None Remove="Scripts\03. Controls.js" />
|
||||||
|
<None Remove="Styles\00. Reset.css" />
|
||||||
|
<None Remove="Styles\01. base.css" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Scripts\01. Base.js" />
|
||||||
|
<EmbeddedResource Include="Scripts\02. Ajax.js" />
|
||||||
|
<EmbeddedResource Include="Scripts\03. Controls.js" />
|
||||||
|
<EmbeddedResource Include="Styles\00. Reset.css" />
|
||||||
|
<EmbeddedResource Include="Styles\01. base.css" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="VAR.Json" Version="1.2.2" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
|
</Project>
|
||||||
Reference in New Issue
Block a user