// control with sound | constructor path Two public LeapTimeButton(Color[] chosenColors, int chosenSecondsAmount, Texture2D buttonTexture, Rectangle buttonDimensions, SoundEffect newSong) { constructorPath = ConstructorPath.Two; menuItem = buttonTexture; // seconds before effect secondsBeforeEffect = chosenSecondsAmount; menuItemColor = Color.White; menuItemRect = buttonDimensions; // new Rectangle(0, 0, 256, 256); // song code buttonSong = newSong; buttonSongInstance = buttonSong.CreateInstance(); #region after several seconds disappear constructor code isMarkTimeEqualToGameTime = false; textSeen = false; isMarkGotten = false; #endregion // colors colorChanger = new Color[secondsBeforeEffect]; for (int i = 0; i < colorChanger.Length; i++) { colorChanger[i] = chosenColors[i]; } }
// constructor THREE public LeapTimeButton(Texture2D buttonTexture, Rectangle buttonDimensions, SoundEffect newSong) { constructorPath = ConstructorPath.Two; menuItem = buttonTexture; // seconds before effect secondsBeforeEffect = 3; menuItemColor = Color.White; menuItemRect = buttonDimensions; // new Rectangle(0, 0, 256, 256); // song code buttonSong = newSong; buttonSongInstance = buttonSong.CreateInstance(); #region after several seconds disappear constructor code isMarkTimeEqualToGameTime = false; textSeen = false; isMarkGotten = false; #endregion // colors colorChanger = new Color[3]; colorChanger[0] = Color.LightBlue; colorChanger[1] = Color.Blue; colorChanger[2] = Color.DarkBlue; }
// control picture only | constructor Empty public LeapTimeButton() { constructorPath = ConstructorPath.Empty; menuItemColor = Color.White; menuItemRect = new Rectangle(0, 0, 256, 256); #region after several seconds disappear constructor code isMarkTimeEqualToGameTime = false; textSeen = false; isMarkGotten = false; #endregion }
List <ActionObjectPath> IFieldUpdateStrategy.GetFieldUpdateAction(CSOMItemField fld, Identity identity) { int getByInternalNameOrTitleId = IdProvider.GetActionId(); int taxonomyParameterConstructorId = IdProvider.GetActionId(); //Set field value MethodAction setFieldValueByValue = new MethodAction { ObjectPathId = getByInternalNameOrTitleId.ToString(), Id = IdProvider.GetActionId(), Name = "SetFieldValueByValueCollection", Parameters = new List <Parameter>() { new ObjectReferenceParameter() { ObjectPathId = identity.Id }, new ObjectReferenceParameter() { ObjectPathId = taxonomyParameterConstructorId } } }; //Get field ObjectPathMethod getFieldByInternalNameMethod = new ObjectPathMethod { Id = getByInternalNameOrTitleId, ParentId = FieldsProperty.Id, Name = "GetByInternalNameOrTitle", Parameters = new MethodParameter() { Properties = new List <Parameter>() { new Parameter() { Type = "String", Value = fld.FieldName } } } }; //Create taxonomy collection List <Parameter> parameters = fld.GetRequestParameters(/*identity.Id*/ getByInternalNameOrTitleId); parameters.Reverse(); ConstructorPath taxonomyCollectionConstructor = new ConstructorPath { Id = taxonomyParameterConstructorId, TypeId = "{c3dfae10-f3bf-4894-9012-bb60665b6d91}", Parameters = new MethodParameter() { Properties = parameters } }; ActionObjectPath setTaxonomyActionObject = new ActionObjectPath() { Action = setFieldValueByValue, ObjectPath = getFieldByInternalNameMethod }; ActionObjectPath constructTaxonomyCollection = new ActionObjectPath() { ObjectPath = taxonomyCollectionConstructor }; return(new List <ActionObjectPath>() { setTaxonomyActionObject, constructTaxonomyCollection }); }