ResourceId

We found 10 examples in language CSharp for this search. You will see 45 fragments of code.

        #endregion



        #region Public Methods
        public void AddResource(short resourceId)
        {
            if (CkeckRes(resourceId))
            {
                throw new Exception($"#Error: resource [{resourceId}] already constaint in system");
            }

            _resourcesInSystem.Add(resourceId, null);

        }
        
        public bool CheckResToFree(short resourceId)
        {
            if (!CkeckRes(resourceId))
            {
                return false;
            }

            var isFree = _resourcesInSystem[resourceId] == null || _resourcesInSystem[resourceId] == "";
            return isFree;
        }

        public bool CkeckRes(short resourceId)
        {
            var isConstaints = _resourcesInSystem.ContainsKey(resourceId);
            return isConstaints;
        }



        public void DeleteLink(short resourceId)
        {
            if(!CkeckRes(resourceId))
                throw new Exception($"#Error: Imposible delete link. Resource with id [{resourceId}] is absent in the system");

            if(CheckResToFree(resourceId))
                throw new Exception($"#Error: Imposible delete link. Resource with id [{resourceId}] is already free");

            Resources[resourceId] = null;
        }


        public Task<TransactionalStatus> CommitReadOnly(string resourceId, Guid transactionId, AccessCounter accessCount, DateTime timeStamp)
        {
            return GetResource(resourceId).CommitReadOnly(transactionId, accessCount, timeStamp);
        }

        public Task Abort(string resourceId, Guid transactionId)
        {
            return GetResource(resourceId).Abort(transactionId);
        }

        public Task Cancel(string resourceId, Guid transactionId, DateTime timeStamp, TransactionalStatus status)
        {
            return GetResource(resourceId).Cancel(transactionId, timeStamp, status);
        }

        public Task Confirm(string resourceId, Guid transactionId, DateTime timeStamp)
        {
            return GetResource(resourceId).Confirm(transactionId, timeStamp);
        }

        public Task Prepare(string resourceId, Guid transactionId, AccessCounter accessCount, DateTime timeStamp, ParticipantId transactionManager)
        {
            return GetResource(resourceId).Prepare(transactionId, accessCount, timeStamp, transactionManager);
        }

        private ITransactionalResource GetResource(string resourceId)
        {
            if (!this.resources.TryGetValue(resourceId, out ITransactionalResource resource))
            {
                this.resources[resourceId] = resource = this.factories[resourceId].Invoke();
            }
            return resource;
        }

        public static string LoggingId(this ResourceId resourceId)
        {
            return resourceId.ShortId();
        }

        public static string ShortId(this ResourceId resourceId)
            => resourceId.Parent != null
                ? $"{resourceId.ResourceGroupName}/{resourceId.Parent}/{resourceId.Name}"
                : $"{resourceId.ResourceGroupName}/{resourceId.Name}";

        public static IDisposable BeginResourceIdScope(this ILogger logger, string name, ResourceId resourceId)
            => logger.BeginKeyValueScope(name + "_id", resourceId.LoggingId());


        #endregion



        #region Public Methods
        public void AddResource(short resourceId)
        {
            _resourcesInSystem.Add(resourceId, null);
        }


        public void MakeLink(short resourceId, string processName)
        {
            _resourcesInSystem[resourceId] = processName;
        }
        
        public void DeleteLink(short resourceId)
        {
            Resources[resourceId] = null;

            ResourceReliaseEvent(this, resourceId);
        }


        public bool IsFreeResource(short resourceId)
        {
            var isFree = _resourcesInSystem[resourceId] == null || _resourcesInSystem[resourceId] == "";
            return isFree;
        }

        public bool IsReallyResource(short resourceId)
        {
            var isConstaints = _resourcesInSystem.ContainsKey(resourceId);
            return isConstaints;
        }

        public bool IsReallyAndFreeResource(short resourceId)
        {
            var isReallyAndFree = IsReallyResource(resourceId) && IsFreeResource(resourceId);
            return isReallyAndFree;
        }


        #endregion



        #region Public methods

        public void InitResource(short resourceId)
        {
            _resourcesAllocator.AddResource(resourceId);
        }

        public void InitResource(string resourceIdStr)
        {
            var isShort = short.TryParse(resourceIdStr, out var resourceId);

            if (!isShort)
            {
                throw new Exception($"#Error: Uncorrect resource id [{resourceIdStr}]");
            }

            InitResource(resourceId);
        }

        public void ProcGetRes(string procName, string resourceId)
        {
            var isShort = short.TryParse(resourceId, out var res);

            if (!isShort)
            {
                throw new Exception($"#Error: Impossible to get process [{procName}] resource. Wrong argument in resource id [{resourceId}]");
            }


            ProcGetRes(procName, res);
        }

        public void RequestGetRes(string procName, string resourceId)
        {
            var isShort = short.TryParse(resourceId, out var res);

            if (!isShort)
            {
                throw new Exception($"#Error: Process [{procName}] can't request a resource. Wrong argument in resource id [{resourceId}]");
            }


            RequestGetRes(procName, res);
        }



        public void ProcFreeRes(string procName, short resourceId)
        {

            _processesController.FreeRes(procName, resourceId);
            _resourcesAllocator.DeleteLink(resourceId);

        }

        public void ProcFreeRes(string procName, string resourceId)
        {
            var isShort = short.TryParse(resourceId, out var res);

            if (!isShort)
            {
                throw new Exception($"#Error: Process [{procName}] can't free a resource. Wrong argument");
            }

            ProcFreeRes(procName, res);
        }


        public Task Ping(string resourceId, Guid transactionId, DateTime timeStamp, ParticipantId resource)
        {
            return GetManager(resourceId).Ping(transactionId, timeStamp, resource);
        }

        public Task<TransactionalStatus> PrepareAndCommit(string resourceId, Guid transactionId, AccessCounter accessCount, DateTime timeStamp, List<ParticipantId> writeResources, int totalResources)
        {
            return GetManager(resourceId).PrepareAndCommit(transactionId, accessCount, timeStamp, writeResources, totalResources);
        }

        public Task Prepared(string resourceId, Guid transactionId, DateTime timestamp, ParticipantId resource, TransactionalStatus status)
        {
            return GetManager(resourceId).Prepared(transactionId, timestamp, resource, status);
        }

        private ITransactionManager GetManager(string resourceId)
        {
            if (!this.managers.TryGetValue(resourceId, out ITransactionManager manager))
            {
                this.managers[resourceId] = manager = this.factories[resourceId].Invoke();
            }
            return manager;
        }


	  public static AuthorizationSpec auth(int type, Resource resource, string resourceId, string userId, params Permission[] permissions)
	  {
		AuthorizationSpec spec = new AuthorizationSpec();
		spec.type = type;
		spec.resource = resource;
		spec.resourceId = resourceId;
		spec.userId = userId;
		spec.permissions = permissions;
		return spec;
	  }

	  public static AuthorizationSpec global(Resource resource, string resourceId, string userId, params Permission[] permissions)
	  {
		return auth(org.camunda.bpm.engine.authorization.Authorization_Fields.AUTH_TYPE_GLOBAL, resource, resourceId, userId, permissions);
	  }

	  public static AuthorizationSpec grant(Resource resource, string resourceId, string userId, params Permission[] permissions)
	  {
		return auth(org.camunda.bpm.engine.authorization.Authorization_Fields.AUTH_TYPE_GRANT, resource, resourceId, userId, permissions);
	  }

	  public static AuthorizationSpec revoke(Resource resource, string resourceId, string userId, params Permission[] permissions)
	  {
		return auth(org.camunda.bpm.engine.authorization.Authorization_Fields.AUTH_TYPE_REVOKE, resource, resourceId, userId, permissions);
	  }

	  public override string ToString()
	  {
		StringBuilder sb = new StringBuilder();
		sb.Append("[Resource: ");
		sb.Append(resource);
		sb.Append(", Resource Id: ");
		sb.Append(resourceId);
		sb.Append(", Type: ");
		sb.Append(type);
		sb.Append(", User Id: ");
		sb.Append(userId);
		sb.Append(", Permissions: [");

		foreach (Permission permission in permissions)
		{
		  sb.Append(permission.Name);
		  sb.Append(", ");
		}

		sb.Append("]]");

		return sb.ToString();

	  }

