本文整理汇总了C#中Misc类的典型用法代码示例。如果您正苦于以下问题:C# Misc类的具体用法?C# Misc怎么用?C# Misc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Misc类属于命名空间,在下文中一共展示了Misc类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowMessage
public void ShowMessage(Misc.MessageType type, string message)
{
if (vGroupInfo.Visible)
{
switch (type)
{
case Misc.MessageType.Error:
lblError.CssClass = "error";
break;
case Misc.MessageType.Success:
lblError.CssClass = "message";
break;
}
lblError.Text = message;
}
else if (vJoinGroup.Visible)
{
switch (type)
{
case Misc.MessageType.Error:
lblError2.CssClass = "error";
break;
case Misc.MessageType.Success:
lblError2.CssClass = "message";
break;
}
lblError2.Text = message;
}
}
示例2: requestEnd
public static void requestEnd(string pluginid, Connector conn, ref Misc.PageElements pageElements, HttpRequest request, HttpResponse response)
{
bool cookiesEnabled = request.Cookies["cookie-control"] != null;
// Add styling and toggle button
Misc.Plugins.addHeaderCSS(pageElements["URL"] + "/Content/CSS/CookieControl.css", ref pageElements);
Misc.Plugins.addHeaderJS(pageElements["URL"] + "/Content/JS/CookieControl.js", ref pageElements);
// Add toggle button
pageElements.appendToKey("BODY_FOOTER", Core.templates["cookiecontrol"]["toggle"]);
// Add warning banner
if (!cookiesEnabled)
pageElements.appendToKey("BODY_HEADER", Core.templates["cookiecontrol"]["banner"]);
else
{
// Check if cookies have been enabled, if so return - no need to remove cookies
pageElements.setFlag("COOKIES_ON");
return;
}
// Clear all the response cookies - these may have been added programmatically
response.Cookies.Clear();
// Add each cookie, sent in the request, in the response - to expire
HttpCookie cookie;
for (int i = 0; i < request.Cookies.Count; i++)
{
cookie = request.Cookies[i];
if (cookie.Name != "ASP.NET_SessionId")
{
cookie.Expires = DateTime.Now.AddDays(-2);
response.Cookies.Add(cookie);
}
}
}
示例3: InsertAddTList
// Algo d'ajout par insertion
private static void InsertAddTList(ref Misc.TList L, int w, char k)
{
Misc.TList p, prec, nouv;
p = L;
prec = null; // sert à rien, c'est juste pour que VS croit pas qu'on arrive au else avec prec sans valeur.
while (p.Weight != 0 && p.Weight < w) // weight = 0 équivaut à pointeur nul.
{
prec = p;
p = p.Next;
}
nouv = new Misc.TList();
nouv.Weight = w;
nouv.Next = p;
nouv.Tree = new Misc.TBinaryTree();
nouv.Tree.Key = k;
nouv.Tree.Left = null;
nouv.Tree.Right = null;
if (p == L)
{
L = nouv;
}
else
{
prec.Next = nouv;
}
}
示例4: Draw
//Tillaggt! -Erik
public void Draw(int w, int h, Misc.Camera cam, float ScaleFactor = 1f, bool ShadowPass = false)
{
for(int i = 0; i < 24; i++) {
for(int k = 0; k < 24; k++) {
map[i, k].Draw(w, h, cam, ScaleFactor, 0.0f, ShadowPass);
}
}
}
示例5: Hitdetecion
public static void Hitdetecion(Moveable obj, Misc.Quad[,] objlist)
{
foreach(Misc.Quad xobj in objlist) {
if(obj.Bounds.IntersectsWith(obj.Bounds)) {
obj.Direction = new OpenTK.Vector2(0, 0);
}
}
}
示例6: Clone
public override Item Clone ()
{
Misc item = new Misc();
base.CloneBase(item);
//copy all vars before return
return item;
}
示例7: calculateKernelsForPositions
public void calculateKernelsForPositions(Map2d<float> map, ref Misc.Vector2<int>[] kernelPositions, ref float[] kernelValues )
{
int i;
for( i = 0; i < kernelPositions.Length; i++ )
{
kernelValues[i] = multiplyKernelWithMapAtCenter(kernelPositions[i].x, kernelPositions[i].y, map);
}
}
示例8: handleRequest
public static void handleRequest(string pluginid, Connector conn, ref Misc.PageElements pageElements, HttpRequest request, HttpResponse response)
{
switch (request.QueryString["page"])
{
case "captcha":
if (!Core.settings[SETTINGS_KEY].getBool(SETTINGS_KEY_CAPTCHA_ENABLED)) return;
pageCaptcha(pluginid, conn, ref pageElements, request, response);
break;
}
}
示例9: Formatting
/// <summary>
/// A text formatting.
/// </summary>
public Formatting()
{
capsStyle = CapsStyle.none;
strikethrough = StrikeThrough.none;
script = Script.none;
highlight = Highlight.none;
underlineStyle = UnderlineStyle.none;
misc = Misc.none;
rPr = new XElement(XName.Get("rPr", DocX.w.NamespaceName));
}
示例10: CreateList
public static Misc.TList CreateList(Misc.TFrequency frequency)
{
Misc.TList L = new Misc.TList();
for (int i = 0; i < 255; i++)
{
if (frequency[i] > 0)
{
InsertAddTList(ref L, frequency[i], Convert.ToChar(i));
}
}
return L;
}
示例11: GetTransformRelative
/// <summary>
/// Internal method to get the transform relative to a bounding box
/// </summary>
/// <param name="bounds">The bounding box to transform relative to</param>
/// <returns>A transform that is relative to a bounding box</returns>
internal override Matrix3x2 GetTransformRelative(Misc.RectangleF bounds)
{
/* Find the relative center on the X axis */
float centerX = bounds.X + (CenterX * bounds.Width);
/* Find the relative center on the Y axis */
float centerY = bounds.Y + (CenterY * bounds.Height);
/* Create the rotation transform matrix */
var transform = Matrix3x2.Rotation(Angle, new PointF(centerX, centerY));
return transform;
}
示例12: Formatting
/// <summary>
/// A text formatting.
/// </summary>
public Formatting()
{
capsStyle = CapsStyle.none;
strikethrough = StrikeThrough.none;
script = Script.none;
highlight = Highlight.none;
underlineStyle = UnderlineStyle.none;
misc = Misc.none;
// Use current culture by default
language = CultureInfo.CurrentCulture;
rPr = new XElement(XName.Get("rPr", DocX.w.NamespaceName));
}
示例13: mon_clear_timed
/**
* Clears the timed effect `ef_idx`.
*
* Returns true if the monster's timer was changed.
*/
public static bool mon_clear_timed(int m_idx, Misc.MON_TMD ef_idx, ushort flag, bool id)
{
Monster m_ptr;
Misc.assert(ef_idx >= 0 && ef_idx < Misc.MON_TMD.MAX);
Misc.assert(m_idx > 0);
m_ptr = Cave.cave_monster(Cave.cave, m_idx);
if (m_ptr.m_timed[(int)ef_idx] == 0) return false;
/* Clearing never fails */
flag |= Misc.MON_TMD_FLG_NOFAIL;
return mon_set_timed(m_ptr, ef_idx, 0, flag, id);
}
示例14: handleRequest
public static void handleRequest(string pluginid, Connector conn, ref Misc.PageElements pageElements, HttpRequest request, HttpResponse response)
{
// Toggle cookie-control
HttpCookie cookie = request.Cookies["cookie-control"];
if (cookie != null)
{
cookie.Expires = DateTime.Now.AddDays(-1);
response.Cookies.Add(cookie);
}
else
response.Cookies.Add(new HttpCookie("cookie-control", "1"));
// Redirect to the origin or homepage
if (request.UrlReferrer != null)
response.Redirect(request.UrlReferrer.AbsoluteUri);
else
response.Redirect(pageElements["URL"]);
}
示例15: CreateTree
public static Misc.TBinaryTree CreateTree(Misc.TList list)
{
while (list.Next.Weight > 0)
{
if (list.Next.Weight <= list.Weight)
{
list.Tree.Left = list.Next.Tree;
list.Tree.Right = list.Tree;
}
else
{
list.Tree.Right = list.Next.Tree;
list.Tree.Left = list.Tree;
}
list.Tree.Key = '\0';
list.Weight += list.Next.Weight;
list = list.Next;
}
return list.Tree;
}