protected void Page_Load(object sender, EventArgs e)
 {
     CustomControl ctrl = new CustomControl();
     Form.Controls.Add(ctrl);
     Form.Controls.Remove(ctrl);
     Form.Controls.Add(ctrl);
 }
        internal static IEnumerable<ExtendedTypeDefinition> GetFormatData()
        {
            var SignatureTypes_GroupingFormat = CustomControl.Create()
                    .StartEntry()
                        .StartFrame(leftIndent: 4)
                            .AddText(FileSystemProviderStrings.DirectoryDisplayGrouping)
                            .AddScriptBlockExpressionBinding(@"split-path $_.Path")
                            .AddNewline()
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var sharedControls = new CustomControl[] {
                SignatureTypes_GroupingFormat
            };

            yield return new ExtendedTypeDefinition(
                "System.Security.Cryptography.X509Certificates.X509Certificate2",
                ViewsOf_System_Security_Cryptography_X509Certificates_X509Certificate2());

            var td2 = new ExtendedTypeDefinition(
                "Microsoft.PowerShell.Commands.X509StoreLocation",
                ViewsOf_CertificateProviderTypes());
            td2.TypeNames.Add("System.Security.Cryptography.X509Certificates.X509Certificate2");
            td2.TypeNames.Add("System.Security.Cryptography.X509Certificates.X509Store");
            yield return td2;

            yield return new ExtendedTypeDefinition(
                "System.Management.Automation.Signature",
                ViewsOf_System_Management_Automation_Signature(sharedControls));

            yield return new ExtendedTypeDefinition(
                "System.Security.Cryptography.X509Certificates.X509CertificateEx",
                ViewsOf_System_Security_Cryptography_X509Certificates_X509CertificateEx());
        }
 public void Register()
 {
     using (var customControl = new CustomControl()) {
         var customControlItemsSourceFeature = FeatureProvider<IItemsSourceFeature>.GetFeature(customControl) as CustomControlItemsSourceFeature;
         Assert.That(customControlItemsSourceFeature, Is.Not.Null);
     }
 }