//
// トンヌラコ
//
// 束縛リソースアクセッサー
//

using TonNurako.Data;
using TonNurako.Widgets.Xm;

namespace TonNurako.Widgets.Xm
{
    /// <summary>
    /// 束縛リソース
    /// </summary>
    /// <typeparam name="T">束縛付きウイジェット</typeparam>
    public class ConstraintResource<T> where T:Widgets.IWidget {
        public Widget Widget {
            get; internal set;
        }
        public Data.ExtremeResourceSports XSports {
            get {
                return Widget.XSports;
            }
        }

        public ConstraintResource(Widget widget) {
            Widget = widget;
        }
    }

    /// <summary>
    /// XmTabStack束縛リソース
    /// </summary>
    public class TabStackConstraint : ConstraintResource<TabStack> {
        public TabStackConstraint(Widget widget) : base(widget) {
        }

        /// <summary>
        ///  XmNfreeTabPixmap
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual bool FreeTabPixmap {
            get {
                return XSports.GetBool(TonNurako.Motif.ResourceId.XmNfreeTabPixmap, false);
            }
            set {
            XSports.SetBool(TonNurako.Motif.ResourceId.XmNfreeTabPixmap, value);
            }
        }

        /// <summary>
        /// XmNtabAlignment
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual Alignment TabAlignment {
            get {
                return XSports.GetValue<Alignment>(TonNurako.Motif.ResourceId.XmNtabAlignment, Alignment.Center);
            }
            set {
                XSports.SetValue<Alignment>(TonNurako.Motif.ResourceId.XmNtabAlignment, value);
            }
        }

