当前位置: 首页>>代码示例>>C#>>正文


C# Action.ToString方法代码示例

本文整理汇总了C#中System.Action.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Action.ToString方法的具体用法?C# Action.ToString怎么用?C# Action.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Action的用法示例。


在下文中一共展示了Action.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Pacote

 public Pacote(Action act, string target, string nick)
 {
     this.users = new List<Amigo>();
     this.action = act.ToString();
     this.target = target;
     this.nickname = nick;
 }
开发者ID:andbreder,项目名称:Chat_C-,代码行数:7,代码来源:Pacote.cs

示例2: PostAction

        private static bool PostAction(Proxy p, Server server, Action action)
        {
            var instance = p.Instance;
            // if we can't issue any commands, bomb out
            if (instance.AdminUser.IsNullOrEmpty() || instance.AdminPassword.IsNullOrEmpty()) return false;

            var loginInfo = $"{instance.AdminUser}:{instance.AdminPassword}";
            var haproxyUri = new Uri(instance.Url);
            var requestBody = $"s={server.Name}&action={action.ToString().ToLower()}&b={p.Name}";
            var requestHeader = $"POST {haproxyUri.AbsolutePath} HTTP/1.1\r\nHost: {haproxyUri.Host}\r\nContent-Length: {Encoding.GetEncoding("ISO-8859-1").GetBytes(requestBody).Length}\r\nAuthorization: Basic {Convert.ToBase64String(Encoding.Default.GetBytes(loginInfo))}\r\n\r\n";

            try
            {
                var socket = new System.Net.Sockets.Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                socket.Connect(haproxyUri.Host, haproxyUri.Port);
                socket.Send(Encoding.UTF8.GetBytes(requestHeader + requestBody));

                var responseBytes = new byte[socket.ReceiveBufferSize];
                socket.Receive(responseBytes);

                var response = Encoding.UTF8.GetString(responseBytes);
                instance.PurgeCache();
                return response.StartsWith("HTTP/1.0 303") || response.StartsWith("HTTP/1.1 303");
            }
            catch (Exception e)
            {
                Current.LogException(e);
                return false;
            }
        }
开发者ID:riiiqpl,项目名称:Opserver,代码行数:30,代码来源:HAProxyAdmin.cs

示例3: EditClassDialog

 public EditClassDialog(List<Class> classList, Action action)
 {
     InitializeComponent();
     this.Text = action + " class";
     bEditClass.Text = action.ToString();
     foreach (Class c in classList)
     {
         cmbClassList.Items.Add(c);
     }
     cmbClassList.SelectedIndex = -1;
 }
开发者ID:kristofberge,项目名称:Classroom,代码行数:11,代码来源:EditClassDialog.cs

示例4: Execute

 public void Execute(Action command)
 {
     executionCount.AtomicIncrementAndGet();
     if (!ignoreExecution.ReadFullFence())
     {
         var th = new Thread(() => command());
         th.Name = command.ToString();
         th.IsBackground = true;
         threads.Add(th);
         th.Start();
     }
 }
开发者ID:bingyang001,项目名称:disruptor-net-3.3.0-alpha,代码行数:12,代码来源:StubExecutor.cs

示例5: EditStudentDialog

 public EditStudentDialog(List<Class> classList, AbstractHelper helper, Action action)
 {
     InitializeComponent();
     this._helper = helper;
     this.Text = action + " student";
     bEditStud.Text = action.ToString();
     foreach (Class c in classList)
     {
         cmbClassList.Items.Add(c);
         cmbEditStudClass.Items.Add(c);
     }
     cmbClassList.SelectedIndex = -1;
 }
开发者ID:kristofberge,项目名称:Classroom,代码行数:13,代码来源:EditStudentDialog.cs

示例6: RunAction

		protected void RunAction (Action<TextEditorData> action)
		{
			HideMouseCursor ();
			try {
				Document.BeginAtomicUndo ();
				action (this.textEditorData);
				if (Document != null) // action may have closed the document.
					Document.EndAtomicUndo ();
			} catch (Exception e) {
				Console.WriteLine ("Error while executing action " + action.ToString () + " :" + e);
			}
		}
开发者ID:pgoron,项目名称:monodevelop,代码行数:12,代码来源:EditMode.cs

示例7: RunAction

		protected void RunAction (Action<TextEditorData> action)
		{
			HideMouseCursor ();
			try {
				action (this.textEditorData);
			} catch (Exception e) {
				Console.WriteLine ("Error while executing action " + action.ToString () + " :" + e);
			}
		}
开发者ID:ArsenShnurkov,项目名称:monodevelop,代码行数:9,代码来源:EditMode.cs

