本文整理汇总了C#中View.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# View.ToString方法的具体用法?C# View.ToString怎么用?C# View.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View.ToString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PortRegistered
public override void PortRegistered(View.VPort port)
{
logger.Log("{0} got registeration notification for {1}", ToString(), port.ToString());
lock (this)
{
if (Role.ContainsRole(port, RoleFitbitUltra.RoleName))
{
fitbitPort = port;
logger.Log("{0} added fitbitUltra port {1}", this.ToString(), port.ToString());
if (logWindow != null)
logWindow.Invoke(new Action(delegate() { logWindow.ConsoleLog("added port " + port.ToString()); }));
}
if (Role.ContainsRole(port, RoleSensor.RoleName))
{
sensorPort = port;
logger.Log("{0} added switchbinary port {0}", this.ToString(), port.ToString());
if (logWindow != null)
logWindow.Invoke(new Action(delegate() { logWindow.ConsoleLog("added port " + port.ToString()); }));
}
}
}
示例2: PortRegistered
public override void PortRegistered(View.VPort port)
{
logger.Log("{0} got registeration notification for {1}", ToString(), port.ToString());
lock (this)
{
if (!otherFitbitUltraPorts.ContainsKey(port) && Role.ContainsRole(port, RoleFitbitUltra.RoleName) && !IsMyPort(port))
{
otherFitbitUltraPorts[port] = null;
logger.Log("{0} added port {1}", this.ToString(), port.ToString());
if (logWindow != null)
logWindow.Invoke(new Action(delegate() { logWindow.ConsoleLog("added port " + port.ToString()); }));
}
}
}
示例3: LogMessageToWindow
public void LogMessageToWindow(View.VPort port, string operationName, IList<View.VParamType> retVals)
{
string message = "";
if (retVals[0].Maintype() != (int)ParamType.SimpleType.error)
{
string result = retVals[0].Value().ToString();
message = String.Format("{0} success to {1} result = {2}", operationName, port.ToString(), result);
}
else
{
message = String.Format("{0} failure to {1}", operationName, port.ToString());
}
logger.Log("{0} {1}", this.ToString(), message);
if (dummyWindow != null)
dummyWindow.Invoke(new Action(delegate() { dummyWindow.ConsoleLog(message); }));
}
示例4: ImportView
private GameObject ImportView(View view)
{
int viewId = (int)view;
string viewStr = view.ToString();
GameObject viewGameObject = Instantiate(viewPrefabs[viewId]);
viewGameObject.transform.SetParent(viewBaseTransform);
viewGameObject.name = viewStr;
ViewManager viewManager = viewGameObject.GetComponent<ViewManager>();
viewManager.Init(this);
return viewGameObject;
}
示例5: PortDeregistered
public override void PortDeregistered(View.VPort port)
{
lock (this)
{
if (otherFitbitUltraPorts.ContainsKey(port))
{
otherFitbitUltraPorts.Remove(port);
logger.Log("{0} deregistered port {1}", this.ToString(), port.GetInfo().ModuleFacingName());
if (logWindow != null)
logWindow.Invoke(new Action(delegate() { logWindow.ConsoleLog("removed port " + port.ToString()); }));
}
}
}
示例6: PortDeregistered
public override void PortDeregistered(View.VPort port)
{
lock (this)
{
if (port.Equals(fitbitPort))
{
fitbitPort = null;
logger.Log("{0} removed fitbitUltra port {1}", this.ToString(), port.ToString());
if (logWindow != null)
logWindow.Invoke(new Action(delegate() { logWindow.ConsoleLog("removed port " + port.ToString()); }));
}
if (port.Equals(sensorPort))
{
sensorPort = null;
logger.Log("{0} removed switchbinary port {0}", this.ToString(), port.ToString());
if (logWindow != null)
logWindow.Invoke(new Action(delegate() { logWindow.ConsoleLog("removed port " + port.ToString()); }));
}
}
}
示例7: installView
/// <summary>
/// Sets the new view and sends a VIEW_CHANGE event up and down the stack.
/// </summary>
/// <param name="new_view">New View to install</param>
public void installView(View new_view)
{
Address coord;
int rc;
ViewId vid=new_view.getVid();
ArrayList mbrs=new_view.getMembers();
lock(members)
{ // serialize access to views
ltime=Math.Max(vid.getId(), ltime); // compute Lamport logical time
/* Check for self-inclusion: if I'm not part of the new membership, I just discard it.
This ensures that messages sent in view V1 are only received by members of V1 */
if(Trace.trace)
Trace.info("GMS.installView()","View to install contains: " + new_view.ToString());
if(checkSelfInclusion(mbrs) == false)
{
if(Trace.trace)
Trace.warn("GMS.installView()",
"checkSelfInclusion() failed, not a member of view " + mbrs + "; discarding view");
if(shun)
{
if(Trace.trace)
Trace.warn("GMS.installView()", "I'm being shunned, will leave and rejoin group");
passUp(new Event(Event.EXIT));
}
return;
}
// Discards view with id lower than our own. Will be installed without check if first view
if(view_id != null)
{
rc = vid.CompareTo(view_id);
if(rc <= 0)
{
if(Trace.trace)
Trace.error("GMS.installView()", "received view <= current view;" +
" discarding it ! (current vid: " + view_id + ", new vid: " + vid +")");
return;
}
}
if(Trace.trace) Trace.info("GMS.installView()", "view is " + new_view);
// assign new_view to view_id
view_id=vid.Copy();
// Set the membership. Take into account joining members
if(mbrs != null && mbrs.Count > 0)
{
members.set(mbrs);
tmp_members.set(members);
foreach(Object obj in mbrs)
{
joining.Remove(obj); // remove all members in mbrs from joining
}
tmp_members.add(joining); // adjust temporary membership
}
// Send VIEW_CHANGE event up and down the stack:
Event view_event=new Event(Event.VIEW_CHANGE, (View)new_view.copy());
passDown(view_event); // needed e.g. by failure detector or UDP
passUp(view_event);
coord=determineCoordinator();
if(coord != null && coord.Equals(local_addr) && !(coord.Equals(vid.getCoordAddress())))
{
becomeCoordinator();
}
else
{
if(haveCoordinatorRole() && !local_addr.Equals(coord))
becomeParticipant();
}
}
}
示例8: SendGetDevicePresenceMethod
public void SendGetDevicePresenceMethod(View.VPort port, View.VCapability capability, int counter)
{
IList<View.VParamType> retVals;
try
{
IList<View.VParamType> parameters = new List<View.VParamType>();
retVals = port.Invoke(RoleFitbitUltra.RoleName, RoleFitbitUltra.OpGetDevicePresence, parameters, ControlPort, capability, ControlPortCapability);
}
catch (Exception e)
{
logger.Log("Error while calling getDevicePresence request: {0}", e.ToString());
return;
}
bool result = false;
string message = "";
if (retVals[0].Maintype() != (int)ParamType.SimpleType.error)
{
result = Convert.ToBoolean(retVals[0].Value());
message = String.Format("{0} success to {1} result = {2}", RoleFitbitUltra.OpGetDevicePresence, port.ToString(), result);
}
else
{
message = String.Format("{0} failure to {1}", RoleFitbitUltra.OpGetDevicePresence, port.ToString());
return;
}
LogMessageToWindow(message);
if (result == true &&
lastResult == false)
{
LogMessageToWindow("User has just entered the scene.");
}
lastResult = result;
}
示例9: DecodeViewInverse
public static string DecodeViewInverse(View v)
{
return v.ToString();
}
示例10: CreateCAMLQuery
//.........这里部分代码省略.........
{
queryXml = CamlHelper.QueryMyTasksOverdue(taskids);
viewFieldsXml = CamlHelper.VIEWFIELDS_MYTASKSVERBOSE;
}
else
{
queryXml = "Overload"; //Too many tasks, revert to old solution
}
break;
case View.vwCompletedApproved | View.vwAssignedTasks:
if (taskids.AssignedTasksCompletedApproved.Count + taskids.AssignedTasksDueToday.Count + taskids.AssignedTasksOverdue.Count + taskids.AssignedTasksNotApplicable.Count < 400)
{
queryXml = CamlHelper.QueryMyTasksApprovedComplete(taskids);
viewFieldsXml = CamlHelper.VIEWFIELDS_MYTASKSVERBOSE;
}
else
{
queryXml = "Overload"; //Too many tasks, revert to old solution
}
break;
case View.vwDueToday | View.vwManagedTasks:
if (taskids.AssignedTasksDueToday.Count + taskids.AssignedTasksOverdue.Count + taskids.ManagedTasksDueToday.Count + taskids.ManagedTasksIncomplete.Count + taskids.ManagedTasksCompleted.Count + taskids.ManagedTasksNotApplicable.Count < 400)
{
queryXml = CamlHelper.QueryManagedTasksDueToday(taskids);
viewFieldsXml = CamlHelper.VIEWFIELDS_MYTASKSVERBOSE;
}
else
{
queryXml = "Overload"; //Too many tasks, revert to old solution
}
break;
case View.vwOverDue | View.vwManagedTasks:
if (taskids.ManagedTasksDueToday.Count + taskids.ManagedTasksIncomplete.Count + taskids.ManagedTasksCompleted.Count + taskids.ManagedTasksNotApplicable.Count < 400)
{
queryXml = CamlHelper.QueryManagedTasksIncomplete(taskids);
viewFieldsXml = CamlHelper.VIEWFIELDS_MYTASKSVERBOSE;
}
else
{
queryXml = "Overload"; //Too many tasks, revert to old solution
}
break;
case View.vwCompletedApproved | View.vwManagedTasks:
if (taskids.ManagedTasksCompleted.Count + taskids.ManagedTasksDueToday.Count + taskids.ManagedTasksIncomplete.Count + taskids.ManagedTasksNotApplicable.Count < 400)
{
queryXml = CamlHelper.QueryManagedTasksCompleted(taskids);
viewFieldsXml = CamlHelper.VIEWFIELDS_MYTASKSVERBOSE;
}
else
{
queryXml = "Overload"; //Too many tasks, revert to old solution
}
break;
case View.vwCustomSearch:
queryXml = CamlHelper.QueryCustomSearch(paramSearch);
viewFieldsXml = CamlHelper.VIEWFIELDS_MYTASKSVERBOSE;
break;
case View.vwArchiveView:
// If its the custom search do nothing, we just use the different service to query
break;
case View.vwAssignedTasks | View.vwNotApplicable:
if (taskids.AssignedTasksNotApplicable.Count + taskids.AssignedTasksDueToday.Count + taskids.AssignedTasksOverdue.Count + taskids.AssignedTasksCompletedApproved.Count < 400)
{
queryXml = CamlHelper.QueryAssignedTasksNotApplicable(taskids);
viewFieldsXml = CamlHelper.VIEWFIELDS_MYTASKSVERBOSE;
}
else
{
queryXml = "Overload"; //Too many tasks, revert to old solution
}
break;
case View.vwManagedTasks | View.vwNotApplicable:
if (taskids.ManagedTasksNotApplicable.Count + taskids.ManagedTasksDueToday.Count + taskids.ManagedTasksIncomplete.Count + taskids.ManagedTasksCompleted.Count < 400)
{
queryXml = CamlHelper.QueryManagedTasksNotApplicable(taskids);
viewFieldsXml = CamlHelper.VIEWFIELDS_MYTASKSVERBOSE;
}
else
{
queryXml = "Overload"; //Too many tasks, revert to old solution
}
break;
default:
queryXml = "";
throw new NotImplementedException("this view has not been implemented:" + vw.ToString());
//break;
}
queryXml = queryXml.Replace("&", "&");
return queryXml;
}
示例11: ConstructUrlParams
/// <summary>
/// Internal function for constructing the URL for the List web service.
/// This method will append parameters to the URL
/// Rationale: IIS logs would be more meaningful with these parameters. Would help us in
/// determining the profile of usage.
/// </summary>
/// <returns></returns>
private string ConstructUrlParams(IIsAction action, View? view, int numRows)
{
string msg = "";
const string toolname = "BCHECK";
string baseUrl = ViewModel.ListAsmxUrl;
switch (action)
{
case IIsAction.ALERTS:
{
msg = string.Format("{0}?TOOLNAME={1}&ACTION={2}", baseUrl, toolname, action.ToString());
}
break;
case IIsAction.QUERY:
{
if (view == null) throw new ArgumentException("The parameter view cannot be NULL when action=QUERY", "view");
msg = string.Format("{0}?TOOLNAME={1}&ACTION={2}&VIEW={3}", baseUrl, toolname, action.ToString(), view.ToString());
}
break;
case IIsAction.QUERYSINGLE:
{
msg = string.Format("{0}?TOOLNAME={1}&ACTION={2}", baseUrl, toolname, action.ToString());
}
break;
case IIsAction.SUMMARY:
{
if (view == null) throw new ArgumentException("The parameter view cannot be NULL when action=SUMMARY", "view");
msg = string.Format("{0}?TOOLNAME={1}&ACTION={2}&VIEW={3}", baseUrl, toolname, action.ToString(), view.ToString());
}
break;
case IIsAction.UPDATESINGLE:
{
msg = string.Format("{0}?TOOLNAME={1}&ACTION={2}", baseUrl, toolname, action.ToString());
}
break;
case IIsAction.UPDATEBULK:
{
if (numRows < 0) throw new ArgumentException("Number of rows should be a positive number", "numRows");
msg = string.Format("{0}?TOOLNAME={1}&ACTION={2}&NUMROWS={3}", baseUrl, toolname, action.ToString(), numRows);
}
break;
case IIsAction.GETATTACHMENTS:
{
msg = string.Format("{0}?TOOLNAME={1}&ACTION={2}", baseUrl, toolname, action.ToString());
}
break;
case IIsAction.DELETEATTACHMENT:
case IIsAction.ADDATTACHMENT:
{
msg = string.Format("{0}?TOOLNAME={1}&ACTION={2}", baseUrl, toolname, action.ToString());
}
break;
case IIsAction.VIEWATTACHMENT:
{
throw new NotImplementedException("Viewing attachments is done through direct URL access and not using Web Services");
}
case IIsAction.UPDATEOWNERSHIP:
{
if (numRows < 0) throw new ArgumentException("Number of rows should be a positive number", "numRows");
msg = string.Format("{0}?TOOLNAME={1}&ACTION={2}&NUMROWS={3}", baseUrl, toolname, action.ToString(), numRows);
}
break;
case IIsAction.UPDATECOMMENTS:
{
if (numRows < 0) throw new ArgumentException("Number of rows should be a positive number", "numRows");
msg = string.Format("{0}?TOOLNAME={1}&ACTION={2}&NUMROWS={3}", baseUrl, toolname, action.ToString(), numRows);
}
break;
case IIsAction.UPDATETIMETOCOMPLETE:
{
if (numRows < 0) throw new ArgumentException("Number of rows should be a positive number", "numRows");
msg = string.Format("{0}?TOOLNAME={1}&ACTION={2}&NUMROWS={3}", baseUrl, toolname, action.ToString(), numRows);
}
break;
case IIsAction.UPDATELATEINCOMPLETEREASON:
{
if (numRows < 0) throw new ArgumentException("Number of rows should be a positive number", "numRows");
msg = string.Format("{0}?TOOLNAME={1}&ACTION={2}&NUMROWS={3}", baseUrl, toolname, action.ToString(), numRows);
}
break;
}
return msg;
}