public static Status GetStatusFromType(Enums.StatusType type, string message) { Status tmpStatus = new Status(); tmpStatus.type = type; tmpStatus.message = message; return(tmpStatus); }
public static Status GetStatusFromType(Enums.StatusType type) { Status tmpStatus = new Status(); tmpStatus.type = type; tmpStatus.message = Translations.GetByName(type.ToString()); return(tmpStatus); }
public static void SetStatus(Enums.StatusType type, string message) { try { Status tmpStatus = new Status(); tmpStatus.type = type; tmpStatus.message = message; JABBER_LAST_STATUS = tmpStatus; Helper.JABBER_CLIENT.Presence.status = tmpStatus; Helper.JABBER_CLIENT.Presence.applyStatus(); } catch (Exception e) { Log.Error(e); } }
/// <summary> /// Load the settings from the mediaportal config /// </summary> public static void Load() { using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Config, "MediaPortal.xml"))) { username = reader.GetValue(Helper.PLUGIN_NAME, "username"); server = reader.GetValue(Helper.PLUGIN_NAME, "server"); string tmpSettingsString = reader.GetValue(Helper.PLUGIN_NAME, "resource"); if (!String.IsNullOrEmpty(tmpSettingsString)) { resource = tmpSettingsString; } string encryptedPassword = reader.GetValue(Helper.PLUGIN_NAME, "password"); password = decryptString(encryptedPassword); autoConnectStartup = reader.GetValueAsBool(Helper.PLUGIN_NAME, "autoConnectStartup", autoConnectStartup); notifyOnMessagePlugin = reader.GetValueAsBool(Helper.PLUGIN_NAME, "notifyOnMessagePlugin", notifyOnMessagePlugin); notifyOnMessageGlobally = reader.GetValueAsBool(Helper.PLUGIN_NAME, "notifyOnMessageGlobally", notifyOnMessageGlobally); notifyOnStatusPlugin = reader.GetValueAsBool(Helper.PLUGIN_NAME, "notifyOnStatusPlugin", notifyOnStatusPlugin); notifyOnStatusGlobally = reader.GetValueAsBool(Helper.PLUGIN_NAME, "notifyOnStatusGlobally", notifyOnStatusGlobally); notifyOnMoodPlugin = reader.GetValueAsBool(Helper.PLUGIN_NAME, "notifyOnMoodPlugin", notifyOnMoodPlugin); notifyOnMoodGlobally = reader.GetValueAsBool(Helper.PLUGIN_NAME, "notifyOnMoodGlobally", notifyOnMoodGlobally); notifyOnActivityPlugin = reader.GetValueAsBool(Helper.PLUGIN_NAME, "notifyOnActivityPlugin", notifyOnActivityPlugin); notifyOnActivityGlobally = reader.GetValueAsBool(Helper.PLUGIN_NAME, "notifyOnActivityGlobally", notifyOnActivityGlobally); notifyOnTunePlugin = reader.GetValueAsBool(Helper.PLUGIN_NAME, "notifyOnTunePlugin", notifyOnTunePlugin); notifyOnTuneGlobally = reader.GetValueAsBool(Helper.PLUGIN_NAME, "notifyOnTuneGlobally", notifyOnTuneGlobally); notifyOnErrorPlugin = reader.GetValueAsBool(Helper.PLUGIN_NAME, "notifyOnErrorPlugin", notifyOnErrorPlugin); notifyOnErrorGlobally = reader.GetValueAsBool(Helper.PLUGIN_NAME, "notifyOnErrorGlobally", notifyOnErrorGlobally); selectStatusOnStartup = reader.GetValueAsBool(Helper.PLUGIN_NAME, "selectStatusOnStartup", selectStatusOnStartup); notifyTimeOut = reader.GetValueAsInt(Helper.PLUGIN_NAME, "notifyTimeOut", notifyTimeOut); autoIdleTimeOut = reader.GetValueAsInt(Helper.PLUGIN_NAME, "autoIdleTimeOut", autoIdleTimeOut); autoIdleStatusType = (Enums.StatusType)reader.GetValueAsInt(Helper.PLUGIN_NAME, "autoIdleStatusType", (int)autoIdleStatusType); tmpSettingsString = reader.GetValue(Helper.PLUGIN_NAME, "autoIdleStatusMessage"); if (!String.IsNullOrEmpty(tmpSettingsString)) { autoIdleStatusMessage = tmpSettingsString; } defaultStatusType = (Enums.StatusType)reader.GetValueAsInt(Helper.PLUGIN_NAME, "defaultStatusType", (int)defaultStatusType); tmpSettingsString = reader.GetValue(Helper.PLUGIN_NAME, "defaultStatusMessage"); if (!String.IsNullOrEmpty(tmpSettingsString)) { defaultStatusMessage = tmpSettingsString; } defaultMoodType = (Enums.MoodType)reader.GetValueAsInt(Helper.PLUGIN_NAME, "defaultMoodType", (int)defaultMoodType); tmpSettingsString = reader.GetValue(Helper.PLUGIN_NAME, "defaultMoodMessage"); if (!String.IsNullOrEmpty(tmpSettingsString)) { defaultMoodMessage = tmpSettingsString; } defaultActivityType = (Enums.ActivityType)reader.GetValueAsInt(Helper.PLUGIN_NAME, "defaultActivityType", (int)defaultActivityType); tmpSettingsString = reader.GetValue(Helper.PLUGIN_NAME, "defaultActivityMessage"); if (!String.IsNullOrEmpty(tmpSettingsString)) { defaultActivityMessage = tmpSettingsString; } notifyWindowType = (Helper.PLUGIN_NOTIFY_WINDOWS)reader.GetValueAsInt(Helper.PLUGIN_NAME, "notifyWindowType", (int)notifyWindowType); defaultKeyboardType = (Dialog.KeyBoardTypes)reader.GetValueAsInt(Helper.PLUGIN_NAME, "defaultKeyboardType", (int)Dialog.KeyBoardTypes.Default); publishTuneInfo = reader.GetValueAsBool(Helper.PLUGIN_NAME, "publishTuneInfo", publishTuneInfo); publishActivityMusic = reader.GetValueAsBool(Helper.PLUGIN_NAME, "publishActivityMusic", publishActivityMusic); publishActivityRadio = reader.GetValueAsBool(Helper.PLUGIN_NAME, "publishActivityRadio", publishActivityRadio); publishActivityMovie = reader.GetValueAsBool(Helper.PLUGIN_NAME, "publishActivityMovie", publishActivityMovie); publishActivityTV = reader.GetValueAsBool(Helper.PLUGIN_NAME, "publishActivityTV", publishActivityTV); publishActivityRecording = reader.GetValueAsBool(Helper.PLUGIN_NAME, "publishActivityRecording", publishActivityRecording); } }