本文整理汇总了C#中Main类的典型用法代码示例。如果您正苦于以下问题:C# Main类的具体用法?C# Main怎么用?C# Main使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Main类属于命名空间,在下文中一共展示了Main类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Init
public override bool Init(Main Main, System.Diagnostics.Stopwatch swInit)
{
if (!Main.EventMgr.PluginExists<Events.Power>())
{
this.Log.LogLine("Task \"LogPowerEvents\" is missing EventPlugin \"Power\"!", Log.Type.Error);
return false;
}
this.Main = Main;
this.Log = Main.Log;
swInit.Stop();
Events.Power pwrEvents = Main.EventMgr.GetPlugin<Events.Power>(new object[] {Main}, true);
swInit.Start();
pwrEvents.PowerModeChanged += new Events.EventPlugin.EventValue<PowerModes>(pwrEvents_PowerModeChanged);
pwrEvents.Suspend += new Events.EventPlugin.Event(pwrEvents_Suspend);
pwrEvents.Resume += new Events.EventPlugin.Event(pwrEvents_Resume);
pwrEvents.PowerLineStatusChanged += new Events.EventPlugin.EventValues<PowerLineStatus>(pwrEvents_PowerLineStatusChanged);
pwrEvents.BatteryAvailabilityChanged += new Events.EventPlugin.EventValue<bool?>(pwrEvents_BatteryAvailabilityChanged);
pwrEvents.BatteryStatusChanged += new Events.EventPlugin.EventValues<BatteryChargeStatus>(pwrEvents_BatteryStatusChanged);
pwrEvents.PowerSchemeChanged += new Events.EventPlugin.EventValues<PowerScheme>(pwrEvents_PowerSchemeChanged);
return true;
}
开发者ID:Jonny007-MKD,项目名称:Trigger4Win,代码行数:25,代码来源:LogPowerEvents.cs
示例2: IncidentQueryForm
/// <summary>
/// Form constructor. passes parent for extra functionality
/// </summary>
public IncidentQueryForm(Main parent)
{
InitializeComponent();
this.parent = parent;
Initialize();
}
开发者ID:TristanZeph,项目名称:QDMS_INB201,代码行数:10,代码来源:IncidentQueryForm.cs
示例3: AddItem
public AddItem(Main form)
{
InitializeComponent();
SetErrorProviders();
mainForm = form;
}
开发者ID:FozaXD,项目名称:SavingsWPF,代码行数:7,代码来源:AddItem.cs
示例4: Create
public override Entity Create(Main main, int offsetX, int offsetY, int offsetZ)
{
Entity result = base.Create(main, offsetX, offsetY, offsetZ);
result.Type = "FillMap";
result.ID = Entity.GenerateID(result, main);
return result;
}
开发者ID:sparker,项目名称:Lemma,代码行数:7,代码来源:FillMapFactory.cs
示例5: Create
public override Entity Create(Main main, int offsetX, int offsetY, int offsetZ)
{
Entity entity = base.Create(main, offsetX, offsetY, offsetZ);
entity.Type = "VoxelFill";
entity.Create<VoxelFill>("VoxelFill").Enabled.Value = false;
return entity;
}
开发者ID:dsmo7206,项目名称:Lemma,代码行数:7,代码来源:VoxelFillFactory.cs
示例6: MainScreen
public MainScreen(
Main.AddressBookViewModel addressBook,
Func<Detail.PersonViewModel> makePersonDetail)
{
_addressBook = addressBook;
_makePersonDetail = makePersonDetail;
}
开发者ID:Assisticant,项目名称:UniversalWindowsPlatform,代码行数:7,代码来源:MainScreen.cs
示例7: Bind
public override void Bind(Entity result, Main main, bool creating = false)
{
result.CannotSuspendByDistance = true;
Transform transform = result.Get<Transform>();
DirectionalLight directionalLight = result.Get<DirectionalLight>();
this.SetMain(result, main);
directionalLight.Add(new TwoWayBinding<Vector3, Matrix>
(
directionalLight.Direction,
delegate(Matrix x)
{
Vector3 y = Vector3.Normalize(-x.Forward);
if (Vector3.Dot(y, directionalLight.Direction) > 0.0f)
return y;
return -y;
},
transform.Orientation,
delegate(Vector3 x)
{
Matrix matrix = Matrix.Identity;
matrix.Forward = Vector3.Normalize(-x);
matrix.Left = x.Equals(Vector3.Up) ? Vector3.Left : Vector3.Normalize(Vector3.Cross(x, Vector3.Up));
matrix.Up = Vector3.Normalize(Vector3.Cross(matrix.Left, matrix.Forward));
return matrix;
}
));
}
开发者ID:kernelbitch,项目名称:Lemma,代码行数:29,代码来源:DirectionalLightFactory.cs
示例8: Init
public override bool Init(Main Main, System.Diagnostics.Stopwatch swInit)
{
if (!Main.EventMgr.PluginExists<Events.Screen>())
{
this.Log.LogLine("Task \"LogScreenEvents\" is missing EventPlugin \"Screen\"!", Log.Type.Error);
return false;
}
this.Main = Main;
this.Log = Main.Log;
swInit.Stop();
Events.Screen screenEvents = Main.EventMgr.GetPlugin<Events.Screen>();
swInit.Start();
screenEvents.ScreenAdded += new Events.EventPlugin.EventValue<ScreenEx>(screenEvents_ScreenAdded);
screenEvents.ScreenRemoved += new Events.EventPlugin.EventValue<ScreenEx>(screenEvents_ScreenRemoved);
screenEvents.ScreenColorDepthChanged += new Events.EventPlugin.EventValues<ScreenEx>(screenEvents_ScreenColorDepthChanged);
screenEvents.ScreenResolutionChanged += new Events.EventPlugin.EventValues<ScreenEx>(screenEvents_ScreenResolutionChanged);
screenEvents.PrimaryScreenChanged += new Events.EventPlugin.EventValues<ScreenEx>(screenEvents_PrimaryScreenChanged);
screenEvents.ScreenLocationChanged += new Events.EventPlugin.EventValues<ScreenEx>(screenEvents_ScreenLocationChanged);
screenEvents.ScreenOrientationChanged += new Events.EventPlugin.EventValues<ScreenEx>(screenEvents_ScreenOrientationChanged);
screenEvents.ScreenRefreshRateChanged += new Events.EventPlugin.EventValues<ScreenEx>(screenEvents_ScreenRefreshRateChanged);
return true;
}
开发者ID:Jonny007-MKD,项目名称:Trigger4Win,代码行数:25,代码来源:LogScreenEvents.cs
示例9: Start
void Start()
{
guitext = "game over";
GameObject M = GameObject.Find("Main");
main = M.GetComponent<Main> ();
UIBar ();
}
开发者ID:CiaranCarrick,项目名称:Assignment1_C13711015,代码行数:7,代码来源:UI.cs
示例10: AttachEditorComponents
public override void AttachEditorComponents(Entity result, Main main)
{
base.AttachEditorComponents(result, main);
Model model = result.Get<Model>("EditorModel");
model.Add(new Binding<Vector3, string>(model.Color, x => string.IsNullOrEmpty(x) ? Vector3.One : new Vector3(1.0f, 0.0f, 0.0f), result.Get<Script>().Errors));
}
开发者ID:kernelbitch,项目名称:Lemma,代码行数:7,代码来源:ScriptFactory.cs
示例11: Bind
public override void Bind(Entity result, Main main, bool creating = false)
{
result.CannotSuspend = true;
Script script = result.Get<Script>();
Property<bool> executeOnLoad = result.GetProperty<bool>("ExecuteOnLoad");
if (executeOnLoad && !main.EditorEnabled)
{
result.Add("Executor", new PostInitialization
{
delegate()
{
if (executeOnLoad)
script.Execute.Execute();
}
});
}
Property<bool> deleteOnExecute = result.GetOrMakeProperty<bool>("DeleteOnExecute", true, false);
if (deleteOnExecute)
result.Add(new CommandBinding(script.Execute, result.Delete));
this.SetMain(result, main);
}
开发者ID:kernelbitch,项目名称:Lemma,代码行数:25,代码来源:ScriptFactory.cs
示例12: Awake
// ******************************************** START/ UPDATE ********************************************
void Awake()
{
// find components:
compoMain = Camera.main.GetComponent<Main>();
highscoreText = highscore.GetComponent<Text>();
nameText = name.GetComponent<Text>();
}
开发者ID:sma-7,项目名称:circularSpaceGame,代码行数:8,代码来源:HighscoreEntry.cs
示例13: PersonnelEditForm
/// <summary>
/// Constructor, passes main form for more functionality
/// </summary>
public PersonnelEditForm(Main form)
{
InitializeComponent();
parent = form;
Intialize();
}
开发者ID:TristanZeph,项目名称:QDMS_INB201,代码行数:10,代码来源:PersonnelEditForm.cs
示例14: CreateDecor
public GameObject CreateDecor(Main main)
{
GameObject parent = new GameObject ("Decor");
int count = UnityEngine.Random.Range(minCount, maxCount + 1);
LocationTiles tempTiles = new LocationTiles (main.Tiles);
for (int i = 0; i < count; i++) {
Point<int> point = tempTiles.GetFreeRandomPoint (1, 1, 0, 0, 0);
if (point == null) {
Debug.Log("no more place for decor");
break;
}
Sprite sprite = Sprites[UnityEngine.Random.Range(0, Sprites.Length)];
GameObject decor = new GameObject("Decor " + sprite.name);
float scale = main.SourceGraphicsScale;
decor.AddComponent<SpriteRenderer>().sprite = sprite;
decor.transform.SetParent(parent.transform, true);
decor.transform.localScale = new Vector3(scale* (UnityEngine.Random.value > 0.5f ? 1 : -1), scale, 1);
decor.transform.localPosition = new Vector3(point.x * main.TileSize + main.TileSize / 2, point.y * main.TileSize + main.TileSize / 2 + scale * sprite.bounds.size.y / 2, 0);
decor.GetComponent<SpriteRenderer>().sortingOrder = LocationSortOrders.GetLocationObjectSortOrder(point.y * main.TileSize + main.TileSize / 2);
tempTiles.Set(point.x, point.y, TileType.Forbidden);
}
return parent;
}
开发者ID:kirgh,项目名称:StopKillingThem,代码行数:26,代码来源:DecorGenerator.cs
示例15: IncidentMap
/// <summary>
/// constructor. passes main form for more functionality
/// </summary>
public IncidentMap(Main form)
{
InitializeComponent();
parent = form;
Initialize();
}
开发者ID:TristanZeph,项目名称:QDMS_INB201,代码行数:10,代码来源:IncidentMap.cs
示例16: AddMember
public AddMember(Main sender)
{
InitializeComponent();
parent = sender;
}
开发者ID:AdolfDupler,项目名称:FBLAStuff,代码行数:7,代码来源:AddMember.cs
示例17: Awake
private void Awake()
{
PlayerData.instance.CheckInstance();
usableMaxPoint = PlayerData.instance.GetClearedStageCount();
if (usableMaxPoint > 12) // World2에선 StageClear해도 포인트 안 줌
usableMaxPoint = 12;
usablePoint = usableMaxPoint;
animator = GetComponent<Animator>();
main = GameObject.FindObjectOfType<Main>();
// 포인트 배분 로드하는 부분 구현
gaugeImages = new Image[upgradeButtons.Length, 6];
int alreadyAllocatedPoints = 0;
for (int i = 0; i < upgradeButtons.Length; ++i)
{
allocatedPoints[i] = PlayerData.instance.upgradePoint[upgradeButtons[i].name];
alreadyAllocatedPoints += allocatedPoints[i];
for (int j = 0; j < 6; ++j)
{
gaugeImages[i, j] = upgradeButtons[i].transform.FindChild("Gauge" + (j + 1).ToString()).GetComponent<Image>();
}
SetGauge(i, allocatedPoints[i]);
}
usablePoint -= alreadyAllocatedPoints;
SetAllocateButtonInteractive(false);
remainingPointText.text = usablePoint.ToString();
}
开发者ID:penspanic,项目名称:Mawang,代码行数:31,代码来源:CastleUpgrade.cs
示例18: Awake
void Awake()
{
main = FindObjectOfType<Main>();
targeter = FindObjectOfType<TapTarget>();
camAngle = 0f;
physicsCtrlVec = Vector2.zero;
}
开发者ID:ChrisLHall,项目名称:SeaweedFace,代码行数:7,代码来源:Player.cs
示例19: GridViewConvert
public GridViewConvert(Main main)
{
_main = main;
InitializeComponent();
// Listen to Messages
// Setup message queue for receiving Messages
IMessageQueue queueMessage = ServiceScope.Get<IMessageBroker>().GetOrCreate("message");
queueMessage.OnMessageReceive += OnMessageReceive;
IMessageQueue queueMessageEncoding = ServiceScope.Get<IMessageBroker>().GetOrCreate("encoding");
queueMessageEncoding.OnMessageReceive += OnMessageReceiveEncoding;
audioEncoder = ServiceScope.Get<IAudioEncoder>();
// Load the Settings
gridColumns = new GridViewColumnsConvert();
dataGridViewConvert.AutoGenerateColumns = false;
dataGridViewConvert.DataSource = bindingList;
// Now Setup the columns, we want to display
CreateColumns();
CreateContextMenu();
}
开发者ID:sanyaade-embedded-systems,项目名称:MPTagThat,代码行数:27,代码来源:GridViewConvert.cs
示例20: GridViewBurn
public GridViewBurn(Main main)
{
_main = main;
// Setup message queue for receiving Messages
IMessageQueue queueMessage = ServiceScope.Get<IMessageBroker>().GetOrCreate("message");
queueMessage.OnMessageReceive += OnMessageReceive;
InitializeComponent();
_main.BurnButtonsEnabled = false;
// Create the Temp Directory for the burner
if (!Directory.Exists(tmpBurnDirectory))
Directory.CreateDirectory(tmpBurnDirectory);
// Load the Settings
gridColumns = new GridViewColumnsBurn();
dataGridViewBurn.AutoGenerateColumns = false;
dataGridViewBurn.DataSource = bindingList;
// Now Setup the columns, we want to display
CreateColumns();
CreateContextMenu();
lbBurningStatus.Text = localisation.ToString("Burning", "DragAndDrop");
// "Use Drag & Drop to order the tracks for burning";
}
开发者ID:sanyaade-embedded-systems,项目名称:MPTagThat,代码行数:30,代码来源:GridViewBurn.cs
注:本文中的Main类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论