示例8: CheckCopyPalette

        void CheckCopyPalette(MainForm form, DataEntry[] de, Action<IWICPalette> method)
        {
            IWICImagingFactory factory = (IWICImagingFactory)new WICImagingFactory();
            IWICPalette palette = factory.CreatePalette();

            try
            {
                method(palette);
                try
                {
                    if (palette.GetColorCount() == 0)
                    {
                        form.Add(this, method.ToString(Resources._0_ZeroColorPalette), de);
                    }
                }
                catch (Exception e)
                {
                    form.Add(this, method.ToString(Resources._0_IncorrectStatePalette), de, new DataEntry(e));
                }
            }
            catch (Exception e)
            {
                form.CheckHRESULT(this, WinCodecError.WINCODEC_ERR_PALETTEUNAVAILABLE, e, de);
            }
            finally
            {
                palette.ReleaseComObject();
                factory.ReleaseComObject();
            }
        }
开发者ID:eakova,项目名称:resizer,代码行数:30,代码来源:BitmapDecoderRule.cs

示例9: UnsubscribeFunction

		//Unsubscribes a Function member from everything
		public static void UnsubscribeFunction(Action<object> func){

			if (func == null)
				return;

			foreach (var eventName in subscribedMembers.Keys){
				foreach (var member in subscribedMembers[eventName].ToArray()){
					if (member.subscribedFunction != null && member.subscribedFunction.ToString() == func.ToString())
						subscribedMembers[eventName].Remove(member);
				}
			}

			if (logEvents)
				Debug.Log("XXX " + func.ToString() + " Unsubscribed from everything");
		}
开发者ID:pangaeastudio,项目名称:vrgame-bruceli,代码行数:16,代码来源:EventHandler.cs

示例10: StandardLoopThread

 public StandardLoopThread(Action method, string threadName, Priority priority, int cycleTimeMS = 0)
     : base(method, threadName, priority, cycleTimeMS)
 {
     UnityEngine.Debug.Log("StandardLoopThread Created " + method.ToString() + " " + threadName + " " + priority + " " + cycleTimeMS);
 }
开发者ID:rygo6,项目名称:ECThreading,代码行数:5,代码来源:StandardLoopThread.cs

示例11: MakeActionException

 private static WikiException MakeActionException(Action action, string error)
 {
     string message = action.ToString() + " failed with error '" + error + "'.";
     switch (action)
     {
         case Action.Edit:
             return new EditException(message);
         case Action.Login:
             return new LoginException(message);
         case Action.Move:
             return new MoveException(message);
         default:
             return new WikiException(message);
     }
 }
开发者ID:Claymore,项目名称:SharpMediaWiki,代码行数:15,代码来源:Wiki.cs

示例12: RemoveListener

 /// <summary>
 /// Removes the listener for the specified sensor
 /// </summary>
 public void RemoveListener(Sensor sensor, Action<Sensor> listener)
 {
     if (Logger.DUMP) Logger.dump("SensorRegistry", "RemoveListener "+ sensor.ID + " " + listener.ToString());
     lock(sync_listener)
     {
     if (!activeSensors.ContainsKey(sensor))
         return; // TODO: handle errors?
     SensorListener sl = activeSensors[sensor];
     var removed = sl.listeners.RemoveAll((g) => {return g == listener;});
     if (removed > 0)
         sensor.NotifyRemoveListener(listener);
     if(sl.listeners.Count == 0)
         activeSensors.Remove(sensor);
     activeSensors_array = null;
     }
 }
开发者ID:cail,项目名称:hobd,代码行数:19,代码来源:SensorRegistry.cs

示例13: SendDeleteMessages

        //SEND MESSAGE TO QUEUE - REQUEST to delete thumbnails & posters
        public void SendDeleteMessages(Action act, string blobUrl = "", string thumbUrl = "")
        {
            // Create message, passing a string message for the body.
            BrokeredMessage message = new BrokeredMessage(AppConfiguration.ApplicationId);

            // Set some additional custom app-specific properties.
            message.Properties["Action"] = act.ToString();
            message.Properties["ImageUrl"] = blobUrl;
            message.Properties["ThumbURL"] = thumbUrl;

            // Send message to the queue.
            QClient.Send(message);
        }
开发者ID:banlong,项目名称:OMDBMovies,代码行数:14,代码来源:AzureServiceProvider.cs

示例14: agentActed

 public void agentActed(Agent agent, Action action, EnvironmentState resultingState)
 {
     System.Console.WriteLine("Agent acted: " + action.ToString());
 }
开发者ID:youthinkk,项目名称:aima-csharp,代码行数:4,代码来源:SimpleEnvironmentView.cs

示例15: Invoke

        //The Invoke action for the interface
        //Provides Run to Gui mechanism
        public void Invoke(Action action)
        {
            var handler = new Handler(Looper.MainLooper);
            Log.Info("SharpXmppDemo", ".MultiDebug: " + "Invoke was called for action: " + action.ToString());

            if (handler != null)
            {
                handler.Post(action);
            }
            else
            {
                throw new InvalidOperationException("No handler for the main thread was created");
            }
        }
开发者ID:pgstath,项目名称:SharpXmppDemo,代码行数:16,代码来源:BackgroundService.cs


注:本文中的System.Action.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。