//do not forget Wproperties in constructor! #endregion Properties for Skins #region Constructor and Dispose /// <summary> /// Constructor... this one is called by the WorkflowManager when this model is loaded due to a screen reference. /// </summary> public Main_GUI() //will be called when the screen is the first time loaded not the same as Init() !!! { Log.Debug("MainGui: Constructor called"); _instance = this; //needed to ensure transfer from static function later on // In models, properties will always be WProperty instances. When using SProperties for screen databinding, _headerProperty = new WProperty(typeof(string), "[TvWishListMP2.1000]"); _modusProperty = new WProperty(typeof(string), "[TvWishListMP2.4200]"); _statusProperty = new WProperty(typeof(string), String.Empty); _textBoxSkinProperty = new WProperty(typeof(string), String.Empty); _dialogHeaderProperty = new WProperty(typeof(string), String.Empty); _inputTextBoxSkinProperty = new WProperty(typeof(string), String.Empty); _inputHeaderProperty = new WProperty(typeof(string), String.Empty); //initialize MP1 plugin translation PluginGuiLocalizeStrings.MP2Section = "TvWishListMP2"; //Message Initialization after language mymessages = new XmlMessages(PluginGuiLocalizeStrings.Get(4900), "", false); //user defined custom DateTimeFormat will overwrite default value later //Log.Debug("[TVWishListMP GUI_List]:Init mymessages.filename=" + mymessages.filename); //TvWishes Initialization myTvWishes = new TvWishProcessing(); // get pipename from Tvserver as MPExtended uses TV1 and NativeTvserver TV2 // get hostname from tvserver for multiseat installation TvBusinessLayer layer = new TvBusinessLayer(); Setting setting; setting = layer.GetSetting("TvWishList_PipeName", "MP2TvWishListPipe"); string pipename = setting.Value; setting = layer.GetSetting("TvWishList_MachineName", "localhost"); string hostname = setting.Value; myPipeClient = new PipeClient(myTvWishes,hostname,pipename); //Format Initialization _TextBoxFormat_16to9_EmailFormat_Org = PluginGuiLocalizeStrings.Get(1900); _TextBoxFormat_16to9_EmailFormat_Org = _TextBoxFormat_16to9_EmailFormat_Org.Replace(@"\n", "\n"); _TextBoxFormat_16to9_EmailFormat_Org = _TextBoxFormat_16to9_EmailFormat_Org.Replace("<br>", "\n"); _TextBoxFormat_16to9_EmailFormat_Org = _TextBoxFormat_16to9_EmailFormat_Org.Replace("<BR>", "\n"); _TextBoxFormat_4to3_EmailFormat_Org = PluginGuiLocalizeStrings.Get(1902); _TextBoxFormat_4to3_EmailFormat_Org = _TextBoxFormat_4to3_EmailFormat_Org.Replace(@"\n", "\n"); _TextBoxFormat_4to3_EmailFormat_Org = _TextBoxFormat_4to3_EmailFormat_Org.Replace("<br>", "\n"); _TextBoxFormat_4to3_EmailFormat_Org = _TextBoxFormat_4to3_EmailFormat_Org.Replace("<BR>", "\n"); _TextBoxFormat_16to9_ViewOnlyFormat_Org = PluginGuiLocalizeStrings.Get(1901); _TextBoxFormat_16to9_ViewOnlyFormat_Org = _TextBoxFormat_16to9_ViewOnlyFormat_Org.Replace(@"\n", "\n"); _TextBoxFormat_16to9_ViewOnlyFormat_Org = _TextBoxFormat_16to9_ViewOnlyFormat_Org.Replace("<br>", "\n"); _TextBoxFormat_16to9_ViewOnlyFormat_Org = _TextBoxFormat_16to9_ViewOnlyFormat_Org.Replace("<BR>", "\n"); _TextBoxFormat_4to3_ViewOnlyFormat_Org = PluginGuiLocalizeStrings.Get(1903); _TextBoxFormat_4to3_ViewOnlyFormat_Org = _TextBoxFormat_4to3_ViewOnlyFormat_Org.Replace(@"\n", "\n"); _TextBoxFormat_4to3_ViewOnlyFormat_Org = _TextBoxFormat_4to3_ViewOnlyFormat_Org.Replace("<br>", "\n"); _TextBoxFormat_4to3_ViewOnlyFormat_Org = _TextBoxFormat_4to3_ViewOnlyFormat_Org.Replace("<BR>", "\n"); //load MP2 data LoadSettings(); //must be done after initialization of windows LoadSettingsResultGui(); //load TvwishlistFolder and filenames from TvServer LoadFromTvServer(); MpVersion = Main_GUI._instance.Version(); if (TvVersion != MpVersion) //version does not match { Log.Debug("TvVersion " + TvVersion + " does not match MpVersion " + MpVersion + " -Aborting plugin"); VersionMismatch = true; } Log.Debug("TvWishList_Mp2Version =" + MpVersion); Log.Debug("TvWishList_TvServerVersion =" + TvVersion); //send servername to native tvserver //string mymessage = GetServerIp(); //Log.Debug("ServerIpaddress=" + mymessage); //TvWishListMessaging.SendTvWishListMessage(TvWishListMessaging.MessageType.Initialization, mymessage); }
public PipeClient(string host, string pipe) { lng = new LanguageTranslation(); #endif _instance = this; pipeName = pipe; hostName = host; if (hostName == "localhost") { hostName = "."; } else Log.Debug("Pipe client initiated"); }
public TvWishListMP2NativeTvProvider() { _initialized = true; _instance = this; ISettingsManager settingsManager = ServiceRegistration.Get<ISettingsManager>(); TvWishListMP2Settings settings = settingsManager.Load<TvWishListMP2Settings>(); Log.InitializeLogFile(); Log.DebugValue = settings.Verbose; Host = settingsManager.Load<TvWishListMP2NativeTvProviderSettings>().TvServerHost; Log.Debug("host=" + Host); PipeClient mypipe = new PipeClient(Host,"MP2TvWishListPipe"); mypipe.Debug = Log.DebugValue; Log.Debug("TvWishListNativeTvProvider initialized"); Log.Debug("mypipe.Debug=" + mypipe.Debug.ToString()); // get server host name from tvserver }
public void InitializeTvWishList() //initialization must be done outside Init() and outside OnAdded() { if (FIRST_INITIALIZE) { // get pipename from Tvserver as MPExtended uses TV1 and NativeTvserver TV2 // get hostname from tvserver for multiseat installation TvBusinessLayer layer = new TvBusinessLayer(); Setting setting; #if (MP2) setting = layer.GetSetting("TvWishList_PipeName", "MP2TvWishListPipe"); #else setting = layer.GetSetting("TvWishList_PipeName", "TvWishListPipe"); #endif string pipename = setting.Value; setting = layer.GetSetting("TvWishList_MachineName", "localhost"); string hostname = setting.Value; myPipeClient = new PipeClient(myTvWishes, hostname, pipename); //load MP data LoadSettings(); //must be done after initialization of windows //load TvwishlistFolder and filenames from TvServer LoadFromTvServer(); MpVersion = this.Version(); if (TvVersion != MpVersion) //version does not match { Log.Debug("TvVersion " + TvVersion + " does not match MpVersion " + MpVersion + " -Aborting plugin"); VersionMismatch = true; } Log.Debug("MpVersion =" + MpVersion); Log.Debug("TvVersion =" + TvVersion); FIRST_INITIALIZE = false; //check command from tvserver needed? } }
public TvWishListSetup() { InitializeComponent(); mymessage = new XmlMessages("", "",true); myTvWishes = new TvWishProcessing(); myTvWishes.TvSetup = true; #if (MPTV2) tvSetupPipeClient = new PipeClient(myTvWishes, lng, "localhost", "MP2TvWishListPipe"); #endif dataGridView1.DataError += DataGridView_DataError; _instance = this; Log.Debug("TvWishListSetup()"); }