        /// <summary>
        /// XmNtabBackground
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual GC.Color TabBackground {
            get {
                return XSports.GetColor(TonNurako.Motif.ResourceId.XmNtabBackground);
            }
            set {
                XSports.SetColor(TonNurako.Motif.ResourceId.XmNtabBackground, value);
            }
        }

        /// <summary>
        /// XmNtabBackgroundPixmap
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual X11.Pixmap TabBackgroundPixmap {
            get {
                return XSports.GetPixmap(TonNurako.Motif.ResourceId.XmNtabBackgroundPixmap);
            }
            set {
                XSports.SetPixmap(TonNurako.Motif.ResourceId.XmNtabBackgroundPixmap, value);
            }
        }

        /// <summary>
        /// XmNtabForeground
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual GC.Color TabForeground {
            get {
                return XSports.GetColor(TonNurako.Motif.ResourceId.XmNtabForeground);
            }
            set {
                XSports.SetColor(TonNurako.Motif.ResourceId.XmNtabForeground, value);
            }
        }

        /// <summary>
        /// XmNtabLabelPixmap
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual X11.Pixmap TabLabelPixmap {
            get {
                return XSports.GetPixmap(TonNurako.Motif.ResourceId.XmNtabLabelPixmap);
            }
            set {
                XSports.SetPixmap(TonNurako.Motif.ResourceId.XmNtabLabelPixmap, value);
            }
        }

        /// <summary>
        /// XmNtabLabelString
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual string TabLabelString {
            get {
                return XSports.GetString(TonNurako.Motif.ResourceId.XmNtabLabelString, "");
            }
            set {
                XSports.SetString(TonNurako.Motif.ResourceId.XmNtabLabelString, value);
            }
        }

        /// <summary>
        /// XmNtabStringDirection
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual StringDirection TabStringDirection {
            get {
                return XSports.GetValue<StringDirection>(TonNurako.Motif.ResourceId.XmNtabStringDirection, StringDirection.Default);
            }
            set {
                XSports.SetValue<StringDirection>(TonNurako.Motif.ResourceId.XmNtabStringDirection, value);
            }
        }

         // 以下未実装

        // テストが出来ないくて困ってる
        // ### XmNtabPixmapPlacement XmCTabPixmapPlacement XmPixmapPlacement XmPIXMAP_RIGHT CSG

    }

    /// <summary>
    /// Frame束縛リソース
    /// </summary>
    public class FrameConstraint : ConstraintResource<Frame> {
        public FrameConstraint(Widget widget) : base(widget) {
        }

        /// <summary>
        /// XmNchildType
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual FrameChildType ChildType {
            get {
                return XSports.GetValue<FrameChildType>(TonNurako.Motif.ResourceId.XmNchildType, FrameChildType.WorkareaChild);
            }
            set {
            XSports.SetValue<FrameChildType>(TonNurako.Motif.ResourceId.XmNchildType, value);
            }
        }

