本文整理汇总了C#中Selection类的典型用法代码示例。如果您正苦于以下问题:C# Selection类的具体用法?C# Selection怎么用?C# Selection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Selection类属于命名空间,在下文中一共展示了Selection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: MainMenu
public MainMenu(Rectangle windowSize, KeyboardState newKeyboardState, MouseState newMouseState)
{
windowWidth = windowSize.Width;
windowHeight = windowSize.Height;
keyboardState = newKeyboardState;
mousestate = newMouseState;
selection = Selection.Play;
wallpaper = new Sprite(new Rectangle(0, 0, windowWidth, windowHeight), windowSize);
wallpaperText = new Sprite(new Rectangle(0, 0, windowWidth, windowHeight), windowSize);
nuages = new Sprite(new Rectangle(0, 0, windowWidth * 3, windowHeight), windowSize);
nuages.Direction = new Vector2(-1, 0);
nuages.Vitesse = 0.1f; // 1f = 1000 px/sec
mouse = new AnimatedSprite(new Rectangle(-100, -100, 80, 100), windowSize, 8, 4, 40);
relativeAmplitudeVibrationSelection = (float)amplitudeVibrationSelection / (float)(windowHeight + windowWidth);
sprites = new List<AnimatedSprite>();
menuItems = new Dictionary<Selection, Sprite>();
menuItems.Add(Selection.Play, new Sprite(new Rectangle(112, 423, 124, 55), windowSize, "menu/textPlay"));
menuItems.Add(Selection.Extra, new Sprite(new Rectangle(191, 480, 124, 55), windowSize, "menu/textExtra"));
menuItems.Add(Selection.Options, new Sprite(new Rectangle(394, 470, 135, 55), windowSize, "menu/textOptions"));
menuItems.Add(Selection.Credit, new Sprite(new Rectangle(562, 400, 124, 55), windowSize, "menu/textCredit"));
menuItems.Add(Selection.Exit, new Sprite(new Rectangle(675, 480, 101, 55), windowSize, "menu/textExit"));
Fire = new ParticleEngine(new Rectangle(0,windowSize.Height,windowSize.Width,0));
Fire.SetSpeedRange(0.2f, 2f, 90, 40);
Fire.SetLifeTimeRange(20, 90);
Fire.SetScaleRange(0.2f, 1.4f);
Cursor = new ParticleEngine(new Rectangle());
Cursor.SetSpeedRange(0.2f, 1.6f, -45, 25);
Cursor.SetAngularSpeedRange(0, 3);
Cursor.SetLifeTimeRange(20, 50);
Cursor.SetScaleRange(0.2f, 1.4f);
Cursor.SetColorRange(0, 255, 0, 255, 0, 255, 0, 20);
}
开发者ID:Thyvs,项目名称:The-Revenge-Of-the-Dark-Side,代码行数:35,代码来源:MainMenu.cs
示例2: Execute
/// <summary>
/// Replace the text of the selection with the answer to the calculation
/// </summary>
/// <param Name="selection">The current selection, used as input, and modified for the output</param>
/// <param Name="argument">Anything added after the command Name, used as input</param>
public void Execute(Selection selection, string[] arguments)
{
//Attempt to perform the calculation
try { selection.Text = PerformCalculation(selection.Text); }
//If it fails, raise an error to the user
catch { new Error(String.Format(@"Sum'{0}' is not formatted correctly", selection.Text), Camera); }
}
开发者ID:malacandrian,项目名称:fyp,代码行数:12,代码来源:CalculateCommand.cs
示例3: Calendar
public Calendar()
{
InitializeComponent();
ItemContextMenu = new ContextMenu();
MenuItem Block = new MenuItem();
Block.Header = "Block";
Block.Click += new RoutedEventHandler(MenuBlock_Click);
ItemContextMenu = new ContextMenu();
MenuItem UnBlock = new MenuItem();
UnBlock.Header = "Unblock";
UnBlock.Click += new RoutedEventHandler(MenuUnBlock_Click);
MenuItem Delete = new MenuItem();
Delete.Header = "Delete";
Delete.Click += new RoutedEventHandler(MenuDelete_Click);
ItemContextMenu.Items.Add(Block);
ItemContextMenu.Items.Add(UnBlock);
ItemContextMenu.Items.Add(Delete);
oSel = new Selection(this);
DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
dispatcherTimer.Start();
oRefresh();
}
开发者ID:JGEsteves89,项目名称:SchedulePlannerWPF,代码行数:26,代码来源:Calendar.xaml.cs
示例4: YoutubeWidget
public YoutubeWidget(string source,
Selection selection)
: this(source)
{
this.mSelection = selection;
HttpService = new HttpService();
}
开发者ID:rlbisbe,项目名称:metrics,代码行数:7,代码来源:YoutubeWidget.cs
示例5: SaveLoadScreen
/// <summary>
/// Create a new Load/Save Screen.
/// </summary>
/// <param name="NextState">Depending whether the game is loading or saving.
/// If the game is loading, then the it is the state the game will go to if the operation is cancelled.
/// If the game is saving, this state will be reached regardless.</param>
/// <param name="SaveMode">True for saving, false for loading.</param>
public SaveLoadScreen(State.State NextState, bool SaveMode)
{
this.NextState = NextState;
this.SaveMode = SaveMode;
if (SaveMode)
{
LogsSelection = new Selection(50, 130, new string[] {
"1: ", "2: ", "3: ", "4: ", "5: ", "6: ", "7: ", "8: ", "Cancel"});
}
else
{
LogsSelection = new Selection(50, 130, new string[] {
"1: ", "2: ", "3: ", "4: ", "5: ", "6: ", "7: ", "8: ", "Autosave", "Cancel"});
}
for (int i = 0; i < 8; i++)
{
if (Properties.Settings.Default.Logs[i] == "0")
{
LogsSelection.Choices[i] += "-";
}
else
{
LogsSelection.Choices[i] += Properties.Settings.Default.Logs[i];
}
}
}
开发者ID:husathap,项目名称:Charlotte,代码行数:35,代码来源:SaveLoadScreen.cs
示例6: UseItem
public Composite UseItem(Selection<bool> reqs = null)
{
return new Decorator(ret => reqs == null || reqs(ret),
new Action(delegate
{
if (_timer.IsRunning && _timer.Elapsed.TotalSeconds < CoolDown)
return RunStatus.Failure;
if (!_timer.IsRunning)
_timer.Start();
foreach (var o in BuddyTor.Me.InventoryEquipment)
{
if (o.Name.Contains(ItemName))
{
o.Use();
o.Interact();
_timer.Stop();
_timer.Reset();
_timer.Start();
return RunStatus.Success;
}
}
return RunStatus.Failure;
}));
}
开发者ID:cassrgs,项目名称:BuddyWing.DefaultCombat,代码行数:26,代码来源:InventoryManager.cs
示例7: TryExtendSelectionToComments
static Selection TryExtendSelectionToComments(IDocument document, Selection selection, IList<ISpecial> commentsBlankLines)
{
var extendedToComments = ExtendSelectionToComments(document, selection, commentsBlankLines);
if (extendedToComments != null)
return extendedToComments;
return selection;
}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:7,代码来源:CodeManipulation.cs
示例8: PreSelection
public virtual Selection PreSelection(SelectionManager sm, Selection sel)
{
if ( !sel.IsEmpty && !sel.Start.Node.Equals(node) )
return new Selection(SelectionManager.CreateSelectionPoint(node, false));
return sel;
}
开发者ID:jugglingcats,项目名称:XEditNet,代码行数:7,代码来源:QuickFix.cs
示例9: ObjectsPropertiesVM
// Constructor
#region Constructor
public ObjectsPropertiesVM()
{
Selection = new Selection();
Selection.PropertyChanged += Selection_SelectionSetChanged;
//_canSelectFirstNodes = true;
}
开发者ID:Sugz,项目名称:ObjectsProperties,代码行数:11,代码来源:ObjectsPropertiesVM.cs
示例10: RelateInfo
/// <summary>
/// Represents the Relationship Class information
/// </summary>
/// <param name="featureLayer"></param>
/// <param name="selection"></param>
public RelateInfo(FeatureLayer featureLayer, Selection selection)
{
_featureLayer = featureLayer;
_selection = selection;
_featureClassName = _featureLayer.GetFeatureClass().GetName();
}
开发者ID:ChaitG,项目名称:arcgis-pro-sdk-community-samples,代码行数:12,代码来源:RelateInfo.cs
示例11: ToSelection
internal Selection ToSelection()
{
Selection s = new Selection();
if (this.Pane != PaneValues.TopLeft) s.Pane = this.Pane;
if (this.ActiveCell.Length > 0 && !this.ActiveCell.Equals("A1", StringComparison.OrdinalIgnoreCase))
{
s.ActiveCell = this.ActiveCell;
}
if (this.ActiveCellId != 0) s.ActiveCellId = this.ActiveCellId;
if (this.SequenceOfReferences.Count > 0)
{
if (this.SequenceOfReferences.Count == 1)
{
// not equal to A1
if (this.SequenceOfReferences[0].StartRowIndex != 1
|| this.SequenceOfReferences[0].StartColumnIndex != 1
|| this.SequenceOfReferences[0].EndRowIndex != 1
|| this.SequenceOfReferences[0].EndColumnIndex != 1)
{
s.SequenceOfReferences = SLTool.TranslateCellPointRangeToSeqRef(this.SequenceOfReferences);
}
}
else
{
s.SequenceOfReferences = SLTool.TranslateCellPointRangeToSeqRef(this.SequenceOfReferences);
}
}
return s;
}
开发者ID:rahmatsyaparudin,项目名称:KP_Raport,代码行数:33,代码来源:SLSelection.cs
示例12: Buff
public static Composite Buff(string spell, Selection<bool> reqs = null)
{
return
new Decorator(
ret => (reqs == null || reqs(ret)) && !Me.HasBuff(spell),
Cast(spell, ret => Me, ret => true));
}
开发者ID:BosslandGmbH,项目名称:BuddyWing.DefaultCombat,代码行数:7,代码来源:Spell.cs
示例13: MainMenu
public MainMenu(Rectangle windowSize, KeyboardState newKeyboardState, MouseState newMouseState)
{
windowWidth = windowSize.Width;
windowHeight = windowSize.Height;
keyboardState = newKeyboardState;
mousestate = newMouseState;
selection = Selection.Play;
wallpaper = new Sprite(new Rectangle(0, 0, windowWidth, windowHeight), windowSize);
wallpaperText = new Sprite(new Rectangle(0, 0, windowWidth, windowHeight), windowSize);
nuages = new Sprite(new Rectangle(0, 0, windowWidth * 3, windowHeight), windowSize);
nuages.Direction = new Vector2(-1, 0);
nuages.Vitesse = 0.1f; // 1f = 1000 px/sec
mouse = new ParticleEngine(windowSize, new DecimalRectangle(-200, -200, 0, 0), new Vector3(1, 10, 10),
new List<string>() { "particle/star"}, 10, 0.1f, 2f, -45f, 15f, 0f, 180f, -1f, 1f, 10f, 150f);
mouse.SetColorRange(0, 100, 0, 30, 0, 30);
relativeAmplitudeVibrationSelection = (float)amplitudeVibrationSelection / (float)(windowHeight + windowWidth);
sprites = new List<AnimatedSprite>();
menuItems = new Dictionary<Selection, Sprite>();
menuItems.Add(Selection.Play, new Sprite(new Rectangle(112, 423, 124, 55), windowSize, "menu/textPlay"));
menuItems.Add(Selection.Extra, new Sprite(new Rectangle(191, 480, 124, 55), windowSize, "menu/textExtra"));
menuItems.Add(Selection.Options, new Sprite(new Rectangle(394, 470, 135, 55), windowSize, "menu/textOptions"));
menuItems.Add(Selection.Credit, new Sprite(new Rectangle(562, 400, 124, 55), windowSize, "menu/textCredit"));
menuItems.Add(Selection.Exit, new Sprite(new Rectangle(675, 480, 101, 55), windowSize, "menu/textExit"));
}
开发者ID:Nicomplex,项目名称:The-Revenge-Of-the-Dark-Side,代码行数:25,代码来源:MainMenu.cs
示例14: Init
protected override void Init ()
{
var listView = new ListView ();
var selection = new Selection ();
listView.SetBinding (ListView.ItemsSourceProperty, "Items");
listView.ItemTemplate = new DataTemplate (() => {
var cell = new SwitchCell ();
cell.SetBinding (SwitchCell.TextProperty, "Name");
cell.SetBinding (SwitchCell.OnProperty, "IsSelected", BindingMode.TwoWay);
return cell;
});
var instructions = new Label {
FontSize = 16,
Text =
"The label at the bottom should equal the number of switches which are in the 'on' position. Flip some of the switches. If the number at the bottom does not equal the number of 'on' switches, the test has failed."
};
var label = new Label { FontSize = 24 };
label.SetBinding (Label.TextProperty, "SelectedCount");
Content = new StackLayout {
VerticalOptions = LayoutOptions.Fill,
Children = {
instructions,
listView,
label
}
};
BindingContext = selection;
}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:34,代码来源:Bugzilla31964.cs
示例15: Execute
/// <summary>
/// Replace the current selection'sections text color with the color specified in the argument
/// </summary>
/// <param Name="selection">The selection to modify</param>
/// <param Name="argument">The argument provided to the command</param>
public override void Execute(Selection selection, string[] arguments)
{
//Detect which color the user wanted
Color? color = GetColor(arguments);
//If there was a valid color and a valid selection, apply the color to the selection
if (color != null && selection != null) { MergeAndApply(selection, color: color); }
}
开发者ID:malacandrian,项目名称:fyp,代码行数:12,代码来源:ColorCommand.cs
示例16: FillEllipse
public Point[] FillEllipse(Selection sel)
{
return drawShape(sel, (g, s) => {
g.FillEllipse(new SolidBrush(CR_FORE), sel.GetTrimRect());
g.DrawEllipse(new Pen (CR_FORE), sel.GetTrimRect());
});
}
开发者ID:jbirkel,项目名称:MapRL,代码行数:7,代码来源:MapBitmap.cs
示例17: Contains
public bool Contains(Selection selection)
{
// single line comparison
if (selection.StartLine == StartLine && selection.EndLine == EndLine)
{
return selection.StartColumn >= StartColumn && selection.EndColumn <= EndColumn;
}
// multiline, obvious case:
if (selection.StartLine > StartLine && selection.EndLine < EndLine)
{
return true;
}
// starts on same line:
if (selection.StartLine == StartLine && selection.StartColumn >= StartColumn)
{
return selection.EndLine < EndLine ||
(selection.EndLine == EndLine && selection.EndColumn <= EndColumn);
}
// ends on same line:
if (selection.EndLine == EndLine && selection.EndColumn <= EndColumn + 1) // +1 for \r\n
{
return selection.StartLine > StartLine ||
(selection.StartLine == StartLine && selection.StartColumn >= StartColumn);
}
return false;
}
开发者ID:ThunderFrame,项目名称:Rubberduck,代码行数:30,代码来源:Selection.cs
示例18: Initialize
public override void Initialize(EditingContext context)
{
this.context = context;
AttachedPropertiesService propertiesService = this.context.Services.GetService<AttachedPropertiesService>();
helpService = this.context.Services.GetService<IIntegratedHelpService>();
oldSelection = this.context.Items.GetValue<Selection>();
isPrimarySelectionProperty = new AttachedProperty<bool>()
{
Getter = (modelItem) => (this.context.Items.GetValue<Selection>().PrimarySelection == modelItem),
Name = "IsPrimarySelection",
OwnerType = typeof(Object)
};
isSelectionProperty = new AttachedProperty<bool>()
{
Getter = (modelItem) => (((IList)this.context.Items.GetValue<Selection>().SelectedObjects).Contains(modelItem)),
Name = "IsSelection",
OwnerType = typeof(Object)
};
propertiesService.AddProperty(isPrimarySelectionProperty);
propertiesService.AddProperty(isSelectionProperty);
if (this.context.Services.GetService<ViewService>() == null)
{
view = new System.Activities.Presentation.View.DesignerView(this.context);
WorkflowViewService viewService = new WorkflowViewService(context);
WorkflowViewStateService viewStateService = new WorkflowViewStateService(context);
this.context.Services.Publish<ViewService>(viewService);
this.context.Services.Publish<VirtualizedContainerService>(new VirtualizedContainerService(this.context));
this.context.Services.Publish<ViewStateService>(viewStateService);
this.context.Services.Publish<DesignerView>(view);
WorkflowAnnotationAdornerService annotationService = new WorkflowAnnotationAdornerService();
annotationService.Initialize(this.context, view.scrollViewer);
this.context.Services.Publish<AnnotationAdornerService>(annotationService);
this.context.Services.Subscribe<ModelService>(delegate(ModelService modelService)
{
this.modelService = modelService;
if (modelService.Root != null)
{
view.MakeRootDesigner(modelService.Root);
}
view.RestoreDesignerStates();
this.context.Items.Subscribe<Selection>(new SubscribeContextCallback<Selection>(OnItemSelected));
});
}
if (helpService != null)
{
helpService.AddContextAttribute(string.Empty, KeywordForWorkflowDesignerHomePage, HelpKeywordType.F1Keyword);
}
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:59,代码来源:WorkflowViewManager.cs
示例19: ViewModelLocator
public ViewModelLocator()
{
if (DesignMode)
_document = LoadDesignModeDocument();
else
_document = LoadDocument();
_selection = new Selection();
}
开发者ID:Assisticant,项目名称:SilverlightAssisticantApp,代码行数:8,代码来源:ViewModelLocator.cs
示例20: BrushEditor
public BrushEditor(IEditorApplication application, Tilemap Tilemap, Tileset Tileset, string brushFile)
{
selection = new Selection();
selection.Changed += OnSelectionChanged;
this.application = application;
this.Tilemap = Tilemap;
brush = Brush.loadFromFile(brushFile, Tileset);
}
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:8,代码来源:BrushEditor.cs
注:本文中的Selection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论