本文整理汇总了C#中Gnome类的典型用法代码示例。如果您正苦于以下问题:C# Gnome类的具体用法?C# Gnome怎么用?C# Gnome使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Gnome类属于命名空间,在下文中一共展示了Gnome类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VolumeSource
public VolumeSource (Gnome.Vfs.Volume vol)
{
this.Volume = vol;
this.Name = vol.DisplayName;
try {
mount_point = new Uri (vol.ActivationUri).LocalPath;
} catch (System.Exception e) {
System.Console.WriteLine (e);
}
uri = mount_point;
if (this.Icon == null)
this.Icon = PixbufUtils.LoadThemeIcon (vol.Icon, 32);
if (this.IsIPodPhoto)
this.Icon = PixbufUtils.LoadThemeIcon ("gnome-dev-ipod", 32);
if (this.Icon == null && this.IsCamera)
this.Icon = PixbufUtils.LoadThemeIcon ("gnome-dev-media-cf", 32);
try {
if (this.Icon == null)
this.Icon = new Gdk.Pixbuf (vol.Icon);
} catch (System.Exception e) {
System.Console.WriteLine (e.ToString ());
}
}
示例2: LookupIcon
public string LookupIcon(string icon_name, int size, Gnome.IconData icon_data, out int base_size) {
IntPtr native_icon_name = GLib.Marshaller.StringToPtrGStrdup (icon_name);
IntPtr raw_ret = gnome_icon_theme_lookup_icon(Handle, native_icon_name, size, ref icon_data, out base_size);
GLib.Marshaller.Free (native_icon_name);
string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
return ret;
}
示例3: MyPrint
void MyPrint(Gnome.PrintContext gpc)
{
gpc.BeginPage ("demo");
gpc.MoveTo (1, 700);
gpc.Show (tv.Buffer.Text);
gpc.ShowPage ();
}
示例4: RemoveBlockMutation
public RemoveBlockMutation(Coordinate Location, Gnome Gnome)
{
this.MutationTimeFrame = MutationTimeFrame.BeforeUpdatingConnectivity;
this.Location = Location;
this.Gnome = Gnome;
}
示例5: PickupResourceMutation
public PickupResourceMutation(Coordinate Location, String Resource, Gnome Gnome)
{
this.MutationTimeFrame = MutationTimeFrame.BeforeUpdatingConnectivity;
this.Location = Location;
this.Resource = Resource;
this.Gnome = Gnome;
}
示例6: UniqueName
//FIXME: rewrite this as a Filter
public static Gnome.Vfs.Uri UniqueName (Gnome.Vfs.Uri path, string shortname)
{
int i = 1;
Gnome.Vfs.Uri target = path.Clone();
Gnome.Vfs.Uri dest = target.AppendFileName(shortname);
while (dest.Exists) {
string numbered_name = System.String.Format ("{0}-{1}{2}",
System.IO.Path.GetFileNameWithoutExtension (shortname),
i++,
System.IO.Path.GetExtension (shortname));
dest = target.AppendFileName(numbered_name);
}
return dest;
}
示例7: ApplyDamageSprite
// Swaps out the sprite for this part based on what kind of damage was received
public void ApplyDamageSprite(Gnome.DamageType damageType)
{
Sprite spriteToUse = null;
switch (damageType) {
case Gnome.DamageType.Burning:
spriteToUse = burnedSprite;
break;
case Gnome.DamageType.Slicing:
spriteToUse = detachedSprite;
break;
}
if (spriteToUse != null) {
GetComponent<SpriteRenderer>().sprite = spriteToUse;
}
}
示例8: Add
public IResponseFormatter Add()
{
var skillDefinitions = GnomanEmpire.Instance.GetSkillDefs();
var faction = GnomanEmpire.Instance.World.AIDirector.PlayerFaction;
var entryPosition = faction.FindRegionEntryPosition();
var gnomadRaceClassDefs = faction.FactionDef.Squads.SelectMany(squad => squad.Classes.Where(squadClass => squadClass.Name == "Gnomad")).ToList();
Int32 defCount = gnomadRaceClassDefs.Count;
Int32 raceClassDefIndex = GnomanEmpire.Instance.Rand.Next(defCount);
var raceClassDef = gnomadRaceClassDefs[raceClassDefIndex];
var gnomad = new Character(entryPosition, raceClassDef, faction.ID);
gnomad.SetBehavior(BehaviorType.PlayerCharacter);
Dictionary<String, Int32> orderedProfessions = GetBestProfessions(gnomad);
var bestProfession = orderedProfessions.OrderByDescending(obj => obj.Value).First().Key;
SetProfession(gnomad, bestProfession);
GnomanEmpire.Instance.EntityManager.SpawnEntityImmediate(gnomad);
GnomanEmpire.Instance.World.NotificationManager.AddNotification(String.Format("The Gnomad {0} has arrived and been assigned as a {1}", gnomad.Name(), bestProfession));
Gnome gnome = new Gnome(gnomad, skillDefinitions);
return JsonResponse(gnome);
}
示例9: OnServerInformationPagePrepared
private void OnServerInformationPagePrepared(object o, Gnome.PreparedArgs args)
{
this.Title = Util.GS("iFolder Account Assistant - (1 of 3)");
UpdateServerInformationPageSensitivity(null, null);
DomainInformation[] domains = domainController.GetDomains();
if (domains != null && domains.Length > 0)
{
MakeDefaultLabel.Visible = true;
DefaultServerCheckButton.Visible = true;
}
else
{
DefaultServerCheckButton.Active = true;
MakeDefaultLabel.Visible = false;
DefaultServerCheckButton.Visible = false;
}
ServerNameEntry.GrabFocus();
}
示例10: MoveURIs
public static void MoveURIs(Gnome.Vfs.Uri[] sources, Gnome.Vfs.Uri[] targets)
{
XferURIs (sources, targets, true);
}
示例11: CopyURIs
public static void CopyURIs(Gnome.Vfs.Uri[] sources, Gnome.Vfs.Uri[] targets)
{
XferURIs (sources, targets, false);
}
示例12: ConsoleXferProgressCallback
/** BLOCKING */
public static int ConsoleXferProgressCallback(Gnome.Vfs.XferProgressInfo info)
{
switch (info.Status) {
case Gnome.Vfs.XferProgressStatus.Vfserror:
LogError("{0}: {1} in {2} -> {3}", info.Status, info.VfsStatus, info.SourceName, info.TargetName);
return (int)Gnome.Vfs.XferErrorAction.Abort;
case Gnome.Vfs.XferProgressStatus.Overwrite:
LogError("{0}: {1} in {2} -> {3}", info.Status, info.VfsStatus, info.SourceName, info.TargetName);
return (int)Gnome.Vfs.XferOverwriteAction.Abort;
default:
// LogError("{0} / {1} {2} -> {3}", info.BytesCopied, info.BytesTotal, info.SourceName, info.TargetName);
return 1;
}
}
示例13: OnImportKeyPagePrepared
private void OnImportKeyPagePrepared(object o, Gnome.PreparedArgs args)
{
this.importDomain.Text = this.selectedDomainName+"-"+this.selectedDomainIP;
ImportUpdateSensitivity();
KeyRecoveryDruid.SetButtonsSensitive(true,false , true, true);
}
示例14: Item_Event
void Item_Event (object obj, Gnome.CanvasEventArgs args) {
EventButton ev = new EventButton (args.Event.Handle);
CanvasRE item = (CanvasRE) obj;
switch (ev.Type) {
case EventType.ButtonPress:
if (ev.Button == 1) {
remember_x = ev.X;
remember_y = ev.Y;
args.RetVal = true;
return;
} else if (ev.Button == 3) {
item.Destroy ();
args.RetVal = true;
return;
}
break;
case EventType.TwoButtonPress:
ChangeItemColor (item);
args.RetVal = true;
return;
case EventType.MotionNotify:
Gdk.ModifierType state = (Gdk.ModifierType) ev.State;
if ((state & Gdk.ModifierType.Button1Mask) != 0) {
double new_x = ev.X, new_y = ev.Y;
item.Move (new_x - remember_x, new_y - remember_y);
remember_x = new_x;
remember_y = new_y;
args.RetVal = true;
return;
}
break;
case EventType.EnterNotify:
item.WidthUnits = 3.0;
args.RetVal = true;
return;
case EventType.LeaveNotify:
item.WidthUnits = 1.0;
args.RetVal = true;
return;
}
args.RetVal = false;
return;
}
示例15: HandleMsg
private void HandleMsg (Gnome.Vfs.ModuleCallback cb)
{
Gnome.Vfs.ModuleCallbackStatusMessage msg = cb as Gnome.Vfs.ModuleCallbackStatusMessage;
System.Console.WriteLine ("{0}", msg.Message);
}