        /// <summary>
        /// XmNchildHorizontalAlignment
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual Alignment ChildHorizontalAlignment {
            get {
                return XSports.GetValue<Alignment>(TonNurako.Motif.ResourceId.XmNchildHorizontalAlignment, Alignment.Beginning);
            }
            set {
            XSports.SetValue<Alignment>(TonNurako.Motif.ResourceId.XmNchildHorizontalAlignment, value);
            }
        }

        /// <summary>
        /// XmNchildHorizontalSpacing
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual int ChildHorizontalSpacing {
            get {
                return XSports.GetInt(TonNurako.Motif.ResourceId.XmNchildHorizontalSpacing, 2);
            }
            set {
            XSports.SetInt(TonNurako.Motif.ResourceId.XmNchildHorizontalSpacing, value);
            }
        }

        /// <summary>
        /// XmNchildVerticalAlignment
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual ChildAlignment ChildVerticalAlignment {
            get {
                return XSports.GetValue<ChildAlignment>(TonNurako.Motif.ResourceId.XmNchildVerticalAlignment, ChildAlignment.Center);
            }
            set {
            XSports.SetValue<ChildAlignment>(TonNurako.Motif.ResourceId.XmNchildVerticalAlignment, value);
            }
        }

        /// <summary>
        /// XmNframeChildType XmCFrameChildType unsigned char XmFRAME_WORKAREA_CHILD CSG
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual FrameChildType FrameChildType {
            get {
                return XSports.GetValue<FrameChildType>(TonNurako.Motif.ResourceId.XmNframeChildType, FrameChildType.WorkareaChild);
            }
            set {
                XSports.SetValue<FrameChildType>(TonNurako.Motif.ResourceId.XmNframeChildType, value);
            }
        }
    }

    /// <summary>
    /// Paned (分割ウインドウズXP)束縛
    /// </summary>
    public class PanedConstraint : ConstraintResource<Paned> {

        public PanedConstraint(Widget widget) : base(widget) {
        }

        /// <summary>
        /// XmNallowResize
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual bool AllowResize
        {
            get
            {
                return XSports.GetBool(
                TonNurako.Motif.ResourceId.XmNallowResize, false, Data.Resource.Access.CSG);
            }
            set
            {
                XSports.SetBool(
                    TonNurako.Motif.ResourceId.XmNallowResize, value, Data.Resource.Access.CSG);
            }
        }

        /// <summary>
        /// XmNpaneMaximum
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual int PaneMaximum
        {
            get
            {
                return XSports.GetInt(
                TonNurako.Motif.ResourceId.XmNpaneMaximum, 1000, Data.Resource.Access.CSG);
            }
            set
            {
                XSports.SetInt(
                    TonNurako.Motif.ResourceId.XmNpaneMaximum, value, Data.Resource.Access.CSG);
            }
        }

        /// <summary>
        /// XmNpaneMinimum
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual int PaneMinimum
        {
            get
            {
                return XSports.GetInt(
                TonNurako.Motif.ResourceId.XmNpaneMinimum, 1, Data.Resource.Access.CSG);
            }
            set
            {
                XSports.SetInt(
                    TonNurako.Motif.ResourceId.XmNpaneMinimum, value, Data.Resource.Access.CSG);
            }
        }

        /// <summary>
        /// XmNskipAdjust
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual bool SkipAdjust
        {
            get
            {
                return XSports.GetBool(
                TonNurako.Motif.ResourceId.XmNskipAdjust, false, Data.Resource.Access.CSG);
            }
            set
            {
                XSports.SetBool(
                    TonNurako.Motif.ResourceId.XmNskipAdjust, value, Data.Resource.Access.CSG);
            }
        }


        /// <summary>
        /// XmNpreferredPaneSize
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual int PreferredPaneSize
        {
            get
            {
                return XSports.GetInt(
                    TonNurako.Motif.ResourceId.XmNpreferredPaneSize, 0, Data.Resource.Access.CSG);
            }
            set
            {
                XSports.SetInt(
                    TonNurako.Motif.ResourceId.XmNpreferredPaneSize, value, Data.Resource.Access.CSG);
            }
        }

