本文整理汇总了C#中ObjectTypes类的典型用法代码示例。如果您正苦于以下问题:C# ObjectTypes类的具体用法?C# ObjectTypes怎么用?C# ObjectTypes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectTypes类属于命名空间,在下文中一共展示了ObjectTypes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例3: SearchForCustom
public SearchForCustom(Dictionary<ObjectTypes, String> typeNames, ObjectTypes initialState)
: base()
{
InitializeComponent();
this.typeNames = typeNames;
InitializeList(initialState);
}
示例4: GravityObject
public GravityObject (Vector2 position, Quaternion rotation, ObjectTypes type)
: this()
{
Position = position;
Rotation = rotation;
Type = type;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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");
}
示例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);
}
示例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;
}
}
示例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)));
}
示例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;
}
}