本文整理汇总了C#中ApplicationInfo类的典型用法代码示例。如果您正苦于以下问题:C# ApplicationInfo类的具体用法?C# ApplicationInfo怎么用?C# ApplicationInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationInfo类属于命名空间,在下文中一共展示了ApplicationInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main()
{
//new CrashLogTraceListener();
using (Mutex mutex = new Mutex(false, MutexName))
{
if (mutex.WaitOne(1, true) == false)
{
MessageBox.Show("Another instance of ConnectUO 2.0 Updater is running. Please wait for that instance to close before running the Updater again.", "Already Running");
return;
}
for (Process[] processArray = Process.GetProcessesByName("ConnectUO.exe"); processArray.Length > 0; processArray = Process.GetProcessesByName("ConnectUO.exe"))
{
Thread.Sleep(50);
}
_applicationInfo = new ApplicationInfo();
Directory.SetCurrentDirectory(_applicationInfo.BaseDirectory);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmUpdate());
if (_status == UpdateStatus.Success)
{
Process.Start(Path.Combine(_applicationInfo.BaseDirectory, "ConnectUO.exe"));
}
_applicationInfo.Process.Kill();
}
}
示例2: ToApplication
public static ApplicationInfo ToApplication(this DataRow dr)
{
ApplicationInfo info = new ApplicationInfo();
info.ApplicationID = dr.GetGuid("ApplicationID");
info.ApplicationName = dr.GetString("ApplicationName");
return info;
}
示例3: SaveHosts
// 将CStringArray中的主机事项写入ini文件或者registry
public static void SaveHosts(ApplicationInfo appInfo,
ArrayList saHost)
{
string strEntry = null;
int i = 0;
for(i=0; i<saHost.Count; i++)
{
strEntry = "entry" + Convert.ToString(i+1);
string strValue = (string)saHost[i];
appInfo.SetString("ServerAddress",
strEntry,
strValue);
}
// 最后一次,截断
strEntry = "entry" + Convert.ToString(i+1);
appInfo.SetString("ServerAddress",
strEntry,
"");
}
示例4: AddRange
/// <summary>
/// Copies the elements of the specified <see cref="ApplicationInfo">ApplicationInfo</see> array to the end of the collection.
/// </summary>
/// <param name="value">An array of type <see cref="ApplicationInfo">ApplicationInfo</see> containing the Components to add to the collection.</param>
public void AddRange(ApplicationInfo[] value)
{
for (int i = 0; (i < value.Length); i = (i + 1))
{
this.Add(value[i]);
}
}
示例5: BmGame
public BmGame(String[] args)
{
int width = WIDTH;
int height = HEIGHT;
int realWidth = width + WIDTH_EX;
int realHeight = height;
graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferWidth = realWidth;
graphics.PreferredBackBufferHeight = realHeight;
IsFixedTimeStep = true;
Content.RootDirectory = "Content";
ApplicationInfo info = new ApplicationInfo(width, height);
#if WINDOWS
info.nativeInterface = this;
info.realWidth = realWidth;
info.realHeight = realHeight;
IsMouseVisible = true;
#endif
info.args = args;
application = new BmApplication(Content, info);
}
示例6: Setup
protected override void Setup(ApplicationInfo info)
{
base.Setup(info);
MyWindow myWindow = new MyWindow(new WindowTemplate());
SetWindow(myWindow);
}
示例7: CreateApplication
public void CreateApplication(string name)
{
var applicationInfo = new ApplicationInfo();
applicationInfo.Name = name;
applicationInfo.CreatedAt = DateTime.UtcNow;
UseRepository(repositoryService=>repositoryService.CreateApplication(applicationInfo));
}
示例8: AreCommandArgumentsValid
/// <summary>
/// Calls <see cref="CheckCommandArguments"/> and checks, if there are errors or not.
/// </summary>
/// <param name="args">The arguments given to the application.</param>
/// <param name="appInfo">Informations on the app.</param>
/// <returns><c>True</c> if the command arguments are valid, otherwise <c>false</c>.</returns>
public static bool AreCommandArgumentsValid(string[] args, ApplicationInfo appInfo)
{
var result = CheckCommandArguments(args, appInfo);
#if TRACE
result.ForEach(line => Trace.WriteLine(line));
#endif
return result.Count == 0;
}
示例9: Summary
public Summary(DeviceInfo deviceInfo, ApplicationInfo applicationInfo)
{
this.Date = DateTime.SpecifyKind(deviceInfo.Date, DateTimeKind.Utc);
this.ApplicationId = applicationInfo.ApplicationId;
this.PlatformId = deviceInfo.PlatformType;
this.Version = applicationInfo.Version;
this.Count++;
}
示例10: Main
public static void Main(string[] args)
{
var applicationInfo = new ApplicationInfo();
Console.WriteLine("***************************************************************");
Console.WriteLine(string.Format("-- {0} {1}", applicationInfo.AssemblyTitle, applicationInfo.AssemblyVersion));
Console.WriteLine(string.Format("-- {0}", applicationInfo.AssemblyCopyright));
Console.WriteLine("***************************************************************");
GetRandomFiles();
}
示例11: Setup
protected override void Setup(ApplicationInfo info)
{
base.Setup(info);
MyWindow win = new MyWindow(new WindowTemplate()
{
HasFrame = true,
});
SetWindow(win);
}
示例12: getResourcesForApplication
public override Resources getResourcesForApplication (ApplicationInfo app)
{
if (app.packageName.Equals ("system")) {
return mContext.mMainThread.getSystemContext ().getResources ();
}
Resources r = mContext.mMainThread.getTopLevelResources (
app.publicSourceDir, mContext.mPackageInfo);
if (r != null) {
return r;
}
throw new NameNotFoundException ("Unable to open " + app.publicSourceDir);
}
示例13: StartApplication
public void StartApplication(string configFile)
{
//start in separate thread
ApplicationInfo appInfo = new ApplicationInfo(XDocument.Load(configFile));
appInfo.Completed += appInfo_Completed;
//when the app is about to stop services, it should check whether the service is used by other programs
appInfo.ServiceCheckCallback = new ServiceCheckFunction(IsServiceUsedByOtherApps);
apps.Add(appInfo);
appInfo.Start();
}
示例14: Main
static void Main(string[] args)
{
ApplicationInfo appInfo = new ApplicationInfo()
{
Title = "OchreGui Demo",
ScreenSize = new Size(80, 70),
Font = "courier12x12_aa_tc.png",
FontFlags = libtcod.TCODFontFlags.LayoutTCOD,
};
using (DemoApplication app = new DemoApplication())
{
app.Start(appInfo);
}
}
示例15: CreateApplication
public static void CreateApplication()
{
// Create an offline connection, we use an empty Guid as personId
// There is a bug to create a constructor without requiring a guid
//// Use this only if you master application wants to do this in Offline mode
OfflineWebApplicationConnection offlineConnection =
new OfflineWebApplicationConnection(Guid.Empty);
offlineConnection.Authenticate();
// Setting up the application we want to create
ApplicationInfo appInfo =
new ApplicationInfo();
appInfo.Name = "Android application";
appInfo.AuthorizationReason =
"Android aplication";
appInfo.Description =
"Just an android application";
// get a base64 encoded logo
appInfo.LargeLogo = new ApplicationBinaryConfiguration(
"C:\\blah.png", "image/gif");
// base64 encoded public key for this application
appInfo.PublicKeys.Add(
GetPublicKeyFromPfxOrP12("C:\\JourneyCompass.cer"));
// You need to have PrivacyStatement + TermsOfUse or ActionUrl
appInfo.PrivacyStatement = new ApplicationBinaryConfiguration(
"C:\\privacy.txt", "text/plain");
appInfo.TermsOfUse = new ApplicationBinaryConfiguration
("C:\\terms.txt", "text/plain");
//actionUrl
//appInfo.ActionUrl = new Uri("http://localhost/redirect.aspx");
// Create and add the rules individually
List<AuthorizationSetDefinition> rules = new List<AuthorizationSetDefinition>();
rules.Add((AuthorizationSetDefinition)(new TypeIdSetDefinition(Height.TypeId)));
rules.Add((AuthorizationSetDefinition)(new TypeIdSetDefinition(new Guid("a5033c9d-08cf-4204-9bd3-cb412ce39fc0"))));
AuthorizationRule rule1 = new AuthorizationRule(
HealthRecordItemPermissions.All,
rules,
null);
// Here we are setting up the child as an offline application
appInfo.OfflineBaseAuthorizations.Add(rule1);
// Add more rules, if needed
// Lets make the child app!
Provisioner.AddApplication(offlineConnection, appInfo);
}