Example #4
0
	public MainForm ()
	{
		// 
		// _contextMenu
		//
		_contextMenu = new ContextMenu ();
		_contextMenu.MenuItems.Add (new MenuItem ("Close"));
		//
		// _customControl
		//
		_customControl = new CustomControl ();
		_customControl.Dock = DockStyle.Fill;
		_customControl.BackColor = Color.LightBlue;
		_customControl.ContextMenu = _contextMenu;
		Controls.Add (_customControl);
		// 
		// _listBox
		//
		_listBox = new ListBox ();
		_listBox.Dock = DockStyle.Bottom;
		_listBox.Height = 150;
		_customControl.ListBox = _listBox;
		Controls.Add (_listBox);
		// 
		// MainForm
		// 
		ClientSize = new Size (300, 200);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #325535";
		Load += new EventHandler (MainForm_Load);
	}
        internal static IEnumerable<ExtendedTypeDefinition> GetFormatData()
        {
            var FileSystemTypes_GroupingFormat = CustomControl.Create()
                    .StartEntry()
                        .StartFrame(leftIndent: 4)
                            .AddText(FileSystemProviderStrings.DirectoryDisplayGrouping)
                            .AddScriptBlockExpressionBinding(@"
                                                  $_.PSParentPath.Replace(""Microsoft.PowerShell.Core\FileSystem::"", """")                                                  
                                              ")
                            .AddNewline()
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var sharedControls = new CustomControl[] {
                FileSystemTypes_GroupingFormat
            };

            var td1 = new ExtendedTypeDefinition(
                "System.IO.DirectoryInfo",
                ViewsOf_FileSystemTypes(sharedControls));
            td1.TypeNames.Add("System.IO.FileInfo");
            yield return td1;

            yield return new ExtendedTypeDefinition(
                "System.Security.AccessControl.FileSystemSecurity",
                ViewsOf_System_Security_AccessControl_FileSystemSecurity(sharedControls));

            yield return new ExtendedTypeDefinition(
                "Microsoft.PowerShell.Commands.AlternateStreamData",
                ViewsOf_Microsoft_PowerShell_Commands_AlternateStreamData());
        }
 /// <summary>
 /// 有效定单查询
 /// </summary>
 /// <param name="sender">event sender</param>
 /// <param name="args">event args</param>
 private void InquiryCustomControl_DoSearch(object sender, CustomControl.DoSearchEventArgs args)
 {
     ManagementViewModel mv = DataContext as ManagementViewModel;
     int pageCount = 0;
     DateTime endDate = new DateTime(args.EndDate.AddDays(1).Year, args.EndDate.AddDays(1).Month, args.EndDate.AddDays(1).Day);
     mv.GetMultiTradeHoldOrderWithPage(args.OrdersTypeString, args.OrgName, args.ProductName, args.AccountName,args.StockCode, args.StartDate, endDate, args.PageIndex, args.PageSize, ref pageCount);
     PageCount = pageCount;
 }
        private static IEnumerable<FormatViewDefinition> ViewsOf_FileSystemTypes(CustomControl[] sharedControls)
        {
            yield return new FormatViewDefinition("children",
                TableControl.Create()
                    .GroupByProperty("PSParentPath", customControl: sharedControls[0])
                    .AddHeader(Alignment.Left, label: "Mode", width: 7)
                    .AddHeader(Alignment.Right, label: "LastWriteTime", width: 25)
                    .AddHeader(Alignment.Right, label: "Length", width: 14)
                    .AddHeader()
                    .StartRowDefinition(wrap: true)
                        .AddPropertyColumn("Mode")
                        .AddScriptBlockColumn(@"
                                    [String]::Format(""{0,10}  {1,8}"", $_.LastWriteTime.ToString(""d""), $_.LastWriteTime.ToString(""t""))
                                ")
                        .AddPropertyColumn("Length")
                        .AddPropertyColumn("Name")
                    .EndRowDefinition()
                .EndTable());

            yield return new FormatViewDefinition("children",
                ListControl.Create()
                    .GroupByProperty("PSParentPath", customControl: sharedControls[0])
                    .StartEntry(entrySelectedByType: new[] { "System.IO.FileInfo" })
                        .AddItemProperty(@"Name")
                        .AddItemProperty(@"Length")
                        .AddItemProperty(@"CreationTime")
                        .AddItemProperty(@"LastWriteTime")
                        .AddItemProperty(@"LastAccessTime")
                        .AddItemProperty(@"Mode")
                        .AddItemProperty(@"LinkType")
                        .AddItemProperty(@"Target")
                        .AddItemProperty(@"VersionInfo")
                    .EndEntry()
                    .StartEntry()
                        .AddItemProperty(@"Name")
                        .AddItemProperty(@"CreationTime")
                        .AddItemProperty(@"LastWriteTime")
                        .AddItemProperty(@"LastAccessTime")
                        .AddItemProperty(@"Mode")
                        .AddItemProperty(@"LinkType")
                        .AddItemProperty(@"Target")
                    .EndEntry()
                .EndList());

            yield return new FormatViewDefinition("children",
                WideControl.Create()
                    .GroupByProperty("PSParentPath", customControl: sharedControls[0])
                    .AddPropertyEntry("Name")
                    .AddPropertyEntry("Name", format: "[{0}]", entrySelectedByType: new[] { "System.IO.DirectoryInfo" })
                .EndWideControl());
        }
 /// <summary>
 /// 入库单查询
 /// </summary>
 /// <param name="sender">event sender</param>
 /// <param name="args">event args</param>
 private void InquiryCustomControl_DoSearch( object sender, CustomControl.DoSearchEventArgs args ) {
     ManagementViewModel mv = DataContext as ManagementViewModel;
     DateTime endDate = new DateTime(args.EndDate.AddDays(1).Year, args.EndDate.AddDays(1).Month, args.EndDate.AddDays(1).Day);
     HistorySearchInfo searchInfo = new HistorySearchInfo {
         ProductName = args.ProductName,
         StartDateTime = args.StartDate,
         EndDateTime = endDate,
         OrdersType = args.OrdersTypeString,
         PageIndex = args.PageIndex,
         PageSize = args.PageSize,
        TradeAccount=args.AccountName,
      
     };
     int pageCount = 0;
     var historyList = mv.GetWarehousingHistoryList( searchInfo, ref pageCount );
     PageCount = pageCount;
     DgResult.DataContext = historyList;
 }
        /// <summary>
        ///平仓查询
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="args">event args</param>
        private void InquiryCustomControl_DoSearch( object sender, CustomControl.DoSearchEventArgs args ) {
            ManagementViewModel vm = DataContext as ManagementViewModel;
            //DateTime endDate = new DateTime(args.EndDate.AddDays(1).Year, args.EndDate.AddDays(1).Month, args.EndDate.AddDays(1).Day);
            //HistorySearchInfo searchInfo = new HistorySearchInfo {
            //    ProductName = args.ProductName,
            //    StartDateTime = args.StartDate,
            //    EndDateTime = endDate,
            //    OrdersType = args.OrdersTypeString,
            //    PageIndex = args.PageIndex,
            //    PageSize = args.PageSize,
            //    TradeAccount=args.AccountName,
            //    OrgName = args.OrgName,
            //};

            int pageCount = 0;
            vm.GetMultiLTradeOrderWithPage(args.OrdersTypeString, args.OrgName, args.ProductName, args.AccountName, args.StockCode, args.StartDate, args.EndDate, args.PageIndex, args.PageSize, ref pageCount);
            PageCount = pageCount;
           // DgResult.DataContext = historyList;
        }
        /// <summary>
        /// 有效订单查询
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="args">event args</param>
        private void InquiryCustomControl_DoSearch(object sender, CustomControl.DoSearchEventArgs args)
        {
            ManagementViewModel mv = DataContext as ManagementViewModel;
            DateTime endDate = new DateTime(args.EndDate.AddDays(1).Year, args.EndDate.AddDays(1).Month, args.EndDate.AddDays(1).Day);
            HistorySearchInfo searchInfo = new HistorySearchInfo
            {
                ProductName = args.ProductName,
                StartDateTime = args.StartDate,
                EndDateTime = endDate,
                OrdersType = args.OrdersTypeString,
                PageIndex = args.PageIndex,
                PageSize = args.PageSize,
                TradeAccount = AccountName,

            };
            int pageCount = 0;
            //Todo:此处应调试恢复
            //DgResult.ItemsSource = mv.GetPendingHistoryDataList(searchInfo, LoginID, ref pageCount);
            //PageCount = pageCount;
        }
Example #11
0
	public MainForm ()
	{
		// 
		// _customControl
		// 
		_customControl = new CustomControl ();
		_customControl.BackColor = Color.Yellow;
		_customControl.Location = new Point (5, 5);
		_customControl.Parent = this;
		_customControl.Size = new Size (50, 50);
		Controls.Add (_customControl);
		// 
		// MainForm
		// 
		ClientSize = new Size (200, 70);
		Location = new Point (350, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #81516";
		Load += new EventHandler (MainForm_Load);
	}
Example #12
0
 private static IEnumerable<FormatViewDefinition> ViewsOf_Microsoft_PowerShell_Commands_Internal_TransactedRegistryKey_Microsoft_Win32_RegistryKey_System_Management_Automation_TreatAs_RegistryValue(CustomControl[] sharedControls)
 {
     yield return new FormatViewDefinition("children",
         TableControl.Create()
             .GroupByProperty("PSParentPath", customControl: sharedControls[0])
             .AddHeader(label: "Name", width: 30)
             .AddHeader(label: "Property")
             .StartRowDefinition(wrap: true)
                 .AddPropertyColumn("PSChildName")
                 .AddScriptBlockColumn(@"
                           $result = (Get-ItemProperty -LiteralPath $_.PSPath |
                               Select * -Exclude PSPath,PSParentPath,PSChildName,PSDrive,PsProvider |
                               Format-List | Out-String | Sort).Trim()
                           $result = $result.Substring(0, [Math]::Min($result.Length, 5000) )
                           if($result.Length -eq 5000) { $result += ""..."" }
                           $result
                         ")
             .EndRowDefinition()
         .EndTable());
 }
Example #13
0
        internal static IEnumerable<ExtendedTypeDefinition> GetFormatData()
        {
            var Registry_GroupingFormat = CustomControl.Create()
                    .StartEntry()
                        .StartFrame(leftIndent: 4)
                            .AddText("Hive: ")
                            .AddScriptBlockExpressionBinding(@"$_.PSParentPath.Replace(""Microsoft.PowerShell.Core\Registry::"", """")")
                            .AddNewline()
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var sharedControls = new CustomControl[] {
                Registry_GroupingFormat
            };

            var td1 = new ExtendedTypeDefinition(
                "Microsoft.PowerShell.Commands.Internal.TransactedRegistryKey",
                ViewsOf_Microsoft_PowerShell_Commands_Internal_TransactedRegistryKey_Microsoft_Win32_RegistryKey_System_Management_Automation_TreatAs_RegistryValue(sharedControls));
            td1.TypeNames.Add("Microsoft.Win32.RegistryKey");
            td1.TypeNames.Add("System.Management.Automation.TreatAs.RegistryValue");
            yield return td1;
        }
Example #14
0
 private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_ExamplesView(CustomControl[] sharedControls)
 {
     yield return new FormatViewDefinition("ExampleCommandHelp",
         CustomControl.Create()
             .StartEntry()
                 .AddPropertyExpressionBinding(@"Details", customControl: sharedControls[2])
                 .StartFrame(leftIndent: 4)
                     .AddPropertyExpressionBinding(@"Examples", customControl: sharedControls[7])
                 .EndFrame()
             .EndEntry()
         .EndControl());
 }
Example #15
0
        private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_DetailedView(CustomControl[] sharedControls)
        {
            var control10 = CustomControl.Create()
                    .StartEntry()
                        .AddText("-")
                        .AddPropertyExpressionBinding(@"name")
                        .AddPropertyExpressionBinding(@"ParameterValue", customControl: sharedControls[6])
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Description", enumerateCollection: true, customControl: sharedControls[4])
                            .AddNewline()
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var control9 = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"Parameter", enumerateCollection: true, customControl: control10)
                    .EndEntry()
                .EndControl();

            yield return new FormatViewDefinition("VerboseCommandHelp",
                CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"Details", customControl: sharedControls[2])
                        .AddScriptBlockExpressionBinding(@"$_", customControl: sharedControls[15])
                        .AddScriptBlockExpressionBinding(@"$_", customControl: sharedControls[3])
                        .AddText(HelpDisplayStrings.Parameters)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Parameters", customControl: control9)
                            .AddCustomControlExpressionBinding(sharedControls[16])
                            .AddText(HelpDisplayStrings.CommonParameters)
                            .AddNewline()
                            .StartFrame(leftIndent: 4)
                                .AddText(HelpDisplayStrings.BaseCmdletInformation)
                            .EndFrame()
                            .AddNewline()
                            .AddNewline()
                        .EndFrame()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Examples", customControl: sharedControls[7])
                        .EndFrame()
                        .AddText(HelpDisplayStrings.RemarksSection)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddText(HelpDisplayStrings.ExampleHelpInfo)
                            .AddText(@"""")
                            .AddScriptBlockExpressionBinding(@"""get-help "" + $_.Details.Name + "" -examples""")
                            .AddText(@""".")
                            .AddNewline()
                            .AddText(HelpDisplayStrings.VerboseHelpInfo)
                            .AddText(@"""")
                            .AddScriptBlockExpressionBinding(@"""get-help "" + $_.Details.Name + "" -detailed""")
                            .AddText(@""".")
                            .AddNewline()
                            .AddText(HelpDisplayStrings.FullHelpInfo)
                            .AddText(@"""")
                            .AddScriptBlockExpressionBinding(@"""get-help "" + $_.Details.Name + "" -full""")
                            .AddText(@""".")
                            .AddNewline()
                            .AddCustomControlExpressionBinding(sharedControls[19])
                        .EndFrame()
                    .EndEntry()
                .EndControl());
        }
Example #16
0
 private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo(CustomControl[] sharedControls)
 {
     yield return new FormatViewDefinition("DefaultCommandHelp",
         CustomControl.Create()
             .StartEntry()
                 .AddPropertyExpressionBinding(@"Details", customControl: sharedControls[2])
                 .AddScriptBlockExpressionBinding(@"$_", customControl: sharedControls[15])
                 .AddScriptBlockExpressionBinding(@"$_", customControl: sharedControls[3])
                 .AddText(HelpDisplayStrings.RelatedLinks)
                 .AddNewline()
                 .StartFrame(leftIndent: 4)
                     .AddPropertyExpressionBinding(@"relatedLinks", customControl: sharedControls[20])
                 .EndFrame()
                 .AddNewline()
                 .AddText(HelpDisplayStrings.RemarksSection)
                 .AddNewline()
                 .StartFrame(leftIndent: 4)
                     .AddText(HelpDisplayStrings.ExampleHelpInfo + "\"")
                     .AddScriptBlockExpressionBinding(@"""get-help "" + $_.Details.Name + "" -examples""")
                     .AddText("\".")
                     .AddNewline()
                     .AddText(HelpDisplayStrings.VerboseHelpInfo + "\"")
                     .AddScriptBlockExpressionBinding(@"""get-help "" + $_.Details.Name + "" -detailed""")
                     .AddText("\".")
                     .AddNewline()
                     .AddText(HelpDisplayStrings.FullHelpInfo)
                     .AddText(@"""")
                     .AddScriptBlockExpressionBinding(@"""get-help "" + $_.Details.Name + "" -full""")
                     .AddText(@""".")
                     .AddNewline()
                     .AddCustomControlExpressionBinding(sharedControls[19])
                 .EndFrame()
             .EndEntry()
         .EndControl());
 }
Example #17
0
        internal static IEnumerable<ExtendedTypeDefinition> GetFormatData()
        {
            var TextPropertyControl = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"Text")
                    .EndEntry()
                .EndControl();

            var MamlShortDescriptionControl = CustomControl.Create()
                    .StartEntry(entrySelectedByType: new[] { "MamlParaTextItem" })
                        .AddPropertyExpressionBinding(@"Text")
                        .AddNewline()
                    .EndEntry()
                    .StartEntry()
                        .AddText(" ")
                    .EndEntry()
                .EndControl();

            var MamlDescriptionControl = CustomControl.Create()
                    .StartEntry(entrySelectedByType: new[] { "MamlParaTextItem" })
                        .AddPropertyExpressionBinding(@"Text")
                        .AddNewline()
                    .EndEntry()
                    .StartEntry(entrySelectedByType: new[] { "MamlOrderedListTextItem" })
                        .StartFrame(firstLineHanging: 4)
                            .AddPropertyExpressionBinding(@"Tag")
                            .AddPropertyExpressionBinding(@"Text")
                            .AddNewline()
                        .EndFrame()
                    .EndEntry()
                    .StartEntry(entrySelectedByType: new[] { "MamlUnorderedListTextItem" })
                        .StartFrame(firstLineHanging: 2)
                            .AddPropertyExpressionBinding(@"Tag")
                            .AddPropertyExpressionBinding(@"Text")
                            .AddNewline()
                        .EndFrame()
                    .EndEntry()
                    .StartEntry(entrySelectedByType: new[] { "MamlDefinitionTextItem" })
                        .AddPropertyExpressionBinding(@"Term")
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Definition")
                            .AddNewline()
                        .EndFrame()
                    .EndEntry()
                    .StartEntry()
                        .AddText(" ")
                    .EndEntry()
                .EndControl();

            var MamlParameterControl = CustomControl.Create()
                    .StartEntry()
                        .AddScriptBlockExpressionBinding(
@"$optional = $_.required -ne 'true'
$positional = (($_.position -ne $()) -and ($_.position -ne '') -and ($_.position -notmatch 'named') -and ([int]$_.position -ne $()))
$parameterValue = if ($null -ne $_.psobject.Members['ParameterValueGroup']) { 
    "" {$($_.ParameterValueGroup.ParameterValue -join ' | ')}""
} elseif ($null -ne $_.psobject.Members['ParameterValue']) {
    "" <$($_.ParameterValue)>""
} else {
    ''
}
$(if ($optional -and $positional) { '[[-{0}]{1}] ' }
elseif ($optional)   { '[-{0}{1}] ' }
elseif ($positional) { '[-{0}]{1} ' }
else                 { '-{0}{1} ' }) -f $_.Name, $parameterValue")
                    .EndEntry()
                .EndControl();

            var MamlParameterValueControl = CustomControl.Create()
                    .StartEntry()
                        .AddScriptBlockExpressionBinding(@"if ($_.required -ne 'true') { "" [<$_>]"" } else { "" <$_>"" }")
                    .EndEntry()
                .EndControl();

            var MamlTextItem = CustomControl.Create()
                    .StartEntry(entrySelectedByType: new[] { "MamlParaTextItem" })
                        .AddPropertyExpressionBinding(@"Text")
                        .AddNewline()
                    .EndEntry()
                    .StartEntry(entrySelectedByType: new[] { "MamlOrderedListTextItem" })
                        .AddPropertyExpressionBinding(@"Tag")
                        .AddPropertyExpressionBinding(@"Text")
                        .AddNewline()
                    .EndEntry()
                    .StartEntry(entrySelectedByType: new[] { "MamlUnorderedListTextItem" })
                        .AddPropertyExpressionBinding(@"Tag")
                        .AddPropertyExpressionBinding(@"Text")
                        .AddNewline()
                    .EndEntry()
                    .StartEntry(entrySelectedByType: new[] { "MamlDefinitionTextItem" })
                        .AddPropertyExpressionBinding(@"Term")
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Definition")
                        .EndFrame()
                        .AddNewline()
                    .EndEntry()
                    .StartEntry(entrySelectedByType: new[] { "MamlPreformattedTextItem" })
                        .AddPropertyExpressionBinding(@"Text")
                    .EndEntry()
                    .StartEntry()
                        .AddText(" ")
                    .EndEntry()
                .EndControl();

            var MamlAlertControl = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"Text")
                        .AddNewline()
                    .EndEntry()
                .EndControl();

            var control4 = CustomControl.Create()
                    .StartEntry()
                        .AddText(HelpDisplayStrings.FalseShort)
                    .EndEntry()
                .EndControl();

            var control3 = CustomControl.Create()
                    .StartEntry()
                        .AddText(HelpDisplayStrings.TrueShort)
                    .EndEntry()
                .EndControl();

            var MamlTrueFalseShortControl = CustomControl.Create()
                    .StartEntry()
                        .AddScriptBlockExpressionBinding(@";", selectedByScript: @"$_.Equals('true', [System.StringComparison]::OrdinalIgnoreCase)", customControl: control3)
                        .AddScriptBlockExpressionBinding(@";", selectedByScript: @"$_.Equals('false', [System.StringComparison]::OrdinalIgnoreCase)", customControl: control4)
                    .EndEntry()
                .EndControl();

            var CommonWorkflowParametersControl = CustomControl.Create()
                    .StartEntry()
                        .AddScriptBlockExpressionBinding(StringUtil.Format(@"$wfp = $_.psobject.Properties['WorkflowCommonParameters']
if ($null -ne $wfp -and $wfp.Value)
{{
    '[{0}] '
}}", HelpDisplayStrings.CommonWorkflowParameters))
                    .EndEntry()
                .EndControl();

            var RelatedLinksHelpInfoControl = CustomControl.Create()
                    .StartEntry()
                        .StartFrame(leftIndent: 4)
                            .AddScriptBlockExpressionBinding(StringUtil.Format(@"Set-StrictMode -Off
if (($_.relatedLinks -ne $()) -and ($_.relatedLinks.navigationLink -ne $()) -and ($_.relatedLinks.navigationLink.Length -ne 0))
{{
    ""    {0}`""get-help $($_.Details.Name) -online`""""
}}", HelpDisplayStrings.RelatedLinksHelpInfo))
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var control6 = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"linkText")
                        .AddScriptBlockExpressionBinding("' '", selectedByScript: "$_.linkText.Length -ne 0")
                        .AddPropertyExpressionBinding(@"uri")
                        .AddNewline()
                    .EndEntry()
                .EndControl();

            var MamlRelatedLinksControl = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"navigationLink", enumerateCollection: true, customControl: control6)
                    .EndEntry()
                .EndControl();

            var MamlDetailsControl = CustomControl.Create()
                    .StartEntry()
                        .AddText(HelpDisplayStrings.Name)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Name")
                            .AddNewline()
                            .AddNewline()
                        .EndFrame()
                        .AddText(HelpDisplayStrings.Synopsis)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Description", enumerateCollection: true, customControl: MamlShortDescriptionControl)
                            .AddNewline()
                            .AddNewline()
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var MamlExampleControl = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"Title")
                        .AddNewline()
                        .AddNewline()
                        .AddPropertyExpressionBinding(@"Introduction", enumerateCollection: true, customControl: TextPropertyControl)
                        .AddPropertyExpressionBinding(@"Code", enumerateCollection: true)
                        .AddNewline()
                        .AddPropertyExpressionBinding(@"results")
                        .AddNewline()
                        .AddPropertyExpressionBinding(@"remarks", enumerateCollection: true, customControl: MamlShortDescriptionControl)
                    .EndEntry()
                .EndControl();

            var control1 = CustomControl.Create()
                    .StartEntry()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"description", enumerateCollection: true, customControl: MamlShortDescriptionControl)
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var control0 = CustomControl.Create()
                    .StartEntry()
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"uri")
                            .AddNewline()
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var MamlTypeControl = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"name", enumerateCollection: true)
                        .AddCustomControlExpressionBinding(control0, selectedByScript: "$_.uri")
                        .AddCustomControlExpressionBinding(control1, selectedByScript: "$_.description")
                    .EndEntry()
                .EndControl();

            var control2 = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"Value")
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Description", enumerateCollection: true, customControl: MamlShortDescriptionControl)
                        .EndFrame()
                        .AddNewline()
                    .EndEntry()
                .EndControl();

            var MamlPossibleValueControl = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"possibleValue", enumerateCollection: true, customControl: control2)
                    .EndEntry()
                .EndControl();

            var MamlIndentedDescriptionControl = CustomControl.Create()
                    .StartEntry()
                        .AddText(HelpDisplayStrings.DetailedDescription)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"description", enumerateCollection: true, customControl: MamlDescriptionControl)
                            .AddNewline()
                        .EndFrame()
                        .AddNewline()
                    .EndEntry()
                .EndControl();

            var control5 = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"name")
                        .AddText(" ")
                        .AddPropertyExpressionBinding(@"Parameter", enumerateCollection: true, customControl: MamlParameterControl)
                        .AddCustomControlExpressionBinding(CommonWorkflowParametersControl)
                        .AddText("[" + HelpDisplayStrings.CommonParameters + "]")
                        .AddNewline(2)
                    .EndEntry()
                .EndControl();

            var MamlSyntaxControl = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"SyntaxItem", enumerateCollection: true, customControl: control5)
                    .EndEntry()
                .EndControl();

            var ExamplesControl = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"Example", enumerateCollection: true, customControl: MamlExampleControl)
                    .EndEntry()
                .EndControl();

            var MamlTypeWithDescriptionControl = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"type", customControl: MamlTypeControl)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"description", enumerateCollection: true, customControl: MamlShortDescriptionControl)
                        .EndFrame()
                        .AddNewline()
                    .EndEntry()
                .EndControl();

            var ErrorControl = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"errorId")
                        .AddText(HelpDisplayStrings.Category)
                        .AddPropertyExpressionBinding(@"category")
                        .AddText(")")
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"description", enumerateCollection: true, customControl: MamlShortDescriptionControl)
                        .EndFrame()
                        .AddNewline()
                        .AddText(HelpDisplayStrings.TypeColon)
                        .AddPropertyExpressionBinding(@"type", customControl: MamlTypeControl)
                        .AddNewline()
                        .AddText(HelpDisplayStrings.TargetObjectTypeColon)
                        .AddPropertyExpressionBinding(@"targetObjectType", customControl: MamlTypeControl)
                        .AddNewline()
                        .AddText(HelpDisplayStrings.SuggestedActionColon)
                        .AddPropertyExpressionBinding(@"recommendedAction", enumerateCollection: true, customControl: MamlShortDescriptionControl)
                        .AddNewline()
                        .AddNewline()
                    .EndEntry()
                .EndControl();

            var MamlPossibleValuesControl = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"possibleValues", customControl: MamlPossibleValueControl)
                    .EndEntry()
                .EndControl();

            var MamlIndentedSyntaxControl = CustomControl.Create()
                    .StartEntry()
                        .AddText(HelpDisplayStrings.Syntax)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Syntax", customControl: MamlSyntaxControl)
                            .AddNewline()
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var control7 = CustomControl.Create()
                    .StartEntry()
                        .AddText(HelpDisplayStrings.NamedParameter)
                    .EndEntry()
                .EndControl();

            var MamlFullParameterControl = CustomControl.Create()
                    .StartEntry()
                        .AddText("-")
                        .AddPropertyExpressionBinding(@"name")
                        .AddPropertyExpressionBinding(@"ParameterValue", customControl: MamlParameterValueControl)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Description", enumerateCollection: true, customControl: MamlDescriptionControl)
                            .AddNewline()
                            .AddCustomControlExpressionBinding(MamlPossibleValuesControl, selectedByScript: "$_.possibleValues -ne $()")
                            .AddText(HelpDisplayStrings.ParameterRequired)
                            .AddPropertyExpressionBinding(@"required", customControl: MamlTrueFalseShortControl)
                            .AddNewline()
                            .AddText(HelpDisplayStrings.ParameterPosition)
                            .AddScriptBlockExpressionBinding(@" ", selectedByScript: @"($_.position -eq  $()) -or ($_.position -eq '')", customControl: control7)
                            .AddScriptBlockExpressionBinding(@"$_.position", selectedByScript: "$_.position  -ne  $()")
                            .AddNewline()
                            .AddText(HelpDisplayStrings.ParameterDefaultValue)
                            .AddPropertyExpressionBinding(@"defaultValue")
                            .AddNewline()
                            .AddText(HelpDisplayStrings.AcceptsPipelineInput)
                            .AddPropertyExpressionBinding(@"pipelineInput")
                            .AddNewline()
                            .AddText(HelpDisplayStrings.AcceptsWildCardCharacters)
                            .AddPropertyExpressionBinding(@"globbing", customControl: MamlTrueFalseShortControl)
                            .AddNewline()
                            .AddNewline()
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var control8 = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"Parameter", enumerateCollection: true, customControl: MamlFullParameterControl)
                    .EndEntry()
                .EndControl();

            var zzz = CustomControl.Create()
                    .StartEntry()
                        .AddCustomControlExpressionBinding(control8)
                        .AddText(HelpDisplayStrings.CommonParameters)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddText(HelpDisplayStrings.BaseCmdletInformation)
                        .EndFrame()
                        .AddNewline()
                        .AddNewline()
                    .EndEntry()
                .EndControl();

            var sharedControls = new CustomControl[] {
                TextPropertyControl,
                MamlShortDescriptionControl,
                MamlDetailsControl,
                MamlIndentedDescriptionControl,
                MamlDescriptionControl,
                MamlParameterControl,
                MamlParameterValueControl,
                ExamplesControl,
                MamlExampleControl,
                MamlTypeControl,
                MamlTextItem,
                MamlAlertControl,
                MamlPossibleValuesControl,
                MamlPossibleValueControl,
                MamlTrueFalseShortControl,
                MamlIndentedSyntaxControl,
                CommonWorkflowParametersControl,
                MamlSyntaxControl,
                MamlTypeWithDescriptionControl,
                RelatedLinksHelpInfoControl,
                MamlRelatedLinksControl,
                ErrorControl,
                MamlFullParameterControl,
                zzz
            };

            yield return new ExtendedTypeDefinition(
                "HelpInfoShort",
                ViewsOf_HelpInfoShort());

            yield return new ExtendedTypeDefinition(
                "CmdletHelpInfo",
                ViewsOf_CmdletHelpInfo());

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo",
                ViewsOf_MamlCommandHelpInfo(sharedControls));

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#DetailedView",
                ViewsOf_MamlCommandHelpInfo_DetailedView(sharedControls));

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#ExamplesView",
                ViewsOf_MamlCommandHelpInfo_ExamplesView(sharedControls));

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#FullView",
                ViewsOf_MamlCommandHelpInfo_FullView(sharedControls));

            yield return new ExtendedTypeDefinition(
                "ProviderHelpInfo",
                ViewsOf_ProviderHelpInfo(sharedControls));

            yield return new ExtendedTypeDefinition(
                "FaqHelpInfo",
                ViewsOf_FaqHelpInfo(sharedControls));

            yield return new ExtendedTypeDefinition(
                "GeneralHelpInfo",
                ViewsOf_GeneralHelpInfo(sharedControls));

            yield return new ExtendedTypeDefinition(
                "GlossaryHelpInfo",
                ViewsOf_GlossaryHelpInfo(sharedControls));

            yield return new ExtendedTypeDefinition(
                "ScriptHelpInfo",
                ViewsOf_ScriptHelpInfo(sharedControls));

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#Examples",
                ViewsOf_MamlCommandHelpInfo_Examples(sharedControls));

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#Example",
                ViewsOf_MamlCommandHelpInfo_Example(sharedControls));

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#commandDetails",
                ViewsOf_MamlCommandHelpInfo_commandDetails(sharedControls));

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#Parameters",
                ViewsOf_MamlCommandHelpInfo_Parameters(sharedControls));

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#Parameter",
                ViewsOf_MamlCommandHelpInfo_Parameter(sharedControls));

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#Syntax",
                ViewsOf_MamlCommandHelpInfo_Syntax(sharedControls));

            var td18 = new ExtendedTypeDefinition(
                "MamlDefinitionTextItem",
                ViewsOf_MamlDefinitionTextItem_MamlOrderedListTextItem_MamlParaTextItem_MamlUnorderedListTextItem(sharedControls));
            td18.TypeNames.Add("MamlOrderedListTextItem");
            td18.TypeNames.Add("MamlParaTextItem");
            td18.TypeNames.Add("MamlUnorderedListTextItem");
            yield return td18;

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#inputTypes",
                ViewsOf_MamlCommandHelpInfo_inputTypes(sharedControls));

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#nonTerminatingErrors",
                ViewsOf_MamlCommandHelpInfo_nonTerminatingErrors(sharedControls));

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#terminatingErrors",
                ViewsOf_MamlCommandHelpInfo_terminatingErrors(sharedControls));

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#relatedLinks",
                ViewsOf_MamlCommandHelpInfo_relatedLinks(sharedControls));

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#returnValues",
                ViewsOf_MamlCommandHelpInfo_returnValues(sharedControls));

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#alertSet",
                ViewsOf_MamlCommandHelpInfo_alertSet(sharedControls));

            yield return new ExtendedTypeDefinition(
                "MamlCommandHelpInfo#details",
                ViewsOf_MamlCommandHelpInfo_details(sharedControls));
        }
Example #18
0
 private static void CustomControl_Start(CustomControl __instance)
 {
     CustomControlInstance = __instance;
     MakerCoroutine        = Instance.StartCoroutine(Instance.AutosaveMaker());
 }
Example #19
0
		public void BindContentPresenterContent ()
		{
			ContentPresenter presenter = new ContentPresenter ();
			presenter.SetBinding (ContentPresenter.ContentProperty, new Binding ("Opacity"));

			CustomControl c = new CustomControl { Content = presenter };
			CreateAsyncTest (c,
				() => {
					c.DataContext = new Data { Opacity = 1.0 };
				}, () => {
					Assert.AreEqual (1.0, presenter.ReadLocalValue (ContentPresenter.DataContextProperty), "#1");
					Assert.AreEqual (1.0, presenter.Content, "#2");

					c.DataContext = new Data { Opacity = 0.0 };
				}, () => {
					Assert.AreEqual (0.0, presenter.ReadLocalValue (ContentPresenter.DataContextProperty), "#3");
					Assert.AreEqual (0.0, presenter.Content, "#4");
				}
			);
		}
Example #20
0
 private static IEnumerable<FormatViewDefinition> ViewsOf_GlossaryHelpInfo(CustomControl[] sharedControls)
 {
     yield return new FormatViewDefinition("GlossaryHelpInfo",
         CustomControl.Create()
             .StartEntry()
                 .AddText(HelpDisplayStrings.TermColon)
                 .AddPropertyExpressionBinding(@"Name")
                 .AddNewline()
                 .AddText(HelpDisplayStrings.DefinitionColon)
                 .AddNewline()
                 .StartFrame(leftIndent: 4)
                     .AddPropertyExpressionBinding(@"Definition", enumerateCollection: true, customControl: sharedControls[10])
                     .AddNewline()
                 .EndFrame()
             .EndEntry()
         .EndControl());
 }
Example #21
0
 private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_terminatingErrors(CustomControl[] sharedControls)
 {
     yield return new FormatViewDefinition("MamlTerminatingErrors",
         CustomControl.Create()
             .StartEntry()
                 .AddPropertyExpressionBinding(@"terminatingError", enumerateCollection: true, customControl: sharedControls[21])
             .EndEntry()
         .EndControl());
 }
Example #22
0
 public static DialogResult ShowDialog(CustomControl value)
 {
     _control = value;
     return(new FormFormat().ShowDialog());
 }
Example #23
0
		public void ViewState2 () {
			CustomControl c = new CustomControl ();
			CustomControl copy = new CustomControl ();
			object state;

			c.DoTrackViewState ();
			c.CustomProperty = "CustomProperty";
			c.ControlStyle.BackColor = Color.Red;
			c.ControlStyle.BorderColor = Color.Green;
			c.ControlStyle.BorderStyle = BorderStyle.Dotted;

			state = c.DoSaveViewState ();

			copy.DoLoadViewState (state);

			Assert.IsFalse (copy.ControlStyleCreated, "copy.ControlStyleCreated");
		}
Example #24
0
        public IEnumerable <ConflictResolutionResult> Save()
        {
            if (CustomControl != null && !ShowAdvancedOptions)
            {
                CustomControl.Save();
            }

            if (CanSave)
            {
                m_newRule = SelectedResolutionAction.NewRule(Scope, Description, DataFields.ToDictionary(x => x.FieldName, x => x.FieldValue));

                List <ConflictResolutionResult> results = new List <ConflictResolutionResult>();
                ConflictResolutionResult        firstConflictResolutionResult = m_conflictManager.ResolveExistingConflictWithNewRule(m_conflict.Id, m_newRule);
                firstConflictResolutionResult.ConflictInternalId = ConflictInternalId;
                results.Add(firstConflictResolutionResult);

                if (firstConflictResolutionResult.Resolved)
                {
                    try
                    {
                        IEnumerable <ConflictResolutionResult> otherConflictsResolutionResult = m_conflictManager.ResolveExistingConflictWithExistingRule(m_newRule);
                        results.AddRange(otherConflictsResolutionResult);
                    }
                    catch (MigrationException)
                    { }
                    catch (EntityException)
                    { }
                }

                foreach (ConflictResolutionResult result in results)
                {
                    if (this.ConflictInternalId == result.ConflictInternalId)
                    {
                        if (result.Resolved)
                        {
                            IsResolved       = ResolvedStatus.Resolved;
                            ResolvedByRuleId = m_newRule.InternalId;
                        }
                        else
                        {
                            IsResolved = ResolvedStatus.Failed;
                        }
                    }
                }

                m_appViewModel.SetResolvedConflicts(results, m_newRule.InternalId);

                // add new rule to rules list
                RuntimeEntityModel context = RuntimeEntityModel.CreateInstance();
                var v = from r in context.RTResolutionRuleSet
                        where r.Id == ResolvedByRuleId
                        select r;
                if (v.Count() > 0)
                {
                    m_appViewModel.Rules.Insert(0, new ExistingRuleViewModel(v.First(), m_appViewModel));
                }

                return(results);
            }
            else
            {
                throw new Exception("Invalid scope");
            }
        }
Example #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZeroitAnidasoHorTrackbar" /> class.
 /// </summary>
 public ZeroitAnidasoHorTrackbar()
 {
     this.InitializeComponent();
     this.panel1.Width = this.slider.Left + this.slider.Width / 2;
     CustomControl.initializeComponent(this);
 }
Example #26
0
        /// <summary>
        /// Takes out the content from the database and writes them out.
        /// </summary>
        protected override void ProcessRecord()
        {
            bool writeOldWay = PowerShellVersion == null ||
                               PowerShellVersion.Major < 5 ||
                               PowerShellVersion.Build < 11086;

            TypeInfoDataBase db = this.Context.FormatDBManager.Database;

            List <ViewDefinition> viewdefinitions            = db.viewDefinitionsSection.viewDefinitionList;
            Dictionary <string, List <string> > typeGroupMap = GetTypeGroupMap(db.typeGroupSection.typeGroupDefinitionList);

            var typedefs = new Dictionary <ConsolidatedString, List <FormatViewDefinition> >(ConsolidatedString.EqualityComparer);

            foreach (ViewDefinition definition in viewdefinitions)
            {
                if (definition.isHelpFormatter)
                {
                    continue;
                }

                var consolidatedTypeName = CreateConsolidatedTypeName(definition, typeGroupMap);

                if (!ShouldGenerateView(consolidatedTypeName))
                {
                    continue;
                }

                PSControl control;

                var tableControlBody = definition.mainControl as TableControlBody;
                if (tableControlBody != null)
                {
                    control = new TableControl(tableControlBody, definition);
                }
                else
                {
                    var listControlBody = definition.mainControl as ListControlBody;
                    if (listControlBody != null)
                    {
                        control = new ListControl(listControlBody, definition);
                    }
                    else
                    {
                        var wideControlBody = definition.mainControl as WideControlBody;
                        if (wideControlBody != null)
                        {
                            control = new WideControl(wideControlBody, definition);
                            if (writeOldWay)
                            {
                                // Alignment was added to WideControl in V2, but wasn't
                                // used.  It was removed in V5, but old PowerShell clients
                                // expect this property or fail to rehydrate the remote object.
                                var psobj = new PSObject(control);
                                psobj.Properties.Add(new PSNoteProperty("Alignment", 0));
                            }
                        }
                        else
                        {
                            var complexControlBody = (ComplexControlBody)definition.mainControl;
                            control = new CustomControl(complexControlBody, definition);
                        }
                    }
                }

                // Older version of PowerShell do not know about something in the control, so
                // don't return it.
                if (writeOldWay && !control.CompatibleWithOldPowerShell())
                {
                    continue;
                }

                var formatdef = new FormatViewDefinition(definition.name, control, definition.InstanceId);

                List <FormatViewDefinition> viewList;
                if (!typedefs.TryGetValue(consolidatedTypeName, out viewList))
                {
                    viewList = new List <FormatViewDefinition>();
                    typedefs.Add(consolidatedTypeName, viewList);
                }
                viewList.Add(formatdef);
            }// foreach(ViewDefinition...

            // write out all the available type definitions
            foreach (var pair in typedefs)
            {
                var typeNames = pair.Key;

                if (writeOldWay)
                {
                    foreach (var typeName in typeNames)
                    {
                        var etd = new ExtendedTypeDefinition(typeName, pair.Value);
                        WriteObject(etd);
                    }
                }
                else
                {
                    var etd = new ExtendedTypeDefinition(typeNames[0], pair.Value);
                    for (int i = 1; i < typeNames.Count; i++)
                    {
                        etd.TypeNames.Add(typeNames[i]);
                    }
                    WriteObject(etd);
                }
            }
        }
 public MyDockedBarControlViewInfo(BarManager manager, BarDrawParameters parameters, CustomControl bar)
     : base(manager, parameters, bar)
 {
 }
Example #28
0
        private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_FullView(CustomControl[] sharedControls)
        {
            var control16 = CustomControl.Create()
                    .StartEntry()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"title")
                            .AddNewline()
                            .AddNewline()
                            .StartFrame(leftIndent: 4)
                                .AddPropertyExpressionBinding(@"alert", enumerateCollection: true, customControl: sharedControls[11])
                            .EndFrame()
                            .AddNewline()
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var control15 = CustomControl.Create()
                    .StartEntry()
                        .AddText(HelpDisplayStrings.Notes)
                        .AddNewline()
                    .EndEntry()
                .EndControl();

            var control14 = CustomControl.Create()
                    .StartEntry()
                        .AddText(HelpDisplayStrings.NonHyphenTerminatingErrors)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"nonTerminatingError", enumerateCollection: true, customControl: sharedControls[21])
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var control13 = CustomControl.Create()
                    .StartEntry()
                        .AddText(HelpDisplayStrings.TerminatingErrors)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"terminatingError", enumerateCollection: true, customControl: sharedControls[21])
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var control12 = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"ReturnValue", enumerateCollection: true, customControl: sharedControls[18])
                    .EndEntry()
                .EndControl();

            var control11 = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"InputType", enumerateCollection: true, customControl: sharedControls[18])
                    .EndEntry()
                .EndControl();

            yield return new FormatViewDefinition("FullCommandHelp",
                CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"Details", customControl: sharedControls[2])
                        .AddScriptBlockExpressionBinding(@"$_", customControl: sharedControls[15])
                        .AddScriptBlockExpressionBinding(@"$_", customControl: sharedControls[3])
                        .AddText(HelpDisplayStrings.Parameters)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Parameters", customControl: sharedControls[23])
                        .EndFrame()
                        .AddText(HelpDisplayStrings.InputType)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"InputTypes", customControl: control11)
                            .AddNewline()
                        .EndFrame()
                        .AddText(HelpDisplayStrings.ReturnType)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"ReturnValues", customControl: control12)
                            .AddNewline()
                        .EndFrame()
                        .AddPropertyExpressionBinding(@"terminatingErrors", selectedByScript: @"
                      (($_.terminatingErrors -ne $null) -and
                      ($_.terminatingErrors.terminatingError -ne $null))
                    ", customControl: control13)
                        .AddPropertyExpressionBinding(@"nonTerminatingErrors", selectedByScript: @"
                      (($_.nonTerminatingErrors -ne $null) -and
                      ($_.nonTerminatingErrors.nonTerminatingError -ne $null))
                    ", customControl: control14)
                        .AddPropertyExpressionBinding(@"alertSet", selectedByScript: "$_.alertSet -ne $null", customControl: control15)
                        .AddPropertyExpressionBinding(@"alertSet", enumerateCollection: true, selectedByScript: "$_.alertSet -ne $null", customControl: control16)
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Examples", customControl: sharedControls[7])
                            .AddNewline()
                        .EndFrame()
                        .AddText(HelpDisplayStrings.RelatedLinks)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"relatedLinks", customControl: sharedControls[20])
                        .EndFrame()
                    .EndEntry()
                .EndControl());
        }
Example #29
0
        private static IEnumerable<FormatViewDefinition> ViewsOf_ProviderHelpInfo(CustomControl[] sharedControls)
        {
            var TaskExampleControl = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"Title")
                        .AddNewline()
                        .AddNewline()
                        .AddPropertyExpressionBinding(@"Introduction", enumerateCollection: true, customControl: sharedControls[0])
                        .AddNewline()
                        .AddNewline()
                        .AddPropertyExpressionBinding(@"Code", enumerateCollection: true)
                        .AddNewline()
                        .AddPropertyExpressionBinding(@"results")
                        .AddNewline()
                        .AddNewline()
                        .AddPropertyExpressionBinding(@"remarks", enumerateCollection: true, customControl: sharedControls[10])
                    .EndEntry()
                .EndControl();

            var DynamicPossibleValues = CustomControl.Create()
                    .StartEntry()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Value")
                            .AddNewline()
                        .EndFrame()
                        .StartFrame(leftIndent: 8)
                            .AddPropertyExpressionBinding(@"Description", enumerateCollection: true, customControl: sharedControls[10])
                            .AddNewline()
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var TaskExamplesControl = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"Example", enumerateCollection: true, customControl: TaskExampleControl)
                    .EndEntry()
                .EndControl();

            var control18 = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"PossibleValue", enumerateCollection: true, customControl: DynamicPossibleValues)
                    .EndEntry()
                .EndControl();

            var control17 = CustomControl.Create()
                    .StartEntry()
                        .AddScriptBlockExpressionBinding(@"""<"" + $_.Name + "">""")
                    .EndEntry()
                .EndControl();

            var DynamicParameterControl = CustomControl.Create()
                    .StartEntry()
                        .StartFrame()
                            .AddText("-")
                            .AddPropertyExpressionBinding(@"Name")
                            .AddText(" ")
                            .AddPropertyExpressionBinding(@"Type", customControl: control17)
                            .AddNewline()
                        .EndFrame()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Description")
                            .AddNewline()
                            .AddNewline()
                            .AddPropertyExpressionBinding(@"PossibleValues", customControl: control18)
                            .AddNewline()
                            .AddText(HelpDisplayStrings.CmdletsSupported)
                            .AddPropertyExpressionBinding(@"CmdletSupported")
                            .AddNewline()
                            .AddNewline()
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var Task = CustomControl.Create()
                    .StartEntry()
                        .StartFrame()
                            .AddText(HelpDisplayStrings.Task)
                            .AddPropertyExpressionBinding(@"Title")
                            .AddNewline()
                            .AddNewline()
                        .EndFrame()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Description", enumerateCollection: true, customControl: sharedControls[10])
                            .AddNewline()
                            .AddNewline()
                            .AddPropertyExpressionBinding(@"Examples", enumerateCollection: true, customControl: TaskExamplesControl)
                            .AddNewline()
                            .AddNewline()
                        .EndFrame()
                    .EndEntry()
                .EndControl();

            var ProviderTasks = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"Task", enumerateCollection: true, customControl: Task)
                        .AddNewline()
                    .EndEntry()
                .EndControl();

            var control19 = CustomControl.Create()
                    .StartEntry()
                        .AddPropertyExpressionBinding(@"DynamicParameter", enumerateCollection: true, customControl: DynamicParameterControl)
                    .EndEntry()
                .EndControl();

            yield return new FormatViewDefinition("ProviderHelpInfo",
                CustomControl.Create()
                    .StartEntry()
                        .AddText(HelpDisplayStrings.ProviderName)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Name")
                            .AddNewline()
                            .AddNewline()
                        .EndFrame()
                        .AddText(HelpDisplayStrings.Drives)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Drives", enumerateCollection: true, customControl: sharedControls[10])
                            .AddNewline()
                        .EndFrame()
                        .AddText(HelpDisplayStrings.Synopsis)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Synopsis", enumerateCollection: true)
                            .AddNewline()
                            .AddNewline()
                        .EndFrame()
                        .AddText(HelpDisplayStrings.DetailedDescription)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"DetailedDescription", enumerateCollection: true, customControl: sharedControls[10])
                            .AddNewline()
                        .EndFrame()
                        .AddText(HelpDisplayStrings.Capabilities)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Capabilities", enumerateCollection: true, customControl: sharedControls[10])
                            .AddNewline()
                        .EndFrame()
                        .AddText(HelpDisplayStrings.Tasks)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Tasks", enumerateCollection: true, customControl: ProviderTasks)
                            .AddNewline()
                        .EndFrame()
                        .AddText(HelpDisplayStrings.DynamicParameters)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"DynamicParameters", customControl: control19)
                            .AddNewline()
                        .EndFrame()
                        .AddText(HelpDisplayStrings.Notes)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"Notes")
                            .AddNewline()
                        .EndFrame()
                        .AddNewline()
                        .AddText(HelpDisplayStrings.RelatedLinks)
                        .AddNewline()
                        .StartFrame(leftIndent: 4)
                            .AddPropertyExpressionBinding(@"relatedLinks", customControl: sharedControls[20])
                        .EndFrame()
                    .EndEntry()
                .EndControl());
        }
Example #30
0
 private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_returnValues(CustomControl[] sharedControls)
 {
     yield return new FormatViewDefinition("MamlReturnTypes",
         CustomControl.Create()
             .StartEntry()
                 .AddPropertyExpressionBinding(@"ReturnValue", enumerateCollection: true, customControl: sharedControls[18])
             .EndEntry()
         .EndControl());
 }
Example #31
0
        private int pagerControlMaterial_EventPaging(CustomControl.EventPagingArg e)
        {
            int count = 0;
            List<AscmMtlOnhandQuantitiesDetail> list = DataBindDataGridView(ref count, this.materialId);
            pagerControlMaterial.DataBind(list);

            if (dgViewMaterialList.DataSource != null)
                this.dgViewMaterialList.DataSource = null;

            this.dgViewMaterialList.AutoGenerateColumns = false;
            this.dgViewMaterialList.DataSource = pagerControlMaterial.bindingSource;
            this.dgViewMaterialList.Refresh();
            return count;
        }
Example #32
0
 private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_alertSet(CustomControl[] sharedControls)
 {
     yield return new FormatViewDefinition("MamlAlertSet",
         CustomControl.Create()
             .StartEntry()
                 .AddPropertyExpressionBinding(@"title")
                 .AddNewline()
                 .AddNewline()
                 .StartFrame(leftIndent: 4)
                     .AddPropertyExpressionBinding(@"alert", enumerateCollection: true, customControl: sharedControls[11])
                 .EndFrame()
             .EndEntry()
         .EndControl());
 }
Example #33
0
 private static IEnumerable<FormatViewDefinition> ViewsOf_MamlCommandHelpInfo_details(CustomControl[] sharedControls)
 {
     yield return new FormatViewDefinition("MamlDetails",
         CustomControl.Create()
             .StartEntry()
                 .AddScriptBlockExpressionBinding(@"$_", customControl: sharedControls[2])
             .EndEntry()
         .EndControl());
 }
        private static bool CardSavePatch(CustomControl __instance)
        {
            if (!MakerAPI.InsideMaker || !_modifiers.Any(x => x.Key != null || x.Value != null))
            {
                return(true);
            }

            try
            {
                Utils.Sound.Play(SystemSE.ok_s);

                var instanceChaCtrl = Singleton <CustomBase> .Instance.chaCtrl;

                var isMale = instanceChaCtrl.sex == 0;

                var folder = UserData.Path + (isMale ? "chara/male/" : "chara/female/");

                var fileName = __instance.saveNew ?
#if KK
                               $"Koikatu_{(isMale ? "M" : "F")}_{DateTime.Now:yyyyMMddHHmmssfff}"
#elif EC
                               $"Emocre_{(isMale ? "M" : "F")}_{DateTime.Now:yyyyMMddHHmmssfff}"
#endif
                    : __instance.saveFileName;

                foreach (var kvp in _modifiers)
                {
                    if (kvp.Key != null)
                    {
                        folder = kvp.Key(folder);
                    }
                    // Keep old filename if not saving as new file
                    if (kvp.Value != null && __instance.saveNew)
                    {
                        fileName = kvp.Value(fileName);
                    }
                }

                var fullPath = Path.Combine(folder, fileName);

                instanceChaCtrl.chaFile.SaveCharaFile(fullPath);

                if (__instance.saveFileListCtrl != null)
                {
                    var listCtrl = Object.FindObjectOfType <CustomCharaFile>();
                    if (listCtrl != null)
                    {
                        RefreshThumbs(listCtrl);
                    }
                }

                __instance.saveMode = false;

                return(false);
            }
            catch (Exception ex)
            {
                KoikatuAPI.Logger.LogError(ex);
                return(true);
            }
        }
 private static IEnumerable<FormatViewDefinition> ViewsOf_System_Security_AccessControl_FileSystemSecurity(CustomControl[] sharedControls)
 {
     yield return new FormatViewDefinition("FileSecurityTable",
         TableControl.Create()
             .GroupByProperty("PSParentPath", customControl: sharedControls[0])
             .AddHeader(label: "Path")
             .AddHeader()
             .AddHeader(label: "Access")
             .StartRowDefinition()
                 .AddScriptBlockColumn(@"
                             split-path $_.Path -leaf
                         ")
                 .AddPropertyColumn("Owner")
                 .AddScriptBlockColumn(@"
                             $_.AccessToString
                         ")
             .EndRowDefinition()
         .EndTable());
 }
Example #36
0
 private static IEnumerable<FormatViewDefinition> ViewsOf_MamlDefinitionTextItem_MamlOrderedListTextItem_MamlParaTextItem_MamlUnorderedListTextItem(CustomControl[] sharedControls)
 {
     yield return new FormatViewDefinition("MamlText",
         CustomControl.Create()
             .StartEntry()
                 .AddScriptBlockExpressionBinding(@"$_", customControl: sharedControls[4])
             .EndEntry()
         .EndControl());
 }
 void dataPage_PageChanged(object sender, CustomControl.PageChangedEventArgs args)
 {
     vm.GetNewsListExecute();
 }
 private static void OnChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     CustomControl customControl = (CustomControl)d;
     d.DisplayText = e.NewValue as string;
 }