public SyncEventArgs(Ta targetItem, Tb sourceItem, CollectionAction action, IEnumerable <Ta> targetItems, IEnumerable <Tb> sourceItems) { TargetItem = targetItem; SourceItem = sourceItem; Action = action; TargetItems = targetItems; SourceItems = sourceItems; }
private void ExecuteMethod(MongoCollection obj) { var dba = new CollectionAction(); dba.Action = ActionType.Drop; dba.CollectionName = obj.Name; dba.Database = obj.Database; obj.Drop(); _eventAggregator.GetEvent <PubSubEvent <CollectionAction> >().Publish(dba); }
protected override void OK() { var coll = _database.CreateCollection(CollectionName); CollectionAction a = new CollectionAction(); a.Action = ActionType.Create; a.CollectionName = CollectionName; a.Database = _database; _eventAggregator.GetEvent <PubSubEvent <CollectionAction> >().Publish(a); RaiseCloseRequest(); }
public static CollectionAction GetCollectionOnView(Collection collection) { collectionView = new CollectionAction { Id = collection.Id, UserId = collection.UserId, Title = collection.Title, Description = collection.Description, Topic = collection.Topic, ImgUrl = collection.ImgUrl, ImageCloudId = collection.ImageCloudId }; return(collectionView); }
private void InvokeHandlers(CollectionAction action, ICollection <KeyValuePair <string, DataElement> > newItems, ICollection <KeyValuePair <string, DataElement> > oldItems) { foreach (CollectionChangedEventHandler <KeyValuePair <string, DataElement> > handler in _handlers) { handler(this, action, newItems, oldItems); } _autoReleaseHandlers.RemoveAll(wr => !wr.IsAlive); foreach (CollectionChangedEventHandler <KeyValuePair <string, DataElement> > handler in _autoReleaseHandlers.Select(wr => wr.Target)) { handler(this, action, newItems, oldItems); } }
public async Task <IActionResult> Create(DataForm AllData) { CollectionAction collectionAct = new CollectionAction(AllData.Title, AllData.Description, AllData.Topic, AllData.Image, userManager.GetUserId(HttpContext.User)); Collection collection = CollectionProcessing.CollectionProcess(collectionAct); if (AllData.AdditionalFields != "[]") { List <CustomField> fields = FieldProcessing.FieldsProcess(AllData.AdditionalFields, collection.Id); for (int i = 0; i < fields.Count; i++) { await Context.CustomFields.AddAsync(fields[i]); } } await Context.Collections.AddAsync(collection); await Context.SaveChangesAsync(); return(RedirectToAction("MyCollections", "Collection")); }
public static Collection CollectionProcess(CollectionAction collection) { var uploadResult = collection.Image != null?UploadFile(collection.Image) : null; if (uploadResult != null) { CloudAccount.DeleteFile(collection.ImageCloudId); } collectionResult = new Collection { Id = collection.Id ?? Guid.NewGuid().ToString(), UserId = collection.UserId, Title = collection.Title, Description = collection.Description, Topic = collection.Topic, ImgUrl = collection.Image != null?GetImageCloudUrl(uploadResult, collection.Image.FileName) : collection.ImgUrl, ImageCloudId = collection.Image != null ? uploadResult.PublicId : collection.ImageCloudId }; return(collectionResult); }
public void SelectModel (TComponentModel componentModel) { if (componentModel.NotNull ()) { ComponentModel = componentModel; Id = ComponentModel.Id; ModelAction.SettingsModel.CopyFrom (ComponentModel.SettingsModel); ModelAction.ComponentInfoModel.CopyFrom (ComponentModel.InfoModel); ModelAction.ComponentStatusModel.CopyFrom (ComponentModel.StatusModel); ModelAction.ExtensionImageModel.CopyFrom (ComponentModel.ImageModel); ModelAction.ExtensionGeometryModel.CopyFrom (ComponentModel.GeometryModel); ModelAction.ExtensionLayoutModel.CopyFrom (ComponentModel.LayoutModel); ModelAction.ExtensionTextModel.CopyFrom (ComponentModel.TextModel); ModelAction.ExtensionNodeModel.CopyFrom (ComponentModel.NodeModel); CollectionAction.SetCollection (ComponentModel.NodeModelCollection); } }
private void CollectionListChanged(CollectionAction collectionAction) { if (collectionAction.Action == ActionType.Create) { if (collectionAction.Database == _db) { Children.Add(new CollectionViewModel(_db.GetCollection(collectionAction.CollectionName))); } return; } if (collectionAction.Action == ActionType.Drop) { if (collectionAction.Database == _db) { var db = Children.SingleOrDefault(x => x.Name == collectionAction.CollectionName); if (db != null) { Children.Remove(db); } } } }
public WorkSpaceCollectionEventArgs(CollectionAction action) : base(action) { }
public override int CompareTo(CollectionAction other) { return 0; }
public ElementCollectionEventArgs(CollectionAction action, int capacity) : base(action) { _Elements = new IElement[capacity]; }
public UtilityCollectionEventArgs(CollectionAction action, IUtility element) : base(action) { _Utilities = new IUtility[1]; _Utilities[0] = element; }
private CollectionAction DisplayEntry(int index) { GenericGamepadProfileSelector.Profile profile = m_selector.GetProfile(index); SerializedProperty profileSP = m_profiles.GetArrayElementAtIndex(index); SerializedProperty isExpanded = profileSP.FindPropertyRelative("IsExpanded"); SerializedProperty gamepadProfile = profileSP.FindPropertyRelative("GamepadProfile"); SerializedProperty constraints = profileSP.FindPropertyRelative("Constraints"); CollectionAction entryAction = CollectionAction.None; string label = "Profile " + (index + 1); if (isExpanded.boolValue) { label += " (Click to collapse)"; } else { label += " (Click to expand)"; } if (GUILayout.Button(label, m_headerStyle, GUILayout.ExpandWidth(true))) { isExpanded.boolValue = !isExpanded.boolValue; } if (isExpanded.boolValue) { Rect bgRect = GUILayoutUtility.GetLastRect(); bgRect.y += 18; bgRect.height = CalculateBackgroundHeight(profile); GUI.Box(bgRect, "", (GUIStyle)"RL Background"); EditorGUILayout.BeginHorizontal(); GUILayout.Space(4.0f); EditorGUILayout.BeginVertical(); EditorGUILayout.PropertyField(gamepadProfile); GUILayout.Space(4.0f); EditorGUILayout.LabelField("Constraints", EditorStyles.boldLabel); if (constraints.arraySize > 0) { GUILayout.BeginHorizontal(); GUILayout.Space(14.0f); GUILayout.BeginVertical(); for (int i = 0; i < constraints.arraySize; i++) { SerializedProperty constraint = constraints.GetArrayElementAtIndex(i); SerializedProperty type = constraint.FindPropertyRelative("Type"); SerializedProperty content = constraint.FindPropertyRelative("Content"); GUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(type, GUIContent.none); EditorGUILayout.PropertyField(content, GUIContent.none); GUILayout.Space(40.0f); EditorGUILayout.EndHorizontal(); Rect constraintRect = GUILayoutUtility.GetLastRect(); Rect plusRect = new Rect(constraintRect.xMax - 36, constraintRect.y, 16, constraintRect.height); Rect minusRect = new Rect(constraintRect.xMax - 16, constraintRect.y, 16, constraintRect.height); if (GUI.Button(plusRect, m_constraintPlusButtonContent, m_footerButtonStyle)) { constraints.InsertArrayElementAtIndex(i); break; } if (GUI.Button(minusRect, m_constraintMinusButtonContent, m_footerButtonStyle)) { constraints.DeleteArrayElementAtIndex(i--); } } EditorGUILayout.EndVertical(); GUILayout.Space(14.0f); EditorGUILayout.EndHorizontal(); } else { GUILayout.BeginHorizontal(); GUILayout.Space(8.0f); GUILayout.BeginVertical(); if (GUILayout.Button("Add Constraint", GUILayout.Height(24.0f))) { constraints.InsertArrayElementAtIndex(0); } EditorGUILayout.EndVertical(); GUILayout.Space(8.0f); EditorGUILayout.EndHorizontal(); } GUILayout.Space(5.0f); EditorGUILayout.EndVertical(); GUILayout.Space(4.0f); EditorGUILayout.EndHorizontal(); GUILayout.Space(2.0f); } else { GUILayout.Box("", (GUIStyle)"RL Background", GUILayout.ExpandWidth(true), GUILayout.Height(10)); GUILayout.Space(-3.0f); } EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("", (GUIStyle)"RL Background", GUILayout.Width(60.0f), GUILayout.Height(20)); Rect lastRect = GUILayoutUtility.GetLastRect(); if (GUI.Button(new Rect(lastRect.x, lastRect.y, lastRect.width / 2, lastRect.height), m_profilePlusButtonContent, m_footerButtonStyle)) { entryAction = CollectionAction.Add; } if (GUI.Button(new Rect(lastRect.center.x, lastRect.y, lastRect.width / 2, lastRect.height), m_profileMinusButtonContent, m_footerButtonStyle)) { entryAction = CollectionAction.Remove; } EditorGUILayout.EndHorizontal(); GUILayout.Space(5); return(entryAction); }
/// <summary> /// Create a new object with the provided collection object, subject, and action /// </summary> /// <param name="collection">The collection object affected</param> /// <param name="subject">Optional. The specific object in the collection that was affected</param> /// <param name="action">The action that was performed on the collection</param> public CollectionChangedEventArgs(CollectionType collection, CollectedObjectType subject, CollectionAction action) { m_Collection = collection; m_Subject = subject; m_Action = action; }
public SyncEventArgs(CollectionAction action, IEnumerable <Ta> targetItems, IEnumerable <Tb> sourceItems) : this(default(Ta), default(Tb), action, targetItems, sourceItems) { }
public WorkSpaceCollectionEventArgs(CollectionAction action, IWorkSpace[] elements) : base(action) { _WorkSpaces = elements; }
public SourceChangedEventArgs(CollectionAction action, Source <T> sourceCollection) : this(action, sourceCollection, default(T)) { }
public SourceChangedEventArgs(CollectionAction action, Source <T> sourceCollection, T item) { Action = action; SourceCollection = sourceCollection; Item = item; }
public IActionResult Update1(CollectionAction collection) { Context.Collections.Update(CollectionProcessing.CollectionProcess(collection)); Context.SaveChanges(); return(RedirectToAction("MyCollections", "Collection")); }
public WorkSpaceCollectionEventArgs(CollectionAction action, int capacity) : base(action) { _WorkSpaces = new IWorkSpace[capacity]; }
public WorkSpaceCollectionEventArgs(CollectionAction action, IWorkSpace element) : base(action) { _WorkSpaces = new IWorkSpace[1]; _WorkSpaces[0] = element; }
public ElementCollectionEventArgs(CollectionAction action, IElement element) : base(action) { _Elements = new IElement[1]; _Elements[0] = element; }
//*************************************************************************** // Class Constructors // public CollectionEventArgs(int index, object value, CollectionAction action) { this.Index = index; this.Value = value; this.Action = action; }
public PipeCollectionEventArgs(CollectionAction action) : base(action) { }
/// <summary> /// Initializes a new instance of <see cref="AddRemoveEventArgs"/> with the given action. /// </summary> /// <param name="action">Action that caused the event</param> public AddRemoveEventArgs(CollectionAction action) { Action = action; }
public PipeCollectionEventArgs(CollectionAction action, IPipe pipe ) : base(action) { _Pipes = new IPipe[1]; _Pipes[0] = pipe; }
public UtilityCollectionEventArgs(CollectionAction action) : base(action) { }
public ElementCollectionEventArgs(CollectionAction action, IElement[] elements) : base(action) { _Elements = elements; }
public PipeCollectionEventArgs(CollectionAction action, int capacity) : base(action) { _Pipes = new IPipe[capacity]; }
private CollectionAction DisplayInputEvent(int index) { SerializedProperty inputEvent = m_inputEvents.GetArrayElementAtIndex(index); SerializedProperty eventName = inputEvent.FindPropertyRelative("m_name"); SerializedProperty actionName = inputEvent.FindPropertyRelative("m_actionName"); SerializedProperty keyCode = inputEvent.FindPropertyRelative("m_keyCode"); SerializedProperty eventType = inputEvent.FindPropertyRelative("m_eventType"); SerializedProperty inputState = inputEvent.FindPropertyRelative("m_inputState"); SerializedProperty playerID = inputEvent.FindPropertyRelative("m_playerID"); SerializedProperty actionEvent = inputEvent.FindPropertyRelative("m_onAction"); SerializedProperty axisEvent = inputEvent.FindPropertyRelative("m_onAxis"); InputEvent evt = m_eventManager.GetEvent(index); CollectionAction evtAction = CollectionAction.None; string label = string.IsNullOrEmpty(evt.Name) ? "Event" : evt.Name; if (inputEvent.isExpanded) { label += " (Click to collapse)"; } else { label += " (Click to expand)"; } if (GUILayout.Button(label, m_headerStyle, GUILayout.ExpandWidth(true))) { inputEvent.isExpanded = !inputEvent.isExpanded; } if (inputEvent.isExpanded) { Rect bgRect = GUILayoutUtility.GetLastRect(); bgRect.y += 18; bgRect.height = CalculateBackgroundHeight(evt); GUI.Box(bgRect, "", (GUIStyle)"RL Background"); EditorGUILayout.BeginHorizontal(); GUILayout.Space(4.0f); EditorGUILayout.BeginVertical(); EditorGUILayout.PropertyField(eventName); EditorGUILayout.PropertyField(eventType); if (evt.EventType == InputEventType.Axis) { EditorGUILayout.PropertyField(playerID); EditorGUILayout.PropertyField(actionName); EditorGUILayout.PropertyField(axisEvent); } else if (evt.EventType == InputEventType.Button) { EditorGUILayout.PropertyField(playerID); EditorGUILayout.PropertyField(actionName); EditorGUILayout.PropertyField(inputState); EditorGUILayout.PropertyField(actionEvent); } else { var keyName = keyCode.enumNames[keyCode.enumValueIndex]; KeyCode key = InputBinding.StringToKey(keyName); key = m_keyCodeField.OnGUI("Key", key); keyCode.enumValueIndex = Array.IndexOf <string>(keyCode.enumNames, key.ToString()); EditorGUILayout.PropertyField(inputState); EditorGUILayout.PropertyField(actionEvent); } GUILayout.Space(5.0f); EditorGUILayout.EndVertical(); GUILayout.Space(4.0f); EditorGUILayout.EndHorizontal(); GUILayout.Space(2.0f); } else { GUILayout.Box("", (GUIStyle)"RL Background", GUILayout.ExpandWidth(true), GUILayout.Height(10)); GUILayout.Space(-3.0f); } EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("", (GUIStyle)"RL Background", GUILayout.Width(60.0f), GUILayout.Height(20)); Rect lastRect = GUILayoutUtility.GetLastRect(); if (GUI.Button(new Rect(lastRect.x, lastRect.y, lastRect.width / 2, lastRect.height), m_plusButtonContent, m_footerButtonStyle)) { evtAction = CollectionAction.Add; } if (GUI.Button(new Rect(lastRect.center.x, lastRect.y, lastRect.width / 2, lastRect.height), m_minusButtonContent, m_footerButtonStyle)) { evtAction = CollectionAction.Remove; } EditorGUILayout.EndHorizontal(); return(evtAction); }
public PipeCollectionEventArgs(CollectionAction action, IPipe[] elements) : base(action) { _Pipes = elements; }
public CollectionEventArgs(CollectionAction action) { Action = action; }
public UtilityCollectionEventArgs(CollectionAction action, int capacity) : base(action) { _Utilities = new IUtility[capacity]; }
CollectionAction DrawInputBindingFields(Rect position, string label, InputAction action, int bindingIndex) { Rect headerRect = new Rect(position.x + 5.0f, position.y, position.width, INPUT_FIELD_HEIGHT); Rect layoutArea = new Rect(position.x + 10.0f, position.y + INPUT_FIELD_HEIGHT + FIELD_SPACING + 5.0f, position.width - 12.5f, position.height - (INPUT_FIELD_HEIGHT + FIELD_SPACING + 5.0f)); InputBinding binding = action.bindings[bindingIndex]; CollectionAction result = CollectionAction.None; EditorGUI.LabelField(headerRect, label, EditorStyles.boldLabel); GUILayout.BeginArea(layoutArea); binding.Type = (InputType)EditorGUILayout.EnumPopup("Type", binding.Type); InputType t = binding.Type; if (t == InputType.KeyButton || t == InputType.DigitalAxis) { binding.Positive = (KeyCode)EditorGUILayout.EnumPopup("Positive", binding.Positive); } if (t == InputType.DigitalAxis) { binding.Negative = (KeyCode)EditorGUILayout.EnumPopup("Negative", binding.Negative); } if (t == InputType.MouseAxis) { binding.MouseAxis = EditorGUILayout.Popup("Axis", binding.MouseAxis, InputBinding.mouseAxisNames); } if (t == InputType.GamepadButton) { binding.GamepadButton = (GamepadButton)EditorGUILayout.EnumPopup("Button", binding.GamepadButton); } if (t == InputType.GamepadAnalogButton || t == InputType.GamepadAxis) { binding.GamepadAxis = (GamepadAxis)EditorGUILayout.EnumPopup("Axis", binding.GamepadAxis); } bool isButton = t == InputType.GamepadButton || t == InputType.KeyButton; bool isAxis = t == InputType.GamepadAxis || t == InputType.MouseAxis; bool isFakeAxis = t == InputType.GamepadAnalogButton || t == InputType.DigitalAxis; if (isAxis) { binding.updateAsButton = EditorGUILayout.Toggle("Update As Button", binding.updateAsButton); } if (isButton) { binding.updateAsAxis = EditorGUILayout.Toggle("Update As Axis", binding.updateAsAxis); } bool buttonAsAxis = isButton && binding.updateAsAxis; bool axisAsButton = isAxis && binding.updateAsButton; if (isAxis || t == InputType.GamepadAnalogButton) { binding.DeadZone = EditorGUILayout.FloatField(m_deadZoneInfo, binding.DeadZone); } if (t == InputType.DigitalAxis || buttonAsAxis) { binding.Gravity = EditorGUILayout.FloatField(m_gravityInfo, binding.Gravity); binding.SnapWhenReadAsAxis = EditorGUILayout.Toggle(m_snapInfo, binding.SnapWhenReadAsAxis); } if (isFakeAxis || axisAsButton) { binding.useNegativeAxisForButton = EditorGUILayout.Toggle("Use Negative Axis For Button Query", binding.useNegativeAxisForButton); } binding.rebindable = EditorGUILayout.Toggle("Rebindable", binding.rebindable); if (isFakeAxis || isAxis || buttonAsAxis) { binding.Sensitivity = EditorGUILayout.FloatField(m_sensitivityInfo, binding.Sensitivity); binding.sensitivityEditable = EditorGUILayout.Toggle("Sensitivity Editable", binding.sensitivityEditable); binding.InvertWhenReadAsAxis = EditorGUILayout.Toggle("Invert When Axis Query", binding.InvertWhenReadAsAxis); binding.invertEditable = EditorGUILayout.Toggle("Invert Editable", binding.invertEditable); } GUILayout.EndArea(); Rect r = new Rect(position.width - 25.0f, position.y + 2, 20.0f, 20.0f); if (action.bindings.Count < InputAction.MAX_BINDINGS) { if (GUI.Button(r, m_plusButtonContent, GUITools.label)) { result = CollectionAction.Add; } } r.x -= r.width; if (GUI.Button(r, m_minusButtonContent, GUITools.label)) { result = CollectionAction.Remove; } r.x -= r.width; if (GUI.Button(r, m_upButtonContent, GUITools.label)) { result = CollectionAction.MoveUp; } r.x -= r.width; if (GUI.Button(r, m_downButtonContent, GUITools.label)) { result = CollectionAction.MoveDown; } r.x -= r.width; return(result); }
public UtilityCollectionEventArgs(CollectionAction action, IUtility[] elements) : base(action) { _Utilities = elements; }
public ElementCollectionEventArgs(CollectionAction action) : base(action) { }