public override int GetHashCode() { unchecked { var hashCode = (FullPath != null ? FullPath.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Filename != null ? Filename.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Extension != null ? Extension.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (FormatName != null ? FormatName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (BitRate != null ? BitRate.GetHashCode() : 0); hashCode = (hashCode * 397) ^ FileSize.GetHashCode(); hashCode = (hashCode * 397) ^ DurationInSecs.GetHashCode(); hashCode = (hashCode * 397) ^ VideoStream.GetHashCode(); hashCode = (hashCode * 397) ^ AudioStream.GetHashCode(); return(hashCode); } }
public ObjectCall(string call, AssembleInfo info) { TemplateName = info.TemplateName; FormatName = string.Empty; char[] splitParams = { '.' }; var callParams = call.Split(splitParams); if (callParams.Length > 3) { throw new ArgumentException("Invalid object call: " + call); } switch (callParams.Length) { case 3: TemplateName = callParams[0]; ObjectName = callParams[1]; FormatName = callParams[2]; TypeCode = "TOF"; break; case 2: if (info.IsTemplateName(callParams[0])) { TypeCode = "TO"; TemplateName = callParams[0]; ObjectName = callParams[1]; } else { TypeCode = "OF"; ObjectName = callParams[0]; FormatName = callParams[1]; } break; case 1: TypeCode = "O"; ObjectName = callParams[0]; break; } TemplateName = TemplateName.ToLowerInvariant(); ObjectName = ObjectName.ToLowerInvariant(); FormatName = FormatName.ToLowerInvariant(); }
/// <summary>Report when multicast is rated limited</summary> private void CheckMulticastSendRate() { if (!FormatName.StartsWith("multicast=", StringComparison.OrdinalIgnoreCase) || Interlocked.CompareExchange(ref multicastCheck, 1, 0) != 0) { return; } const string kbpsKey = "SOFTWARE\\Microsoft\\MSMQ\\Parameters"; var key = Registry.LocalMachine.OpenSubKey(kbpsKey); if (key == null) { return; // MSMQ not installed? } const string valueName = "MulticastRateKbitsPerSec"; var val = key.GetValue(valueName); float mbps = (int)(val ?? 650) / 1000f; Console.Error.WriteLine($"Sending MSMQ multicast messages is limited to {mbps:N1}MB/sec via the registry HKLM\\{kbpsKey}\\{valueName}"); }
static extern IntPtr glitz_find_standard_format (IntPtr drawable, FormatName format_name);
public IntPtr FindStandardFormat(FormatName format_name) { return(GlitzAPI.glitz_find_standard_format(Handle, format_name)); }
static extern IntPtr glitz_find_standard_format(IntPtr drawable, FormatName format_name);
public void FormattedPrint(FormatName format) { Console.WriteLine(format(this)); }
public IntPtr FindStandardFormat (FormatName format_name) { return GlitzAPI.glitz_find_standard_format (Handle, format_name); }
/// <summary> /// 檢查格式 /// </summary> /// <param name="ID"></param> /// <param name="type"></param> /// <returns></returns> public bool CheckID(String ID, FormatName type) { try { switch (type) { case FormatName.Storage: if (Regex.IsMatch(ID, @"^([2-4]{1})([0-9A-Z]{1})([0-9A-Z]{2})([0-9A]{1})([0-9A]{1})$") || Regex.IsMatch(ID, @"^([A-Z]{1})([0-9]{8})$")) { return(true); } break; case FormatName.Product: if (Regex.IsMatch(ID, @"^\d{8}$")) { return(true); } break; case FormatName.Number: if (Regex.IsMatch(ID, @"^\d+$")) { return(true); } break; //分成In/Out(2013-0730修改)(2013-0910修改) case FormatName.TInBox: if (Regex.IsMatch(ID, @"^[H,A,S,D,E,F,G,K,L]([0-9]{11})$") || Regex.IsMatch(ID, @"^(\w)(\d{9})(T)$")) { return(true); } break; case FormatName.TOutBox: if (Regex.IsMatch(ID, @"^[T]([0-9]{11})$") || Regex.IsMatch(ID, @"^(\w)(\d{9})([H,P,U])$")) { return(true); } break; case FormatName.HInBox: if (Regex.IsMatch(ID, @"^[T,B,C]([0-9]{11})$") || Regex.IsMatch(ID, @"^(\w)(\d{9})(H)$")) { return(true); } break; case FormatName.HOutBox: if (Regex.IsMatch(ID, @"^[H,A,S,B,C,D,E,F,G,K,L]([0-9]{11})$") || Regex.IsMatch(ID, @"^(\w)(\d{9})([T,H,P,U])$")) { return(true); } break; } return(false); } catch (Exception ex) { return(false); } }