        /// <summary>
        /// XmNresizeToPreferred
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual bool ResizeToPreferred
        {
            get
            {
                return XSports.GetBool(
                    TonNurako.Motif.ResourceId.XmNresizeToPreferred, false, Data.Resource.Access.CSG);
            }
            set
            {
                XSports.SetBool(
                    TonNurako.Motif.ResourceId.XmNresizeToPreferred, value, Data.Resource.Access.CSG);
            }
        }
        /// <summary>
        /// XmNshowSash
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual bool ShowSash
        {
            get
            {
                return XSports.GetBool(
                    TonNurako.Motif.ResourceId.XmNshowSash, true, Data.Resource.Access.CSG);
            }
            set
            {
                XSports.SetBool(
                    TonNurako.Motif.ResourceId.XmNshowSash, value, Data.Resource.Access.CSG);
            }
        }
    }

    /// <summary>
    /// みんな大好き RowColumn束縛リソース
    /// </summary>
    public class RowColumnConstraint : ConstraintResource<RowColumn> {
        public RowColumnConstraint(Widget widget) : base(widget) {
        }

        /// <summary>
        /// XmNpositionIndex XmCPositionIndex short XmLAST_POSITION CSG
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual int PositionIndex {
            get {
                return XSports.GetInt(TonNurako.Motif.ResourceId.XmNpositionIndex, (int)TonNurako.Motif.Constant.XmLAST_POSITION);
            }
            set {
                XSports.SetInt(TonNurako.Motif.ResourceId.XmNpositionIndex, value);
            }
        }
    }

    /// <summary>
    /// PanedWindow(分割ウインドウズXP)束縛リソース
    /// </summary>
    public class PanedWindowConstraint : ConstraintResource<Paned> {

        public PanedWindowConstraint(Widget widget) : base(widget) {
        }

        /// <summary>
        /// XmNallowResize
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual bool AllowResize {
            get {
                return XSports.GetBool(TonNurako.Motif.ResourceId.XmNallowResize, false);
            }
            set {
            XSports.SetBool(TonNurako.Motif.ResourceId.XmNallowResize, value);
            }
        }

        /// <summary>
        /// XmNpaneMaximum
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual int PaneMaximum {
            get {
                return XSports.GetInt(TonNurako.Motif.ResourceId.XmNpaneMaximum, 1000);
            }
            set {
            XSports.SetInt(TonNurako.Motif.ResourceId.XmNpaneMaximum, value);
            }
        }

        /// <summary>
        /// XmNpaneMinimum
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual int PaneMinimum {
            get {
                return XSports.GetInt(TonNurako.Motif.ResourceId.XmNpaneMinimum, 1);
            }
            set {
            XSports.SetInt(TonNurako.Motif.ResourceId.XmNpaneMinimum, value);
            }
        }

        /// <summary>
        /// XmNpositionIndex
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual int PositionIndex {
            get {
                return XSports.GetInt(TonNurako.Motif.ResourceId.XmNpositionIndex, (int)TonNurako.Motif.Constant.XmLAST_POSITION);
            }
            set {
                XSports.SetInt(TonNurako.Motif.ResourceId.XmNpositionIndex, value);
            }
        }

        /// <summary>
        /// XmNskipAdjust
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual bool SkipAdjust {
            get {
                return XSports.GetBool(TonNurako.Motif.ResourceId.XmNskipAdjust, false);
            }
            set {
                XSports.SetBool(TonNurako.Motif.ResourceId.XmNskipAdjust, value);
            }
        }
    }

    /// <summary>
    /// Hierarchy束縛リソース
    /// </summary>
    public class HierarchyConstraint : ConstraintResource<Hierarchy> {
        public HierarchyConstraint(Widget widget) : base(widget) {

        }

        /// <summary>
        /// XmNinsertBefore
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual Widgets.IWidget InsertBefore {
            get {
                return XSports.GetWidget<Widgets.IWidget>(
                    TonNurako.Motif.ResourceId.XmNinsertBefore, Data.Resource.Access.CSG);
            }
            set {
                XSports.SetWidget<Widgets.IWidget>(
                    TonNurako.Motif.ResourceId.XmNinsertBefore, value, Data.Resource.Access.CSG);
            }
        }

