コード例 #1
0
 protected virtual void InitContent(SpawnInfo info)
 {
     if (info != null)
     {
         this.onClose = info.onClose;
     }
 }
コード例 #2
0
ファイル: AvatarExporter.cs プロジェクト: raveenajain/hifi
 public void Init(string initialPath, OnCloseDelegate closeCallback)
 {
     minSize           = new Vector2(MIN_WIDTH, MIN_HEIGHT);
     titleContent.text = "Export New Avatar";
     projectLocation   = initialPath;
     onCloseCallback   = closeCallback;
     ShowUtility();
 }
コード例 #3
0
 public CornerLauncher(Dictionary <string, MergedCommand> mergedCommands, OnCloseDelegate onClose)
 {
     this._onClose = onClose;
     this._menu    = new CornerLauncherMenu(mergedCommands);
     //Thread thread = new Thread(() => StartKeysListenerInNewThread(null));
     //thread.Start();
     this._listener = new KeysListener(OnActivateCornerLauncher, OnDeactivateCornerLauncher, OnKeyPressedInCornerLauncher);
     this._listener.Start();
 }
コード例 #4
0
		/// <summary>
		/// Only this is allowed for use.
		/// </summary>
		/// <param name="suggestions"></param>
		/// <param name="offerAllSuggestions"></param>
		/// <param name="readOnly"></param>
		/// <param name="predefinedValue"></param>
		/// <param name="acceptOnlySuggested"></param>
		/// <returns></returns>
		public static string Display(string caption, List<string> suggestions, bool offerAllSuggestions, bool readOnly, string predefinedValue, bool acceptOnlySuggested, bool caseSensitive, OnCloseDelegate onClose, object contextData, Screen screen = null)
		{
			_suggestions = (suggestions == null) ? new List<string>() : suggestions;
			_readOnly = readOnly;
			_offerAllSuggestions = _readOnly || offerAllSuggestions;
			_caseSensitive = caseSensitive;
			if (_readOnly && _suggestions.Count == 0)
			{
				return null;
			}
			_acceptOnlySuggested = acceptOnlySuggested;
			OnClose = onClose;
			_contextData = contextData;

			CenterFormOnScreen(formBackPanel, screen);
			formBackPanel.TopMost = true;
			formBackPanel.Show();
			formBackPanel.TopMost = false;
			
			formParameterBox.lblCaption.Text = caption;
			formParameterBox.tbParameter.Text = string.Empty;
			result = null;
			suggestionsSelectionIndex = -1;
			suggestionsOffset = 0;
			oldEnteredText = null;
			oldOffset = 0;
		
			//TODO: check this verification
			//if (_readOnly)
			//{
			if (!string.IsNullOrEmpty(predefinedValue))
			{
				formParameterBox.tbParameter.Text = predefinedValue;
				suggestionsSelectionIndex = _suggestions.IndexOf(predefinedValue);
				if (suggestionsSelectionIndex != -1)
				{
					suggestionsOffset = suggestionsSelectionIndex - (int)((numberOfSuggestionsDisplayed / 2));
					while (suggestionsOffset > _suggestions.Count - numberOfSuggestionsDisplayed) suggestionsOffset--;
					if (suggestionsOffset < 0) suggestionsOffset = 0;
				}
			}
			//}    

			CenterFormOnScreen(formParameterBox,screen);
			formParameterBox.TopMost = true;
			formParameterBox.Show();
			return result;
		}
コード例 #5
0
		public static string Display(ParameterInputArguments args, OnCloseDelegate onClose, object contextData, Screen screen = null)
		{
			return Display(args.caption, args.suggestions, args.offerAllSuggestions, args.readOnly, args.predefinedValue, args.acceptOnlySuggested, args.caseSensitive, onClose, contextData, screen);
		}
コード例 #6
0
ファイル: Websocket.cs プロジェクト: Shikuma/MixerTemplate
 private static extern int open_websocket(IntPtr websocketHandle, [MarshalAs(UnmanagedType.LPStr)] string uri, OnConnectDelegate onConnect, OnMessageDelegate onMessage, OnErrorDelegate onError, OnCloseDelegate onClose);