本文整理汇总了C#中View类的典型用法代码示例。如果您正苦于以下问题:C# View类的具体用法?C# View怎么用?C# View使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
View类属于命名空间,在下文中一共展示了View类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MemberController
/// <summary>
/// Constructor, creates new instances of necessary objects
/// save them to fields
/// </summary>
/// <param name="mainMenu"></param>
/// <param name="editUpdateMenu"></param>
public MemberController(View.MainMenuView mainMenu, EditUpdateMenu editUpdateMenu)
{
_mainMenu = mainMenu;
_editUpdateMenu = editUpdateMenu;
_memberDAL = new MemberDAL(directorieStrs.MemberListPath);
_members = new List<Member>();
}
示例2: Printer
public Printer(View.UserInput input)
: this()
{
// Always a dilemma how much validation to do and where
// For now expecting View to validate user input
// TODO: Clear definition of protocol for each of M, V and C
// so it is clear what validation to do and where.
if (input.Options["feedType"] != null)
{
feedType = input.Options["feedType"];
}
if (input.Options["feedIdentifier"] != null)
{
feedIdentifier = input.Options["feedIdentifier"];
}
if (input.Options["/with"] != null) {
conditions["searchTerm"] = input.Options["/with"];
conditions["excludeSearchTerm"] = false;
}
else if (input.Options["/without"] != null) {
conditions["searchTerm"] = input.Options["/with"];
conditions["excludeSearchTerm"] = true;
}
if (input.Options["/latest"] != null) {
conditions["tailSize"] = input.Options["/latest"];
}
}
示例3: ToggleViewOnSelection
void ToggleViewOnSelection(View myView)
{
if (selectedView != myView) { selectedView = myView; }
if (lastView != null) { Managers.Views.ToggleView(lastView, false); }
Managers.Views.ToggleView(selectedView, true);
lastView = selectedView;
}
示例4: Export
public void Export(JekyllExporter exporter, View view, StreamWriter writer)
{
var guid = Guid.NewGuid();
writer.WriteLine($"<div id='{guid}' class='cy'></div>");
writer.WriteLine(@"
<script>
var cy = cytoscape({
");
writer.WriteLine($"container: document.getElementById('{guid}'),");
writer.WriteLine("elements: [");
var nodes = view.Elements.Select(e => "{ data: { id: '" + e.Name + "', width: '"+ e.Name.Length * 10 +"px' } }");
var edges = view.Relationships.Select(r => "{ data: { id: '" + r.Source.Name + "_to_" + r.Target.Name + "', source: '"+ r.Source.Name +"', target: '"+r.Target.Name+"' } }");
writer.WriteLine(string.Join(",", nodes.Union(edges)));
writer.WriteLine(@"
],
style: cyto_" + view.ViewType.ToString().ToLowerInvariant() + @",
layout: {
name: 'cola',
fit: true,
nodeSpacing: 5,
edgeLengthVal: 45
}
});
</script>");
}
示例5: DataTablePropertiesDialog
/// <summary>
/// Default constructor for the class
/// </summary>
public DataTablePropertiesDialog(MainForm frm, Project currentProject, View view)
: base(frm)
{
InitializeComponent();
project = currentProject;
currentView = view;
}
示例6: frmMain
public frmMain()
{
InitializeComponent();
viewCurent = View.Main;
clhData.Width = -1;
clhDetalii.Width = 350;
clhPerioada.Width =-1;
clhSuma.Width = -2;
pnlAdaugaNotita.Hide();
pnlNotite.Hide();
pnlGrafic.Hide();
pnlAdaugaEveniment.Hide();
pnlMain.Show();
evenimente = EvenimentReader.citesteEvenimente("evenimente.xml");
maxIdEveniment = getMaxIdEveniment();
notite = NotitaReader.citesteNotite("notite.xml");
maxIdNotita = getMaxIdNotita();
amModificat = false;
modificare = false;
totalEvenimente = true;
amAfisatEvenimentePeriodice = false;
afiseazaEvenimente();
tmrEvenimente.Enabled = true;
}
示例7: UpdateEffect
protected override void UpdateEffect(GameTime gameTime, View view)
{
if (Acceleration != Vector2.Zero) {
Velocity = Vector2.Add (Velocity, Acceleration);
}
view.PositionAdd(Velocity);
}
示例8: Init
public void Init()
{
var spawns = Entity.GetByClass<SpawnPoint>();
if(spawns.Count() > 0)
{
Position = spawns.First().Position;
Rotation = spawns.First().Rotation;
}
View = View.Get(Id);
View.Position = Position;
View.Rotation = Rotation;
View.FieldOfView = Math.DegreesToRadians(60);
ReceiveUpdates = true;
// Defined in Libs/Config/defaultprofile.xml
Input.RegisterAction("zoom_in", OnActionZoomIn);
Input.RegisterAction("zoom_out", OnActionZoomOut);
Input.MouseEvents += ProcessMouseEvents;
MaxZoomLevel = 5;
MaxDistanceFromTarget = 100;
CurrentZoomLevel = MaxZoomLevel;
// The CVar attribute isn't functional at the moment, so we use this workaround.
CVar.RegisterInt("g_camMaxZoomLevel", ref MaxZoomLevel);
CVar.RegisterFloat("g_camMaxDistanceFromTarget", ref MaxDistanceFromTarget);
TargetEntity = Launcher.Instance;
}
示例9: GenerateHtml
protected override string GenerateHtml(View view, string className, string clasError)
{
string s = "<input type=\"password\" value=\"" + HttpUtility.HtmlAttributeEncode(Value) + "\"";
s = AddIdAttribute(s);
s = AddNameAttribute(s);
s = AddClassAttribute(s, className, clasError);
s = AddEnabledAttribute(s);
s = AddOnChangeAttribute(s);
if (MaxLength != Int32.MaxValue)
s += " maxlength=\"" + MaxLength + "\"";
if (Size != 0)
s += " size=\"" + Size + "\"";
if (!string.IsNullOrEmpty(OnKeyDown))
s += " onkeydown=\"" + OnKeyDown + "\"";
if (!string.IsNullOrEmpty(OnKeyUp))
s += " onkeyup=\"" + OnKeyUp + "\"";
if (!string.IsNullOrEmpty(OnKeyPress))
s += " onkeypress=\"" + OnKeyPress + "\"";
s += " autocomplete=\"off\"";
return s + " />";
}
示例10: getView
public override View getView(int position, View convertView, ViewGroup parent)
{
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowView = inflater.inflate(mResource, parent, false);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final com.opentok.android.Subscriber subscriber = mSubscribers.get(position);
Subscriber subscriber = outerInstance.mSubscribers[position];
// Set name
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final android.widget.TextView name = (android.widget.TextView) rowView.findViewById(R.id.subscribername);
TextView name = (TextView) rowView.findViewById(R.id.subscribername);
name.Text = subscriber.Stream.Name;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final android.widget.ImageView picture = (android.widget.ImageView) rowView.findViewById(R.id.subscriberpicture);
ImageView picture = (ImageView) rowView.findViewById(R.id.subscriberpicture);
// Initialize meter view
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final com.opentok.android.demo.ui.MeterView meterView = (com.opentok.android.demo.ui.MeterView) rowView.findViewById(R.id.volume);
MeterView meterView = (MeterView) rowView.findViewById(R.id.volume);
meterView.setIcons(BitmapFactory.decodeResource(Resources, R.drawable.unmute_sub), BitmapFactory.decodeResource(Resources, R.drawable.mute_sub));
subscriber.AudioLevelListener = new AudioLevelListenerAnonymousInnerClassHelper(this, subscriber, meterView);
meterView.setOnClickListener(new OnClickListenerAnonymousInnerClassHelper(this, subscriber, name, picture));
return rowView;
}
示例11: Show
public void Show(View view, object param = null)
{
Messenger.Default.Send(
param == null
? new Uri(_viewToUri[view], UriKind.Relative)
: new Uri(String.Format(_viewToUri[view], param), UriKind.Relative), "NavigationRequest");
}
示例12: GetValidRules
public virtual IEnumerable<ILogicRuleObject> GetValidRules(View view, ExecutionContext executionContext) {
if (view!=null) {
var tuple = new Tuple<ITypeInfo, ExecutionContext>(view.ObjectTypeInfo, executionContext);
return LogicRuleManager.Instance[tuple].Where(rule => IsValidRule(rule, view)).OrderBy(rule => rule.Index);
}
return Enumerable.Empty<ILogicRuleObject>();
}
示例13: 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()); }));
}
}
}
示例14: onListItemClick
public override void onListItemClick(ListView l, View v, int position, long id)
{
string path = mCurrentPath + mArrayList[position];
File file = new File(path);
if (file.Directory)
{
if (path.IndexOf(PARENT_DIRECTORY_PATH, StringComparison.Ordinal) > 0)
{
mCurrentPath = file.ParentFile.Parent + DIRECTORY_DELIMITER;
}
else
{
mCurrentPath = path;
}
createDirectoryList(new File(mCurrentPath));
mTextView.Text = mCurrentPath;
mAdapter.notifyDataSetChanged();
}
else
{
if (!path.EndsWith(".fls", StringComparison.Ordinal) && !path.EndsWith(".bin", StringComparison.Ordinal))
{
Toast.makeText(this, "Must choose .fls or .bin file", Toast.LENGTH_SHORT).show();
}
else
{
Intent data = new Intent();
data.putExtra(MainActivity.FIRMWARE_FILE_NAME, path);
setResult(MainActivity.RESULT_CODE_SELECT_FIRMWARE, data);
finish();
}
}
}
示例15: OnClick
public void OnClick(View v)
{
var offset = _scrollView.ParallaxOffset;
switch (v.Id)
{
case Resource.Id.minus:
offset = _scrollView.ParallaxOffset;
offset = offset - 0.05f;
_scrollView.ParallaxOffset = offset;
offset = _scrollView.ParallaxOffset;
_factorText.Text = string.Format("{0}", offset);
break;
case Resource.Id.plus:
offset = _scrollView.ParallaxOffset;
offset = offset + 0.05f;
_scrollView.ParallaxOffset = offset;
offset = _scrollView.ParallaxOffset;
_factorText.Text = string.Format("{0}", offset);
break;
}
if (offset * 100 <= 10)
{
_minus.Enabled = false;
_plus.Enabled = true;
}
else
{
_minus.Enabled = true;
_plus.Enabled = true;
}
}