        /// <summary>
        /// XmNnodeState
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual Hierarchy.NodeState NodeState {
            get {
                return XSports.GetValue< Hierarchy.NodeState>(TonNurako.Motif.ResourceId.XmNnodeState, Hierarchy.NodeState.Open);
            }
            set {
                XSports.SetValue< Hierarchy.NodeState>(TonNurako.Motif.ResourceId.XmNnodeState, value);
            }
        }

        /// <summary>
        /// XmNparentNode
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual Widgets.IWidget ParentNode {
            get {
                return XSports.GetWidget<Widgets.IWidget>(
                TonNurako.Motif.ResourceId.XmNparentNode, Data.Resource.Access.CSG);
            }
            set {
            XSports.SetWidget<Widgets.IWidget>(
                TonNurako.Motif.ResourceId.XmNparentNode, value, Data.Resource.Access.CSG);
            }
        }

    }



    /// <summary>
    /// Container束縛リソース
    /// </summary>
    public class ContainerConstraint : ConstraintResource<Container> {
        public ContainerConstraint(Widget widget) : base(widget) {
        }

        /// <summary>
        /// XmNentryParent XmCWidget Widget NULL CSG
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual IWidget EntryParent {
            get {
                return XSports.GetWidget<IWidget>(
                    TonNurako.Motif.ResourceId.XmNentryParent, Data.Resource.Access.CSG);
            }
            set {
                XSports.SetWidget<IWidget>(
                    TonNurako.Motif.ResourceId.XmNentryParent, value, Data.Resource.Access.CSG);
            }
        }

        /// <summary>
        /// XmNoutlineState XmCOutlineState unsigned char XmCOLLAPSED CSG
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual OutlineState OutlineState {
            get {
                return XSports.GetValue<OutlineState>(
                TonNurako.Motif.ResourceId.XmNoutlineState, OutlineState.Collapsed, Data.Resource.Access.CSG);
            }
            set {
                XSports.SetValue<OutlineState>(
                    TonNurako.Motif.ResourceId.XmNoutlineState, value, Data.Resource.Access.CSG);
            }
        }

        /// <summary>
        /// XmNpositionIndex XmCPositionIndex int dynamic CSG
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual int PositionIndex {
            get {
                return XSports.GetInt(
                    TonNurako.Motif.ResourceId.XmNpositionIndex, 0, Data.Resource.Access.CSG);
            }
            set {
                XSports.SetInt(
                    TonNurako.Motif.ResourceId.XmNpositionIndex, value, Data.Resource.Access.CSG);
            }
        }
    }

