protected MessageEditor( ProjectData projectData, SetupConfig config, MessageDescriptor descriptor, ProtoMessageType messageType, MessageInfo defaultMessage, FileInfo protoFile, EnumInfoHelper enumInfoHelper) { this.m_ProjectData = projectData; this.m_Config = config; this.m_DefaultMessage = defaultMessage; this.m_MessageType = messageType; this.m_Descriptor = descriptor; this.m_EnumInfoHelper = enumInfoHelper; this.m_SavedEditorState = new EditorState(m_Config.GetUseAdvanced(m_MessageType), new MessageInfo(m_Descriptor)); // If using advanced mode, use the saved editor state which has user-inserted fields to prevent // inconsistencies. EditorState defaultEditorState = m_Config.GetUseAdvanced(m_MessageType) ? m_SavedEditorState : new EditorState(m_Config.GetUseAdvanced(m_MessageType), defaultMessage); this.m_EditorStatePrefs = new EditorStatePrefs <EditorState>(messageType.ToString(), defaultEditorState); this.m_EditorState = m_EditorStatePrefs.Get(); this.m_ProtoFile = protoFile; CheckValidationErrors(); }
public InstrumentationSettingsEditor(ProjectData projectData) { m_EditorStatePrefs = new EditorStatePrefs <EditorState>("instrumentation-settings", new EditorState() { useAdvanced = false, jsonSettings = SettingsUtil.defaultSettings.ToString() }); m_ProjectData = projectData; m_EditorState = m_EditorStatePrefs.Get(); LoadFromCachedEditorStateOrData(); }
public InstrumentationSettingsEditor(ProjectData projectData, SetupConfig setupConfig) { m_ProjectData = projectData; m_SetupConfig = setupConfig; LoadFromCachedEditorStateOrData(); m_EditorStatePrefs = new EditorStatePrefs <EditorState>("instrumentation-settings", new EditorState() { useAdvanced = m_SetupConfig.useAdvancedInstrumentationSettings, jsonSettings = m_AdvancedSettings.ToString() }); m_EditorState = m_EditorStatePrefs.Get(); m_DefaultSettingsUiString = ToUiString(SettingsUtil.defaultSettings); }
protected MessageEditor( SetupConfig config, MessageDescriptor descriptor, ProtoMessageType messageType, MessageInfo defaultMessage, FileInfo protoFile, EnumInfoHelper enumInfoHelper) { this.m_Config = config; this.m_DefaultMessage = defaultMessage; this.m_MessageType = messageType; this.m_Descriptor = descriptor; this.m_EnumInfoHelper = enumInfoHelper; this.m_EditorStatePrefs = new EditorStatePrefs <EditorState>(messageType.ToString(), new EditorState(m_Config.GetUseAdvanced(m_MessageType), defaultMessage)); this.m_EditorState = m_EditorStatePrefs.Get(); this.m_ProtoFile = protoFile; this.m_SavedEditorState = new EditorState(m_Config.GetUseAdvanced(m_MessageType), new MessageInfo(m_Descriptor)); CheckValidationErrors(); }