本文整理汇总了C#中Dialog.SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C# Dialog.SetPosition方法的具体用法?C# Dialog.SetPosition怎么用?C# Dialog.SetPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dialog
的用法示例。
在下文中一共展示了Dialog.SetPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnSignupEvent
//.........这里部分代码省略.........
split.PackEnd( right, true, true, 10 );
NameValueCollection fields =
(NameValueCollection)form[ "fields" ];
Hashtable data = (Hashtable)form[ "data" ];
foreach( string Key in fields.AllKeys )
{
Hashtable fd = (Hashtable)data[ Key ];
string Name = Key.Substring( 0, 1 ).ToUpper() +
Key.Substring( 1 ) + ":";
Label lbl = new Label( Name );
lbl.SetAlignment( 0, (float)0.5 );
left.PackStart( lbl, false, false, 5 );
if( fields[ Key ].Equals( "TextEditView" ) )
{
Entry ent = new Entry();
ent.Name = Key;
ent.ActivatesDefault = true;
if( fd[ "isPassword" ] != null )
ent.Visibility = false;
if( fd[ "value" ] != null )
ent.Text = (string)fd[ "value" ];
right.PackStart( ent, false, false, 5 );
}
else if( fields[ Key ].Equals( "PopupButtonView" ) )
{
ComboBox cbox = ComboBox.NewText();
cbox.WrapWidth = 5;
cbox.Name = Key;
if( fd[ "menuItems" ] != null )
{
string menuItems = (string)fd[ "menuItems" ];
foreach( string Value in menuItems.Split( ',' ) )
cbox.AppendText( Value );
if( fd[ "value" ] != null &&
(string)fd[ "value" ] != String.Empty )
{
cbox.Active = Convert.ToInt32( fd[ "value" ] ) - 1;
}
else
{
cbox.Active = 0;
}
}
right.PackStart( cbox, false, false, 5 );
}
else if( fields[ Key ].Equals( "ComboControlView" ) )
{
ComboBoxEntry cboxe = ComboBoxEntry.NewText();
cboxe.WrapWidth = 5;
cboxe.Name = Key;
if( fd[ "menuItems" ] != null )
{
string menuItems = (string)fd[ "menuItems" ];
foreach( string Value in menuItems.Split( ',' ) )
cboxe.AppendText( Value );
}
if( fd[ "value" ] != null )
((Entry)cboxe.Child).Text = (string)fd[ "value" ];
right.PackStart( cboxe, false, false, 5 );
}
else if( fields[ Key ].Equals( "CheckboxView" ) )
{
CheckButton cbtn = new CheckButton();
cbtn.Name = Key;
if( fd[ "value" ] != null &&
(string)fd[ "value" ] != String.Empty )
{
int v = Convert.ToInt32( (string)fd[ "value" ] );
cbtn.Active = v == 1;
}
right.PackStart( cbtn, false, false, 5 );
}
}
dlg.AddActionWidget( new Button( "Cancel" ),
ResponseType.Cancel );
Button btn = new Button( "Next" );
btn.CanDefault = true;
dlg.AddActionWidget( btn, ResponseType.Ok );
dlg.DefaultResponse = ResponseType.Ok;
dlg.Response += new ResponseHandler( OnSignupResponse );
dlg.TransientFor = this.MainWindow;
dlg.SetPosition( WindowPosition.CenterOnParent );
dlg.ShowAll();
if( form[ "redtext" ] != null )
new AlertDialog( dlg, AlertType.Warning,
(string)form[ "title" ],
(string)form[ "redtext" ] );
}
}