private void GeneratePlayer(int gamepadNumber) { if (AllocatedGamepads.Count < MaxPlayerCount) { var newDef = new PlayerDefinition() { AssignedGamepad = gamepadNumber }; AllocatedGamepads.Add(gamepadNumber, newDef); if (PlayerDefinitionEditorPrefab.IsAvailable) { var newEditor = PlayerDefinitionEditorPrefab.Res.Instantiate(); var editor = newEditor.GetComponent <PlayerDefinitionEditor>(); editor.PlayerDef = newDef; for (int i = 1; i < AllocatedGamepads.Count; i++) { newDef.NextColor(); } newDef.Editor = editor; Editors.Add(editor); Editors.Sort(Comparer <PlayerDefinitionEditor> .Create((one, two) => { return(one.PlayerDef.AssignedGamepad.CompareTo(two.PlayerDef.AssignedGamepad)); })); Scene.Current.AddObject(newEditor); } } }
// public List<FTrackEditor> _trackEditors = new List<FTrackEditor>(); // [SerializeField] // private int[] _trackEditorIds = new int[0]; // [SerializeField] // private AnimVector3 _offsetAnim = new AnimVector3(); // private FTrackEditor _trackDragged = null; public override void Init(FObject obj, FEditor owner) { base.Init(obj, owner); if (Timeline.Owner == null) { Timeline.Awake(); } Editors.Clear(); List <FTrack> tracks = Timeline.Tracks; for (int i = 0; i < tracks.Count; ++i) { FTrack track = tracks[i]; FTrackEditor trackEditor = ContainerEditor.SequenceEditor.GetEditor <FTrackEditor>(track); trackEditor.Init(track, this); Editors.Add(trackEditor); } _icon = new GUIContent(FUtility.GetFluxTexture("Plus.png")); // _offsetAnim.valueChanged.AddListener( ContainerEditor.SequenceEditor.Repaint ); }
protected virtual void AddEnumEditors() { var propertyInfos = Effect.GetType().GetRuntimeProperties(); if (propertyInfos == null) { return; } foreach (var propertyInfo in propertyInfos) { if (propertyInfo.PropertyType == null) { continue; } TypeInfo typeInfo = propertyInfo.PropertyType.GetTypeInfo(); if (typeInfo == null) { continue; } if (typeInfo.BaseType == typeof(System.Enum) && propertyInfo.PropertyType != typeof(RenderOptions) && propertyInfo.PropertyType != typeof(EffectCategoryEnum)) { Editors.Add(new EnumEditorViewModel(propertyInfo.Name, this, propertyInfo.PropertyType)); } } }
private void newFromTemplateToolStripMenuItem_Click(object sender, EventArgs e) { var n = new FormEditor(this); Editors.Add(n); n.Show(); }
public int AddCourse(string name) { // リストへ追加 Program.Project.Courses.Add(new Course()); Program.Project.Courses[Program.Project.Courses.Count - 1].Name = name; Editors.Add(new Editor(Program.Project.Courses[Program.Project.Courses.Count - 1].Document, Program.Project.Courses[Program.Project.Courses.Count - 1])); return(Program.Project.Courses.Count - 1); }
private void OpenFile(string filename) { UseWaitCursor = true; Application.DoEvents(); var n = new FormEditor(this, filename); Editors.Add(n); n.Show(); UseWaitCursor = false; }
private void CreateEditor <EditorType>() where EditorType : Editor { var editor = AddUIComponent <EditorType>(); editor.Active = false; editor.Init(this); TabStrip.AddTab(editor); Editors.Add(editor); }
protected override void AddRangeEditors() { foreach (string propertyName in PropertyDescriptions.Keys) { PropertyDescription propertyDescription; PropertyDescriptions.TryGetValue(propertyName, out propertyDescription); Editors.Add(new RangeEditorViewModel(propertyName, propertyDescription, this)); } }
public void AddEditors(Person[] editors) { if (editors.Length != 0) { foreach (Person p in editors) { Editors.Add(p); } } }
private void CreateEditor <EditorType>() where EditorType : Editor { var editor = AddUIComponent <EditorType>(); editor.Init(this); TabStrip.AddTab <PointsEditor>(editor.Name); editor.isVisible = false; editor.size = EditorSize; editor.relativePosition = EditorPosition; Editors.Add(editor); }
private void newProgramToolStripMenuItem_Click(object sender, EventArgs e) { var n = new FormEditor(this, null); Editors.Add(n); try { n.Show(); } catch { } }
private void CreateEditor <EditorType>() where EditorType : BaseEditor { Log.Debug("LaneManagerPanel.CreateEditor<EditorType>() called"); var editor = AddUIComponent <EditorType>(); editor.Init(this); TabStrip.AddTab(editor.Name); editor.isVisible = false; editor.size = EditorSize; editor.relativePosition = EditorPosition; Editors.Add(editor); }
public void RegisterEditor() { Editors.Add(typeof(Period), (name, value, options) => { var period = (Period)value; if (period == null) { return(null); } return("<label style='padding:2px'>Год</label>" + GetEdit(name + ".Year", typeof(int), period.Year, options) + "<label style='padding:2px'>Месяц</label>" + GetEdit(name + ".Interval", typeof(Interval), period.Interval, options)); }); }
/// <summary> /// Adds the specified file path key and <see cref="IEditor"/> /// value to the <see cref="EditorDictionary"/>. /// </summary> /// <param name="key"> /// The file path key of the <see cref="IEditor"/> to add. /// </param> /// <param name="value"> /// The <see cref="IEditor"/> of the element to add. /// </param> /// <exception cref="ArgumentNullException"> /// <paramref name="key"/> is <see langword="null"/>. /// <para/> /// -or- /// <para/> /// <paramref name="value"/> is <see langword="null"/>. /// </exception> /// <exception cref="ArgumentException"> /// <paramref name="key"/> is a zero-length string, contains only /// whitespace, or contains one or more of the invalid characters /// defined in <see cref=" GetInvalidPathChars"/>. /// <para/> /// -or- /// <para/> /// The system could not retrieve the absolute path. /// </exception> /// <exception cref="System.Security.SecurityException"> /// The caller does not have the required permissions. /// </exception> /// <exception cref="NotSupportedException"> /// <paramref name="key"/> contains a colon (":") that is not part /// of a volume identifier (for example, "c:\"). /// </exception> /// <exception cref="System.IO.PathTooLongException"> /// The specified path, file name, or both exceed the /// system-defined maximum length. /// </exception> public void Add(string key, IEditor value) { if (value is null) { throw new ArgumentNullException(nameof(value)); } var actualKey = GetFullPath(key); Editors.Add(actualKey, value); var e = new EditorEventArgs(value); EditorSelector.OnEditorAdded(e); }
internal TableNodeHandler(TreeNode node, UDTTable table) { Node = node; Table = table; this.Editors = new List <IEditable>(); IEditable uieditor = new TableUIEditable("資料表-" + Table.Name, this); Editors.Add(uieditor); IEditable xmlEditor = new TableXmlEditable("資料表-" + Table.Name, this); Editors.Add(xmlEditor); CurrentEditor = uieditor; }
public BlockTiltDoF() { Name = "BlockTiltDoF"; //Editors.Add(new EnumEditorViewModel<BlockTiltDoF, DepthOfFieldQuality>("Quality", this, (effect) => //{ // if (effect.m_effectEffect == null) return DepthOfFieldQuality.Preview; // return effect.m_effectEffect.Quality; //}, (effect, value) => //{ // if (effect.m_effectEffect == null) // return; // effect.m_effectEffect.Quality = value; //})); Editors.Add(new RangeEditorViewModelEx <BlockTiltDoF>("Strength at edge 1", 0, 1.0, this, (effect) => { if (effect.m_effectEffect == null) { return(1.0); } return(effect.m_effectEffect.StrengthAtEdge1); }, (effect, value) => { if (effect.m_effectEffect == null) { return; } effect.m_effectEffect.StrengthAtEdge1 = value; })); Editors.Add(new RangeEditorViewModelEx <BlockTiltDoF>("Strength at edge 2", 0, 1.0, this, (effect) => { if (effect.m_effectEffect == null) { return(1.0); } return(effect.m_effectEffect.StrengthAtEdge2); }, (effect, value) => { if (effect.m_effectEffect == null) { return; } effect.m_effectEffect.StrengthAtEdge2 = value; })); }
private void RegisterPropertyEditors() { Log.Info("Registering default property editors."); Editors.Add(typeof(byte), typeof(byte)); Editors.Add(typeof(byte?), typeof(byte?)); Editors.Add(typeof(short), typeof(short)); Editors.Add(typeof(short?), typeof(short?)); Editors.Add(typeof(ushort), typeof(ushort)); Editors.Add(typeof(ushort?), typeof(ushort?)); Editors.Add(typeof(int), typeof(int)); Editors.Add(typeof(int?), typeof(int?)); Editors.Add(typeof(uint), typeof(uint)); Editors.Add(typeof(uint?), typeof(uint?)); Editors.Add(typeof(long), typeof(long)); Editors.Add(typeof(long?), typeof(long?)); Editors.Add(typeof(ulong), typeof(ulong)); Editors.Add(typeof(ulong?), typeof(ulong?)); Editors.Add(typeof(float), typeof(float)); Editors.Add(typeof(float?), typeof(float?)); Editors.Add(typeof(double), typeof(double)); Editors.Add(typeof(double?), typeof(double?)); Editors.Add(typeof(Guid), typeof(string)); Editors.Add(typeof(string)); Editors.Add(typeof(Enum), typeof(string)); Log.Info("Finished registering default property editors."); if (Plugins != null) { foreach (var plugin in Plugins) { Log.Info($"Registering property editors for {plugin.PluginName} {plugin.UniqueId}."); plugin.Register(Editors); Log.Info($"Finished registering property editors for {plugin.PluginName} {plugin.UniqueId}."); } } }
protected virtual void AddBooleanEditors() { var propertyInfos = Effect.GetType().GetRuntimeProperties().Where(x => x.PropertyType == typeof(bool)); if (propertyInfos == null) { return; } foreach (var propertyInfo in propertyInfos) { if (propertyInfo.Name != "CanRenderAtPreviewSize") { Editors.Add(new BoolEditorViewModel(propertyInfo.Name, this)); } } }
private void AddRangeEditors(int index) { Editors.Add(new RangeEditorViewModelEx <SplitToneEffect>(String.Format("[{0}] Red", index), 0, 255, this, effect => effect.SplitToneRanges[index].Color.R, (effect, value) => { var c = effect.SplitToneRanges[index].Color; effect.SplitToneRanges[index].Color = Color.FromArgb(255, (byte)value, c.G, c.B); })); Editors.Add(new RangeEditorViewModelEx <SplitToneEffect>(String.Format("[{0}] Green ", index), 0, 255, this, effect => effect.SplitToneRanges[index].Color.G, (effect, value) => { var c = effect.SplitToneRanges[index].Color; effect.SplitToneRanges[index].Color = Color.FromArgb(255, c.R, (byte)value, c.B); })); Editors.Add(new RangeEditorViewModelEx <SplitToneEffect>(String.Format("[{0}] Blue", index), 0, 255, this, effect => effect.SplitToneRanges[index].Color.B, (effect, value) => { var c = effect.SplitToneRanges[index].Color; effect.SplitToneRanges[index].Color = Color.FromArgb(255, c.R, c.G, (byte)value); })); Editors.Add(new RangeEditorViewModelEx <SplitToneEffect>(String.Format("[{0}] Luminance Low", index), 0, 255, this, effect => effect.SplitToneRanges[index].LuminanceLow, (effect, value) => effect.SplitToneRanges[index].LuminanceLow = Math.Min(effect.SplitToneRanges[index].LuminanceHigh, (byte)value))); Editors.Add(new RangeEditorViewModelEx <SplitToneEffect>(String.Format("[{0}] Luminance High", index), 0, 255, this, effect => effect.SplitToneRanges[index].LuminanceHigh, (effect, value) => effect.SplitToneRanges[index].LuminanceHigh = Math.Max(effect.SplitToneRanges[index].LuminanceLow, (byte)value))); }
public override void Init(FObject obj, FEditor owner) { base.Init(obj, owner); Editors.Clear(); List <FTrack> tracks = Container.Tracks; for (int i = 0; i < tracks.Count; ++i) { FTrack track = tracks[i]; FTrackEditor trackEditor = SequenceEditor.GetEditor <FTrackEditor>(track); trackEditor.Init(track, this); Editors.Add(trackEditor); } _icon = new GUIContent(FUtility.GetFluxTexture("Plus.png")); }
public EllipseTiltDoF() { Name = "EllipseTiltDoF"; m_ellipseFocus1 = new FocusEllipse(new Point(0.5, 0.3), new EllipseRadius(0.05, 0.2)); m_ellipseFocus2 = new FocusEllipse(new Point(0.5, 0.7), new EllipseRadius(0.05, 0.2)); m_selectedEllipse = m_ellipseFocus1; //Editors.Add(new EnumEditorViewModel<EllipseTiltDoF, DepthOfFieldQuality>("Quality", this, (effect) => //{ // if (effect.m_effectEffect == null) return DepthOfFieldQuality.Preview; // return effect.m_effectEffect.Quality; //}, (effect, value) => //{ // if (effect.m_effectEffect == null) // return; // effect.m_effectEffect.Quality = value; //})); //Editors.Add(new BoolEditorViewModel<EllipseTiltDoF>("InvertedEllipse", this, (effect) => //{ // return effect.m_invertedEllipse; //}, (effect, value) => //{ // effect.m_invertedEllipse = value; // effect.m_selectedEllipse = value ? m_ellipseFocus2 : m_ellipseFocus1; //})); Editors.Add(new RangeEditorViewModelEx <EllipseTiltDoF>("Strength", 0, 1.0, this, (effect) => { if (effect.m_effectEffect == null) { return(1.0); } return(effect.m_effectEffect.Strength); }, (effect, value) => { if (effect.m_effectEffect == null) { return; } effect.m_effectEffect.Strength = value; })); }
public ValidationHtmlConventions() { Editors.Add(new FieldValidationElementModifier()); Editors.Add(new RemoteValidationElementModifier()); Editors.Add(new DateElementModifier()); Editors.Add(new NumberElementModifier()); Editors.Add(new MaximumLengthModifier()); Editors.Add(new MinimumLengthModifier()); Editors.Add(new RangeLengthModifier()); Editors.Add(new MinValueModifier()); Editors.Add(new MaxValueModifier()); Editors.Add(new LocalizationLabelModifier()); Editors.Add(new RegularExpressionModifier()); Forms.Add(new FormValidationSummaryModifier()); Forms.Add(new FormValidationModifier()); Forms.Add(new FieldEqualityFormModifier()); Forms.Add(new NotificationSerializationModifier()); }
public override void Init(FObject obj, FEditor owner) { base.Init(obj, owner); Editors.Clear(); List <FTimeline> timelines = Container.Timelines; for (int i = 0; i < timelines.Count; ++i) { FTimeline timeline = timelines[i]; FTimelineEditor timelineEditor = SequenceEditor.GetEditor <FTimelineEditor>(timeline); timelineEditor.Init(timeline, this); Editors.Add(timelineEditor); } _icon = new GUIContent(FUtility.GetFluxTexture("Folder.png")); // _contentOffset = new Vector2(8, HeaderHeight); }
private void ModelsDocumentAdded(object sender, XamlDocumentChangedEventArgs e) { var editor = new EditorView(e.Document) { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch }; Editors.Add(editor); var tab = new TabItem { Content = editor, Header = System.IO.Path.GetFileName(e.Document.FileName), Tag = e.Document.FileName, VerticalAlignment = VerticalAlignment.Stretch }; EditorsContainer.Items.Add(tab); EditorsContainer.SelectedItem = tab; }
protected virtual void AddRangeEditors() { if (m_useCustomRangeEditor) { return; } var propertyDescriptions = Effect as IPropertyDescriptions; if (propertyDescriptions == null) { return; } foreach (string propertyName in propertyDescriptions.PropertyDescriptions.Keys) { PropertyDescription propertyDescription; propertyDescriptions.PropertyDescriptions.TryGetValue(propertyName, out propertyDescription); Editors.Add(new RangeEditorViewModel(propertyName, propertyDescription, this)); } }
public LandscapeBackgroundDoF() { Name = "LandscapeBackgroundDoF"; var radialGradient = new RadialGradient(new Point(0.5, 0.3), new EllipseRadius(0.2, 0.4)) { Stops = new [] { new GradientStop() { Color = foreground, Offset = 0 }, new GradientStop() { Color = foreground, Offset = 0.5 }, new GradientStop() { Color = background, Offset = 0.51 }, new GradientStop() { Color = background, Offset = 0.9 } } }; m_scribbles = new GradientImageSource(new Size(500, 500), radialGradient); //Editors.Add(new EnumEditorViewModel<LandscapeBackgroundDoF, DepthOfFieldQuality>("Quality", this, (effect) => //{ // if (effect.m_effectEffect == null) return DepthOfFieldQuality.Preview; // return effect.m_effectEffect.Quality; //}, (effect, value) => //{ // if (effect.m_effectEffect == null) // return; // effect.m_effectEffect.Quality = value; //})); Editors.Add(new RangeEditorViewModelEx <LandscapeBackgroundDoF>("Strength above horizon", 0, 1.0, this, (effect) => { if (effect.m_effectEffect == null) { return(1.0); } return(effect.m_effectEffect.StrengthAboveHorizon); }, (effect, value) => { if (effect.m_effectEffect == null) { return; } effect.m_effectEffect.StrengthAboveHorizon = value; })); Editors.Add(new RangeEditorViewModelEx <LandscapeBackgroundDoF>("Strength below horizon", 0, 1.0, this, (effect) => { if (effect.m_effectEffect == null) { return(1.0); } return(effect.m_effectEffect.StrengthBelowHorizon); }, (effect, value) => { if (effect.m_effectEffect == null) { return; } effect.m_effectEffect.StrengthBelowHorizon = value; })); }
public void Reload() { this.ProjectName = MainForm.CurrentProject.Name; try { if (!ModuleHandler.Exists(ProjectName)) { ModuleHandler = ModuleHandler.CreateNew(ProjectName, string.Empty, this.Node); } else { ModuleHandler = new ModuleHandler(this.Node, MainForm.CurrentProject.Name); } } catch (Exception ex) { string msg = ex.Message; string err = "檔案管理服務無法使用({0})"; if (!ProjectHandler.ValidName(ProjectName)) { this.Node.Text = string.Format(err, "專案名稱含有不合法字元"); } else { Regex reg = new Regex("ischool.dsa.exception.DSAServiceException: (.*)\n"); Match m = reg.Match(msg); if (m.Success) { this.Node.Text = string.Format(err, m.Groups[1].Value); } else { this.Node.Text = string.Format(err, "檔案管理服務初始化失敗"); } this.Node.ToolTipText = ex.Message; } this.Editors = new List <IEditable>(); return; } //ModuleHandler.StatusChanged += new EventHandler<ModuleStatusEventArgs>(ModuleHandler_StatusChanged); if (this.Editors == null) { this.Editors = new List <IEditable>(); FileEditable edit = new FileEditable(this); Editors.Add(edit); this.CurrentEditor = edit; } else { FileEditable fe = CurrentEditor as FileEditable; FileUIEditor ui = fe.Editor as FileUIEditor; ui.Reload(); } if (Directory.Exists(ModuleHandler.LocalPath)) { this.Node.Text = "檔案管理 ( 本機路徑 : " + ModuleHandler.LocalPath + " )"; } else { this.Node.Text = "檔案管理 ( 本機路徑不存在 : " + ModuleHandler.LocalPath + " )"; } ModuleHandler.CheckItemStatus(); }
public void AddSupportedType(string typeName) { Editors.Add(typeName, typeof(object).FullName); Designer.AddSupportedType(typeName); }
public SeaShellEffect() { m_hueSaturationEffect = new HueSaturationEffect() { Saturation = 0.6 - 1 }; m_vibranceEffect = new VibranceEffect() { Level = .6 }; m_splitToningEffect = new SplitToneEffect { ShadowsHue = 230, ShadowsSaturation = 37, HighlightsHue = 50, HighlightsSaturation = 20 }; var globalCurve = new Curve(CurveInterpolation.Linear, new[] { new Point(0, 10), new Point(32, 68), new Point(64, 119), new Point(96, 158), new Point(128, 187), new Point(160, 209), new Point(192, 226), new Point(255, 248) }); var curve = new Curve(CurveInterpolation.Linear, new[] { new Point(10, 0), new Point(32, 27), new Point(70, 70) }); var redCurve = globalCurve; var greenCurve = Curve.Compose(curve, globalCurve, null); var blueCurve = globalCurve; var curvesEffect = new CurvesEffect(redCurve, greenCurve, blueCurve); var colorizationLayerList = new LayerList( new AdjustmentLayer(LayerStyle.Normal(), new GrayscaleEffect()), new Layer(LayerStyle.Multiply(), context => new ColorImageSource(context.HintedRenderSize, Color.FromArgb(0xff, 0xff, 0xe6, 0x99))) ); LayerList.AddRange( new AdjustmentLayer(LayerStyle.Normal(0.2), context => colorizationLayerList.ToImageProvider(context.BackgroundImage, context.HintedRenderSize, context.HintedRenderSize)), new AdjustmentLayer(LayerStyle.Normal(), new ContrastEffect(-0.15)), new AdjustmentLayer(LayerStyle.Normal(), curvesEffect), new AdjustmentLayer(LayerStyle.Normal(), m_hueSaturationEffect), new AdjustmentLayer(LayerStyle.Normal(), m_vibranceEffect), new AdjustmentLayer(LayerStyle.Normal(), m_splitToningEffect) ); Editors.Add(new RangeEditorViewModel <SeaShellEffect>("SaturationLevel", -1.0, 1.0, this, filter => filter.SaturationLevel, (filter, value) => filter.SaturationLevel = value)); // Editors.Add(new RangeEditorViewModel<SeaShellEffect>("ContrastLevel", -1.0, 1.0, this, filter => filter.ContrastLevel, (filter, value) => filter.ContrastLevel = value)); Editors.Add(new RangeEditorViewModel <SeaShellEffect>("VibranceLevel", 0, 1.0, this, filter => filter.VibranceLevel, (filter, value) => filter.VibranceLevel = value)); Editors.Add(new RangeEditorViewModel <SeaShellEffect>("ShadowsHue", 0, 365, this, filter => filter.ShadowsHue, (filter, value) => filter.ShadowsHue = (int)value)); Editors.Add(new RangeEditorViewModel <SeaShellEffect>("ShadowsSaturation", 0, 100, this, filter => filter.ShadowsSaturation, (filter, value) => filter.ShadowsSaturation = (int)value)); Editors.Add(new RangeEditorViewModel <SeaShellEffect>("HighlightsHue", 0, 365, this, filter => filter.HighlightsHue, (filter, value) => filter.HighlightsHue = (int)value)); Editors.Add(new RangeEditorViewModel <SeaShellEffect>("HighlightsSaturation", 0, 100, this, filter => filter.HighlightsSaturation, (filter, value) => filter.HighlightsSaturation = (int)value)); }