public override void Add (IComponent component, string name) { IDesigner designer; base.Add (component, name); if (_rootComponent == null) { _rootComponent = component; designer = this.CreateDesigner (component, true); } else { designer = this.CreateDesigner (component, false); } if (designer != null) { _designers[component] = designer; designer.Initialize (component); } if (component is IExtenderProvider) { IExtenderProviderService service = this.GetService (typeof (IExtenderProviderService)) as IExtenderProviderService; if (service != null) service.AddExtenderProvider ((IExtenderProvider) component); } }
public override void Initialize(IComponent component) { base.Initialize(component); base.AutoResizeHandles = true; this.propChanged = new EventHandler(this.OnControlPropertyChanged); ((ComboBox) this.Control).StyleChanged += this.propChanged; }
/// <summary> /// <para> /// Initializes the designer with the component for design. /// </para> /// </summary> /// <param name='component'> /// The control element for design. /// </param> /// <remarks> /// <para> /// This is called by the designer host to establish the component for /// design. /// </para> /// </remarks> /// <seealso cref='System.ComponentModel.Design.IDesigner'/> public override void Initialize(IComponent component) { Debug.Assert(component is System.Web.UI.MobileControls.TextBox, "TextBoxDesigner.Initialize - Invalid TextBox Control"); _textBox = (System.Web.UI.MobileControls.TextBox) component; base.Initialize(component); }
private float m_Radius; // size of the collider for a sphere public Collider(Vector3 size,Boolean trigger = false, IComponent material = null, Vector3 centre = null ) { m_Trigger = trigger; m_Material = material; m_Centre = centre != null ? centre : new Vector3(); m_Size = size; }
public DesignModeSite (IComponent component, string name, IContainer container, IServiceProvider serviceProvider) { _component = component; _container = container; _componentName = name; _serviceProvider = serviceProvider; }
protected virtual void VisitComponent(IComponent component) { foreach (var property in component.Properties) { VisitProperty(property); } }
/// <summary> /// Overridden. Inherited from <see cref="ControlDesigner.Initialize( IComponent )"/>. /// </summary> /// <param name="component"> /// The <see cref="IComponent"/> hosted by the designer. /// </param> public override void Initialize(IComponent component) { _page = component as MultiPanelPage; if (_page == null) DisplayError(new Exception("You attempted to use a MultiPanelPageDesigner with a class that does not inherit from MultiPanelPage.")); base.Initialize(component); }
/// <summary> /// Initialize /// </summary> /// <param name="component"></param> /// <remarks> /// Initialize /// </remarks> public override void Initialize(IComponent component) { this.deluxeGrid = (DeluxeGrid)component; base.Initialize(component); SetViewFlags(ViewFlags.DesignTimeHtmlRequiresLoadComplete, true); SetViewFlags(ViewFlags.TemplateEditing, true); }
public object DrawAndGetNewValue(Type type, string fieldName, object value, Entity entity, int index, IComponent component) { var myObject = (CustomObject)value; var fieldType = myObject.GetType().GetField("name").FieldType; EntityInspector.DrawAndSetElement(fieldType, "customObject.name", myObject.name, entity, index, component, newValue => myObject.name = (string)newValue); return myObject; }
public void HandleEntity(Entity entity, int index, IComponent component) { if (_matcher.Matches(entity)) { addEntity(entity, index, component); } else { removeEntity(entity, index, component); } }
/// <summary> /// Initializes a new instance of the ImageListViewActionLists class. /// </summary> /// <param name="component">A component related to the DesignerActionList.</param> public ImageListViewActionLists(IComponent component) : base(component) { imageListView = (ImageListView)component; designerService = (DesignerActionUIService)GetService(typeof(DesignerActionUIService)); }
public override void Initialize(IComponent component) { Debug.Assert(component is System.Web.UI.MobileControls.AdRotator, "AdRotatorDesigner.Initialize - Invalid AdRotator Control"); _adRotator = (System.Web.UI.MobileControls.AdRotator) component; base.Initialize(component); }
/// <summary> /// /// </summary> private void InvokeItemSelected(IComponent component) { if (ItemSelected == null) return; ItemSelected(this, component); }
internal DesignerActionBehavior(IServiceProvider serviceProvider, IComponent relatedComponent, DesignerActionListCollection actionLists, DesignerActionUI parentUI) { this.actionLists = actionLists; this.serviceProvider = serviceProvider; this.relatedComponent = relatedComponent; this.parentUI = parentUI; }
/// <summary> /// <para> /// Initializes the designer with the component for design. /// </para> /// </summary> /// <param name='component'> /// The control element for design. /// </param> /// <remarks> /// <para> /// This is called by the designer host to establish the component for /// design. /// </para> /// </remarks> /// <seealso cref='System.ComponentModel.Design.IDesigner'/> public override void Initialize(IComponent component) { Debug.Assert(component is System.Web.UI.MobileControls.Calendar, "CalendarDesigner.Initialize - Invalid Calendar Control"); _calendar = (System.Web.UI.MobileControls.Calendar) component; base.Initialize(component); }
public override void Initialize(IComponent component) { _accordion = component as Accordion; if (_accordion == null) throw new ArgumentException("Component must be an Accordion control", "component"); base.Initialize(component); }
void OnGameBoardElementAdded(Group group, Entity entity, int index, IComponent component) { var grid = pool.gameBoardCache.grid; var pos = entity.position; grid.Add(pos.x, pos.y, entity); pool.ReplaceGameBoardCache(grid); }
public ComponentIsInStateCondition(IComponent component, ComponentState state) { if (component == null) throw new ArgumentNullException(nameof(component)); if (state == null) throw new ArgumentNullException(nameof(state)); WithExpression(() => component.GetState().Equals(state)); }
protected override ISite CreateSite(IComponent component,string name) { ISite site = base.CreateSite(component,name); if (site == null) { } return new IDESite(component,this,name); }
/// <summary> /// Initializes the designer with the specified component. /// </summary> /// <param name="component">The IComponent to associate the designer with.</param> public override void Initialize(IComponent component) { // Validate the parameter reference if (component == null) throw new ArgumentNullException("component"); // Let base class do standard stuff base.Initialize(component); // The resizing handles around the control need to change depending on the // value of the AutoSize and AutoSizeMode properties. When in AutoSize you // do not get the resizing handles, otherwise you do. AutoResizeHandles = true; // Cast to correct type _breadCrumb = component as KryptonBreadCrumb; if (_breadCrumb != null) { // Hook into bread crumb events _breadCrumb.GetViewManager().MouseUpProcessed += new MouseEventHandler(OnBreadCrumbMouseUp); _breadCrumb.GetViewManager().DoubleClickProcessed += new PointHandler(OnBreadCrumbDoubleClick); } // Get access to the design services _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost)); _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService)); _selectionService = (ISelectionService)GetService(typeof(ISelectionService)); // We need to know when we are being removed _changeService.ComponentRemoving += new ComponentEventHandler(OnComponentRemoving); }
public override void Initialize (IComponent component) { base.Initialize (component); if (!(component is Control)) throw new ArgumentException ("Component is not a Control."); Control.Text = component.Site.Name; _messageRouter = new WndProcRouter ((Control) component, (IMessageReceiver) this); Control.WindowTarget = _messageRouter; // DT properties // this.Visible = true; this.Enabled = true; this.Locked = false; this.AllowDrop = false; // // The control properties // Control.Enabled = true; Control.Visible = true; Control.AllowDrop = false; this.Control.DragDrop += new DragEventHandler (OnDragDrop); this.Control.DragEnter += new DragEventHandler (OnDragEnter); this.Control.DragLeave += new EventHandler (OnDragLeave); this.Control.DragOver += new DragEventHandler (OnDragOver); // XXX: The control already has a handle? // if (Control.IsHandleCreated) OnCreateHandle (); }
/// <summary> /// <para> /// Initializes the designer with the component for design. /// </para> /// </summary> /// <param name='component'> /// The control element for design. /// </param> /// <remarks> /// <para> /// This is called by the designer host to establish the component for /// design. /// </para> /// </remarks> /// <seealso cref='System.ComponentModel.Design.IDesigner'/> public override void Initialize(IComponent component) { Debug.Assert(component is System.Web.UI.MobileControls.Link, "LinkDesigner.Initialize - Invalid Link Control"); _link = (System.Web.UI.MobileControls.Link) component; base.Initialize(component); }
protected override void When() { component = component .WithName("name") .WithAttr("name", "other") .WithAttr("misc", "random"); }
/// <devdoc> /// Creates a new NestedContainer. /// </devdoc> public NestedContainer(IComponent owner) { if (owner == null) { throw new ArgumentNullException("owner"); } _owner = owner; _owner.Disposed += new EventHandler(OnOwnerDisposed); }
string GetComponentName(IComponent component) { string siteName = component.Site.Name; if (GeneralOptionsPanel.GenerateVisualStudioStyleEventHandlers) return siteName; return Char.ToUpper(siteName[0]) + siteName.Substring(1); }
/// <summary> /// Initializes the designer with the specified component. /// </summary> /// <param name="component">The IComponent to associate the designer with.</param> public override void Initialize(IComponent component) { Debug.Assert(component != null); // Validate the parameter reference if (component == null) throw new ArgumentNullException("component"); // Let base class do standard stuff base.Initialize(component); // Cast to correct type _groupBox = component as KryptonGroupBox; // The resizing handles around the control need to change depending on the // value of the AutoSize and AutoSizeMode properties. When in AutoSize you // do not get the resizing handles, otherwise you do. AutoResizeHandles = true; // Acquire service interfaces _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost)); // Let the internal panel in the container be designable if (_groupBox != null) EnableDesignMode(_groupBox.Panel, "Panel"); }
protected virtual void Dispose(bool disposing) { if (disposing) { IPropertyValueUIService service = (IPropertyValueUIService) this.GetService(typeof(IPropertyValueUIService)); if (service != null) { service.RemovePropertyValueUIHandler(new PropertyValueUIHandler(this.OnGetUIValueItem)); } IServiceContainer container = (IServiceContainer) this.GetService(typeof(IServiceContainer)); if (container != null) { if (this._urlResolutionService != null) { container.RemoveService(typeof(IUrlResolutionService)); } container.RemoveService(typeof(IImplicitResourceProvider)); if (this._designerActionService != null) { this._designerActionService.Dispose(); } this._designerActionUIService.Dispose(); } this._urlResolutionService = null; this._component = null; } }
private string RenderHtml(IComponent component) { string layout = ReadLayout(); string content = BuildContent(component); content = layout.Replace("@Body@", content); return content; }
public Collider( float radius,Boolean trigger = false, IComponent material = null, Vector3 centre = null) { m_Trigger = trigger; m_Material = material; m_Centre = centre != null ? centre : new Vector3(); m_Radius = radius; }
public virtual void Add(IComponent component, string name) { lock (this.syncObj) { if (component != null) { ISite site = component.Site; if ((site == null) || (site.Container != this)) { if (this.sites == null) { this.sites = new ISite[4]; } else { this.ValidateName(component, name); if (this.sites.Length == this.siteCount) { ISite[] destinationArray = new ISite[this.siteCount * 2]; Array.Copy(this.sites, 0, destinationArray, 0, this.siteCount); this.sites = destinationArray; } } if (site != null) { site.Container.Remove(component); } ISite site2 = this.CreateSite(component, name); this.sites[this.siteCount++] = site2; component.Site = site2; this.components = null; } } } }
/// <inheritdoc /> public void SendDirectedComponentNetworkMessage(INetChannel channel, IEntity entity, IComponent component, ComponentMessage message) { if (_mNetManager.IsClient) { return; } if (!component.NetID.HasValue) { throw new ArgumentException($"Component {component.Name} does not have a NetID.", nameof(component)); } var msg = _mNetManager.CreateNetMessage <MsgEntity>(); msg.Type = EntityMessageType.ComponentMessage; msg.EntityUid = entity.Uid; msg.NetId = component.NetID.Value; msg.ComponentMessage = message; //Send the message if (channel == null) { _mNetManager.ServerSendToAll(msg); } else { _mNetManager.ServerSendMessage(msg, channel); } }
public static void DrawAndSetElement(Type type, string fieldName, object value, Entity entity, int index, IComponent component, Action <object> setValue) { var newValue = DrawAndGetNewValue(type, fieldName, value, entity, index, component); if (DidValueChange(value, newValue)) { entity.WillRemoveComponent(index); setValue(newValue); entity.ReplaceComponent(index, component); } }
void drawComponent(EntityDebugBehaviour debugBehaviour, Entity entity, int index, IComponent component) { var componentType = component.GetType(); var fields = componentType.GetFields(BindingFlags.Public | BindingFlags.Instance); EditorGUILayout.BeginVertical(GUI.skin.box); EditorGUILayout.BeginHorizontal(); if (fields.Length == 0) { EditorGUILayout.LabelField(componentType.RemoveComponentSuffix(), EditorStyles.boldLabel); } else { debugBehaviour.unfoldedComponents[index] = EditorGUILayout.Foldout(debugBehaviour.unfoldedComponents[index], componentType.RemoveComponentSuffix(), _foldoutStyle); } if (GUILayout.Button("-", GUILayout.Width(19), GUILayout.Height(14))) { entity.RemoveComponent(index); } EditorGUILayout.EndHorizontal(); if (debugBehaviour.unfoldedComponents[index]) { foreach (var field in fields) { var value = field.GetValue(component); DrawAndSetElement(field.FieldType, field.Name, value, entity, index, component, newValue => field.SetValue(component, newValue)); } } EditorGUILayout.EndVertical(); }
public abstract object GetValue(IComponent source, IPage page = null);
/// <summary> /// Prepares the designer to view, edit, and design the specified component. /// </summary> /// <param name="component">The component for this designer.</param> public override void Initialize(IComponent component) { base.Initialize(component); _ctl = component as NuGenMiniBarControl; }
public object DrawAndGetNewValue(Type type, string fieldName, object value, Entity entity, int index, IComponent component) { var myObject = (CustomObject)value; var fieldType = myObject.GetType().GetField("name").FieldType; EntityEditor.DrawAndSetElement(fieldType, "customObject.name", myObject.name, entity, index, component, newValue => myObject.name = (string)newValue); return(myObject); }
/// This is used by the context to manage the group. public void UpdateEntity(TEntity entity, int index, IComponent previousComponent, IComponent newComponent) { if (_entities.Contains(entity)) { if (OnEntityRemoved != null) { OnEntityRemoved(this, entity, index, previousComponent); } if (OnEntityAdded != null) { OnEntityAdded(this, entity, index, newComponent); } if (OnEntityUpdated != null) { OnEntityUpdated( this, entity, index, previousComponent, newComponent ); } } }
public MyPostfixDecorator(string postfix, IComponent component) { _postfix = postfix; _component = component; }
/// <summary> /// Invoked when this verb is activated from the right click menu. /// </summary> /// <param name="user">The entity of the user opening this menu.</param> /// <param name="component">The component instance for which this verb is being loaded.</param> public abstract void Activate(IEntity user, IComponent component);
public void SendComponentNetworkMessage(IEntity entity, IComponent component, ComponentMessage message) { throw new NotImplementedException(); }
/// <summary> /// Gets the text string that will be shown to <paramref name="user"/> in the right click menu. /// </summary> /// <param name="user">The entity of the user opening this menu.</param> /// <param name="component">The component instance for which this verb is being loaded.</param> /// <returns>The text string that is shown in the right click menu for this verb.</returns> public abstract string GetText(IEntity user, IComponent component);
public MyPrefixDecorator(string prefix, IComponent component) { _prefix = prefix; _component = component; }
public static bool DrawComponentMember(Type memberType, string memberName, object value, IComponent component, Action <IComponent, object> setValue) { if (value == null) { EditorGUI.BeginChangeCheck(); { var isUnityObject = memberType == typeof(UnityEngine.Object) || memberType.IsSubclassOf(typeof(UnityEngine.Object)); EditorGUILayout.BeginHorizontal(); { if (isUnityObject) { setValue(component, EditorGUILayout.ObjectField(memberName, (UnityEngine.Object)value, memberType, true)); } else { EditorGUILayout.LabelField(memberName, "null"); } if (EntitasEditorLayout.MiniButton("new " + memberType.ToCompilableString().ShortTypeName())) { object defaultValue; if (CreateDefault(memberType, out defaultValue)) { setValue(component, defaultValue); } } } EditorGUILayout.EndHorizontal(); } return(EditorGUI.EndChangeCheck()); } if (!memberType.IsValueType) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginVertical(); } EditorGUI.BeginChangeCheck(); { var typeDrawer = getTypeDrawer(memberType); if (typeDrawer != null) { setValue(component, typeDrawer.DrawAndGetNewValue(memberType, memberName, value, component)); } else { drawUnsupportedType(memberType, memberName, value); EditorGUILayout.BeginVertical(); { EditorGUILayout.Space(); var infos = memberType.GetPublicMemberInfos(); for (int i = 0; i < infos.Count; i++) { var info = infos[i]; EditorGUILayout.LabelField(info.name, info.GetValue(value).ToString()); } } EditorGUILayout.EndVertical(); } if (!memberType.IsValueType) { EditorGUILayout.EndVertical(); if (EntitasEditorLayout.MiniButton("×")) { setValue(component, null); } EditorGUILayout.EndHorizontal(); } } return(EditorGUI.EndChangeCheck()); }
/// <summary> /// Gets whether this verb is "disabled" in the right click menu. /// The verb is still visible in disabled state, but greyed out. /// </summary> /// <param name="user">The entity of the user opening this menu.</param> /// <param name="component">The component instance for which this verb is being loaded.</param> /// <returns>True if the verb is disabled, false otherwise.</returns> public abstract bool IsDisabled(IEntity user, IComponent component);
private static string GetName(IComponent component) => component.GetType().Name;
public bool InsertComponentEvent(IComponent component, EventDescriptor edesc, string eventMethodName, string body, out string file, out int position) { throw new NotImplementedException(); }
public override void Initialize(IComponent component) { base.Initialize(component); AutoResizeHandles = true; }
public static void DrawComponent(bool[] unfoldedComponents, string[] componentMemberSearch, IContext context, IEntity entity, int index, IComponent component) { var componentType = component.GetType(); var componentName = componentType.Name.RemoveComponentSuffix(); if (EntitasEditorLayout.MatchesSearchString(componentName.ToLower(), componentNameSearchString.ToLower())) { var boxStyle = getColoredBoxStyle(context, index); EditorGUILayout.BeginVertical(boxStyle); { var memberInfos = componentType.GetPublicMemberInfos(); EditorGUILayout.BeginHorizontal(); { if (memberInfos.Count == 0) { EditorGUILayout.LabelField(componentName, EditorStyles.boldLabel); } else { unfoldedComponents[index] = EntitasEditorLayout.Foldout(unfoldedComponents[index], componentName, foldoutStyle); if (unfoldedComponents[index]) { componentMemberSearch[index] = memberInfos.Count > 5 ? EntitasEditorLayout.SearchTextField(componentMemberSearch[index]) : string.Empty; } } if (EntitasEditorLayout.MiniButton("-")) { entity.RemoveComponent(index); } } EditorGUILayout.EndHorizontal(); if (unfoldedComponents[index]) { var newComponent = entity.CreateComponent(index, componentType); component.CopyPublicMemberValues(newComponent); var changed = false; var componentDrawer = getComponentDrawer(componentType); if (componentDrawer != null) { EditorGUI.BeginChangeCheck(); { componentDrawer.DrawComponent(newComponent); } changed = EditorGUI.EndChangeCheck(); } else { foreach (var info in memberInfos) { if (EntitasEditorLayout.MatchesSearchString(info.name.ToLower(), componentMemberSearch[index].ToLower())) { if (DrawComponentMember(info.type, info.name, info.GetValue(newComponent), newComponent, info.SetValue)) { changed = true; } } } } if (changed) { entity.ReplaceComponent(index, newComponent); } else { entity.GetComponentPool(index).Push(newComponent); } } } EntitasEditorLayout.EndVerticalBox(); } }
public virtual void Initialize (IComponent component) { throw new NotImplementedException (); }
public TipoServicioService(IComponent <TipoServicio> component) : base(component) { }
public override void Initialize(IComponent component) { base.Initialize(component); }
public Decorator(IComponent component) { _component = component; }
public void AddComponent(IComponent component) { components.Add(component); }
public ComponentEventArgs(IComponent component) { this.Component = component; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Returns the localization category for the specified IComponent object. /// </summary> /// ------------------------------------------------------------------------------------ private static LocalizationCategory GetCategory(IComponent component) { if (component is ILocalizableComponent) { return(LocalizationCategory.LocalizableComponent); } if (component is ToolStripMenuItem) { return(LocalizationCategory.MenuItem); } if (component is ToolStripItem) { return(LocalizationCategory.ToolbarOrStatusBarItem); } if (component is Button) { return(LocalizationCategory.Button); } if (component is TextBox) { return(LocalizationCategory.TextBox); } if (component is LinkLabel) { return(LocalizationCategory.LinkLabel); } if (component is Label) { return(LocalizationCategory.Label); } if (component is ComboBox) { return(LocalizationCategory.ComboBox); } if (component is RadioButton) { return(LocalizationCategory.RadioButton); } if (component is CheckBox) { return(LocalizationCategory.CheckBox); } if (component is Form) { return(LocalizationCategory.WindowOrDialog); } if (component is TabPage) { return(LocalizationCategory.TabPage); } if (component is ColumnHeader) { return(LocalizationCategory.ListViewColumnHeading); } if (component is DataGridViewColumn) { return(LocalizationCategory.ListViewColumnHeading); } return(LocalizationCategory.Other); }
public UCenterZkWatcher(IComponent co_app) { mCoApp = co_app as LoginApp <ComponentDef>; }
public override void HandleMessage(ComponentMessage message, INetChannel netChannel = null, IComponent component = null) { switch (message) { case HudStateChange msg: if (CurrentlyControlled) { ChangeHudIcon(msg); } break; case PlayerAttachedMsg _: ApplyOverlay(); break; case PlayerDetachedMsg _: RemoveOverlay(); break; } }
public void Initialize(IComponent component) { }
public object DrawAndGetNewValue(Type memberType, string memberName, object value, IEntity entity, int index, IComponent component) { return(EditorGUILayout.BoundsField(memberName, (Bounds)value)); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes a new instance of the <see cref="LocalizingInfo"/> class. /// </summary> /// ------------------------------------------------------------------------------------ public LocalizingInfo(IComponent component, string id) : this(component, true) { Id = id; }