public PaletteDefinition(string name, IBlockCollection paletteBlock, IBlockCollection instancesBlock) { Name = name; this.paletteBlock = paletteBlock; this.instancesBlock = instancesBlock; }
public IGistConfig<IndexValue, string> CreateGistConfig(IBlockCollection blocks) { return new GistConfig<IndexValue, string> { Blocks = blocks, Ext = new OrderedGistExtension<IndexValue, string>( new GistIndexValueType { StringComparer = Options.WhenStringThenIgnoreCase ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal, DateTimeComparer = Options.WhenDateThenIgnoreTimeOfDay ? (IComparer<DateTime>) new IgnoreTimeOfDayComparer() : Comparer<DateTime>.Default } , new GistStringType()), UpdateStrategy = Options.IsUnique ? UpdateStrategy<IndexValue, string>.UniqueKey : UpdateStrategy<IndexValue, string>.AppendKey }; }
public IGistConfig <IndexValue, string> CreateGistConfig(IBlockCollection blocks) { return (new GistConfig <IndexValue, string> { Blocks = blocks, Ext = new OrderedGistExtension <IndexValue, string>( new GistIndexValueType { StringComparer = Options.WhenStringThenIgnoreCase ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal, DateTimeComparer = Options.WhenDateThenIgnoreTimeOfDay ? (IComparer <DateTime>) new IgnoreTimeOfDayComparer() : Comparer <DateTime> .Default } , new GistStringType()), UpdateStrategy = Options.IsUnique ? UpdateStrategy <IndexValue, string> .UniqueKey : UpdateStrategy <IndexValue, string> .AppendKey }); }
public void DataBindCollection(IBlockCollection blockCollection) { this.blockCollection = blockCollection; //blockCollection.CollectionChanged += new EventHandler(blockCollection_CollectionChanged); blockCollection.BlockAdded += blockCollection_CollectionChanged; blockCollection.BlockRemoved += blockCollection_CollectionChanged; UpdateComboBox(); }
public MasterTable(IBlockCollection blocks) : base(blocks.MasterBlockReference, new GistConfig <string, IJsonValue> { Blocks = blocks, Ext = new OrderedGistExtension <string, IJsonValue>( new GistStringType(), new GistJsonType()), UpdateStrategy = UpdateStrategy <string, IJsonValue> .UpdateKey }) { }
public override string GetBlockStringForScriptingReferenceType(short blockIndex, short type) { IBlockCollection blocks = GetBlockCollectionForScriptingReferenceType(type); if (blocks != null) { return("\"" + blocks.GetBlock(blockIndex).BlockName + "\""); } else { return(blockIndex.ToString()); } }
public override string[] GetBlockStringsForScriptingReferenceType(short type) { IBlockCollection blocks = GetBlockCollectionForScriptingReferenceType(type); string[] blockStrings = new string[blocks.BlockCount]; for (int i = 0; i < blocks.BlockCount; i++) { blockStrings[i] = blocks.GetBlock(i).BlockName; } return(blockStrings); }
protected Gist <string, string> CreateGist(IBlockCollection blocks, IUpdateStrategy <string, string> updateStrategy) { return(new Gist <string, string>( blocks.MasterBlockReference, new GistConfig <string, string> { Blocks = blocks, Ext = new OrderedGistExtension <string, string>( new GistStringType(), new GistStringType() ), UpdateStrategy = updateStrategy } )); }
public IndexCatalog(IBlockCollection blocks, IIndexValueFactory indexValueFactory, IMasterTable masterTable) : base( blocks.ApplicationBlockReference, new GistConfig <string, IJsonValue> { Blocks = blocks, Ext = new OrderedGistExtension <string, IJsonValue>( new GistStringType(), new GistJsonType()), UpdateStrategy = UpdateStrategy <string, IJsonValue> .UpdateKey }) { Blocks = blocks; IndexValueFactory = indexValueFactory; MasterTable = masterTable; }
protected Gist<string, string> CreateGist(IBlockCollection blocks, IUpdateStrategy<string, string> updateStrategy) { return new Gist<string, string>( blocks.MasterBlockReference, new GistConfig<string, string> { Blocks = blocks, Ext = new OrderedGistExtension<string, string>( new GistStringType(), new GistStringType() ), UpdateStrategy = updateStrategy } ); }
protected virtual Gist <string, string> CreateGist(IBlockCollection blocks) { return(CreateGist(blocks, new UpdateKey <string, string>())); }
public SyncService(IChainService chainService, ILogger logger) { _blockCollection = new BlockCollection(chainService, logger); }
public void JustDecompileGenerated_set_UncommittedBlockList(IBlockCollection value) { this.JustDecompileGenerated_UncommittedBlockList_k__BackingField = value; }
public void DatabindChildrenToBlock(IBlock block, IFieldControlContainer container) { #region Old Method /*linkedBlock = block; * * if (block != null) * { * int index = -1; * IFieldControl[] childFields = GetChildFields(); * foreach (FieldControlBase field in childFields) * { * index++; * field.Enabled = true; * * try * { * // If the field is not a block, we will need to databind it. * if (!(field is IBlockControl)) * { * IField binding = (LocateFieldByName(linkedBlock, field.BoundPropertyName) as IField); * if (binding != null) * { * field.DataBind(binding); * Binding[] bindings = field.GetDataBindings(); * foreach (Binding bind in bindings) * { * bind.Parse += bind_Parse; * } * } * } * // If it is a block, we need to recurse on the block so that its children get databound. * else * { * IBlockCollection binding = LocateFieldByName(linkedBlock, field.BoundPropertyName) as IBlockCollection; * if (binding != null) * { * (field as IBlockControl).DataBindCollection(binding); * (field as IBlockControl).Initialize(); * } * else * field.Enabled = false; * } * } * catch (Exception ex) * { * Interfaces.Output.Write(Interfaces.OutputTypes.Warning, "There was an error databinding to " + field.BoundPropertyName + ":" + ex.Message, ex); * //MessageBox.Show("There was an error binding \"" + field.BoundPropertyName + ":\" " + ex.Message); * } * } * } * else * { * foreach (FieldControlBase field in GetChildFields()) * field.Enabled = false; * }*/ #endregion #region New Method if (container is FieldContainerBase) { container = (container as FieldContainerBase).FieldPanel; } if (container == null) { return; } //(container as Control).Enabled = (block != null); if (block == null) { IFieldControl[] children = container.GetChildFields(); foreach (FieldControlBase field in children) { field.Enabled = false; } return; } Control control = container as Control; // This is a bug-fix. At some point along the line, databinding was attached to an FieldContainerBase... so to fix it, we relink to the FieldPanel property. if (container is FieldContainerBase) { control = (container as FieldContainerBase).FieldPanel; } for (int x = 0; x < control.Controls.Count; x++) { Control curControl = control.Controls[x]; curControl.Visible = true; // Determine whether or not the field is a FieldControlBase or not. FieldControlBase field = (curControl is FieldControlBase) ? curControl as FieldControlBase : null; #region the current control is a field if (field != null) { field.Enabled = true; #region If the field is not a block, we will need to databind it. if (!(field is IBlockControl)) { IField binding = (LocateFieldByName(block, field.BoundPropertyName) as IField); if (binding != null) { field.DataBind(binding); Binding[] bindings = field.GetDataBindings(); foreach (Binding bind in bindings) { bind.Parse += bind_Parse; } } else { field.Enabled = false; } } #endregion else // This shouldn't happen, EVER! { Interfaces.Output.Write(Interfaces.OutputTypes.Information, "DatabindChildrenToBlock came across an IBlockControl."); } } #endregion #region the current control is a block container. else if (curControl is Prometheus.Controls.BlockContainer) { Prometheus.Controls.BlockContainer blockContainer = curControl as Prometheus.Controls.BlockContainer; blockContainer.Enabled = true; IBlock nextBlock = null; BlockContainerPanel nextContainer = null; #region get the next container // We're getting all of the controls of type FieldContainerPanel, though there should only be one. /*Control[] fieldContainerPanels = GetChildControlsByType(blockContainer, typeof(BlockContainerPanel)); * if (fieldContainerPanels.Length > 0) * { * nextContainer = fieldContainerPanels[0] as BlockContainerPanel; * } * else * { * // This is a warning because the rest of the tag will work properly and execution can continue as normal. * Interfaces.Output.Write(Interfaces.OutputTypes.Warning, "During databinding, the block \"" + blockContainer.BoundPropertyName + "\" did not have a field container panel!"); * continue; * }*/ if (blockContainer.FieldPanel != null) { nextContainer = blockContainer.FieldPanel; } #endregion #region get the next block /*Control[] blocks = GetChildControlsByType(blockContainer, typeof(IBlockControl)); * if (blocks.Length > 0) * { * IBlockControl blockControl = blocks[0] as IBlockControl; * blockControl.Container = nextContainer as IFieldControlContainer; * IBlockCollection binding = LocateFieldByName(block, (blockControl as IBoundPropertyCapable).BoundPropertyName) as IBlockCollection; * if (binding != null) * { * blockControl.DataBindCollection(binding); * blockControl.Initialize(); * } * } * else * { * Interfaces.Output.Write(Interfaces.OutputTypes.Warning, "During databinding, the block \"" + blockContainer.BoundPropertyName + "\" did not have an IBlockControl!"); * continue; * }*/ if (blockContainer.Block != null) { IBlockControl blockControl = blockContainer.Block; if (blockContainer.FieldPanel == null) { blockControl.Container = blockContainer; } else { blockControl.Container = blockContainer.FieldPanel; } IBlockCollection binding = LocateFieldByName(block, (blockControl as IBoundPropertyCapable).BoundPropertyName) as IBlockCollection; if (binding != null) { blockControl.DataBindCollection(binding); blockControl.Initialize(); } if (blockControl.SelectedBlockIndex > -1) { nextBlock = blockControl.BlockCollection.GetBlock(blockControl.SelectedBlockIndex); } } #endregion if ((nextBlock != null) && (nextContainer != null)) { DatabindChildrenToBlock(nextBlock, nextContainer); } } else if (curControl is FieldContainerBase) { FieldContainerBase fieldContainer = curControl as FieldContainerBase; fieldContainer.Enabled = true; DatabindChildrenToBlock(block, fieldContainer.FieldPanel); } #endregion } #endregion }
public Session(IBlockCollection blocks, IIndexValueFactory indexValueFactory) { IndexValueFactory = indexValueFactory; _blocks = blocks; }
public BlockReference(IBlockCollection blocks, Func <int> getter, Action <int> setter) { Getter = getter; Setter = setter; Blocks = blocks; }
protected virtual Gist<string, string> CreateGist(IBlockCollection blocks) { return CreateGist(blocks, new UpdateKey<string, string>()); }