subtitleMemorize.UtilsInputFiles.SetPropertiesOfFirstFile C# (CSharp) Method

SetPropertiesOfFirstFile() public method

public SetPropertiesOfFirstFile ( string key, string value ) : void
key string
value string
return void
		public void SetPropertiesOfFirstFile (string key, string value)
		{
			// create filler entry
			if (m_dataEntries.Count == 0)
				m_dataEntries.Add (new DataEntry (null, null));

			m_dataEntries [0].properties = m_dataEntries [0].properties ?? new Dictionary<string, string> ();
			m_dataEntries [0].properties [key] = value;
		}
	}

Usage Example

Example #1
0
		private void ConnectEventsSubitleWindowOptions() {

			m_subtitleOptionsWindow.DeleteEvent += delegate(object obj, DeleteEventArgs args) {
				m_subtitleOptionsWindow.Hide ();
				args.RetVal = true; // this prevents the window from being actually getting deleted
			};

			m_buttonSubOptionsApply.Clicked += delegate(object sender, EventArgs e) {

				Gtk.Entry currentEntry = m_subOptionsWindow_subIndex == 0 ? m_entryTargetLanguage : m_entryNativeLanguage;
				UtilsInputFiles allFiles = new UtilsInputFiles(currentEntry.Text);
				allFiles.SetPropertiesOfFirstFile("enc", InfoEncoding.getEncodings()[m_comboboxSubEncoding.Active].ShortName);

				if(m_comboboxSubStream.Active >= 0)
					allFiles.SetPropertiesOfFirstFile("stream", m_subOptionsWindowStreamIndices[m_comboboxSubStream.Active].ToString());

				//allFiles.SetPropertiesOfFirstFile("stream", );
				currentEntry.Text = allFiles.ToString();
				m_subtitleOptionsWindow.Hide();
			};
		}