示例#1
0
        public PSObject AsCustomObject()
        {
            if (this._sessionState == null)
            {
                throw PSTraceSource.NewInvalidOperationException("Modules", "InvalidOperationOnBinaryModule", new object[0]);
            }
            PSObject obj2 = new PSObject();

            foreach (KeyValuePair <string, FunctionInfo> pair in this.ExportedFunctions)
            {
                FunctionInfo info = pair.Value;
                if (info != null)
                {
                    PSScriptMethod member = new PSScriptMethod(info.Name, info.ScriptBlock);
                    obj2.Members.Add(member);
                }
            }
            foreach (KeyValuePair <string, PSVariable> pair2 in this.ExportedVariables)
            {
                PSVariable variable = pair2.Value;
                if (variable != null)
                {
                    PSVariableProperty property = new PSVariableProperty(variable);
                    obj2.Members.Add(property);
                }
            }
            return(obj2);
        }
示例#2
0
        public override PSMemberInfo Copy()
        {
            PSNoteProperty destiny = new PSVariableProperty(this._variable);

            base.CloneBaseProperties(destiny);
            return(destiny);
        }
示例#3
0
 public PSObject AsCustomObject()
 {
     if (this._sessionState == null)
     {
         throw PSTraceSource.NewInvalidOperationException("Modules", "InvalidOperationOnBinaryModule", new object[0]);
     }
     PSObject obj2 = new PSObject();
     foreach (KeyValuePair<string, FunctionInfo> pair in this.ExportedFunctions)
     {
         FunctionInfo info = pair.Value;
         if (info != null)
         {
             PSScriptMethod member = new PSScriptMethod(info.Name, info.ScriptBlock);
             obj2.Members.Add(member);
         }
     }
     foreach (KeyValuePair<string, PSVariable> pair2 in this.ExportedVariables)
     {
         PSVariable variable = pair2.Value;
         if (variable != null)
         {
             PSVariableProperty property = new PSVariableProperty(variable);
             obj2.Members.Add(property);
         }
     }
     return obj2;
 }
示例#4
0
 public override PSMemberInfo Copy()
 {
     PSNoteProperty destiny = new PSVariableProperty(this._variable);
     base.CloneBaseProperties(destiny);
     return destiny;
 }