Esempio n. 1
0
        public HexViewOptionsGroupImpl(HexViewOptionsGroupServiceImpl owner, string groupName, TagOptionDefinition[] defaultOptions, OptionsStorage optionsStorage)
        {
            if (owner == null)
            {
                throw new ArgumentNullException(nameof(owner));
            }
            if (groupName == null)
            {
                throw new ArgumentNullException(nameof(groupName));
            }
            if (defaultOptions == null)
            {
                throw new ArgumentNullException(nameof(defaultOptions));
            }
            if (optionsStorage == null)
            {
                throw new ArgumentNullException(nameof(optionsStorage));
            }
            this.owner     = owner;
            hexViews       = new List <WpfHexView>();
            toOptions      = new Dictionary <string, HexViewGroupOptionCollection>(StringComparer.OrdinalIgnoreCase);
            this.groupName = groupName;

            foreach (var option in defaultOptions)
            {
                Debug.Assert(option.Name != null);
                if (option.Name == null)
                {
                    continue;
                }

                var subGroup = option.SubGroup;
                Debug.Assert(subGroup != null);
                if (subGroup == null)
                {
                    continue;
                }

                HexViewGroupOptionCollection coll;
                if (!toOptions.TryGetValue(subGroup, out coll))
                {
                    toOptions.Add(subGroup, coll = new HexViewGroupOptionCollection(subGroup));
                }
                coll.Add(new HexViewGroupOption(this, option));
            }

            foreach (var coll in toOptions.Values)
            {
                optionsStorage.InitializeOptions(groupName, coll);
            }
            this.optionsStorage = optionsStorage;
        }
Esempio n. 2
0
 HexEditorFactoryServiceListenerImpl(HexViewOptionsGroupServiceImpl hexViewOptionsGroupServiceImpl) => this.hexViewOptionsGroupServiceImpl = hexViewOptionsGroupServiceImpl;
		HexEditorFactoryServiceListenerImpl(HexViewOptionsGroupServiceImpl hexViewOptionsGroupServiceImpl) {
			this.hexViewOptionsGroupServiceImpl = hexViewOptionsGroupServiceImpl;
		}