本文整理汇总了C#中Misc类的典型用法代码示例。如果您正苦于以下问题:C# Misc类的具体用法?C# Misc怎么用?C# Misc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Misc类属于命名空间,在下文中一共展示了Misc类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
}
开发者ID:haimon74,项目名称:Easy-Fixup,代码行数:29,代码来源:ViewGroup.ascx.cs
示例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);
}
}
}
开发者ID:kassemshehady,项目名称:Uber-CMS,代码行数:31,代码来源:Base.cs
示例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;
}
}
开发者ID:Zboubinours,项目名称:tp,代码行数:27,代码来源:Compression.cs
示例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);
}
}
}
开发者ID:Erlisch,项目名称:Caliginous,代码行数:9,代码来源:World.cs
示例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);
}
}
}
开发者ID:Erlisch,项目名称:Caliginous,代码行数:8,代码来源:Collision.cs
示例6: Clone
public override Item Clone ()
{
Misc item = new Misc();
base.CloneBase(item);
//copy all vars before return
return item;
}
开发者ID:Gapti,项目名称:INT-Marks,代码行数:8,代码来源:Misc.cs
示例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);
}
}
开发者ID:PtrMan,项目名称:ai2,代码行数:9,代码来源:RadialKernelDetector.cs
示例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;
}
}
开发者ID:kassemshehady,项目名称:Uber-CMS,代码行数:10,代码来源:Common.cs
示例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));
}
开发者ID:JonKruger,项目名称:DocX,代码行数:14,代码来源:Formatting.cs
示例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;
}
开发者ID:Zboubinours,项目名称:tp,代码行数:12,代码来源:Compression.cs
示例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;
}
开发者ID:treytomes,项目名称:DirectCanvas,代码行数:18,代码来源:RotateTransform.cs
示例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));
}
开发者ID:Johnnyfly,项目名称:source20131023,代码行数:17,代码来源:Formatting.cs
示例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);
}
开发者ID:jobjingjo,项目名称:csangband,代码行数:21,代码来源:Monster_Timed.cs
示例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"]);
}
开发者ID:kassemshehady,项目名称:Uber-CMS,代码行数:17,代码来源:Base.cs
示例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;
}
开发者ID:Zboubinours,项目名称:tp,代码行数:20,代码来源:Compression.cs
示例16: mon_dec_timed
/**
* Decreases the timed effect `ef_idx` by `timer`.
*
* Calculates the new timer, then passes that to mon_set_timed().
* If a timer would be set to a negative number, it is set to 0 instead.
* Note that decreasing a timed effect should never fail.
*
* Returns true if the monster's timer changed.
*/
public static bool mon_dec_timed(int m_idx, Misc.MON_TMD ef_idx, int timer, 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);
Misc.assert(timer > 0);
/* Decreasing is never resisted */
flag |= Misc.MON_TMD_FLG_NOFAIL;
/* New counter amount */
timer = m_ptr.m_timed[(int)ef_idx] - timer;
if (timer < 0)
timer = 0;
return mon_set_timed(m_ptr, ef_idx, timer, flag, id);
}
开发者ID:jobjingjo,项目名称:csangband,代码行数:30,代码来源:Monster_Timed.cs
示例17: handleRequest
public static void handleRequest(string pluginid, Connector conn, ref Misc.PageElements pageElements, HttpRequest request, HttpResponse response)
{
switch (request.QueryString["1"])
{
case null:
case "home":
pageHome(pluginid, conn, ref pageElements, request, response);
break;
case "sync":
pageSync(pluginid, conn, ref pageElements, request, response);
break;
case "package":
pagePackage(pluginid, conn, ref pageElements, request, response);
break;
case "dump":
pageDump(pluginid, conn, ref pageElements, request, response);
break;
case "upload":
pageUpload(pluginid, conn, ref pageElements, request, response);
break;
}
}
开发者ID:kassemshehady,项目名称:Uber-CMS,代码行数:22,代码来源:DevPackage.cs
示例18: ColorRoute
Color ColorRoute(Misc.Vertex<int > curr, Color inpc) // inpc, income predicted color
{
Color newpc = Color.OrangeRed;// some mess to make compiler happy
if (inpc == Color.White) newpc = Color.Black; else newpc = Color.White;
List<Color> currlist = new List<Color>();
Color back;
int i = 0;
if (curr._inner != Color.Gray) return curr._inner;
curr._inner = Color.Red;
g.CreateIterator(curr.id);
while (g.IsValid())
{
Misc.Vertex<int> newcurr;
newcurr = g.GetVertex(g.Current());// get linked vertex
back = ColorRoute(newcurr,newpc);
if (back == Color.Red) { newcurr._inner = newpc; back = newpc; }
currlist.Add(back);
g.CreateIterator(curr.id);
for (int j = 0; j < i; j++) g.MoveNext();
g.MoveNext();
i++;
}
if (currlist.Count > 0)
{
bool iswhite = (currlist[0] == Color.White);
for (int j = 0; j < currlist.Count; j++)
{
if (currlist[j] == Color.Red) continue;
bool localcc = (currlist[j] == Color.White);
if (localcc != iswhite) throw new Exception("Cant find solution");
}
if (iswhite) curr._inner = Color.Black; else curr._inner = Color.White;
}
else curr._inner = inpc;
// check bypassed, things are looking good, now able to color current vertex
return curr._inner;
}
开发者ID:NSoft-SteAleX,项目名称:Graphs,代码行数:38,代码来源:Tasks.cs
示例19: CanEdit
public bool CanEdit(Misc m)
{
if (this.IsAdmin)
return true;
if (this.K == m.UsrK)
return true;
if (m.Promoter != null && this.IsEnabledPromoter(m.PromoterK))
return true;
return false;
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:11,代码来源:Usr.cs
示例20: OnAttack
public override void OnAttack(Misc.DamageAction action)
{
if (action.Victim is NPC && m_dmgBonusVsCreatureTypePct != null)
{
var bonus = m_dmgBonusVsCreatureTypePct[(int)((NPC)action.Victim).Entry.Type];
if (bonus != 0)
{
action.Damage += (bonus * action.Damage + 50) / 100;
}
}
base.OnAttack(action);
}
开发者ID:remixod,项目名称:netServer,代码行数:12,代码来源:Character.cs
注:本文中的Misc类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论