/// <summary> /// Declare header configuration by call /// </summary> /// <param name="header"></param> public void HeaderByRequest(HeaderDelegate header) { var modifiers = new HeaderParametersModifiers(); header(modifiers); partialHeader = Setmodifiers(modifiers); }
/// <summary> /// Declare configuration by endpoint /// </summary> /// <param name="header"></param> public void HeaderCustom(HeaderDelegate header) { var modifiers = new HeaderParametersModifiers(); header(modifiers); customHeader = Setmodifiers(modifiers); }
public SerializedPropertyTable(string serializationUID, SerializedPropertyDataStore.GatherDelegate gatherDelegate, HeaderDelegate headerDelegate) { //dragHandleEnabled = true; m_SerializationUID = serializationUID; m_GatherDelegate = gatherDelegate; m_HeaderDelegate = headerDelegate; //OnEnable(); }
public SerializedPropertyTable(string serializationUID, SerializedPropertyDataStore.GatherDelegate gatherDelegate, HeaderDelegate headerDelegate) { m_SerializationUID = serializationUID; m_GatherDelegate = gatherDelegate; m_HeaderDelegate = headerDelegate; OnEnable(); }
public SerializedPropertyTable(string serializationUID, SerializedPropertyDataStore.GatherDelegate gatherDelegate, HeaderDelegate headerDelegate, bool showFilterGUI) { m_SerializationUID = serializationUID; m_GatherDelegate = gatherDelegate; m_HeaderDelegate = headerDelegate; m_ShowFilterGUI = showFilterGUI; }
private static void ExportAssets <T>(string header, List <T> assets, HeaderDelegate headerDelegate, AssetDelegate <T> assetDelegate, bool delegatesAtEnd, StreamWriter file) where T : Asset { // Generate list of all fields: List <Field> allFields = new List <Field>(); foreach (var asset in assets) { foreach (var field in asset.fields) { if (allFields.Find(f => string.Equals(f.title, field.title)) == null) { allFields.Add(field); } } } // Export header: file.WriteLine(header); StringBuilder titles = new StringBuilder("ID"); StringBuilder types = new StringBuilder("Number"); if (headerDelegate != null && !delegatesAtEnd) { headerDelegate(titles, types); } foreach (var field in allFields) { titles.AppendFormat(",{0}", CleanField(field.title)); types.AppendFormat(",{0}", field.type.ToString()); } if (headerDelegate != null && delegatesAtEnd) { headerDelegate(titles, types); } file.WriteLine(titles.ToString()); file.WriteLine(types.ToString()); // Export all assets: foreach (var asset in assets) { StringBuilder sb = new StringBuilder(asset.id.ToString()); if (assetDelegate != null && !delegatesAtEnd) { assetDelegate(sb, asset); } AppendFields(sb, allFields, asset.fields); if (assetDelegate != null && delegatesAtEnd) { assetDelegate(sb, asset); } file.WriteLine(sb.ToString()); } }
private void WriteCore(int headerSize, byte[] payload, HeaderDelegate headerDelegate) { var blockPosition = (int)(BaseStream.Position % Constants.BlockSize); var remainingBlockBytes = Constants.BlockSize - blockPosition; UInt16 blockIndex = 0; if (remainingBlockBytes <= headerSize) // packet header doesn't fit into remaining space in current block { BaseStream.Position += remainingBlockBytes; // fill remaining space with zeroes (unused data) blockPosition = 0; } if (blockPosition == 0) // beginning of the block { writer.Write((UInt16)blockIndex); // "start block count" blockPosition = sizeof(UInt16); } var totalBlockCount = GetBlockCount(payload.Length, blockPosition + headerSize); // packet header headerDelegate(totalBlockCount); // compute current position & remaining blockPosition = (int)(BaseStream.Position % Constants.BlockSize); remainingBlockBytes = Constants.BlockSize - blockPosition; // TODO: update ApproxLineCount int payloadOffset = 0; while (payloadOffset < payload.Length) { int len = Math.Min(remainingBlockBytes, payload.Length - payloadOffset); if (blockIndex > 0) // beginning of the block { writer.Write((UInt16)blockIndex); // "start block count" writer.Write((UInt16)len); // "length of prev data" } BaseStream.Write(payload, payloadOffset, len); payloadOffset += len; blockIndex++; // init new block remainingBlockBytes = Constants.BlockSize - sizeof(UInt16) - sizeof(UInt16); // "start block count" + "length of prev data" } }
void BtnClose_TouchUpInside(object sender, EventArgs e) { HeaderDelegate?.OnClose(); }