/// <summary> /// 移动日志文件 /// </summary> /// <param name="fileName">新文件名</param> /// <returns>是否成功</returns> public bool MoveFile(string fileName) { while (Interlocked.CompareExchange(ref outputLock, 1, 0) != 0) { Thread.Sleep(1); } try { if (File.Exists(FileName)) { if (File.Exists(fileName)) { File.Delete(fileName); } File.Move(FileName, fileName); return(true); } } catch (Exception error) { if (Default != this) { Default.Add(error, null, true); } } finally { outputLock = 0; } return(false); }
public Node DefaultCase() { var defaultCase = new Default() { AnchorToken = Expect(TokenCategory.DEFAULT) }; Expect(TokenCategory.COLON); defaultCase.Add(StmtList()); return(defaultCase); }
/// <summary> /// Adds a modifier to the default category and profile /// </summary> /// <param name="modifier"></param> public void Add(ITagModifier <T> modifier) { Default.Add(modifier); }
/// <summary> /// Adds a builder to the default category and profile /// </summary> /// <param name="builder"></param> public void Add(ITagBuilder <T> builder) { Default.Add(builder); }
/// <summary> /// Adds a modifier to the default category and profile /// </summary> /// <param name="modifier"></param> public void Add(ITagModifier modifier) => Default.Add(modifier);
/// <summary> /// Adds a builder policy to the default category and profile /// </summary> /// <param name="policy"> </param> public void Add(ITagBuilderPolicy policy) => Default.Add(policy);
/// <summary> /// Adds a builder policy to the default category and profile /// </summary> /// <param name="policy"> </param> public void Add(ITagBuilderPolicy <T> policy) { Default.Add(policy); }
static CollisionDispatcher() { Default.Add(typeof(Sphere), typeof(Sphere), new SphereCollider()); }