public override System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> ReadFields(System.IO.BinaryReader binaryReader) { System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(base.ReadFields(binaryReader)); this.Name = binaryReader.ReadStringID(); this.NodeListChecksum = binaryReader.ReadInt32(); this.ProductionChecksum = binaryReader.ReadInt32(); this.ImportChecksum = binaryReader.ReadInt32(); this.Type = ((TypeEnum)(binaryReader.ReadByte())); this.FrameInfoType = ((FrameInfoTypeEnum)(binaryReader.ReadByte())); this.BlendScreen = binaryReader.ReadByteBlockIndex1(); this.NodeCount = binaryReader.ReadByte(); this.FrameCount = binaryReader.ReadInt16(); this.AnimationPoolInternalFlags = ((InternalFlags)(binaryReader.ReadByte())); this.AnimationPoolProductionFlags = ((ProductionFlags)(binaryReader.ReadByte())); this.AnimationPoolPlaybackFlags = ((PlaybackFlags)(binaryReader.ReadInt16())); this.DesiredCompression = ((DesiredCompressionEnum)(binaryReader.ReadByte())); this.CurrentCompression = ((CurrentCompressionEnum)(binaryReader.ReadByte())); this.Weight = binaryReader.ReadSingle(); this.ParentGraphIndex = binaryReader.ReadInt32(); this.ParentGraphBlockIndex = binaryReader.ReadInt32(); this.ParentGraphBlockOffset = binaryReader.ReadInt32(); this.ParentGraphStartingPointIndex = binaryReader.ReadInt16(); this.LoopFrameIndex = binaryReader.ReadInt16(); this.ParentAnimation = binaryReader.ReadShortBlockIndex1(); this.NextAnimation = binaryReader.ReadShortBlockIndex1(); pointerQueue.Enqueue(binaryReader.ReadBlamPointer(1)); pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(pointerQueue.Concat(this.DataSizes.ReadFields(binaryReader))); pointerQueue.Enqueue(binaryReader.ReadBlamPointer(4)); pointerQueue.Enqueue(binaryReader.ReadBlamPointer(8)); pointerQueue.Enqueue(binaryReader.ReadBlamPointer(4)); pointerQueue.Enqueue(binaryReader.ReadBlamPointer(28)); return(pointerQueue); }
public override System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> ReadFields(System.IO.BinaryReader binaryReader) { System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(base.ReadFields(binaryReader)); this.MaxSoundsPerTag116 = binaryReader.ReadInt16(); this.MaxSoundsPerObject116 = binaryReader.ReadInt16(); this.PreemptionTime = binaryReader.ReadInt32(); this.SoundClassInternalFlags = ((InternalFlags)(binaryReader.ReadInt16())); this.SoundClassFlags = ((Flags)(binaryReader.ReadInt16())); this.Priority = binaryReader.ReadInt16(); this.CacheMissMode = ((CacheMissModeEnum)(binaryReader.ReadInt16())); this.ReverbGain = binaryReader.ReadSingle(); this.OverrideSpeakerGain = binaryReader.ReadSingle(); this.DistanceBounds = binaryReader.ReadRange(); this.GainBounds = binaryReader.ReadRange(); this.CutsceneDucking = binaryReader.ReadSingle(); this.CutsceneDuckingFadeInTime = binaryReader.ReadSingle(); this.CutsceneDuckingSustainTime = binaryReader.ReadSingle(); this.CutsceneDuckingFadeOutTime = binaryReader.ReadSingle(); this.ScriptedDialogDucking = binaryReader.ReadSingle(); this.ScriptedDialogDuckingFadeInTime = binaryReader.ReadSingle(); this.ScriptedDialogDuckingSustainTime = binaryReader.ReadSingle(); this.ScriptedDialogDuckingFadeOutTime = binaryReader.ReadSingle(); this.DopplerFactor = binaryReader.ReadSingle(); this.StereoPlaybackType = ((StereoPlaybackTypeEnum)(binaryReader.ReadByte())); this.fieldpad = binaryReader.ReadBytes(3); this.TransmissionMultiplier = binaryReader.ReadSingle(); this.ObstructionMaxBend = binaryReader.ReadSingle(); this.OcclusionMaxBend = binaryReader.ReadSingle(); return(pointerQueue); }
internal ParameterData(ParameterDefinition underlyingParameter, MemberDataBase declaringMember) { var modifer = ParameterModifier.None; var parameterType = underlyingParameter.ParameterType; var byReferenceType = parameterType as ByReferenceType; if (byReferenceType != null) { modifer = underlyingParameter.IsOut ? ParameterModifier.Out : ParameterModifier.Ref; parameterType = byReferenceType.ElementType; } this.DeclaringMemberKind = declaringMember.MetadataItemKind; this.Modifer = modifer; this.Name = underlyingParameter.Name; this.Type = TypeData.FromType(parameterType); if (underlyingParameter.IsOptional) { _flags |= InternalFlags.IsOptional; this.DefaultValue = Utilities.PreprocessConstantValue(parameterType, underlyingParameter.GetDefualtValue()); } if (underlyingParameter.CustomAttributes.Any(c => c.AttributeType.EqualsType(typeof(ParamArrayAttribute)))) { _flags |= InternalFlags.IsParamsArray; } if (underlyingParameter.IsDynamicType()) { _flags |= InternalFlags.IsTypeDynamic; } }
private readonly InternalFlags _flags; // TODO_Serialize: round trip and test #endregion // Member Variables #region Constructor internal ParameterData(MetadataItemKinds declaringMemberKind, string name, TypeData type, ParameterModifier modifer, InternalFlags flags, object defaultValue) { _flags = flags; this.DeclaringMemberKind = declaringMemberKind; this.DefaultValue = defaultValue; this.Modifer = modifer; this.Name = name; this.Type = type; }
private void WriteInternalFlag(InternalFlags reqFlag, bool set) { if (set) { var frameworkTemplate = this; frameworkTemplate.flags = frameworkTemplate.flags | reqFlag; return; } var frameworkTemplate1 = this; frameworkTemplate1.flags = frameworkTemplate1.flags & ~reqFlag; }
internal ParameterData(IParameterSymbol parameterSymbol, MemberDataBase declaringMember) { Context = declaringMember.Context; var parameterType = parameterSymbol.Type; ParameterModifier modifer; switch (parameterSymbol.RefKind) { case RefKind.None: modifer = ParameterModifier.None; break; case RefKind.Out: modifer = ParameterModifier.Out; break; case RefKind.Ref: modifer = ParameterModifier.Ref; break; default: throw new InvalidOperationException($"Unknown RefKind value: {parameterSymbol.RefKind}"); } DeclaringMemberKind = declaringMember.MetadataItemKind; Modifer = modifer; Name = parameterSymbol.Name; Type = Context.GetTypeData(parameterType); if (parameterSymbol.IsOptional) { _flags |= InternalFlags.IsOptional; DefaultValue = Utilities.PreprocessConstantValue(parameterType, parameterSymbol.ExplicitDefaultValue); } if (parameterSymbol.IsParams) { _flags |= InternalFlags.IsParamsArray; } if (parameterSymbol.Type.TypeKind == TypeKind.Dynamic) { _flags |= InternalFlags.IsTypeDynamic; } }
private bool GetFlag(InternalFlags flag) { return((_flags & flag) == flag); }
private bool ReadInternalFlag(InternalFlags reqFlag) { return((int)(this.flags & reqFlag) != 0); }
// Sets or Unsets the required flag based on // the bool argument private void WriteInternalFlag(InternalFlags reqFlag, bool set) { if (set) { _flags |= reqFlag; } else { _flags &= (~reqFlag); } }
// Extracts the required flag and returns // bool to indicate if it is set or unset private bool ReadInternalFlag(InternalFlags reqFlag) { return (_flags & reqFlag) != 0; }
internal void WriteInternalFlag(InternalFlags reqFlag, bool set) { if (set) this._flags |= reqFlag; else this._flags &= ~reqFlag; }
internal bool ReadInternalFlag(InternalFlags reqFlag) { return (this._flags & reqFlag) != (InternalFlags) 0; }
/// <summary> /// Initializes a new instance of the <see cref="Destination"/> class. /// </summary> /// <param name="fieldInfo">Field information.</param> /// <param name="argument">Argument attribute.</param> /// <param name="internalTarget">Internal flags.</param> public Destination(FieldInfo fieldInfo, ArgumentAttribute argument, InternalFlags internalTarget) { _fieldInfo = fieldInfo; _argument = argument; _internalTarget = internalTarget; // _AlreadySaved = false; _parameterList = fieldInfo.FieldType.IsArray ? new ArrayList() : null; }
private bool ReadInternalFlag(InternalFlags reqFlag) { return (int)(this.flags & reqFlag) != 0; }
// // This method // 1. Is called whenever a new Style/Template is upapplied from an FE/FCE // 2. It removes per-instance StyleData/TemplateData for the old Style/Template // internal static void ReleaseInstanceData( UncommonField<HybridDictionary[]> dataField, DependencyObject container, FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, FrameworkTemplate oldFrameworkTemplate, InternalFlags hasGeneratedSubTreeFlag) { Debug.Assert((fe != null && fce == null) || (fe == null && fce != null)); Debug.Assert((fe != null && fe == container) || (fce != null && fce == container)); Debug.Assert(oldStyle != null || oldFrameworkTemplate != null ); // Fetch the per-instance data field value HybridDictionary[] styleData = dataField.GetValue(container); if (oldStyle != null) { HybridDictionary instanceValues = (styleData != null) ? styleData[(int)InstanceStyleData.InstanceValues] : null; ReleaseInstanceDataForDataTriggers(dataField, instanceValues, oldStyle, oldFrameworkTemplate ); if (oldStyle.HasInstanceValues) { StyleHelper.ProcessInstanceValuesForChild( container, container, 0, instanceValues, false, ref oldStyle.ChildRecordFromChildIndex); } } else if (oldFrameworkTemplate != null) { HybridDictionary instanceValues = (styleData != null) ? styleData[(int)InstanceStyleData.InstanceValues] : null; ReleaseInstanceDataForDataTriggers(dataField, instanceValues, oldStyle, oldFrameworkTemplate ); if (oldFrameworkTemplate.HasInstanceValues) { StyleHelper.ProcessInstanceValuesForChild( container, container, 0, instanceValues, false, ref oldFrameworkTemplate.ChildRecordFromChildIndex); } } else { HybridDictionary instanceValues = (styleData != null) ? styleData[(int)InstanceStyleData.InstanceValues] : null; ReleaseInstanceDataForDataTriggers(dataField, instanceValues, oldStyle, oldFrameworkTemplate ); } }
// =========================================================================== // These methods are invoked when a visual tree is // being created/destroyed via a Style/Template and // when a Style/Template is being applied or // unapplied to a FE/FCE // =========================================================================== #region WriteInstanceData // // This method // 1. Is called whenever a Style/Template is [un]applied to an FE/FCE // 2. It updates the per-instance StyleData/TemplateData // internal static void UpdateInstanceData( UncommonField<HybridDictionary[]> dataField, FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle, FrameworkTemplate oldFrameworkTemplate, FrameworkTemplate newFrameworkTemplate, InternalFlags hasGeneratedSubTreeFlag) { Debug.Assert((fe != null && fce == null) || (fe == null && fce != null)); DependencyObject container = (fe != null) ? (DependencyObject)fe : (DependencyObject)fce; if (oldStyle != null || oldFrameworkTemplate != null ) { ReleaseInstanceData(dataField, container, fe, fce, oldStyle, oldFrameworkTemplate, hasGeneratedSubTreeFlag); } if (newStyle != null || newFrameworkTemplate != null ) { CreateInstanceData(dataField, container, fe, fce, newStyle, newFrameworkTemplate ); } else { dataField.ClearValue(container); } }
/// <summary> /// Parse the command-line array args, and save the value to the target class. /// </summary> /// <param name="args">Argument string array.</param> /// <param name="target">Target object to associate parsing and save result.</param> public static void Parse(string[] args, object target) { ClpHelper.CheckTarget(target); ClpHelper.CheckArgs(args, target); InternalFlags internalTarget = new InternalFlags(); ClpHelper helper = new ClpHelper(target, internalTarget); helper.ParseArgs(args); if (!string.IsNullOrEmpty(internalTarget.ConfigFile)) { args = ClpHelper.GetStringsFromConfigFile(internalTarget.ConfigFile); helper.ParseArgs(args); } if (internalTarget.NeedHelp) { throw new CommandLineParseException(string.Empty, "help"); } helper.CheckAllRequiredDestination(); }
/// <summary> /// Initializes a new instance of the <see cref="ClpHelper"/> class. /// </summary> /// <param name="target">Target object to reflect usage information.</param> /// <param name="internalTarget">Internal flags.</param> public ClpHelper(object target, InternalFlags internalTarget) { _target = target; _internalTarget = internalTarget; // interal flags class, include "-h","-?","-help","-C" ParseTheDestination(target); }
private bool GetFlag(InternalFlags flag) => (_flags & flag) == flag;