本文整理汇总了C#中Main类的典型用法代码示例。如果您正苦于以下问题:C# Main类的具体用法?C# Main怎么用?C# Main使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Main类属于命名空间,在下文中一共展示了Main类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: IncidentQueryForm
/// <summary>
/// Form constructor. passes parent for extra functionality
/// </summary>
public IncidentQueryForm(Main parent)
{
InitializeComponent();
this.parent = parent;
Initialize();
}
示例3: AddItem
public AddItem(Main form)
{
InitializeComponent();
SetErrorProviders();
mainForm = form;
}
示例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;
}
示例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;
}
示例6: MainScreen
public MainScreen(
Main.AddressBookViewModel addressBook,
Func<Detail.PersonViewModel> makePersonDetail)
{
_addressBook = addressBook;
_makePersonDetail = makePersonDetail;
}
示例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;
}
));
}
示例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;
}
示例9: Start
void Start()
{
guitext = "game over";
GameObject M = GameObject.Find("Main");
main = M.GetComponent<Main> ();
UIBar ();
}
示例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));
}
示例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);
}
示例12: Awake
// ******************************************** START/ UPDATE ********************************************
void Awake()
{
// find components:
compoMain = Camera.main.GetComponent<Main>();
highscoreText = highscore.GetComponent<Text>();
nameText = name.GetComponent<Text>();
}
示例13: PersonnelEditForm
/// <summary>
/// Constructor, passes main form for more functionality
/// </summary>
public PersonnelEditForm(Main form)
{
InitializeComponent();
parent = form;
Intialize();
}
示例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;
}
示例15: IncidentMap
/// <summary>
/// constructor. passes main form for more functionality
/// </summary>
public IncidentMap(Main form)
{
InitializeComponent();
parent = form;
Initialize();
}