    /// <summary>
    /// Notebook束縛リソース
    /// </summary>
    public class NotebookConstraint : ConstraintResource<Container> {
        public NotebookConstraint(Widget widget) : base(widget) {
        }
        /// <summary>
        /// XmNnotebookChildType XmCNotebookChildType unsigned char dynamic CG
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CG)]
        public virtual NotebookChildType NotebookChildType {
            get {
                return XSports.GetValue<NotebookChildType>(
                    TonNurako.Motif.ResourceId.XmNnotebookChildType, NotebookChildType.Page, Data.Resource.Access.CG);
            }
            set {
                XSports.SetValue<NotebookChildType>(
                    TonNurako.Motif.ResourceId.XmNnotebookChildType, value, Data.Resource.Access.CG);
            }
        }

        /// <summary>
        /// XmNpageNumber XmCPageNumber int dynamic CSG
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual int PageNumber {
            get {
                return XSports.GetInt(
                    TonNurako.Motif.ResourceId.XmNpageNumber, 0, Data.Resource.Access.CSG);
            }
            set {
            XSports.SetInt(
                TonNurako.Motif.ResourceId.XmNpageNumber, value, Data.Resource.Access.CSG);
            }
        }

        /// <summary>
        /// XmNresizable XmCResizable Boolean True CSG
        /// </summary>
        [Data.Resource.SportyResource(Data.Resource.Access.CSG)]
        public virtual bool Resizable {
            get {
                return XSports.GetBool(
                TonNurako.Motif.ResourceId.XmNresizable, true, Data.Resource.Access.CSG);
            }
            set {
            XSports.SetBool(
                TonNurako.Motif.ResourceId.XmNresizable, value, Data.Resource.Access.CSG);
            }
        }
    }
}


        public static string GetResourceUrl(string resourceId)
        {
            return String.Format(ResourceUrlFormatString, resourceId);
        }
        public static string GetResourceGroupUrl(string resourceGroupId)
        {
            return String.Format(ResourceGroupUrlFormatString, resourceGroupId);
        }
        public static string GetSqlServerResourceId(string subscriptionId, string resourceGroupName, string sqlServerName)
        {
            return String.Format(ResourceIdForSqlServerFormatString, subscriptionId, resourceGroupName, sqlServerName);
        }
        public static string GetResourceGroupResourceId(string subscriptionId, string resourceGroupName)
        {
            return String.Format(ResourceIdForResourceGroupFormatString, subscriptionId, resourceGroupName);
        }

        public static string GetSqlServerName(string resourceId)
        {
            return GetNextSegmentAfter(resourceId: resourceId, segmentName: "Microsoft.Sql/servers");
        }
        public static string GetDatabaseName(string resourceId)
        {
            return GetNextSegmentAfter(resourceId: resourceId, segmentName: "databases");
        }


        public string GetSplunkEventFromMessage()
        {
            ExpandoObject o = new ExpandoObject();
            ((IDictionary<String, Object>)o).Add("sourcetype", SplunkSourceType);
            ((IDictionary<String, Object>)o).Add("event", Message);
            string json = Newtonsoft.Json.JsonConvert.SerializeObject(o);

            return json;
        }

        double unixTime()
        {
            double unixTimestamp = MessageTime.Ticks - new DateTime(1970, 1, 1).Ticks;
            unixTimestamp /= TimeSpan.TicksPerSecond;
            return unixTimestamp;
        }
        
        protected void GetStandardProperties()
        {
            string pattern;

            pattern = @"SUBSCRIPTIONS\/(.*?)\/";
            Match m = Regex.Match(ResourceId.ToUpper(), pattern);
            SubscriptionId = m.Groups[1].Value;

            pattern = @"SUBSCRIPTIONS\/(?:.*?)\/RESOURCEGROUPS\/(.*?)(\/|\Z)";
            m = Regex.Match(ResourceId.ToUpper(), pattern);
            ResourceGroup = m.Groups[1].Value;

            pattern = @"PROVIDERS\/(?:.*?\/.*?\/)(.*?)(?:\/|$)";
            m = Regex.Match(ResourceId.ToUpper(), pattern);
            ResourceName = m.Groups[1].Value;

            pattern = @"PROVIDERS\/(.*?\/.*?)(?:\/)(?:.*\/)(.*DATABASES)";
            m = Regex.Match(ResourceId.ToUpper(), pattern);
            var group1 = m.Groups[1].Value;
            var group2 = m.Groups[2].Value;
            if (group2 == "DATABASES")
            {
                ResourceType = group1 + "/" + group2;
            }
            else
            {
                pattern = @"PROVIDERS\/(.*?\/.*?)(?:\/)";
                m = Regex.Match(ResourceId.ToUpper(), pattern);
                ResourceType = m.Groups[1].Value;
            }
        }

        protected void AddStandardProperties(string prefix)
        {
            if (TenantId != "")
            {
                ((IDictionary<String, Object>)Message).Add($"{prefix}_TenantId", TenantId);
            }
            if (SubscriptionId != "")
            {
                ((IDictionary<String, Object>)Message).Add($"{prefix}_SubscriptionId", SubscriptionId);
            }
            if (ResourceGroup != "")
            {
                ((IDictionary<String, Object>)Message).Add($"{prefix}_ResourceGroup", ResourceGroup);
            }
            if (ResourceType != "")
            {
                ((IDictionary<String, Object>)Message).Add($"{prefix}_ResourceType", ResourceType);
            }
            if (ResourceName != "")
            {
                ((IDictionary<String, Object>)Message).Add($"{prefix}_ResourceName", ResourceName);
            }
        }

Google.Apis.YouTube.v3.Data.ResourceId : IDirectResponseSchema

Constructors :

public ResourceId()

Methods :

public String get_ChannelId()
public Void set_ChannelId(String value = )
public String get_Kind()
public Void set_Kind(String value = )
public String get_PlaylistId()
public Void set_PlaylistId(String value = )
public String get_VideoId()
public Void set_VideoId(String value = )
public String get_ETag()
public Void set_ETag(String value = )
public Type GetType()
public String ToString()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()