本文整理汇总了C#中ObjectTypes类的典型用法代码示例。如果您正苦于以下问题:C# ObjectTypes类的具体用法?C# ObjectTypes怎么用?C# ObjectTypes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectTypes类属于命名空间,在下文中一共展示了ObjectTypes类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetSharingLevel
public static int GetSharingLevel(ObjectTypes ObjectType, int ObjectId)
{
int UserId = Security.CurrentUser.UserID;
int RetVal = -1;
switch(ObjectType)
{
case ObjectTypes.ToDo:
RetVal = DBToDo.GetSharingLevel(UserId, ObjectId);
break;
case ObjectTypes.Task:
RetVal = DBTask.GetSharingLevel(UserId, ObjectId);
break;
case ObjectTypes.CalendarEntry:
RetVal = DBEvent.GetSharingLevel(UserId, ObjectId);
break;
case ObjectTypes.Issue:
RetVal = DBIncident.GetSharingLevel(UserId, ObjectId);
break;
case ObjectTypes.Project:
RetVal = DBProject.GetSharingLevel(UserId, ObjectId);
break;
case ObjectTypes.Document:
RetVal = DBDocument.GetSharingLevel(UserId, ObjectId);
break;
default:
RetVal = -1;
break;
}
return RetVal;
}
开发者ID:0anion0,项目名称:IBN,代码行数:31,代码来源:Sharing.cs
示例2: CheckSecurityForObject
public static bool CheckSecurityForObject(ObjectTypes objectType, int ObjectId, int UserId)
{
bool isValid = false;
if (objectType == ObjectTypes.Project)
{
Project.ProjectSecurity sec = Project.GetSecurity(ObjectId, UserId);
isValid = sec.IsManager || sec.IsExecutiveManager || sec.IsTeamMember || sec.IsSponsor || sec.IsStakeHolder;
}
else if (objectType == ObjectTypes.Task)
{
Task.TaskSecurity sec = Task.GetSecurity(ObjectId, UserId);
isValid = sec.IsManager || sec.IsRealTaskResource;
}
else if (objectType == ObjectTypes.ToDo)
{
ToDo.ToDoSecurity sec = ToDo.GetSecurity(ObjectId, UserId);
isValid = sec.IsManager || sec.IsResource || sec.IsCreator;
}
else if (objectType == ObjectTypes.CalendarEntry)
{
CalendarEntry.EventSecurity sec = CalendarEntry.GetSecurity(ObjectId, UserId);
isValid = sec.IsManager || sec.IsResource;
}
else if (objectType == ObjectTypes.Document)
{
Document.DocumentSecurity sec = Document.GetSecurity(ObjectId, UserId);
isValid = sec.IsManager || sec.IsResource || sec.IsCreator;
}
return isValid;
}
开发者ID:0anion0,项目名称:IBN,代码行数:31,代码来源:Schedule2.cs
示例3: SearchForCustom
public SearchForCustom(Dictionary<ObjectTypes, String> typeNames, ObjectTypes initialState)
: base()
{
InitializeComponent();
this.typeNames = typeNames;
InitializeList(initialState);
}
开发者ID:ChrisH4rding,项目名称:xenadmin,代码行数:7,代码来源:SearchForCustom.cs
示例4: GravityObject
public GravityObject (Vector2 position, Quaternion rotation, ObjectTypes type)
: this()
{
Position = position;
Rotation = rotation;
Type = type;
}
开发者ID:SteinLabs,项目名称:Gravity,代码行数:7,代码来源:GravityObject.cs
示例5: GenerateDataJSONOutput
/// <summary>
/// generates JSON dataset from sensor data
/// </summary>
/// <returns></returns>
public String GenerateDataJSONOutput(ObjectTypes DataType, String ObjectTypeName, String ObjectName, DateTime StartDateTime, DateTime EndDateTime)
{
/* Example:
*
* { label: 'Europe (EU27)',
* data: [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5], [2005, 2.0], [2006, 3.1], [2007, 2.9], [2008, 0.9]]
* }
*
* */
StringBuilder Output = new StringBuilder();
Output.Append("{ \"label\": \"" + ObjectName + "\", \"data\": [");
bool firstdataset = true;
UInt64 SerializerCounter = 0;
// TODO: there should be an appropriate caching algorithm in the sensor data...
lock (sensor_data.InMemoryIndex)
{
foreach (OnDiscAdress ondisc in sensor_data.InMemoryIndex)
{
if (ondisc.CreationTime >= StartDateTime.Ticks)
{
if (ondisc.CreationTime <= EndDateTime.Ticks)
{
XS1_DataObject dataobject = ReadFromCache(ondisc);
SerializerCounter++;
if (dataobject.Type == DataType)
{
if (dataobject.TypeName == ObjectTypeName)
{
if (dataobject.Name == ObjectName)
{
if (!firstdataset)
Output.Append(",");
else
firstdataset = false;
Output.Append("[");
Output.Append(dataobject.Timecode.JavaScriptTimestamp());
Output.Append(",");
Output.Append(dataobject.Value.ToString().Replace(',', '.'));
Output.Append("]");
}
}
}
}
}
}
}
Output.Append("]}");
ConsoleOutputLogger_.WriteLineToScreenOnly("Generated JSON Dataset with "+SerializerCounter+" Elements");
return Output.ToString();
}
开发者ID:aheil,项目名称:hacs,代码行数:61,代码来源:JSONData.cs
示例6: XS1_DataObject
public XS1_DataObject(String _ServerName, String _Name, ObjectTypes _Type, String _TypeName, DateTime _Timecode, Int32 _XS1ObjectID, Double _Value)
{
ServerName = _ServerName;
Name = _Name;
Type = _Type;
TypeName = _TypeName;
Timecode = _Timecode;
XS1ObjectID = _XS1ObjectID;
Value = _Value;
}
开发者ID:pereritob,项目名称:hacs,代码行数:10,代码来源:XS1_DataObject.cs
示例7: WoWObject
/// <summary>
/// WoWObject constructor
/// </summary>
/// <param name="valuesCount">Number of fields</param>
/// <param name="typeId">Object typeid</param>
public WoWObject(uint valuesCount, ObjectTypes typeId)
{
if (m_valuesCount != 0)
m_valuesCount = valuesCount;
else
m_valuesCount = GetValuesCountByObjectType(typeId);
m_uint32Values = new uint[m_valuesCount];
m_typeId = typeId;
}
开发者ID:arkanoid1,项目名称:mywowtools,代码行数:15,代码来源:WoWObject.cs
示例8: XS1_DataObject
public XS1_DataObject(String _ServerName, String _Name, ObjectTypes _Type, String _TypeName, DateTime _Timecode, Int32 _XS1ObjectID, Double _Value, Boolean _IgnoreForAlarming = false)
{
ServerName = _ServerName;
Name = _Name;
Type = _Type;
TypeName = _TypeName;
Timecode = _Timecode;
XS1ObjectID = _XS1ObjectID;
Value = _Value;
IgnoreForAlarming = _IgnoreForAlarming;
}
开发者ID:pereritob,项目名称:hacs,代码行数:11,代码来源:XS1_DataObject.cs
示例9: UserObjectRightCreateViewModel
public UserObjectRightCreateViewModel(Model.UserObjectRight userObjectRight,
ObjectTypes objectType, SelectList entityList)
: base(userObjectRight)
{
if (userObjectRight.User == null)
throw new ArgumentException("User in UserObjectRight cannot be null");
this.ObjectType = objectType;
this.Email = userObjectRight.User.Email;
this.EntityList = entityList;
this.RightName = userObjectRight.Right.DisplayName;
}
开发者ID:Natsui31,项目名称:keyhub,代码行数:12,代码来源:UserObjectRightCreateViewModel.cs
示例10: Render
public static byte[] Render(bool vastScale,
DateTime curDate,
DateTime startDate,
int[] users,
ObjectTypes[] objectTypes,
List<KeyValuePair<int, int>> highlightedItems,
bool generateDataXml,
string styleFilePath,
int portionX,
int portionY,
int itemsPerPage,
int pageNumber)
{
startDate = startDate.AddDays((vastScale ? 7 : 21) * portionX);
DateTime finishDate = startDate.AddDays(vastScale ? 7 : 21);
portionX = 0;
GanttView gantt = CreateGanttView(startDate, vastScale, ConvertDayOfWeek(PortalConfig.PortalFirstDayOfWeek), HeaderItemHeight, ItemHeight);
if (portionY >= 0)
{
#region Add data
foreach (int userId in users)
{
Element spanElement = gantt.CreateSpanElement(null, null, null);
DataTable table = Calendar.GetResourceUtilization(userId, curDate, startDate, finishDate, new ArrayList(objectTypes), highlightedItems, true, true, true, false);
table.AcceptChanges();
for (int i = 0; i < table.Rows.Count; i++)
{
DataRow row = table.Rows[i];
if (row.RowState != DataRowState.Deleted)
{
DateTime intervalStart = (DateTime)row["Start"];
DateTime intervalFinish = ((DateTime)row["Finish"]);
Calendar.TimeType timeType = (Calendar.TimeType)row["Type"];
bool highlight = (bool)row["Highlight"];
gantt.CreateIntervalElement(spanElement, intervalStart, intervalFinish, null, timeType.ToString(), null);
if (highlight)
gantt.CreateIntervalElement(spanElement, intervalStart, intervalFinish, null, "Highlight", null);
}
}
}
#endregion
}
return GanttManager.Render(gantt, generateDataXml, styleFilePath, portionX, portionY, PortionWidth, users.Length * ItemHeight, itemsPerPage, pageNumber);
}
开发者ID:0anion0,项目名称:IBN,代码行数:52,代码来源:ResourceChart.cs
示例11: CreateAccountRightsFor
public static void CreateAccountRightsFor(RemoteWebDriver browser, string userEmail, ObjectTypes objectType, string objectName)
{
browser.FindElementByCssSelector("a[href='/Account']").Click();
var vendorUserRow =
browser.FindElementByLinkText(userEmail).FindElement(By.XPath("./ancestor::tr"));
vendorUserRow.FindElement(By.CssSelector("a[href^='/Account/Edit']")).Click();
browser.FindElementByCssSelector("a[href^='/AccountRights/Create'][href$='" + Enum.GetName(typeof(ObjectTypes), objectType) + "']").Click();
SiteUtil.SetValueForChosenJQueryControl(browser, "#ObjectId_chzn", objectName);
browser.FindElementByCssSelector("form[action^='/AccountRights/Create'] input[type='submit']").Click();
browser.FindElementByCssSelector(".success");
}
开发者ID:Natsui31,项目名称:keyhub,代码行数:14,代码来源:AdminUtil.cs
示例12: MakeAuthSession
/// <summary>
/// Makes the auth session.
/// </summary>
/// <param name="forceCleanup">if set to <c>true</c> [force cleanup].</param>
/// <param name="elStorageType">Type of the el storage.</param>
/// <param name="objectId">The object id.</param>
/// <returns></returns>
public static Guid MakeAuthSession(bool forceCleanup, ObjectTypes elStorageType, int objectId)
{
Guid retVal = Guid.Empty;
//Cleanup expiated sessions
if (forceCleanup)
{
CleanupAuthSession(elStorageType);
}
UserLight currentUser = Security.CurrentUser;
if (currentUser == null)
throw new Exception("CurrentUser");
return DBCommon.AddGate((int)elStorageType, objectId, currentUser.UserID);
}
开发者ID:0anion0,项目名称:IBN,代码行数:23,代码来源:WebDavAuthHelper.cs
示例13: AddObject
public ObjectBase AddObject(ObjectTypes Type, string Key, string ContentKey)
{
if (objectTable.ContainsKey(Key) == false)
{
switch (Type)
{
case ObjectTypes.Player:
objectTable.Add(Key, new ObjectPlayer(Key, Type, ContentKey, Content));
break;
case ObjectTypes.Enemy:
objectTable.Add(Key, new ObjectEnemy(Key, Type, ContentKey, Content));
break;
case ObjectTypes.Cursor:
objectTable.Add(Key, new ObjectCursor(Key, Type, ContentKey, Content));
break;
case ObjectTypes.Button:
objectTable.Add(Key, new ObjectButton(Key, Type, ContentKey, Content));
break;
case ObjectTypes.Weapon:
objectTable.Add(Key, new ObjectWeapon(Key, Type, ContentKey, Content));
break;
case ObjectTypes.Bullet:
objectTable.Add(Key, new ObjectBullet(Key, Type, ContentKey, Content));
break;
case ObjectTypes.DebugPoint:
objectTable.Add(Key, new ObjectDebugPoint(Key, Type, ContentKey, Content));
break;
case ObjectTypes.AchivementShelf:
objectTable.Add(Key, new ObjectAchivementShelf(Key, Type, ContentKey, Content));
break;
case ObjectTypes.Ground:
objectTable.Add(Key, new ObjectGround(Key, Type, ContentKey, Content));
break;
case ObjectTypes.EnemySpawner:
objectTable.Add(Key, new ObjectEnemySpawner(Key, Type, ContentKey, Content));
break;
default:
break;
}
return (ObjectBase)objectTable[Key];
}
else
{
return null;
}
}
开发者ID:elefantstudio-se,项目名称:todesesser,代码行数:47,代码来源:ObjectPool.cs
示例14: InitializeList
private void InitializeList(ObjectTypes initialState)
{
AddItemToSearchFor(ObjectTypes.Pool, initialState);
AddItemToSearchFor(ObjectTypes.Server, initialState);
AddItemToSearchFor(ObjectTypes.DisconnectedServer, initialState);
AddItemToSearchFor(ObjectTypes.VM, initialState);
AddItemToSearchFor(ObjectTypes.UserTemplate, initialState);
AddItemToSearchFor(ObjectTypes.DefaultTemplate, initialState);
AddItemToSearchFor(ObjectTypes.Snapshot, initialState);
AddItemToSearchFor(ObjectTypes.RemoteSR, initialState);
AddItemToSearchFor(ObjectTypes.LocalSR, initialState);
AddItemToSearchFor(ObjectTypes.VDI, initialState);
AddItemToSearchFor(ObjectTypes.Network, initialState);
AddItemToSearchFor(ObjectTypes.Folder, initialState);
//AddItemToSearchFor(ObjectTypes.DockerContainer, initialState);
// The item check change event only fires before the check state changes
// so to reuse the logic we have to pretend that something has changed as the enablement code expects to deal with a new value from the args
checkedListBox_ItemCheck(null, new ItemCheckEventArgs(0, checkedListBox.GetItemCheckState(0), checkedListBox.GetItemCheckState(0)));
}
开发者ID:huizh,项目名称:xenadmin,代码行数:20,代码来源:SearchForCustom.cs
示例15: GetValuesCountByObjectType
uint GetValuesCountByObjectType(ObjectTypes typeId)
{
switch (typeId)
{
case ObjectTypes.TYPEID_ITEM:
return UpdateFieldsLoader.ITEM_END;
case ObjectTypes.TYPEID_CONTAINER:
return UpdateFieldsLoader.CONTAINER_END;
case ObjectTypes.TYPEID_UNIT:
return UpdateFieldsLoader.UNIT_END;
case ObjectTypes.TYPEID_PLAYER:
return UpdateFieldsLoader.PLAYER_END;
case ObjectTypes.TYPEID_GAMEOBJECT:
return UpdateFieldsLoader.GO_END;
case ObjectTypes.TYPEID_DYNAMICOBJECT:
return UpdateFieldsLoader.DO_END;
case ObjectTypes.TYPEID_CORPSE:
return UpdateFieldsLoader.CORPSE_END;
default:
return 0;
}
}
开发者ID:arkanoid1,项目名称:mywowtools,代码行数:22,代码来源:WoWObject.cs
示例16: ReturnObject
private GameObject ReturnObject (ObjectTypes obj)
{
if (obj == ObjectTypes.Rocket)
return _rocket;
else if (obj == ObjectTypes.BlackHole)
return _blackHole;
else if (obj == ObjectTypes.Rocky)
return _rocky;
else if (obj == ObjectTypes.Rocky2)
return _rocky2;
else if (obj == ObjectTypes.GasGiant)
return _gasGiant;
else if (obj == ObjectTypes.EndPlanet)
return _endPlanet;
else if (obj == ObjectTypes.StartPlanet)
return _startPlanet;
else if (obj == ObjectTypes.Beyonce)
return _beyonce;
else if (obj == ObjectTypes.ButtHole)
return _buttHole;
else if (obj == ObjectTypes.LonelyPlanet)
return _lonelyPlanet;
else if (obj == ObjectTypes.SeaGod)
return _seaGod;
else if (obj == ObjectTypes.Son)
return _son;
else if (obj == ObjectTypes.WormIn)
return _wormIn;
else if (obj == ObjectTypes.WormOut)
return _wormOut;
else if (obj == ObjectTypes.BigAsteroid)
return _bigAsteroid;
else if (obj == ObjectTypes.SmallAsteroid)
return _smallAsteroid;
return null;
}
开发者ID:SteinLabs,项目名称:Gravity,代码行数:37,代码来源:LevelInstantiator.cs
示例17: ScreenModel
//defaulted moveable object, no velocity
//overload that instantiates the BoundingBox; MUST USE COLLISION PROCESSOR
public ScreenModel(Game1 GameRefArg, Model SentModel, Vector3 ModelPosition)
{
GameRef = GameRefArg;
Position = ModelPosition;
MyModel = SentModel;
//Gets the object type attribute from the
List<object> DataFromProcessor=(List<object>)MyModel.Tag;
CollisionType = (ObjectTypes)DataFromProcessor[0];
//only allocates space when the bounding box must be checked;
//otherwise, then use the sphere to check
if (CollisionType == ObjectTypes.Box)
{
//gets box data from the content
//Does not check for exception in this case, because this method should be used on models that go through the processor
BoundingBox Temp = (BoundingBox)DataFromProcessor[1];
//adds the Position Vector to the Vectors that control the shape of the bounding box
//-----> because Vectors aren't as "free floating" in programing as they are in math
LocalBox = new BoundingBox(Temp.Min + Position, Temp.Max + Position);
//allocates current data from the default spot...but these values will change based on a direction/velocity vector
MinVect = LocalBox.Min;
MaxVect = LocalBox.Max;
MovingBox = new BoundingBox(MinVect, MaxVect);
}
//case for if this model is a room
if (CollisionType == ObjectTypes.Room)
{
ListOfWalls = (List<Plane>)DataFromProcessor[1];
}
//allocates the other related objects if the bool is set to true
Moveable = true;
//Can be picked up by the user
PickUpable = true;
//default velocity as a unit vector...Remember: an object stays at rest until it is acted upon by another force!
Velocity = Vector3.Zero;
//used so any object can have it's bounding box drawn...should be removed later if memory needs to be saved
buffers = new BoundingBoxBuffers(this.MovingBox, GameRef);
}
开发者ID:schuylermartin45,项目名称:LHS-The-Video-Game,代码行数:39,代码来源:ScreenModel.cs
示例18: Create
/// <summary>
/// Create a new UserObjectRight
/// </summary>
/// <param name="userId">Id of the user to create right for</param>
/// <param name="objectType">The type of entity to create a right for</param>
/// <exception cref="NotImplementedException">NotImplementedException if ObjectType is unhandled</exception>
/// <returns>UserObjectRightCreateViewModel</returns>
public ActionResult Create(int userId, ObjectTypes objectType)
{
using (var context = dataContextFactory.CreateByUser())
{
UserObjectRight userObjectRight = NewUserObjectRight(objectType);
SelectList objectList = null;
Model.Right right = null;
switch(objectType)
{
case ObjectTypes.Vendor:
objectList = (from v in context.Vendors select v).ToSelectList(x => x.ObjectId, x => x.Name);
right = (from x in context.Rights where x.RightId == Model.VendorAdmin.Id select x).FirstOrDefault();
break;
case ObjectTypes.Customer:
objectList = (from c in context.Customers select c).ToSelectList(x => x.ObjectId, x => x.Name);
right = (from x in context.Rights where x.RightId == Model.EditEntityMembers.Id select x).FirstOrDefault();
break;
case ObjectTypes.License:
objectList = (from l in context.Licenses select new {Id = l.ObjectId, Name = l.Sku.SkuCode}).ToSelectList(x => x.Id, x => x.Name);
right = (from x in context.Rights where x.RightId == Model.EditLicenseInfo.Id select x).FirstOrDefault();
break;
default:
throw new NotImplementedException("ObjectType not known");
}
userObjectRight.User = (from x in context.Users where x.UserId == userId select x).FirstOrDefault();
userObjectRight.UserId = userId;
userObjectRight.Right = right;
userObjectRight.RightId = right.RightId;
var viewModel = new UserObjectRightCreateViewModel(userObjectRight, objectType, objectList);
viewModel.UseLocalReferrerAsRedirectUrl(Request);
return View(viewModel);
}
}
开发者ID:Natsui31,项目名称:keyhub,代码行数:44,代码来源:AccountRightsController.cs
示例19: TS_SupportsDataType
/// -------------------------------------------------------------------
/// <summary></summary>
/// -------------------------------------------------------------------
internal void TS_SupportsDataType(ObjectTypes objType, object CurrentValue, bool CanBeNull, CheckType checkType)
{
Comment("Determining if " + CurrentValue + " supports " + objType + " type");
if (CanBeNull && (CurrentValue == null))
{
Comment("Object was equal to null and is allowed");
}
else
{
// This is a step, since we said it could not support null values if we get to this location
if (CurrentValue == null)
ThrowMe(CheckType.Verification, "Cannot check to see if CurrentValue supports " + objType + " since CurrentValue = null so cannot call CurrentValue.GetType()");
if (!SupportsDataType(objType, CurrentValue))
ThrowMe(checkType, CurrentValue.GetType() + " does not support " + objType);
}
m_TestStep++;
}
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:22,代码来源:PatternObject.cs
示例20: AliasedSetCommand
public AliasedSetCommand( AccessLevel level, string command, string name, string value, ObjectTypes objects )
{
m_Name = name;
m_Value = value;
AccessLevel = level;
if ( objects == ObjectTypes.Items )
Supports = CommandSupport.AllItems;
else if ( objects == ObjectTypes.Mobiles )
Supports = CommandSupport.AllMobiles;
else
Supports = CommandSupport.All;
Commands = new string[]{ command };
ObjectTypes = objects;
Usage = command;
Description = String.Format( "Sets the {0} property to {1}.", name, value );
}
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:19,代码来源:Commands.cs
注:本文中的ObjectTypes类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论