Esempio n. 1
0
        public void Load(IDVDProfilerAPI api)
        {
            Api = api;

            if (Directory.Exists(ApplicationPath) == false)
            {
                Directory.CreateDirectory(ApplicationPath);
            }

            if (File.Exists(SettingsFile))
            {
                try
                {
                    //Settings = Settings.Deserialize(SettingsFile);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(String.Format(MessageBoxTexts.FileCantBeRead, SettingsFile, ex.Message)
                                    , MessageBoxTexts.ErrorHeader, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            CreateSettings();

            Api.RegisterForEvent(PluginConstants.EVENTID_FormCreated);

            //MenuToken = Api.RegisterMenuItem(PluginConstants.FORMID_Main, PluginConstants.MENUID_Form
            //    , @"Tools", "Plugin Template", MenuId);
        }
Esempio n. 2
0
        public void Load(IDVDProfilerAPI api)
        {
            Api = api;

            if (Directory.Exists(_applicationPath) == false)
            {
                Directory.CreateDirectory(_applicationPath);
            }

            if (File.Exists(_settingsFile))
            {
                try
                {
                    _settings = DVDProfilerSerializer <Settings> .Deserialize(_settingsFile);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format(MessageBoxTexts.FileCantBeRead, _settingsFile, ex.Message), MessageBoxTexts.ErrorHeader, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            this.CreateSettings();

            if (_settings.DefaultValues.ReceiveFromCastCrewEdit)
            {
                this.LoadReceiver();
            }

            if (Directory.Exists(_applicationPath) == false)
            {
                Directory.CreateDirectory(_applicationPath);
            }

            Api.RegisterForEvent(PluginConstants.EVENTID_FormCreated);

            _copyCastMenuToken = Api.RegisterMenuItem(PluginConstants.FORMID_Main, PluginConstants.MENUID_Form, @"DVD", "Copy Cast", CopyCastMenuId);

            _copyCrewMenuToken = Api.RegisterMenuItem(PluginConstants.FORMID_Main, PluginConstants.MENUID_Form, @"DVD", "Copy Crew", CopyCrewMenuId);

            _pasteMenuToken = Api.RegisterMenuItem(PluginConstants.FORMID_Main, PluginConstants.MENUID_Form, @"DVD", "Paste Cast / Crew", PasteMenuId);

            _receiverSettingMenuToken = Api.RegisterMenuItem(PluginConstants.FORMID_Main, PluginConstants.MENUID_Form, @"Tools", "Enable Cast/Crew Edit 2 Receiver", ReceiverSettingMenuId);

            api.SetRegisteredMenuItemChecked(_receiverSettingMenuToken, _settings.DefaultValues.ReceiveFromCastCrewEdit);

            var pluginVersion = this.PluginVersion.ToString();

            if (_settings.CurrentVersion != pluginVersion)
            {
                this.OpenReadme();

                _settings.CurrentVersion = pluginVersion;
            }
        }